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

```c
#include <stdio.h>
int main(void){
    
    char s[1001];
    int cntn=0, cnts=0, cnte=0, cntw=0, i=0;

    scanf("%s", s);

    while(s[i] != '\0'){
        if(s[i]=='N') cntn++;
        else if(s[i]=='S') cnts++;
        else if(s[i]=='E') cnte++;
        else if(s[i]=='W') cntw++;
        i++;
    }

    if(((cntn==0 && cnts==0) || (cntn>0 && cnts>0)) &&
       ((cnte==0 && cntw==0) || (cnte>0 && cntw>0))) printf("Yes\n");
    else printf("No\n");

    return 0;
}
```

Assembly Code:

```assembly
	.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	%esi, %esi
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$83, %al
	je	.L36
	cmpb	$69, %al
	je	.L37
	cmpb	$87, %al
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %esi
.L4:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L38
.L7:
	cmpb	$78, %al
	jne	.L3
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	addl	$1, %ecx
	testb	%al, %al
	jne	.L7
.L38:
	movl	%ecx, %eax
	orl	%edi, %eax
	je	.L8
	testl	%ecx, %ecx
	jle	.L9
	testl	%edi, %edi
	jle	.L9
.L8:
	movl	%r8d, %eax
	orl	%esi, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L9
	testl	%esi, %esi
	jle	.L9
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	addl	$1, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %r8d
	jmp	.L4
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	xorl	%eax, %eax
	addq	$1032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L39:
	.cfi_restore_state
	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:
```

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.
Optimized Assembly Code:

user
```assembly
	.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	%esi, %esi
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$83, %al
	je	.L36
	cmpb	$69, %al
	je	.L37
	cmpb	$87, %al
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %esi
.L4:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L38
.L7:
	cmpb	$78, %al
	jne	.L3
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	addl	$1, %ecx
	testb	%al, %al
	jne	.L7
.L38:
	movl	%ecx, %eax
	orl	%edi, %eax
	je	.L8
	testl	%ecx, %ecx
	jle	.L9
	testl	%edi, %edi
	jle	.L9
.L8:
	movl	%r8d, %eax
	orl	%esi, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L9
	testl	%esi, %esi
	jle	.L9
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	addl	$1, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %r8d
	jmp	.L4
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	xorl	%eax, %eax
	addq	$1032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L39:
	.cfi_restore_state
	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
```assembly
	.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	%esi, %esi
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$83, %al
	je	.L36
	cmpb	$69, %al
	je	.L37
	cmpb	$87, %al
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %esi
.L4:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L38
.L7:
	cmpb	$78, %al
	jne	.L3
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	addl	$1, %ecx
	testb	%al, %al
	jne	.L7
.L38:
	movl	%ecx, %eax
	orl	%edi, %eax
	je	.L8
	testl	%ecx, %ecx
	jle	.L9
	testl	%edi, %edi
	jle	.L9
.L8:
	movl	%r8d, %eax
	orl	%esi, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L9
	testl	%esi, %esi
	jle	.L9
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	addl	$1, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %r8d
	jmp	.L4
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	xorl	%eax, %eax
	addq	$1032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L39:
	.cfi_restore_state
	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:
```
```c
#include <stdio.h>
int main(void){
    
    char s[1001];
    int cntn=0, cnts=0, cnte=0, cntw=0, i=0;

    scanf("%s", s);

    while(s[i] != '\0'){
        if(s[i]=='N') cntn++;
        else if(s[i]=='S') cnts++;
        else if(s[i]=='E') cnte++;
        else if(s[i]=='W') cntw++;
        i++;
    }

    if(((cntn==0 && cnts==0) || (cntn>0 && cnts>0)) &&
       ((cnte==0 && cntw==0) || (cnte>0 && cntw>0))) printf("Yes\n");
    else printf("No\n");

    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main(void){
    
    char s[1001];
    int cntn=0, cnts=0, cnte=0, cntw=0, i=0;

    scanf("%s", s);

    while(s[i] != '\0'){
        if(s[i]=='N') cntn++;
        else if(s[i]=='S') cnts++;
        else if(s[i]=='E') cnte++;
        else if(s[i]=='W') cntw++;
        i++;
    }

    if(((cntn==0 && cnts==0) || (cntn>0 && cnts>0)) &&
       ((cnte==0 && cntw==0) || (cnte>0 && cntw>0))) printf("Yes\n");
    else printf("No\n");

    return 0;
}
```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main(void){
    
    char s[1001];
    int cntn=0, cnts=0, cnte=0, cntw=0, i=0;

    scanf("%s", s);

    while(s[i] != '\0'){
        if(s[i]=='N') cntn++;
        else if(s[i]=='S') cnts++;
        else if(s[i]=='E') cnte++;
        else if(s[i]=='W') cntw++;
        i++;
    }

    if(((cntn==0 && cnts==0) || (cntn>0 && cnts>0)) &&
       ((cnte==0 && cntw==0) || (cnte>0 && cntw>0))) printf("Yes\n");
    else printf("No\n");

    return 0;
}
```

Assembly Code:

```assembly
	.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	%esi, %esi
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$83, %al
	je	.L36
	cmpb	$69, %al
	je	.L37
	cmpb	$87, %al
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %esi
.L4:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L38
.L7:
	cmpb	$78, %al
	jne	.L3
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	addl	$1, %ecx
	testb	%al, %al
	jne	.L7
.L38:
	movl	%ecx, %eax
	orl	%edi, %eax
	je	.L8
	testl	%ecx, %ecx
	jle	.L9
	testl	%edi, %edi
	jle	.L9
.L8:
	movl	%r8d, %eax
	orl	%esi, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L9
	testl	%esi, %esi
	jle	.L9
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	addl	$1, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %r8d
	jmp	.L4
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	xorl	%eax, %eax
	addq	$1032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L39:
	.cfi_restore_state
	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:
```

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.
Optimized Assembly Code:

train
```assembly
	.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	%esi, %esi
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%ecx, %ecx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$83, %al
	je	.L36
	cmpb	$69, %al
	je	.L37
	cmpb	$87, %al
	sete	%al
	movzbl	%al, %eax
	addl	%eax, %esi
.L4:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	je	.L38
.L7:
	cmpb	$78, %al
	jne	.L3
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	addl	$1, %ecx
	testb	%al, %al
	jne	.L7
.L38:
	movl	%ecx, %eax
	orl	%edi, %eax
	je	.L8
	testl	%ecx, %ecx
	jle	.L9
	testl	%edi, %edi
	jle	.L9
.L8:
	movl	%r8d, %eax
	orl	%esi, %eax
	je	.L2
	testl	%r8d, %r8d
	jle	.L9
	testl	%esi, %esi
	jle	.L9
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L36:
	addl	$1, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, %r8d
	jmp	.L4
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1016(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	xorl	%eax, %eax
	addq	$1032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L39:
	.cfi_restore_state
	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:
```