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 <stdlib.h>
 
int main(void) {
 int n;
 scanf("%d",&n);
 long  int sum1=0,a_count[100001] = {0},t;
 for(int i=0;i<n;i++){
  scanf("%ld",&t);
  //aの和と数値ごとの出現回数を格納する。
  a_count[t]++;//数値ごとの出現回数
  sum1+=t;//aの和
 }
 int q;
 scanf("%d",&q);
 int b[q],c[q];
 for(int i=0;i<q;i++){
  scanf("%d%d",&b[i],&c[i]);
  sum1+=(c[i]-b[i])*a_count[b[i]];
  a_count[c[i]] += a_count[b[i]];
  a_count[b[i]] = 0;
  printf("%ld\n",sum1);
 }
 
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1400, %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	-800128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -800104(%rbp)
	leaq	-800064(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -800120(%rbp)
	jmp	.L2
.L3:
	leaq	-800112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800112(%rbp), %rax
	movq	-800064(%rbp,%rax,8), %rdx
	addq	$1, %rdx
	movq	%rdx, -800064(%rbp,%rax,8)
	movq	-800112(%rbp), %rax
	addq	%rax, -800104(%rbp)
	addl	$1, -800120(%rbp)
.L2:
	movl	-800128(%rbp), %eax
	cmpl	%eax, -800120(%rbp)
	jl	.L3
	leaq	-800124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -800096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -800144(%rbp)
	movq	$0, -800136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -800160(%rbp)
	movq	$0, -800152(%rbp)
	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
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -800088(%rbp)
	movl	-800124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -800080(%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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -800072(%rbp)
	movl	$0, -800116(%rbp)
	jmp	.L10
.L11:
	movl	-800116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-800072(%rbp), %rax
	addq	%rax, %rdx
	movl	-800116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-800088(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movslq	%eax, %rcx
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	addq	%rax, -800104(%rbp)
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rsi
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rcx
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leaq	(%rsi,%rcx), %rdx
	cltq
	movq	%rdx, -800064(%rbp,%rax,8)
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	$0, -800064(%rbp,%rax,8)
	movq	-800104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800116(%rbp)
.L10:
	movl	-800124(%rbp), %eax
	cmpl	%eax, -800116(%rbp)
	jl	.L11
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%ld"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1320, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-800080(%rbp), %rsi
	call	__isoc99_scanf@PLT
	leaq	-800064(%rbp), %rdi
	movl	$800008, %edx
	xorl	%esi, %esi
	call	memset@PLT
	movl	-800080(%rbp), %eax
	testl	%eax, %eax
	jle	.L14
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	leaq	-800072(%rbp), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movq	-800072(%rbp), %rax
	addq	$1, -800064(%rbp,%rax,8)
	addq	%rax, %rbx
	cmpl	%r15d, -800080(%rbp)
	jg	.L3
.L2:
	leaq	-800076(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-800076(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L5
.L26:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L26
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L27
.L6:
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%rsp, %r14
	andq	$-16, %rdx
	subq	%rax, %rsi
.L7:
	cmpq	%rsi, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L27:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L14:
	xorl	%ebx, %ebx
	jmp	.L2
.L8:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L28
.L9:
	movq	%rsp, %r15
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %r13
	testl	%ecx, %ecx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	(%r15), %rax
	movslq	(%r14), %rsi
	addl	$1, %r12d
	addq	$4, %r14
	addq	$4, %r15
	movl	%eax, %edx
	movq	-800064(%rbp,%rsi,8), %rdi
	addq	%rdi, -800064(%rbp,%rax,8)
	xorl	%eax, %eax
	movq	$0, -800064(%rbp,%rsi,8)
	subl	%esi, %edx
	leaq	.LC3(%rip), %rsi
	movslq	%edx, %rdx
	imulq	%rdi, %rdx
	movl	$1, %edi
	addq	%rdx, %rbx
	movq	%rbx, %rdx
	call	__printf_chk@PLT
	cmpl	%r12d, -800076(%rbp)
	jg	.L11
.L12:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L29
	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
.L28:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L9
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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	"%ld"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1320, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-800080(%rbp), %rsi
	call	__isoc99_scanf@PLT
	leaq	-800064(%rbp), %rdi
	movl	$800008, %edx
	xorl	%esi, %esi
	call	memset@PLT
	movl	-800080(%rbp), %eax
	testl	%eax, %eax
	jle	.L14
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	leaq	-800072(%rbp), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movq	-800072(%rbp), %rax
	addq	$1, -800064(%rbp,%rax,8)
	addq	%rax, %rbx
	cmpl	%r15d, -800080(%rbp)
	jg	.L3
.L2:
	leaq	-800076(%rbp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-800076(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L5
.L26:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L26
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L27
.L6:
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%rsp, %r14
	andq	$-16, %rdx
	subq	%rax, %rsi
.L7:
	cmpq	%rsi, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L27:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L14:
	xorl	%ebx, %ebx
	jmp	.L2
.L8:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L28
.L9:
	movq	%rsp, %r15
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %r13
	testl	%ecx, %ecx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	(%r15), %rax
	movslq	(%r14), %rsi
	addl	$1, %r12d
	addq	$4, %r14
	addq	$4, %r15
	movl	%eax, %edx
	movq	-800064(%rbp,%rsi,8), %rdi
	addq	%rdi, -800064(%rbp,%rax,8)
	xorl	%eax, %eax
	movq	$0, -800064(%rbp,%rsi,8)
	subl	%esi, %edx
	leaq	.LC3(%rip), %rsi
	movslq	%edx, %rdx
	imulq	%rdi, %rdx
	movl	$1, %edi
	addq	%rdx, %rbx
	movq	%rbx, %rdx
	call	__printf_chk@PLT
	cmpl	%r12d, -800076(%rbp)
	jg	.L11
.L12:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L29
	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
.L28:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L9
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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>
#include <stdlib.h>
 
int main(void) {
 int n;
 scanf("%d",&n);
 long  int sum1=0,a_count[100001] = {0},t;
 for(int i=0;i<n;i++){
  scanf("%ld",&t);
  //aの和と数値ごとの出現回数を格納する。
  a_count[t]++;//数値ごとの出現回数
  sum1+=t;//aの和
 }
 int q;
 scanf("%d",&q);
 int b[q],c[q];
 for(int i=0;i<q;i++){
  scanf("%d%d",&b[i],&c[i]);
  sum1+=(c[i]-b[i])*a_count[b[i]];
  a_count[c[i]] += a_count[b[i]];
  a_count[b[i]] = 0;
  printf("%ld\n",sum1);
 }
 
}
4
1 2 3 3
3
1 2
3 4
2 4
 4
2 1 1 1
3
1 2
2 1
3 5
 4
1 2 3 3
3
1 2
3 4
0 4
 4
0 1 1 1
3
1 2
2 1
3 5
 4
1 3 3 3
3
1 2
3 4
0 4
 4
1 3 4 3
3
1 2
3 4
0 4
 4
0 1 1 1
3
1 4
2 1
5 10
 4
0 2 4 3
3
1 2
3 4
0 4
 4
0 1 1 1
3
1 0
2 1
5 10
 4
0 2 1 1
3
1 0
2 1
5 10

10
12
16
 8
4
4
 10
12
12
 6
3
3
 11
14
14
 12
14
14
 12
12
12
 9
10
14
 0
0
0
 2
1
1

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 <stdlib.h>
 
int main(void) {
 int n;
 scanf("%d",&n);
 long  int sum1=0,a_count[100001] = {0},t;
 for(int i=0;i<n;i++){
  scanf("%ld",&t);
  //aの和と数値ごとの出現回数を格納する。
  a_count[t]++;//数値ごとの出現回数
  sum1+=t;//aの和
 }
 int q;
 scanf("%d",&q);
 int b[q],c[q];
 for(int i=0;i<q;i++){
  scanf("%d%d",&b[i],&c[i]);
  sum1+=(c[i]-b[i])*a_count[b[i]];
  a_count[c[i]] += a_count[b[i]];
  a_count[b[i]] = 0;
  printf("%ld\n",sum1);
 }
 
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1400, %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	-800128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -800104(%rbp)
	leaq	-800064(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -800120(%rbp)
	jmp	.L2
.L3:
	leaq	-800112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800112(%rbp), %rax
	movq	-800064(%rbp,%rax,8), %rdx
	addq	$1, %rdx
	movq	%rdx, -800064(%rbp,%rax,8)
	movq	-800112(%rbp), %rax
	addq	%rax, -800104(%rbp)
	addl	$1, -800120(%rbp)
.L2:
	movl	-800128(%rbp), %eax
	cmpl	%eax, -800120(%rbp)
	jl	.L3
	leaq	-800124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -800096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -800144(%rbp)
	movq	$0, -800136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -800160(%rbp)
	movq	$0, -800152(%rbp)
	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
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -800088(%rbp)
	movl	-800124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -800080(%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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -800072(%rbp)
	movl	$0, -800116(%rbp)
	jmp	.L10
.L11:
	movl	-800116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-800072(%rbp), %rax
	addq	%rax, %rdx
	movl	-800116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-800088(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movslq	%eax, %rcx
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	addq	%rax, -800104(%rbp)
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rsi
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rcx
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leaq	(%rsi,%rcx), %rdx
	cltq
	movq	%rdx, -800064(%rbp,%rax,8)
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	$0, -800064(%rbp,%rax,8)
	movq	-800104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800116(%rbp)
.L10:
	movl	-800124(%rbp), %eax
	cmpl	%eax, -800116(%rbp)
	jl	.L11
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%ld"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1400, %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	-800128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -800104(%rbp)
	leaq	-800064(%rbp), %rax
	movl	$800008, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -800120(%rbp)
	jmp	.L2
.L3:
	leaq	-800112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800112(%rbp), %rax
	movq	-800064(%rbp,%rax,8), %rdx
	addq	$1, %rdx
	movq	%rdx, -800064(%rbp,%rax,8)
	movq	-800112(%rbp), %rax
	addq	%rax, -800104(%rbp)
	addl	$1, -800120(%rbp)
.L2:
	movl	-800128(%rbp), %eax
	cmpl	%eax, -800120(%rbp)
	jl	.L3
	leaq	-800124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -800096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -800144(%rbp)
	movq	$0, -800136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -800160(%rbp)
	movq	$0, -800152(%rbp)
	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
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -800088(%rbp)
	movl	-800124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -800080(%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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -800072(%rbp)
	movl	$0, -800116(%rbp)
	jmp	.L10
.L11:
	movl	-800116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-800072(%rbp), %rax
	addq	%rax, %rdx
	movl	-800116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-800088(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movslq	%eax, %rcx
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rax
	imulq	%rcx, %rax
	addq	%rax, -800104(%rbp)
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rsi
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	-800064(%rbp,%rax,8), %rcx
	movq	-800072(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leaq	(%rsi,%rcx), %rdx
	cltq
	movq	%rdx, -800064(%rbp,%rax,8)
	movq	-800088(%rbp), %rax
	movl	-800116(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	$0, -800064(%rbp,%rax,8)
	movq	-800104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800116(%rbp)
.L10:
	movl	-800124(%rbp), %eax
	cmpl	%eax, -800116(%rbp)
	jl	.L11
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
