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>
#include <string.h>

int main(void){
    int ec=0,wc=0,nc=0,sc=0;
    int flagew=0,flagns=0;
    char s[1000];
    scanf("%s",s);
    for(int i=0;i<=strlen(s);i++){
        if(s[i] == 'E')ec++;
        else if(s[i] == 'W')wc++;
        else if(s[i] == 'N')nc++;
        else if(s[i] == 'S')sc++;
    }
    if(ec == wc){
        flagew = 1;
    }else if(ec != 0 && wc != 0){
        flagew = 1;
    }
    if(nc == sc){
        flagns = 1;
    }else if(nc != 0 && sc != 0){
        flagns = 1;
    }
    if(flagns && flagew){
        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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$1008, %rsp
	.cfi_def_cfa_offset 1024
	movq	%fs:40, %rax
	movq	%rax, 1000(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	movq	%rax, %r8
	movq	%rbx, %rax
	leaq	1(%rsp,%r8), %rcx
	xorl	%r8d, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	cmpb	$87, %dl
	je	.L24
	cmpb	$78, %dl
	je	.L25
	cmpb	$83, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %edi
.L3:
	addq	$1, %rax
	cmpq	%rax, %rcx
	je	.L26
.L6:
	movzbl	(%rax), %edx
	cmpb	$69, %dl
	jne	.L2
	addq	$1, %rax
	addl	$1, %esi
	cmpq	%rax, %rcx
	jne	.L6
.L26:
	cmpl	%r8d, %esi
	je	.L7
	testl	%esi, %esi
	je	.L9
	testl	%r8d, %r8d
	je	.L9
.L7:
	cmpl	%edi, %r9d
	je	.L11
	testl	%r9d, %r9d
	je	.L9
	testl	%edi, %edi
	je	.L9
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %r8d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %r9d
	jmp	.L3
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1000(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1008, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$1008, %rsp
	.cfi_def_cfa_offset 1024
	movq	%fs:40, %rax
	movq	%rax, 1000(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	movq	%rax, %r8
	movq	%rbx, %rax
	leaq	1(%rsp,%r8), %rcx
	xorl	%r8d, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	cmpb	$87, %dl
	je	.L24
	cmpb	$78, %dl
	je	.L25
	cmpb	$83, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %edi
.L3:
	addq	$1, %rax
	cmpq	%rax, %rcx
	je	.L26
.L6:
	movzbl	(%rax), %edx
	cmpb	$69, %dl
	jne	.L2
	addq	$1, %rax
	addl	$1, %esi
	cmpq	%rax, %rcx
	jne	.L6
.L26:
	cmpl	%r8d, %esi
	je	.L7
	testl	%esi, %esi
	je	.L9
	testl	%r8d, %r8d
	je	.L9
.L7:
	cmpl	%edi, %r9d
	je	.L11
	testl	%r9d, %r9d
	je	.L9
	testl	%edi, %edi
	je	.L9
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %r8d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %r9d
	jmp	.L3
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1000(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1008, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$1008, %rsp
	.cfi_def_cfa_offset 1024
	movq	%fs:40, %rax
	movq	%rax, 1000(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	movq	%rax, %r8
	movq	%rbx, %rax
	leaq	1(%rsp,%r8), %rcx
	xorl	%r8d, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	cmpb	$87, %dl
	je	.L24
	cmpb	$78, %dl
	je	.L25
	cmpb	$83, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %edi
.L3:
	addq	$1, %rax
	cmpq	%rax, %rcx
	je	.L26
.L6:
	movzbl	(%rax), %edx
	cmpb	$69, %dl
	jne	.L2
	addq	$1, %rax
	addl	$1, %esi
	cmpq	%rax, %rcx
	jne	.L6
.L26:
	cmpl	%r8d, %esi
	je	.L7
	testl	%esi, %esi
	je	.L9
	testl	%r8d, %r8d
	je	.L9
.L7:
	cmpl	%edi, %r9d
	je	.L11
	testl	%r9d, %r9d
	je	.L9
	testl	%edi, %edi
	je	.L9
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %r8d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %r9d
	jmp	.L3
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1000(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1008, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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>
#include <string.h>

int main(void){
    int ec=0,wc=0,nc=0,sc=0;
    int flagew=0,flagns=0;
    char s[1000];
    scanf("%s",s);
    for(int i=0;i<=strlen(s);i++){
        if(s[i] == 'E')ec++;
        else if(s[i] == 'W')wc++;
        else if(s[i] == 'N')nc++;
        else if(s[i] == 'S')sc++;
    }
    if(ec == wc){
        flagew = 1;
    }else if(ec != 0 && wc != 0){
        flagew = 1;
    }
    if(nc == sc){
        flagns = 1;
    }else if(nc != 0 && sc != 0){
        flagns = 1;
    }
    if(flagns && flagew){
        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>
#include <string.h>

int main(void){
    int ec=0,wc=0,nc=0,sc=0;
    int flagew=0,flagns=0;
    char s[1000];
    scanf("%s",s);
    for(int i=0;i<=strlen(s);i++){
        if(s[i] == 'E')ec++;
        else if(s[i] == 'W')wc++;
        else if(s[i] == 'N')nc++;
        else if(s[i] == 'S')sc++;
    }
    if(ec == wc){
        flagew = 1;
    }else if(ec != 0 && wc != 0){
        flagew = 1;
    }
    if(nc == sc){
        flagns = 1;
    }else if(nc != 0 && sc != 0){
        flagns = 1;
    }
    if(flagns && flagew){
        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>
#include <string.h>

int main(void){
    int ec=0,wc=0,nc=0,sc=0;
    int flagew=0,flagns=0;
    char s[1000];
    scanf("%s",s);
    for(int i=0;i<=strlen(s);i++){
        if(s[i] == 'E')ec++;
        else if(s[i] == 'W')wc++;
        else if(s[i] == 'N')nc++;
        else if(s[i] == 'S')sc++;
    }
    if(ec == wc){
        flagew = 1;
    }else if(ec != 0 && wc != 0){
        flagew = 1;
    }
    if(nc == sc){
        flagns = 1;
    }else if(nc != 0 && sc != 0){
        flagns = 1;
    }
    if(flagns && flagew){
        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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$1008, %rsp
	.cfi_def_cfa_offset 1024
	movq	%fs:40, %rax
	movq	%rax, 1000(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	movq	%rax, %r8
	movq	%rbx, %rax
	leaq	1(%rsp,%r8), %rcx
	xorl	%r8d, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	cmpb	$87, %dl
	je	.L24
	cmpb	$78, %dl
	je	.L25
	cmpb	$83, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %edi
.L3:
	addq	$1, %rax
	cmpq	%rax, %rcx
	je	.L26
.L6:
	movzbl	(%rax), %edx
	cmpb	$69, %dl
	jne	.L2
	addq	$1, %rax
	addl	$1, %esi
	cmpq	%rax, %rcx
	jne	.L6
.L26:
	cmpl	%r8d, %esi
	je	.L7
	testl	%esi, %esi
	je	.L9
	testl	%r8d, %r8d
	je	.L9
.L7:
	cmpl	%edi, %r9d
	je	.L11
	testl	%r9d, %r9d
	je	.L9
	testl	%edi, %edi
	je	.L9
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %r8d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %r9d
	jmp	.L3
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1000(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1008, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$1008, %rsp
	.cfi_def_cfa_offset 1024
	movq	%fs:40, %rax
	movq	%rax, 1000(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	xorl	%esi, %esi
	movq	%rax, %r8
	movq	%rbx, %rax
	leaq	1(%rsp,%r8), %rcx
	xorl	%r8d, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	cmpb	$87, %dl
	je	.L24
	cmpb	$78, %dl
	je	.L25
	cmpb	$83, %dl
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %edi
.L3:
	addq	$1, %rax
	cmpq	%rax, %rcx
	je	.L26
.L6:
	movzbl	(%rax), %edx
	cmpb	$69, %dl
	jne	.L2
	addq	$1, %rax
	addl	$1, %esi
	cmpq	%rax, %rcx
	jne	.L6
.L26:
	cmpl	%r8d, %esi
	je	.L7
	testl	%esi, %esi
	je	.L9
	testl	%r8d, %r8d
	je	.L9
.L7:
	cmpl	%edi, %r9d
	je	.L11
	testl	%r9d, %r9d
	je	.L9
	testl	%edi, %edi
	je	.L9
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %r8d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %r9d
	jmp	.L3
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L10:
	movq	1000(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$1008, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
```