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 n;
  scanf("%d",&n);

  long long int m = 0;
  long long int a = 0;
  long long int r = 0;
  long long int c = 0;
  long long int h = 0;

  int P[10]={0,0,0,0,0,0,1,1,1,2};
  int Q[10]={1,1,1,2,2,3,2,2,3,3};
  int R[10]={2,3,4,3,4,4,3,4,4,4};

  char name[11];
  for(int i = 0 ; i < n ; ++i){
    scanf("%s",name);
    if(name[0] == 'M') m++;
    if(name[0] == 'A') a++;
    if(name[0] == 'R') r++;
    if(name[0] == 'C') c++;
    if(name[0] == 'H') h++;
  }

  long long int d[5];
  d[0]=m; d[1]=a; d[2]=r; d[3]=c; d[4]=h;

  long long int ans = 0;
  for(int i = 0; i <10 ; ++i){
    ans += d[P[i]] * d[Q[i]] * d[R[i]];
  }

  printf("%lld",ans);

  return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-268(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -256(%rbp)
	movq	$0, -248(%rbp)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	movl	$0, -208(%rbp)
	movl	$0, -204(%rbp)
	movl	$0, -200(%rbp)
	movl	$0, -196(%rbp)
	movl	$0, -192(%rbp)
	movl	$0, -188(%rbp)
	movl	$1, -184(%rbp)
	movl	$1, -180(%rbp)
	movl	$1, -176(%rbp)
	movl	$2, -172(%rbp)
	movl	$1, -160(%rbp)
	movl	$1, -156(%rbp)
	movl	$1, -152(%rbp)
	movl	$2, -148(%rbp)
	movl	$2, -144(%rbp)
	movl	$3, -140(%rbp)
	movl	$2, -136(%rbp)
	movl	$2, -132(%rbp)
	movl	$3, -128(%rbp)
	movl	$3, -124(%rbp)
	movl	$2, -112(%rbp)
	movl	$3, -108(%rbp)
	movl	$4, -104(%rbp)
	movl	$3, -100(%rbp)
	movl	$4, -96(%rbp)
	movl	$4, -92(%rbp)
	movl	$3, -88(%rbp)
	movl	$4, -84(%rbp)
	movl	$4, -80(%rbp)
	movl	$4, -76(%rbp)
	movl	$0, -264(%rbp)
	jmp	.L2
.L8:
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-19(%rbp), %eax
	cmpb	$77, %al
	jne	.L3
	addq	$1, -256(%rbp)
.L3:
	movzbl	-19(%rbp), %eax
	cmpb	$65, %al
	jne	.L4
	addq	$1, -248(%rbp)
.L4:
	movzbl	-19(%rbp), %eax
	cmpb	$82, %al
	jne	.L5
	addq	$1, -240(%rbp)
.L5:
	movzbl	-19(%rbp), %eax
	cmpb	$67, %al
	jne	.L6
	addq	$1, -232(%rbp)
.L6:
	movzbl	-19(%rbp), %eax
	cmpb	$72, %al
	jne	.L7
	addq	$1, -224(%rbp)
.L7:
	addl	$1, -264(%rbp)
.L2:
	movl	-268(%rbp), %eax
	cmpl	%eax, -264(%rbp)
	jl	.L8
	movq	-256(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	-248(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-232(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	$0, -216(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L9
.L10:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rax
	imulq	%rax, %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	addq	%rax, -216(%rbp)
	addl	$1, -260(%rbp)
.L9:
	cmpl	$9, -260(%rbp)
	jle	.L10
	movq	-216(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	"%lld"
	.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
	leaq	.LC0(%rip), %rdi
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	movq	$0, (%rsp)
	xorl	%ebp, %ebp
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	leaq	29(%rsp), %r15
	movq	$0, 8(%rsp)
	leaq	.LC1(%rip), %r14
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$65, %al
	je	.L5
	cmpb	$82, %al
	jne	.L19
	addq	$1, %r13
.L4:
	addl	$1, %ebp
	cmpl	%ebp, 24(%rsp)
	jle	.L2
.L11:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	29(%rsp), %eax
	cmpb	$77, %al
	jne	.L3
	addq	$1, 8(%rsp)
	addl	$1, %ebp
	cmpl	%ebp, 24(%rsp)
	jg	.L11
.L2:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	leaq	0(%r13,%rbx), %rdx
	leaq	(%r12,%rdx), %rcx
	movq	%rdi, %rax
	imulq	%rsi, %rax
	imulq	%rax, %rcx
	movq	%rsi, %rax
	imulq	%r13, %rax
	imulq	%rbx, %rsi
	movq	%rax, %rdx
	imulq	%r12, %rax
	imulq	%rbx, %rdx
	movq	%rsi, %rbp
	leaq	.LC2(%rip), %rsi
	imulq	%r12, %rbp
	addq	%rcx, %rdx
	addq	%rdx, %rax
	movq	%rbx, %rdx
	addq	%rax, %rbp
	movq	%rdi, %rax
	imulq	%r13, %rax
	imulq	%rbx, %rdi
	imulq	%r13, %rbx
	imulq	%rax, %rdx
	imulq	%r12, %rax
	imulq	%r12, %rbx
	addq	%rbp, %rdx
	addq	%rax, %rdx
	movq	%rdi, %rax
	movl	$1, %edi
	imulq	%r12, %rax
	addq	%rdx, %rax
	leaq	(%rbx,%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$56, %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
.L19:
	.cfi_restore_state
	cmpb	$67, %al
	jne	.L21
	addq	$1, %rbx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, (%rsp)
	jmp	.L4
.L21:
	cmpb	$72, %al
	jne	.L4
	addq	$1, %r12
	jmp	.L4
.L13:
	movq	$0, (%rsp)
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	movq	$0, 8(%rsp)
	jmp	.L2
.L20:
	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	"%lld"
	.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
	leaq	.LC0(%rip), %rdi
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	movq	$0, (%rsp)
	xorl	%ebp, %ebp
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	leaq	29(%rsp), %r15
	movq	$0, 8(%rsp)
	leaq	.LC1(%rip), %r14
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$65, %al
	je	.L5
	cmpb	$82, %al
	jne	.L19
	addq	$1, %r13
.L4:
	addl	$1, %ebp
	cmpl	%ebp, 24(%rsp)
	jle	.L2
.L11:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	29(%rsp), %eax
	cmpb	$77, %al
	jne	.L3
	addq	$1, 8(%rsp)
	addl	$1, %ebp
	cmpl	%ebp, 24(%rsp)
	jg	.L11
.L2:
	movq	(%rsp), %rdi
	movq	8(%rsp), %rsi
	leaq	0(%r13,%rbx), %rdx
	leaq	(%r12,%rdx), %rcx
	movq	%rdi, %rax
	imulq	%rsi, %rax
	imulq	%rax, %rcx
	movq	%rsi, %rax
	imulq	%r13, %rax
	imulq	%rbx, %rsi
	movq	%rax, %rdx
	imulq	%r12, %rax
	imulq	%rbx, %rdx
	movq	%rsi, %rbp
	leaq	.LC2(%rip), %rsi
	imulq	%r12, %rbp
	addq	%rcx, %rdx
	addq	%rdx, %rax
	movq	%rbx, %rdx
	addq	%rax, %rbp
	movq	%rdi, %rax
	imulq	%r13, %rax
	imulq	%rbx, %rdi
	imulq	%r13, %rbx
	imulq	%rax, %rdx
	imulq	%r12, %rax
	imulq	%r12, %rbx
	addq	%rbp, %rdx
	addq	%rax, %rdx
	movq	%rdi, %rax
	movl	$1, %edi
	imulq	%r12, %rax
	addq	%rdx, %rax
	leaq	(%rbx,%rax), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$56, %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
.L19:
	.cfi_restore_state
	cmpb	$67, %al
	jne	.L21
	addq	$1, %rbx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, (%rsp)
	jmp	.L4
.L21:
	cmpb	$72, %al
	jne	.L4
	addq	$1, %r12
	jmp	.L4
.L13:
	movq	$0, (%rsp)
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	movq	$0, 8(%rsp)
	jmp	.L2
.L20:
	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 n;
  scanf("%d",&n);

  long long int m = 0;
  long long int a = 0;
  long long int r = 0;
  long long int c = 0;
  long long int h = 0;

  int P[10]={0,0,0,0,0,0,1,1,1,2};
  int Q[10]={1,1,1,2,2,3,2,2,3,3};
  int R[10]={2,3,4,3,4,4,3,4,4,4};

  char name[11];
  for(int i = 0 ; i < n ; ++i){
    scanf("%s",name);
    if(name[0] == 'M') m++;
    if(name[0] == 'A') a++;
    if(name[0] == 'R') r++;
    if(name[0] == 'C') c++;
    if(name[0] == 'H') h++;
  }

  long long int d[5];
  d[0]=m; d[1]=a; d[2]=r; d[3]=c; d[4]=h;

  long long int ans = 0;
  for(int i = 0; i <10 ; ++i){
    ans += d[P[i]] * d[Q[i]] * d[R[i]];
  }

  printf("%lld",ans);

  return 0;

}

5
MASHIKE
RUMOI
OBIRA
OROBAH
HOROKANAI
 5
CHOKUD@I
RNG
MAKOTO
AOKI
RINGO
 4
ZY
ZZZ
Z
ZZZZZZZZZZ
 5
DHOKUD@I
RNG
MAKOTO
AOKI
RINGN
 5
I@DUKOGE
HNR
MTAOKP
AINK
RINGN
 5
MASHIKE
IOMUR
OBIRA
OROBAH
HOROKANAI
 5
CHOKUD@I
RNG
MAKOTO
AOKI
RINGN
 4
ZY
ZZY
Z
ZZZZZZZZZZ
 5
MASHIKE
IOMUR
ARIBO
OROBAH
HOROKANAI
 4
ZY
YZZ
Z
ZZZZZZZZZZ

1 7 0 2 4 0 7 0 1 0
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 n;
  scanf("%d",&n);

  long long int m = 0;
  long long int a = 0;
  long long int r = 0;
  long long int c = 0;
  long long int h = 0;

  int P[10]={0,0,0,0,0,0,1,1,1,2};
  int Q[10]={1,1,1,2,2,3,2,2,3,3};
  int R[10]={2,3,4,3,4,4,3,4,4,4};

  char name[11];
  for(int i = 0 ; i < n ; ++i){
    scanf("%s",name);
    if(name[0] == 'M') m++;
    if(name[0] == 'A') a++;
    if(name[0] == 'R') r++;
    if(name[0] == 'C') c++;
    if(name[0] == 'H') h++;
  }

  long long int d[5];
  d[0]=m; d[1]=a; d[2]=r; d[3]=c; d[4]=h;

  long long int ans = 0;
  for(int i = 0; i <10 ; ++i){
    ans += d[P[i]] * d[Q[i]] * d[R[i]];
  }

  printf("%lld",ans);

  return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-268(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -256(%rbp)
	movq	$0, -248(%rbp)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	movl	$0, -208(%rbp)
	movl	$0, -204(%rbp)
	movl	$0, -200(%rbp)
	movl	$0, -196(%rbp)
	movl	$0, -192(%rbp)
	movl	$0, -188(%rbp)
	movl	$1, -184(%rbp)
	movl	$1, -180(%rbp)
	movl	$1, -176(%rbp)
	movl	$2, -172(%rbp)
	movl	$1, -160(%rbp)
	movl	$1, -156(%rbp)
	movl	$1, -152(%rbp)
	movl	$2, -148(%rbp)
	movl	$2, -144(%rbp)
	movl	$3, -140(%rbp)
	movl	$2, -136(%rbp)
	movl	$2, -132(%rbp)
	movl	$3, -128(%rbp)
	movl	$3, -124(%rbp)
	movl	$2, -112(%rbp)
	movl	$3, -108(%rbp)
	movl	$4, -104(%rbp)
	movl	$3, -100(%rbp)
	movl	$4, -96(%rbp)
	movl	$4, -92(%rbp)
	movl	$3, -88(%rbp)
	movl	$4, -84(%rbp)
	movl	$4, -80(%rbp)
	movl	$4, -76(%rbp)
	movl	$0, -264(%rbp)
	jmp	.L2
.L8:
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-19(%rbp), %eax
	cmpb	$77, %al
	jne	.L3
	addq	$1, -256(%rbp)
.L3:
	movzbl	-19(%rbp), %eax
	cmpb	$65, %al
	jne	.L4
	addq	$1, -248(%rbp)
.L4:
	movzbl	-19(%rbp), %eax
	cmpb	$82, %al
	jne	.L5
	addq	$1, -240(%rbp)
.L5:
	movzbl	-19(%rbp), %eax
	cmpb	$67, %al
	jne	.L6
	addq	$1, -232(%rbp)
.L6:
	movzbl	-19(%rbp), %eax
	cmpb	$72, %al
	jne	.L7
	addq	$1, -224(%rbp)
.L7:
	addl	$1, -264(%rbp)
.L2:
	movl	-268(%rbp), %eax
	cmpl	%eax, -264(%rbp)
	jl	.L8
	movq	-256(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	-248(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-232(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	$0, -216(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L9
.L10:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rax
	imulq	%rax, %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	addq	%rax, -216(%rbp)
	addl	$1, -260(%rbp)
.L9:
	cmpl	$9, -260(%rbp)
	jle	.L10
	movq	-216(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	"%lld"
	.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	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-268(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -256(%rbp)
	movq	$0, -248(%rbp)
	movq	$0, -240(%rbp)
	movq	$0, -232(%rbp)
	movq	$0, -224(%rbp)
	movl	$0, -208(%rbp)
	movl	$0, -204(%rbp)
	movl	$0, -200(%rbp)
	movl	$0, -196(%rbp)
	movl	$0, -192(%rbp)
	movl	$0, -188(%rbp)
	movl	$1, -184(%rbp)
	movl	$1, -180(%rbp)
	movl	$1, -176(%rbp)
	movl	$2, -172(%rbp)
	movl	$1, -160(%rbp)
	movl	$1, -156(%rbp)
	movl	$1, -152(%rbp)
	movl	$2, -148(%rbp)
	movl	$2, -144(%rbp)
	movl	$3, -140(%rbp)
	movl	$2, -136(%rbp)
	movl	$2, -132(%rbp)
	movl	$3, -128(%rbp)
	movl	$3, -124(%rbp)
	movl	$2, -112(%rbp)
	movl	$3, -108(%rbp)
	movl	$4, -104(%rbp)
	movl	$3, -100(%rbp)
	movl	$4, -96(%rbp)
	movl	$4, -92(%rbp)
	movl	$3, -88(%rbp)
	movl	$4, -84(%rbp)
	movl	$4, -80(%rbp)
	movl	$4, -76(%rbp)
	movl	$0, -264(%rbp)
	jmp	.L2
.L8:
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-19(%rbp), %eax
	cmpb	$77, %al
	jne	.L3
	addq	$1, -256(%rbp)
.L3:
	movzbl	-19(%rbp), %eax
	cmpb	$65, %al
	jne	.L4
	addq	$1, -248(%rbp)
.L4:
	movzbl	-19(%rbp), %eax
	cmpb	$82, %al
	jne	.L5
	addq	$1, -240(%rbp)
.L5:
	movzbl	-19(%rbp), %eax
	cmpb	$67, %al
	jne	.L6
	addq	$1, -232(%rbp)
.L6:
	movzbl	-19(%rbp), %eax
	cmpb	$72, %al
	jne	.L7
	addq	$1, -224(%rbp)
.L7:
	addl	$1, -264(%rbp)
.L2:
	movl	-268(%rbp), %eax
	cmpl	%eax, -264(%rbp)
	jl	.L8
	movq	-256(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	-248(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	-240(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-232(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-224(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	$0, -216(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L9
.L10:
	movl	-260(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rax
	imulq	%rax, %rdx
	movl	-260(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	cltq
	movq	-64(%rbp,%rax,8), %rax
	imulq	%rdx, %rax
	addq	%rax, -216(%rbp)
	addl	$1, -260(%rbp)
.L9:
	cmpl	$9, -260(%rbp)
	jle	.L10
	movq	-216(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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:
