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>
char c;
char d[4];
int main(void){
  while((c=getchar())!=10){
    if(c=='N'){
      d[0]=1;
    }else if(c=='W'){
      d[1]=1;
    }else if(c=='S'){
      d[2]=1;
    }else{
      d[3]=1;
    }
  }
  if((d[0]^d[2]) || (d[1]^d[3])){
    puts("No");
  }else{
    puts("Yes");
  }
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"No"
.LC1:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movb	%al, c(%rip)
	cmpb	$10, %al
	je	.L13
	cmpb	$78, %al
	je	.L14
	cmpb	$87, %al
	je	.L15
	cmpb	$83, %al
	je	.L16
	movb	$1, 3+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$1, d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L15:
	movb	$1, 1+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movb	$1, 2+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movzbl	2+d(%rip), %eax
	cmpb	%al, d(%rip)
	jne	.L8
	movzbl	3+d(%rip), %eax
	cmpb	%al, 1+d(%rip)
	je	.L9
.L8:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L10:
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.type	c, @object
	.size	c, 1
c:
	.zero	1
	.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	"No"
.LC1:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movb	%al, c(%rip)
	cmpb	$10, %al
	je	.L13
	cmpb	$78, %al
	je	.L14
	cmpb	$87, %al
	je	.L15
	cmpb	$83, %al
	je	.L16
	movb	$1, 3+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$1, d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L15:
	movb	$1, 1+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movb	$1, 2+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movzbl	2+d(%rip), %eax
	cmpb	%al, d(%rip)
	jne	.L8
	movzbl	3+d(%rip), %eax
	cmpb	%al, 1+d(%rip)
	je	.L9
.L8:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L10:
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.type	c, @object
	.size	c, 1
c:
	.zero	1
	.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	"No"
.LC1:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movb	%al, c(%rip)
	cmpb	$10, %al
	je	.L13
	cmpb	$78, %al
	je	.L14
	cmpb	$87, %al
	je	.L15
	cmpb	$83, %al
	je	.L16
	movb	$1, 3+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$1, d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L15:
	movb	$1, 1+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movb	$1, 2+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movzbl	2+d(%rip), %eax
	cmpb	%al, d(%rip)
	jne	.L8
	movzbl	3+d(%rip), %eax
	cmpb	%al, 1+d(%rip)
	je	.L9
.L8:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L10:
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.type	c, @object
	.size	c, 1
c:
	.zero	1
	.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>
char c;
char d[4];
int main(void){
  while((c=getchar())!=10){
    if(c=='N'){
      d[0]=1;
    }else if(c=='W'){
      d[1]=1;
    }else if(c=='S'){
      d[2]=1;
    }else{
      d[3]=1;
    }
  }
  if((d[0]^d[2]) || (d[1]^d[3])){
    puts("No");
  }else{
    puts("Yes");
  }
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
char c;
char d[4];
int main(void){
  while((c=getchar())!=10){
    if(c=='N'){
      d[0]=1;
    }else if(c=='W'){
      d[1]=1;
    }else if(c=='S'){
      d[2]=1;
    }else{
      d[3]=1;
    }
  }
  if((d[0]^d[2]) || (d[1]^d[3])){
    puts("No");
  }else{
    puts("Yes");
  }
}
```

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>
char c;
char d[4];
int main(void){
  while((c=getchar())!=10){
    if(c=='N'){
      d[0]=1;
    }else if(c=='W'){
      d[1]=1;
    }else if(c=='S'){
      d[2]=1;
    }else{
      d[3]=1;
    }
  }
  if((d[0]^d[2]) || (d[1]^d[3])){
    puts("No");
  }else{
    puts("Yes");
  }
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"No"
.LC1:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movb	%al, c(%rip)
	cmpb	$10, %al
	je	.L13
	cmpb	$78, %al
	je	.L14
	cmpb	$87, %al
	je	.L15
	cmpb	$83, %al
	je	.L16
	movb	$1, 3+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$1, d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L15:
	movb	$1, 1+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movb	$1, 2+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movzbl	2+d(%rip), %eax
	cmpb	%al, d(%rip)
	jne	.L8
	movzbl	3+d(%rip), %eax
	cmpb	%al, 1+d(%rip)
	je	.L9
.L8:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L10:
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.type	c, @object
	.size	c, 1
c:
	.zero	1
	.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	"No"
.LC1:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movb	%al, c(%rip)
	cmpb	$10, %al
	je	.L13
	cmpb	$78, %al
	je	.L14
	cmpb	$87, %al
	je	.L15
	cmpb	$83, %al
	je	.L16
	movb	$1, 3+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	movb	$1, d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L15:
	movb	$1, 1+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	movb	$1, 2+d(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movzbl	2+d(%rip), %eax
	cmpb	%al, d(%rip)
	jne	.L8
	movzbl	3+d(%rip), %eax
	cmpb	%al, 1+d(%rip)
	je	.L9
.L8:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L10:
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L10
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.type	c, @object
	.size	c, 1
c:
	.zero	1
	.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:
```