Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
  char s[1001];
  int i,N,W,E,S;
  scanf("%s",s);
  i=0;N=0;W=0;E=0;S=0;
  while(s[i]!=NULL){
	if(s[i]=='N')N=1;
    if(s[i]=='W')W=-1;
    if(s[i]=='E')E=1;
    if(s[i]=='S')S=-1;
    i++;
  }
  if((N+S)==0 && (W+E)==0)printf("Yes\n");
  else printf("No\n");
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1044(%rbp)
	movl	$0, -1040(%rbp)
	movl	$0, -1036(%rbp)
	movl	$0, -1032(%rbp)
	movl	$0, -1028(%rbp)
	jmp	.L2
.L7:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$78, %al
	jne	.L3
	movl	$1, -1040(%rbp)
.L3:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L4
	movl	$-1, -1036(%rbp)
.L4:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$69, %al
	jne	.L5
	movl	$1, -1032(%rbp)
.L5:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L6
	movl	$-1, -1028(%rbp)
.L6:
	addl	$1, -1044(%rbp)
.L2:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L7
	movl	-1040(%rbp), %edx
	movl	-1028(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	movl	-1036(%rbp), %edx
	movl	-1032(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
.L8:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$1032, %rsp
	.cfi_def_cfa_offset 1040
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1016(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movzbl	(%rsp), %eax
	testb	%al, %al
	je	.L2
	leaq	1(%rsp), %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	xorl	%edi, %edi
	movl	$-1, %r9d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$87, %al
	je	.L9
	cmpb	$69, %al
	jne	.L17
	movl	$1, %r8d
.L3:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L18
.L4:
	cmpb	$78, %al
	jne	.L19
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	movl	$1, %edi
	testb	%al, %al
	jne	.L4
.L18:
	addl	%edi, %ecx
	jne	.L5
	addl	%r8d, %esi
	je	.L2
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L6:
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	xorl	%eax, %eax
	addq	$1032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	cmpb	$83, %al
	cmove	%r9d, %ecx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$-1, %esi
	jmp	.L3
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L6
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$1032, %rsp
	.cfi_def_cfa_offset 1040
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1016(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movzbl	(%rsp), %eax
	testb	%al, %al
	je	.L2
	leaq	1(%rsp), %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	xorl	%edi, %edi
	movl	$-1, %r9d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$87, %al
	je	.L9
	cmpb	$69, %al
	jne	.L17
	movl	$1, %r8d
.L3:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L18
.L4:
	cmpb	$78, %al
	jne	.L19
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	movl	$1, %edi
	testb	%al, %al
	jne	.L4
.L18:
	addl	%edi, %ecx
	jne	.L5
	addl	%r8d, %esi
	je	.L2
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L6:
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	xorl	%eax, %eax
	addq	$1032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	cmpb	$83, %al
	cmove	%r9d, %ecx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L9:
	movl	$-1, %esi
	jmp	.L3
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L6
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>

int main(){
  char s[1001];
  int i,N,W,E,S;
  scanf("%s",s);
  i=0;N=0;W=0;E=0;S=0;
  while(s[i]!=NULL){
	if(s[i]=='N')N=1;
    if(s[i]=='W')W=-1;
    if(s[i]=='E')E=1;
    if(s[i]=='S')S=-1;
    i++;
  }
  if((N+S)==0 && (W+E)==0)printf("Yes\n");
  else printf("No\n");
}
SEWN
 NNDW
 ESWN
 NSNSNNSN
 WNES
 NEWS
 ENWS
 NWES
 WNEN
 SNEW

Yes
 No
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 No
 Yes

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
  char s[1001];
  int i,N,W,E,S;
  scanf("%s",s);
  i=0;N=0;W=0;E=0;S=0;
  while(s[i]!=NULL){
	if(s[i]=='N')N=1;
    if(s[i]=='W')W=-1;
    if(s[i]=='E')E=1;
    if(s[i]=='S')S=-1;
    i++;
  }
  if((N+S)==0 && (W+E)==0)printf("Yes\n");
  else printf("No\n");
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1044(%rbp)
	movl	$0, -1040(%rbp)
	movl	$0, -1036(%rbp)
	movl	$0, -1032(%rbp)
	movl	$0, -1028(%rbp)
	jmp	.L2
.L7:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$78, %al
	jne	.L3
	movl	$1, -1040(%rbp)
.L3:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L4
	movl	$-1, -1036(%rbp)
.L4:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$69, %al
	jne	.L5
	movl	$1, -1032(%rbp)
.L5:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L6
	movl	$-1, -1028(%rbp)
.L6:
	addl	$1, -1044(%rbp)
.L2:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L7
	movl	-1040(%rbp), %edx
	movl	-1028(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	movl	-1036(%rbp), %edx
	movl	-1032(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
.L8:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1044(%rbp)
	movl	$0, -1040(%rbp)
	movl	$0, -1036(%rbp)
	movl	$0, -1032(%rbp)
	movl	$0, -1028(%rbp)
	jmp	.L2
.L7:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$78, %al
	jne	.L3
	movl	$1, -1040(%rbp)
.L3:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$87, %al
	jne	.L4
	movl	$-1, -1036(%rbp)
.L4:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$69, %al
	jne	.L5
	movl	$1, -1032(%rbp)
.L5:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L6
	movl	$-1, -1028(%rbp)
.L6:
	addl	$1, -1044(%rbp)
.L2:
	movl	-1044(%rbp), %eax
	cltq
	movzbl	-1024(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L7
	movl	-1040(%rbp), %edx
	movl	-1028(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	movl	-1036(%rbp), %edx
	movl	-1032(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
.L8:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L9:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
