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>
int main(){

  int m[6],r=1,blank,n,i;
  char hou[10];

  while(1){

    r=1;
  scanf("%d",&n);
  if(n == 0) break;
  
  for(i = 0; i < 6; i++) m[i]=i+1;

  for(i = 0; i < n; i++){

    scanf("%s",hou);

    if(hou[0] == 'N'){

      blank=m[0];
      m[0]=m[1];
      m[1]=m[5];
      m[5]=m[4];
      m[4]=blank;

    }

    if(hou[0] == 'E'){

      blank=m[0];
      m[0]=m[3];
      m[3]=m[5];
      m[5]=m[2];
      m[2]=blank;

    }

    if(hou[0] == 'S'){

      blank=m[0];
      m[0]=m[4];
      m[4]=m[5];
      m[5]=m[1];
      m[1]=blank;

    }


    if(hou[0] == 'W'){

      blank=m[0];
      m[0]=m[2];
      m[2]=m[5];
      m[5]=m[3];
      m[3]=blank;

    }

    if(hou[0] == 'R'){

      blank=m[1];
      m[1]=m[2];
      m[2]=m[4];
      m[4]=m[3];
      m[3]=blank;

    }

    if(hou[0] == 'L'){

      blank=m[1];
      m[1]=m[3];
      m[3]=m[4];
      m[4]=m[2];
      m[2]=blank;

    }

    r += m[0];

  }

  printf("%d\n",r);

  }
  
  return 0;

}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -60(%rbp)
.L14:
	movl	$1, -60(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-56(%rbp), %eax
	leal	1(%rax), %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$5, -56(%rbp)
	jle	.L5
	movl	$0, -56(%rbp)
	jmp	.L6
.L13:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-18(%rbp), %eax
	cmpb	$78, %al
	jne	.L7
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -32(%rbp)
.L7:
	movzbl	-18(%rbp), %eax
	cmpb	$69, %al
	jne	.L8
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
.L8:
	movzbl	-18(%rbp), %eax
	cmpb	$83, %al
	jne	.L9
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -44(%rbp)
.L9:
	movzbl	-18(%rbp), %eax
	cmpb	$87, %al
	jne	.L10
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
.L10:
	movzbl	-18(%rbp), %eax
	cmpb	$82, %al
	jne	.L11
	movl	-44(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
.L11:
	movzbl	-18(%rbp), %eax
	cmpb	$76, %al
	jne	.L12
	movl	-44(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
.L12:
	movl	-48(%rbp), %eax
	addl	%eax, -60(%rbp)
	addl	$1, -56(%rbp)
.L6:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L13
	movl	-60(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L10
	leaq	46(%rsp), %rax
	movl	$3, 12(%rsp)
	movl	$6, %ebx
	xorl	%ebp, %ebp
	movl	$2, 8(%rsp)
	movl	$5, %r14d
	movl	$4, %r13d
	movl	$1, %r12d
	movq	%rax, 16(%rsp)
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	16(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	46(%rsp), %eax
	cmpb	$78, %al
	je	.L4
	cmpb	$69, %al
	jne	.L23
.L14:
	movl	%r12d, %eax
	movl	%r13d, %r12d
	movl	%ebx, %r13d
	movl	12(%rsp), %ebx
	movl	%eax, 12(%rsp)
.L6:
	addl	%r12d, %r15d
	addl	$1, %ebp
	cmpl	%ebp, 40(%rsp)
	jg	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r15d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L23:
	cmpb	$83, %al
	jne	.L24
	movl	%r12d, %eax
	movl	%r14d, %r12d
	addl	$1, %ebp
	movl	%ebx, %r14d
	addl	%r12d, %r15d
	movl	8(%rsp), %ebx
	movl	%eax, 8(%rsp)
	cmpl	%ebp, 40(%rsp)
	jg	.L7
	jmp	.L3
.L24:
	cmpb	$87, %al
	jne	.L25
	movl	%r12d, %eax
	movl	12(%rsp), %r12d
	addl	$1, %ebp
	movl	%ebx, 12(%rsp)
	movl	%r13d, %ebx
	movl	%eax, %r13d
	addl	%r12d, %r15d
	cmpl	%ebp, 40(%rsp)
	jg	.L7
	jmp	.L3
.L25:
	cmpb	$82, %al
	jne	.L26
	movl	8(%rsp), %eax
	movl	12(%rsp), %ecx
	addl	%r12d, %r15d
	movl	%r14d, 12(%rsp)
	addl	$1, %ebp
	movl	%r13d, %r14d
	movl	%ecx, 8(%rsp)
	movl	%eax, %r13d
	cmpl	%ebp, 40(%rsp)
	jg	.L7
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$72, %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
.L10:
	.cfi_restore_state
	movl	$1, %r15d
	jmp	.L3
.L26:
	movl	8(%rsp), %esi
	movl	%r12d, 8(%rsp)
	movl	%r14d, %r12d
	movl	%ebx, %r14d
	movl	%esi, %ebx
.L4:
	movl	%r12d, %esi
	movl	%r14d, %ecx
	movl	12(%rsp), %r12d
	movl	%r14d, 12(%rsp)
	movl	%esi, %r14d
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	8(%rsp), %r13d
	movl	%ebx, 8(%rsp)
	movl	%esi, %ebx
	cmpb	$76, %al
	jne	.L14
	movl	%r12d, %eax
	movl	%esi, 8(%rsp)
	movl	%r13d, %r12d
	movl	%ecx, %ebx
	movl	%r14d, %r13d
	movl	%edx, 12(%rsp)
	movl	%eax, %r14d
	jmp	.L6
.L27:
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L10
	leaq	46(%rsp), %rax
	movl	$3, 12(%rsp)
	movl	$6, %ebx
	xorl	%ebp, %ebp
	movl	$2, 8(%rsp)
	movl	$5, %r14d
	movl	$4, %r13d
	movl	$1, %r12d
	movq	%rax, 16(%rsp)
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	16(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	46(%rsp), %eax
	cmpb	$78, %al
	je	.L4
	cmpb	$69, %al
	jne	.L23
.L14:
	movl	%r12d, %eax
	movl	%r13d, %r12d
	movl	%ebx, %r13d
	movl	12(%rsp), %ebx
	movl	%eax, 12(%rsp)
.L6:
	addl	%r12d, %r15d
	addl	$1, %ebp
	cmpl	%ebp, 40(%rsp)
	jg	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r15d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L23:
	cmpb	$83, %al
	jne	.L24
	movl	%r12d, %eax
	movl	%r14d, %r12d
	addl	$1, %ebp
	movl	%ebx, %r14d
	addl	%r12d, %r15d
	movl	8(%rsp), %ebx
	movl	%eax, 8(%rsp)
	cmpl	%ebp, 40(%rsp)
	jg	.L7
	jmp	.L3
.L24:
	cmpb	$87, %al
	jne	.L25
	movl	%r12d, %eax
	movl	12(%rsp), %r12d
	addl	$1, %ebp
	movl	%ebx, 12(%rsp)
	movl	%r13d, %ebx
	movl	%eax, %r13d
	addl	%r12d, %r15d
	cmpl	%ebp, 40(%rsp)
	jg	.L7
	jmp	.L3
.L25:
	cmpb	$82, %al
	jne	.L26
	movl	8(%rsp), %eax
	movl	12(%rsp), %ecx
	addl	%r12d, %r15d
	movl	%r14d, 12(%rsp)
	addl	$1, %ebp
	movl	%r13d, %r14d
	movl	%ecx, 8(%rsp)
	movl	%eax, %r13d
	cmpl	%ebp, 40(%rsp)
	jg	.L7
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$72, %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
.L10:
	.cfi_restore_state
	movl	$1, %r15d
	jmp	.L3
.L26:
	movl	8(%rsp), %esi
	movl	%r12d, 8(%rsp)
	movl	%r14d, %r12d
	movl	%ebx, %r14d
	movl	%esi, %ebx
.L4:
	movl	%r12d, %esi
	movl	%r14d, %ecx
	movl	12(%rsp), %r12d
	movl	%r14d, 12(%rsp)
	movl	%esi, %r14d
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	8(%rsp), %r13d
	movl	%ebx, 8(%rsp)
	movl	%esi, %ebx
	cmpb	$76, %al
	jne	.L14
	movl	%r12d, %eax
	movl	%esi, 8(%rsp)
	movl	%r13d, %r12d
	movl	%ecx, %ebx
	movl	%r14d, %r13d
	movl	%edx, 12(%rsp)
	movl	%eax, %r14d
	jmp	.L6
.L27:
	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:

#include <stdio.h>
int main(){

  int m[6],r=1,blank,n,i;
  char hou[10];

  while(1){

    r=1;
  scanf("%d",&n);
  if(n == 0) break;
  
  for(i = 0; i < 6; i++) m[i]=i+1;

  for(i = 0; i < n; i++){

    scanf("%s",hou);

    if(hou[0] == 'N'){

      blank=m[0];
      m[0]=m[1];
      m[1]=m[5];
      m[5]=m[4];
      m[4]=blank;

    }

    if(hou[0] == 'E'){

      blank=m[0];
      m[0]=m[3];
      m[3]=m[5];
      m[5]=m[2];
      m[2]=blank;

    }

    if(hou[0] == 'S'){

      blank=m[0];
      m[0]=m[4];
      m[4]=m[5];
      m[5]=m[1];
      m[1]=blank;

    }


    if(hou[0] == 'W'){

      blank=m[0];
      m[0]=m[2];
      m[2]=m[5];
      m[5]=m[3];
      m[3]=blank;

    }

    if(hou[0] == 'R'){

      blank=m[1];
      m[1]=m[2];
      m[2]=m[4];
      m[4]=m[3];
      m[3]=blank;

    }

    if(hou[0] == 'L'){

      blank=m[1];
      m[1]=m[3];
      m[3]=m[4];
      m[4]=m[2];
      m[2]=blank;

    }

    r += m[0];

  }

  printf("%d\n",r);

  }
  
  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>
int main(){

  int m[6],r=1,blank,n,i;
  char hou[10];

  while(1){

    r=1;
  scanf("%d",&n);
  if(n == 0) break;
  
  for(i = 0; i < 6; i++) m[i]=i+1;

  for(i = 0; i < n; i++){

    scanf("%s",hou);

    if(hou[0] == 'N'){

      blank=m[0];
      m[0]=m[1];
      m[1]=m[5];
      m[5]=m[4];
      m[4]=blank;

    }

    if(hou[0] == 'E'){

      blank=m[0];
      m[0]=m[3];
      m[3]=m[5];
      m[5]=m[2];
      m[2]=blank;

    }

    if(hou[0] == 'S'){

      blank=m[0];
      m[0]=m[4];
      m[4]=m[5];
      m[5]=m[1];
      m[1]=blank;

    }


    if(hou[0] == 'W'){

      blank=m[0];
      m[0]=m[2];
      m[2]=m[5];
      m[5]=m[3];
      m[3]=blank;

    }

    if(hou[0] == 'R'){

      blank=m[1];
      m[1]=m[2];
      m[2]=m[4];
      m[4]=m[3];
      m[3]=blank;

    }

    if(hou[0] == 'L'){

      blank=m[1];
      m[1]=m[3];
      m[3]=m[4];
      m[4]=m[2];
      m[2]=blank;

    }

    r += m[0];

  }

  printf("%d\n",r);

  }
  
  return 0;

}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -60(%rbp)
.L14:
	movl	$1, -60(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-56(%rbp), %eax
	leal	1(%rax), %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$5, -56(%rbp)
	jle	.L5
	movl	$0, -56(%rbp)
	jmp	.L6
.L13:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-18(%rbp), %eax
	cmpb	$78, %al
	jne	.L7
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -32(%rbp)
.L7:
	movzbl	-18(%rbp), %eax
	cmpb	$69, %al
	jne	.L8
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
.L8:
	movzbl	-18(%rbp), %eax
	cmpb	$83, %al
	jne	.L9
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -44(%rbp)
.L9:
	movzbl	-18(%rbp), %eax
	cmpb	$87, %al
	jne	.L10
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
.L10:
	movzbl	-18(%rbp), %eax
	cmpb	$82, %al
	jne	.L11
	movl	-44(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
.L11:
	movzbl	-18(%rbp), %eax
	cmpb	$76, %al
	jne	.L12
	movl	-44(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
.L12:
	movl	-48(%rbp), %eax
	addl	%eax, -60(%rbp)
	addl	$1, -56(%rbp)
.L6:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L13
	movl	-60(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -60(%rbp)
.L14:
	movl	$1, -60(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -56(%rbp)
	jmp	.L4
.L5:
	movl	-56(%rbp), %eax
	leal	1(%rax), %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L4:
	cmpl	$5, -56(%rbp)
	jle	.L5
	movl	$0, -56(%rbp)
	jmp	.L6
.L13:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-18(%rbp), %eax
	cmpb	$78, %al
	jne	.L7
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -32(%rbp)
.L7:
	movzbl	-18(%rbp), %eax
	cmpb	$69, %al
	jne	.L8
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
.L8:
	movzbl	-18(%rbp), %eax
	cmpb	$83, %al
	jne	.L9
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -44(%rbp)
.L9:
	movzbl	-18(%rbp), %eax
	cmpb	$87, %al
	jne	.L10
	movl	-48(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
.L10:
	movzbl	-18(%rbp), %eax
	cmpb	$82, %al
	jne	.L11
	movl	-44(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
.L11:
	movzbl	-18(%rbp), %eax
	cmpb	$76, %al
	jne	.L12
	movl	-44(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
.L12:
	movl	-48(%rbp), %eax
	addl	%eax, -60(%rbp)
	addl	$1, -56(%rbp)
.L6:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L13
	movl	-60(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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:
