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>
 
enum {A, X, Y, Z, W, B, ERROR};
int map[6][2] = {
	{X, Y},
	{ERROR, Z},
	{X, ERROR},
	{W, B},
	{B, Y},
	{Y, X}
};
 
int main(void)
{
	int sw;
	int now_pos;
	
	for (now_pos = A; (sw = getchar()) != '#';){
		if (sw == '\n'){
			puts(now_pos == B ? "Yes" : "No");
			now_pos = A;
			continue;
		}
		if (now_pos == ERROR) continue;
		now_pos = map[now_pos][sw == '1'];
	}
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 48
map:
	.long	1
	.long	2
	.long	6
	.long	3
	.long	1
	.long	6
	.long	4
	.long	5
	.long	5
	.long	2
	.long	2
	.long	1
	.section	.rodata
.LC0:
	.string	"Yes"
.LC1:
	.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	$16, %rsp
	movl	$0, -8(%rbp)
	jmp	.L2
.L7:
	cmpl	$10, -4(%rbp)
	jne	.L3
	cmpl	$5, -8(%rbp)
	jne	.L4
	leaq	.LC0(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC1(%rip), %rax
.L5:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	cmpl	$6, -8(%rbp)
	jne	.L6
	jmp	.L2
.L6:
	cmpl	$49, -4(%rbp)
	sete	%al
	movzbl	%al, %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L2:
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$35, -4(%rbp)
	jne	.L7
	movl	$0, %eax
	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	"Yes"
.LC1:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	map(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$35, %eax
	je	.L13
	cmpl	$10, %eax
	je	.L14
	cmpl	$6, %ebx
	je	.L2
	cmpl	$49, %eax
	sete	%al
	movzbl	%al, %eax
	leaq	(%rax,%rbx,2), %rax
	movslq	0(%rbp,%rax,4), %rbx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$5, %ebx
	movq	%r12, %rdi
	cmove	%r13, %rdi
	xorl	%ebx, %ebx
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 48
map:
	.long	1
	.long	2
	.long	6
	.long	3
	.long	1
	.long	6
	.long	4
	.long	5
	.long	5
	.long	2
	.long	2
	.long	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Yes"
.LC1:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	map(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$35, %eax
	je	.L13
	cmpl	$10, %eax
	je	.L14
	cmpl	$6, %ebx
	je	.L2
	cmpl	$49, %eax
	sete	%al
	movzbl	%al, %eax
	leaq	(%rax,%rbx,2), %rax
	movslq	0(%rbp,%rax,4), %rbx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$5, %ebx
	movq	%r12, %rdi
	cmove	%r13, %rdi
	xorl	%ebx, %ebx
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 48
map:
	.long	1
	.long	2
	.long	6
	.long	3
	.long	1
	.long	6
	.long	4
	.long	5
	.long	5
	.long	2
	.long	2
	.long	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:

#include <stdio.h>
 
enum {A, X, Y, Z, W, B, ERROR};
int map[6][2] = {
	{X, Y},
	{ERROR, Z},
	{X, ERROR},
	{W, B},
	{B, Y},
	{Y, X}
};
 
int main(void)
{
	int sw;
	int now_pos;
	
	for (now_pos = A; (sw = getchar()) != '#';){
		if (sw == '\n'){
			puts(now_pos == B ? "Yes" : "No");
			now_pos = A;
			continue;
		}
		if (now_pos == ERROR) continue;
		now_pos = map[now_pos][sw == '1'];
	}
	return (0);
}
0100
0101
10100
01000
0101011
0011
011110
#
 0100
1101
10100
11000
0001011
0011
011110
#
 0100
1101
10000
10000
0001011
0011
011110
#
 0100
0101
10100
10001
0011011
1011
011110
#
 0100
0100
10100
10001
0011011
1001
011110
#
 0100
1101
10100
10000
0001011
0011
011111
#
 0100
0101
10101
10011
0011011
1011
011110
#
 0100
0100
10110
10011
0011011
1101
011110
#
 0100
0100
10100
10011
0011011
1101
011111
#
 0100
1101
10110
11000
0101011
0011
011110
#

Yes
No
Yes
No
Yes
No
No
 Yes
No
Yes
No
No
No
No
 Yes
No
No
No
No
No
No
 Yes
No
Yes
No
No
Yes
No
 Yes
Yes
Yes
No
No
No
No
 Yes
No
Yes
No
No
No
Yes
 Yes
No
No
No
No
Yes
No
 Yes
Yes
No
No
No
No
No
 Yes
Yes
Yes
No
No
No
Yes
 Yes
No
No
No
Yes
No
No

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>
 
enum {A, X, Y, Z, W, B, ERROR};
int map[6][2] = {
	{X, Y},
	{ERROR, Z},
	{X, ERROR},
	{W, B},
	{B, Y},
	{Y, X}
};
 
int main(void)
{
	int sw;
	int now_pos;
	
	for (now_pos = A; (sw = getchar()) != '#';){
		if (sw == '\n'){
			puts(now_pos == B ? "Yes" : "No");
			now_pos = A;
			continue;
		}
		if (now_pos == ERROR) continue;
		now_pos = map[now_pos][sw == '1'];
	}
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 48
map:
	.long	1
	.long	2
	.long	6
	.long	3
	.long	1
	.long	6
	.long	4
	.long	5
	.long	5
	.long	2
	.long	2
	.long	1
	.section	.rodata
.LC0:
	.string	"Yes"
.LC1:
	.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	$16, %rsp
	movl	$0, -8(%rbp)
	jmp	.L2
.L7:
	cmpl	$10, -4(%rbp)
	jne	.L3
	cmpl	$5, -8(%rbp)
	jne	.L4
	leaq	.LC0(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC1(%rip), %rax
.L5:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	cmpl	$6, -8(%rbp)
	jne	.L6
	jmp	.L2
.L6:
	cmpl	$49, -4(%rbp)
	sete	%al
	movzbl	%al, %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L2:
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$35, -4(%rbp)
	jne	.L7
	movl	$0, %eax
	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
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 48
map:
	.long	1
	.long	2
	.long	6
	.long	3
	.long	1
	.long	6
	.long	4
	.long	5
	.long	5
	.long	2
	.long	2
	.long	1
	.section	.rodata
.LC0:
	.string	"Yes"
.LC1:
	.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	$16, %rsp
	movl	$0, -8(%rbp)
	jmp	.L2
.L7:
	cmpl	$10, -4(%rbp)
	jne	.L3
	cmpl	$5, -8(%rbp)
	jne	.L4
	leaq	.LC0(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC1(%rip), %rax
.L5:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	cmpl	$6, -8(%rbp)
	jne	.L6
	jmp	.L2
.L6:
	cmpl	$49, -4(%rbp)
	sete	%al
	movzbl	%al, %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	addq	%rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	map(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
.L2:
	call	getchar@PLT
	movl	%eax, -4(%rbp)
	cmpl	$35, -4(%rbp)
	jne	.L7
	movl	$0, %eax
	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:
