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(void)
{
  int n,m;
  scanf("%d%d",&n,&m);
  int ac[n+1],wa[n+1];
  for(int i=1;i<=n;i++){
    ac[i]=0;
    wa[i]=0;
  }
  for(int i=0;i<m;i++){
    char tmp2[3];
    int tmp1;
    scanf("%d%s",&tmp1,tmp2);
    if(tmp2[0]=='A') ac[tmp1]++;
    else if(tmp2[0]=='W'){
      if(ac[tmp1]==0) wa[tmp1]++;
    }
  }
  int ans=0,penalty=0;
  for(int i=1;i<=n;i++){
    if(ac[i]>0){
      ans++;
      penalty+=wa[i];
    }
  }
  printf("%d %d",ans,penalty);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%s"
.LC2:
	.string	"%d %d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-124(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$1, -116(%rbp)
	jmp	.L8
.L9:
	movq	-88(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-72(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -116(%rbp)
.L8:
	movl	-128(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L9
	movl	$0, -112(%rbp)
	jmp	.L10
.L13:
	leaq	-59(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-59(%rbp), %eax
	cmpb	$65, %al
	jne	.L11
	movl	-120(%rbp), %eax
	movq	-88(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-88(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
	jmp	.L12
.L11:
	movzbl	-59(%rbp), %eax
	cmpb	$87, %al
	jne	.L12
	movl	-120(%rbp), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-120(%rbp), %eax
	movq	-72(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-72(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L12:
	addl	$1, -112(%rbp)
.L10:
	movl	-124(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L13
	movl	$0, -108(%rbp)
	movl	$0, -104(%rbp)
	movl	$1, -100(%rbp)
	jmp	.L14
.L16:
	movq	-88(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	jle	.L15
	addl	$1, -108(%rbp)
	movq	-72(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, -104(%rbp)
.L15:
	addl	$1, -100(%rbp)
.L14:
	movl	-128(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jle	.L16
	movl	-104(%rbp), %edx
	movl	-108(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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%d"
.LC1:
	.string	"%d%s"
.LC2:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %r12d
	movq	%rsp, %rcx
	leal	1(%r12), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
	cmpq	%rcx, %rsp
	je	.L3
.L30:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L30
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L31
.L4:
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	movq	%rsp, %rbx
	andq	$-16, %rdx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L31:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L7:
	movq	%rsp, %r15
	movq	%r15, -88(%rbp)
	testl	%r12d, %r12d
	jle	.L8
	movslq	%r12d, %r13
	leaq	4(%rbx), %rdi
	xorl	%esi, %esi
	salq	$2, %r13
	movq	%r13, %rdx
	call	memset@PLT
	leaq	4(%r15), %rdi
	movq	%r13, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movl	-68(%rbp), %r8d
	testl	%r8d, %r8d
	jle	.L9
.L16:
	xorl	%r14d, %r14d
	leaq	-59(%rbp), %r15
	leaq	-64(%rbp), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$87, %al
	je	.L33
.L11:
	addl	$1, %r14d
	cmpl	%r14d, -68(%rbp)
	jle	.L34
.L12:
	movq	%r15, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	-59(%rbp), %eax
	cmpb	$65, %al
	jne	.L10
	movslq	-64(%rbp), %rax
	addl	$1, %r14d
	addl	$1, (%rbx,%rax,4)
	cmpl	%r14d, -68(%rbp)
	jg	.L12
.L34:
	movl	-72(%rbp), %r12d
	testl	%r12d, %r12d
	jle	.L17
.L9:
	movl	$1, %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L15:
	movl	(%rbx,%rax,4), %esi
	testl	%esi, %esi
	jle	.L14
	movq	-88(%rbp), %rdi
	addl	$1, %edx
	addl	(%rdi,%rax,4), %ecx
.L14:
	addq	$1, %rax
	cmpl	%eax, %r12d
	jge	.L15
.L13:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L35
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	movslq	-64(%rbp), %rax
	movl	(%rbx,%rax,4), %edi
	testl	%edi, %edi
	jne	.L11
	movq	-88(%rbp), %rcx
	addl	$1, (%rcx,%rax,4)
	jmp	.L11
.L8:
	cmpl	$0, -68(%rbp)
	jg	.L16
.L17:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L13
.L32:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L35:
	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%d"
.LC1:
	.string	"%d%s"
.LC2:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-68(%rbp), %rdx
	leaq	-72(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %r12d
	movq	%rsp, %rcx
	leal	1(%r12), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
	cmpq	%rcx, %rsp
	je	.L3
.L30:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L30
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L31
.L4:
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	movq	%rsp, %rbx
	andq	$-16, %rdx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L31:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L7:
	movq	%rsp, %r15
	movq	%r15, -88(%rbp)
	testl	%r12d, %r12d
	jle	.L8
	movslq	%r12d, %r13
	leaq	4(%rbx), %rdi
	xorl	%esi, %esi
	salq	$2, %r13
	movq	%r13, %rdx
	call	memset@PLT
	leaq	4(%r15), %rdi
	movq	%r13, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movl	-68(%rbp), %r8d
	testl	%r8d, %r8d
	jle	.L9
.L16:
	xorl	%r14d, %r14d
	leaq	-59(%rbp), %r15
	leaq	-64(%rbp), %r13
	leaq	.LC1(%rip), %r12
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$87, %al
	je	.L33
.L11:
	addl	$1, %r14d
	cmpl	%r14d, -68(%rbp)
	jle	.L34
.L12:
	movq	%r15, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	-59(%rbp), %eax
	cmpb	$65, %al
	jne	.L10
	movslq	-64(%rbp), %rax
	addl	$1, %r14d
	addl	$1, (%rbx,%rax,4)
	cmpl	%r14d, -68(%rbp)
	jg	.L12
.L34:
	movl	-72(%rbp), %r12d
	testl	%r12d, %r12d
	jle	.L17
.L9:
	movl	$1, %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L15:
	movl	(%rbx,%rax,4), %esi
	testl	%esi, %esi
	jle	.L14
	movq	-88(%rbp), %rdi
	addl	$1, %edx
	addl	(%rdi,%rax,4), %ecx
.L14:
	addq	$1, %rax
	cmpl	%eax, %r12d
	jge	.L15
.L13:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L35
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	movslq	-64(%rbp), %rax
	movl	(%rbx,%rax,4), %edi
	testl	%edi, %edi
	jne	.L11
	movq	-88(%rbp), %rcx
	addl	$1, (%rcx,%rax,4)
	jmp	.L11
.L8:
	cmpl	$0, -68(%rbp)
	jg	.L16
.L17:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L13
.L32:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L35:
	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(void)
{
  int n,m;
  scanf("%d%d",&n,&m);
  int ac[n+1],wa[n+1];
  for(int i=1;i<=n;i++){
    ac[i]=0;
    wa[i]=0;
  }
  for(int i=0;i<m;i++){
    char tmp2[3];
    int tmp1;
    scanf("%d%s",&tmp1,tmp2);
    if(tmp2[0]=='A') ac[tmp1]++;
    else if(tmp2[0]=='W'){
      if(ac[tmp1]==0) wa[tmp1]++;
    }
  }
  int ans=0,penalty=0;
  for(int i=1;i<=n;i++){
    if(ac[i]>0){
      ans++;
      penalty+=wa[i];
    }
  }
  printf("%d %d",ans,penalty);
  return 0;
}
100000 3
7777 AC
7777 AC
7777 CA
 100000 3
12676 AC
7777 AC
7777 CA
 1 0
 4 5
1 WA
1 AC
2 WA
2 AC
2 WA
 4 5
1 WA
1 AC
0 WA
2 AC
2 WA
 100000 3
6234 AC
7777 AC
7777 AC
 2 0
 2 -1
 2 -2
 2 -4

1 0 2 0 0 0 2 2 2 1 2 0 0 0 0 0 0 0 0 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(void)
{
  int n,m;
  scanf("%d%d",&n,&m);
  int ac[n+1],wa[n+1];
  for(int i=1;i<=n;i++){
    ac[i]=0;
    wa[i]=0;
  }
  for(int i=0;i<m;i++){
    char tmp2[3];
    int tmp1;
    scanf("%d%s",&tmp1,tmp2);
    if(tmp2[0]=='A') ac[tmp1]++;
    else if(tmp2[0]=='W'){
      if(ac[tmp1]==0) wa[tmp1]++;
    }
  }
  int ans=0,penalty=0;
  for(int i=1;i<=n;i++){
    if(ac[i]>0){
      ans++;
      penalty+=wa[i];
    }
  }
  printf("%d %d",ans,penalty);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%s"
.LC2:
	.string	"%d %d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-124(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$1, -116(%rbp)
	jmp	.L8
.L9:
	movq	-88(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-72(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -116(%rbp)
.L8:
	movl	-128(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L9
	movl	$0, -112(%rbp)
	jmp	.L10
.L13:
	leaq	-59(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-59(%rbp), %eax
	cmpb	$65, %al
	jne	.L11
	movl	-120(%rbp), %eax
	movq	-88(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-88(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
	jmp	.L12
.L11:
	movzbl	-59(%rbp), %eax
	cmpb	$87, %al
	jne	.L12
	movl	-120(%rbp), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-120(%rbp), %eax
	movq	-72(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-72(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L12:
	addl	$1, -112(%rbp)
.L10:
	movl	-124(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L13
	movl	$0, -108(%rbp)
	movl	$0, -104(%rbp)
	movl	$1, -100(%rbp)
	jmp	.L14
.L16:
	movq	-88(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	jle	.L15
	addl	$1, -108(%rbp)
	movq	-72(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, -104(%rbp)
.L15:
	addl	$1, -100(%rbp)
.L14:
	movl	-128(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jle	.L16
	movl	-104(%rbp), %edx
	movl	-108(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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%d"
.LC1:
	.string	"%d%s"
.LC2:
	.string	"%d %d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-124(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$1, -116(%rbp)
	jmp	.L8
.L9:
	movq	-88(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-72(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -116(%rbp)
.L8:
	movl	-128(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L9
	movl	$0, -112(%rbp)
	jmp	.L10
.L13:
	leaq	-59(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-59(%rbp), %eax
	cmpb	$65, %al
	jne	.L11
	movl	-120(%rbp), %eax
	movq	-88(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-88(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
	jmp	.L12
.L11:
	movzbl	-59(%rbp), %eax
	cmpb	$87, %al
	jne	.L12
	movl	-120(%rbp), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-120(%rbp), %eax
	movq	-72(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-72(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L12:
	addl	$1, -112(%rbp)
.L10:
	movl	-124(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L13
	movl	$0, -108(%rbp)
	movl	$0, -104(%rbp)
	movl	$1, -100(%rbp)
	jmp	.L14
.L16:
	movq	-88(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	jle	.L15
	addl	$1, -108(%rbp)
	movq	-72(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, -104(%rbp)
.L15:
	addl	$1, -100(%rbp)
.L14:
	movl	-128(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jle	.L16
	movl	-104(%rbp), %edx
	movl	-108(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
