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>
#include<string.h>
 
int n,i;
char mozi[6];
int me;
 
int main(){
 
int sum,
    saikoro1,
    saikoro2,
    saikoro3;
     
while(1){
    scanf("%d",&n);
    if(n==0)break;
 
    saikoro1 = 1;
    saikoro2 = 2;
    saikoro3 = 3;
    sum = saikoro1;
    for(i=0;i<n;i++){
        scanf("%s",mozi);
        if(strcmp("North",mozi)==0){
            me = 7 - saikoro1;
            saikoro1 = saikoro2;
            saikoro2 = me;
        }
        if(strcmp("East",mozi)==0){
            me = 7-saikoro3;
            saikoro3 = saikoro1;
            saikoro1 = me;
        }
        if(strcmp("West",mozi)==0){
            me = 7-saikoro1;
            saikoro1 = saikoro3;
            saikoro3 = me;
        }
        if(strcmp("South",mozi)==0){
            me = 7-saikoro2;
            saikoro2 = saikoro1;
            saikoro1 = me;
        }
        if(strcmp("Right",mozi)==0){
            me = 7-saikoro2;
            saikoro2 = saikoro3;
            saikoro3 = me;
        }
        if(strcmp("Left",mozi)==0){
            me = 7 - saikoro3;
            saikoro3 = saikoro2;
            saikoro2 = me;
        }
        sum +=saikoro1;
    }
    printf("%d\n",sum);
}
return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	mozi
	.type	mozi, @object
	.size	mozi, 6
mozi:
	.zero	6
	.globl	me
	.align 4
	.type	me, @object
	.size	me, 4
me:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"North"
.LC3:
	.string	"East"
.LC4:
	.string	"West"
.LC5:
	.string	"South"
.LC6:
	.string	"Right"
.LC7:
	.string	"Left"
.LC8:
	.string	"%d\n"
	.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
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L15
	movl	$1, -12(%rbp)
	movl	$2, -8(%rbp)
	movl	$3, -4(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, i(%rip)
	jmp	.L4
.L11:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L5
	movl	$7, %eax
	subl	-12(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -8(%rbp)
.L5:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L6
	movl	$7, %eax
	subl	-4(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -12(%rbp)
.L6:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L7
	movl	$7, %eax
	subl	-12(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -4(%rbp)
.L7:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L8
	movl	$7, %eax
	subl	-8(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -12(%rbp)
.L8:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L9
	movl	$7, %eax
	subl	-8(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -4(%rbp)
.L9:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L10
	movl	$7, %eax
	subl	-4(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -8(%rbp)
.L10:
	movl	-12(%rbp), %eax
	addl	%eax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L15:
	nop
	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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"North"
.LC3:
	.string	"East"
.LC4:
	.string	"West"
.LC5:
	.string	"South"
.LC6:
	.string	"Right"
.LC7:
	.string	"Left"
.LC8:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	mozi(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, i(%rip)
	jle	.L19
	movl	$3, %r12d
	movl	$2, %ebx
	movl	$1, %ebp
	movl	$1, %r13d
	leaq	.LC2(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L4
	movl	$7, %eax
	subl	%ebp, %eax
	movl	%ebx, %ebp
	movl	%eax, me(%rip)
	movl	%eax, %ebx
.L4:
	cmpl	$1953718597, (%r14)
	je	.L23
.L7:
	cmpl	$1953719639, (%r14)
	je	.L24
.L10:
	movq	%r14, %rsi
	leaq	.LC5(%rip), %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L11
	movl	$7, %eax
	subl	%ebx, %eax
	movl	%ebp, %ebx
	movl	%eax, me(%rip)
	movl	%eax, %ebp
.L11:
	movq	%r14, %rsi
	leaq	.LC6(%rip), %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L12
	movl	$7, %eax
	subl	%ebx, %eax
	movl	%r12d, %ebx
	movl	%eax, me(%rip)
	movl	%eax, %r12d
.L12:
	cmpl	$1952867660, (%r14)
	je	.L25
.L13:
	movl	i(%rip), %eax
	addl	%ebp, %r13d
	addl	$1, %eax
	cmpl	n(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L17
.L3:
	movl	%r13d, %edx
	leaq	.LC8(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L25:
	cmpb	$0, 4+mozi(%rip)
	jne	.L13
	movl	i(%rip), %eax
	movl	$7, %edx
	addl	%ebp, %r13d
	subl	%r12d, %edx
	addl	$1, %eax
	cmpl	%eax, n(%rip)
	movl	%edx, me(%rip)
	movl	%eax, i(%rip)
	jle	.L3
	movl	%ebx, %r12d
	movl	%edx, %ebx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L24:
	cmpb	$0, 4+mozi(%rip)
	jne	.L10
	movl	$7, %eax
	subl	%ebp, %eax
	movl	%r12d, %ebp
	movl	%eax, me(%rip)
	movl	%eax, %r12d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L23:
	cmpb	$0, 4+mozi(%rip)
	jne	.L7
	movl	$7, %eax
	subl	%r12d, %eax
	movl	%ebp, %r12d
	movl	%eax, me(%rip)
	movl	%eax, %ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	movl	$1, %r13d
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	me
	.bss
	.align 4
	.type	me, @object
	.size	me, 4
me:
	.zero	4
	.globl	mozi
	.type	mozi, @object
	.size	mozi, 6
mozi:
	.zero	6
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"North"
.LC3:
	.string	"East"
.LC4:
	.string	"West"
.LC5:
	.string	"South"
.LC6:
	.string	"Right"
.LC7:
	.string	"Left"
.LC8:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	mozi(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, i(%rip)
	jle	.L19
	movl	$3, %r12d
	movl	$2, %ebx
	movl	$1, %ebp
	movl	$1, %r13d
	leaq	.LC2(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L4
	movl	$7, %eax
	subl	%ebp, %eax
	movl	%ebx, %ebp
	movl	%eax, me(%rip)
	movl	%eax, %ebx
.L4:
	cmpl	$1953718597, (%r14)
	je	.L23
.L7:
	cmpl	$1953719639, (%r14)
	je	.L24
.L10:
	movq	%r14, %rsi
	leaq	.LC5(%rip), %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L11
	movl	$7, %eax
	subl	%ebx, %eax
	movl	%ebp, %ebx
	movl	%eax, me(%rip)
	movl	%eax, %ebp
.L11:
	movq	%r14, %rsi
	leaq	.LC6(%rip), %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L12
	movl	$7, %eax
	subl	%ebx, %eax
	movl	%r12d, %ebx
	movl	%eax, me(%rip)
	movl	%eax, %r12d
.L12:
	cmpl	$1952867660, (%r14)
	je	.L25
.L13:
	movl	i(%rip), %eax
	addl	%ebp, %r13d
	addl	$1, %eax
	cmpl	n(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L17
.L3:
	movl	%r13d, %edx
	leaq	.LC8(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L25:
	cmpb	$0, 4+mozi(%rip)
	jne	.L13
	movl	i(%rip), %eax
	movl	$7, %edx
	addl	%ebp, %r13d
	subl	%r12d, %edx
	addl	$1, %eax
	cmpl	%eax, n(%rip)
	movl	%edx, me(%rip)
	movl	%eax, i(%rip)
	jle	.L3
	movl	%ebx, %r12d
	movl	%edx, %ebx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L24:
	cmpb	$0, 4+mozi(%rip)
	jne	.L10
	movl	$7, %eax
	subl	%ebp, %eax
	movl	%r12d, %ebp
	movl	%eax, me(%rip)
	movl	%eax, %r12d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L23:
	cmpb	$0, 4+mozi(%rip)
	jne	.L7
	movl	$7, %eax
	subl	%r12d, %eax
	movl	%ebp, %r12d
	movl	%eax, me(%rip)
	movl	%eax, %ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	movl	$1, %r13d
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	me
	.bss
	.align 4
	.type	me, @object
	.size	me, 4
me:
	.zero	4
	.globl	mozi
	.type	mozi, @object
	.size	mozi, 6
mozi:
	.zero	6
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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>
#include<string.h>
 
int n,i;
char mozi[6];
int me;
 
int main(){
 
int sum,
    saikoro1,
    saikoro2,
    saikoro3;
     
while(1){
    scanf("%d",&n);
    if(n==0)break;
 
    saikoro1 = 1;
    saikoro2 = 2;
    saikoro3 = 3;
    sum = saikoro1;
    for(i=0;i<n;i++){
        scanf("%s",mozi);
        if(strcmp("North",mozi)==0){
            me = 7 - saikoro1;
            saikoro1 = saikoro2;
            saikoro2 = me;
        }
        if(strcmp("East",mozi)==0){
            me = 7-saikoro3;
            saikoro3 = saikoro1;
            saikoro1 = me;
        }
        if(strcmp("West",mozi)==0){
            me = 7-saikoro1;
            saikoro1 = saikoro3;
            saikoro3 = me;
        }
        if(strcmp("South",mozi)==0){
            me = 7-saikoro2;
            saikoro2 = saikoro1;
            saikoro1 = me;
        }
        if(strcmp("Right",mozi)==0){
            me = 7-saikoro2;
            saikoro2 = saikoro3;
            saikoro3 = me;
        }
        if(strcmp("Left",mozi)==0){
            me = 7 - saikoro3;
            saikoro3 = saikoro2;
            saikoro2 = me;
        }
        sum +=saikoro1;
    }
    printf("%d\n",sum);
}
return 0;
}
5
North
North
East
South
West
8
West
North
Left
South
Right
North
Left
East
0
 5
North
North
East
South
West
8
West
North
Left
South
Right
North
Left
East
0

21
34
 21
34

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>
#include<string.h>
 
int n,i;
char mozi[6];
int me;
 
int main(){
 
int sum,
    saikoro1,
    saikoro2,
    saikoro3;
     
while(1){
    scanf("%d",&n);
    if(n==0)break;
 
    saikoro1 = 1;
    saikoro2 = 2;
    saikoro3 = 3;
    sum = saikoro1;
    for(i=0;i<n;i++){
        scanf("%s",mozi);
        if(strcmp("North",mozi)==0){
            me = 7 - saikoro1;
            saikoro1 = saikoro2;
            saikoro2 = me;
        }
        if(strcmp("East",mozi)==0){
            me = 7-saikoro3;
            saikoro3 = saikoro1;
            saikoro1 = me;
        }
        if(strcmp("West",mozi)==0){
            me = 7-saikoro1;
            saikoro1 = saikoro3;
            saikoro3 = me;
        }
        if(strcmp("South",mozi)==0){
            me = 7-saikoro2;
            saikoro2 = saikoro1;
            saikoro1 = me;
        }
        if(strcmp("Right",mozi)==0){
            me = 7-saikoro2;
            saikoro2 = saikoro3;
            saikoro3 = me;
        }
        if(strcmp("Left",mozi)==0){
            me = 7 - saikoro3;
            saikoro3 = saikoro2;
            saikoro2 = me;
        }
        sum +=saikoro1;
    }
    printf("%d\n",sum);
}
return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	mozi
	.type	mozi, @object
	.size	mozi, 6
mozi:
	.zero	6
	.globl	me
	.align 4
	.type	me, @object
	.size	me, 4
me:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"North"
.LC3:
	.string	"East"
.LC4:
	.string	"West"
.LC5:
	.string	"South"
.LC6:
	.string	"Right"
.LC7:
	.string	"Left"
.LC8:
	.string	"%d\n"
	.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
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L15
	movl	$1, -12(%rbp)
	movl	$2, -8(%rbp)
	movl	$3, -4(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, i(%rip)
	jmp	.L4
.L11:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L5
	movl	$7, %eax
	subl	-12(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -8(%rbp)
.L5:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L6
	movl	$7, %eax
	subl	-4(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -12(%rbp)
.L6:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L7
	movl	$7, %eax
	subl	-12(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -4(%rbp)
.L7:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L8
	movl	$7, %eax
	subl	-8(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -12(%rbp)
.L8:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L9
	movl	$7, %eax
	subl	-8(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -4(%rbp)
.L9:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L10
	movl	$7, %eax
	subl	-4(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -8(%rbp)
.L10:
	movl	-12(%rbp), %eax
	addl	%eax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L15:
	nop
	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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	mozi
	.type	mozi, @object
	.size	mozi, 6
mozi:
	.zero	6
	.globl	me
	.align 4
	.type	me, @object
	.size	me, 4
me:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"North"
.LC3:
	.string	"East"
.LC4:
	.string	"West"
.LC5:
	.string	"South"
.LC6:
	.string	"Right"
.LC7:
	.string	"Left"
.LC8:
	.string	"%d\n"
	.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
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L15
	movl	$1, -12(%rbp)
	movl	$2, -8(%rbp)
	movl	$3, -4(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, i(%rip)
	jmp	.L4
.L11:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L5
	movl	$7, %eax
	subl	-12(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -8(%rbp)
.L5:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L6
	movl	$7, %eax
	subl	-4(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -12(%rbp)
.L6:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L7
	movl	$7, %eax
	subl	-12(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -4(%rbp)
.L7:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L8
	movl	$7, %eax
	subl	-8(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -12(%rbp)
.L8:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L9
	movl	$7, %eax
	subl	-8(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -4(%rbp)
.L9:
	leaq	mozi(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC7(%rip), %rax
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L10
	movl	$7, %eax
	subl	-4(%rbp), %eax
	movl	%eax, me(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	me(%rip), %eax
	movl	%eax, -8(%rbp)
.L10:
	movl	-12(%rbp), %eax
	addl	%eax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC8(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L15:
	nop
	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:
