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,i,j,k,A[1001]={0},B[1001]={0},ans[1001]={0},ANS=0,aans;
    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    for(i=0;i<m;i++){
        scanf("%d",&B[i]);
    }
    for(i=0;i<m;i++){
        for(j=0;j<n;j++){
            if(A[j]<=B[i]){
                ans[j]++;
                break;
            }
        }
    }
    for(i=0;i<1000;i++){
        if(ans[i]>ANS){
            ANS=ans[i];
            aans=i;
        }
    }
    printf("%d\n",aans+1);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.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	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3888, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12048(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-8032(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -12056(%rbp)
	leaq	-12068(%rbp), %rdx
	leaq	-12072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12064(%rbp)
	jmp	.L2
.L3:
	leaq	-12048(%rbp), %rdx
	movl	-12064(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12064(%rbp)
.L2:
	movl	-12072(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L3
	movl	$0, -12064(%rbp)
	jmp	.L4
.L5:
	leaq	-8032(%rbp), %rdx
	movl	-12064(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12064(%rbp)
.L4:
	movl	-12068(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L5
	movl	$0, -12064(%rbp)
	jmp	.L6
.L11:
	movl	$0, -12060(%rbp)
	jmp	.L7
.L10:
	movl	-12060(%rbp), %eax
	cltq
	movl	-12048(%rbp,%rax,4), %edx
	movl	-12064(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	-12060(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-12060(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	jmp	.L9
.L8:
	addl	$1, -12060(%rbp)
.L7:
	movl	-12072(%rbp), %eax
	cmpl	%eax, -12060(%rbp)
	jl	.L10
.L9:
	addl	$1, -12064(%rbp)
.L6:
	movl	-12068(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L11
	movl	$0, -12064(%rbp)
	jmp	.L12
.L14:
	movl	-12064(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cmpl	%eax, -12056(%rbp)
	jge	.L13
	movl	-12064(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, -12056(%rbp)
	movl	-12064(%rbp), %eax
	movl	%eax, -12052(%rbp)
.L13:
	addl	$1, -12064(%rbp)
.L12:
	cmpl	$999, -12064(%rbp)
	jle	.L14
	movl	-12052(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	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	.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%d"
.LC1:
	.string	"%d"
.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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$3896, %rsp
	.cfi_def_cfa_offset 12144
	movl	$500, %ecx
	movq	%fs:40, %rax
	movq	%rax, 12072(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	28(%rsp), %rdx
	movq	%rbp, %rdi
	leaq	8064(%rsp), %rbx
	leaq	24(%rsp), %rsi
	rep stosq
	movl	$500, %ecx
	movl	$0, (%rdi)
	leaq	4048(%rsp), %rdi
	movq	%rdi, 8(%rsp)
	rep stosq
	movl	$500, %ecx
	movl	$0, (%rdi)
	movq	%rbx, %rdi
	rep stosq
	movl	$0, (%rdi)
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	movq	%rbp, %r13
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	addq	$4, %r13
	cmpl	%r14d, 24(%rsp)
	jg	.L3
.L2:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	movq	8(%rsp), %rdx
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r15
	movq	%rdx, %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdx, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rdx, (%rsp)
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rdx
	movl	28(%rsp), %eax
	addl	$1, %r14d
	addq	$4, %rdx
	cmpl	%r14d, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L4
	movq	8(%rsp), %rdi
	movslq	24(%rsp), %rsi
	subl	$1, %eax
	addq	$4, %rdi
	movq	%rsi, %r8
	leaq	(%rdi,%rax,4), %r9
	.p2align 4,,10
	.p2align 3
.L6:
	testl	%r8d, %r8d
	jle	.L8
	movl	0(%r13), %ecx
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rax
	cmpq	%rax, %rsi
	je	.L8
.L9:
	movslq	%eax, %rdx
	cmpl	%ecx, 0(%rbp,%rax,4)
	jg	.L7
	addl	$1, 8064(%rsp,%rdx,4)
.L8:
	movq	%rdi, %r13
	cmpq	%r9, %rdi
	je	.L4
	addq	$4, %rdi
	jmp	.L6
.L4:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%rbx,%rax,4), %edx
	cmpl	%ecx, %edx
	jle	.L11
	movl	%eax, %r12d
	movl	%edx, %ecx
.L11:
	addq	$1, %rax
	cmpq	$1000, %rax
	jne	.L12
	xorl	%eax, %eax
	leal	1(%r12), %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	12072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$12088, %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
.L20:
	.cfi_restore_state
	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"
.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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$3896, %rsp
	.cfi_def_cfa_offset 12144
	movl	$500, %ecx
	movq	%fs:40, %rax
	movq	%rax, 12072(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	28(%rsp), %rdx
	movq	%rbp, %rdi
	leaq	8064(%rsp), %rbx
	leaq	24(%rsp), %rsi
	rep stosq
	movl	$500, %ecx
	movl	$0, (%rdi)
	leaq	4048(%rsp), %rdi
	movq	%rdi, 8(%rsp)
	rep stosq
	movl	$500, %ecx
	movl	$0, (%rdi)
	movq	%rbx, %rdi
	rep stosq
	movl	$0, (%rdi)
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	movq	%rbp, %r13
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	addq	$4, %r13
	cmpl	%r14d, 24(%rsp)
	jg	.L3
.L2:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	movq	8(%rsp), %rdx
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r15
	movq	%rdx, %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdx, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rdx, (%rsp)
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rdx
	movl	28(%rsp), %eax
	addl	$1, %r14d
	addq	$4, %rdx
	cmpl	%r14d, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L4
	movq	8(%rsp), %rdi
	movslq	24(%rsp), %rsi
	subl	$1, %eax
	addq	$4, %rdi
	movq	%rsi, %r8
	leaq	(%rdi,%rax,4), %r9
	.p2align 4,,10
	.p2align 3
.L6:
	testl	%r8d, %r8d
	jle	.L8
	movl	0(%r13), %ecx
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rax
	cmpq	%rax, %rsi
	je	.L8
.L9:
	movslq	%eax, %rdx
	cmpl	%ecx, 0(%rbp,%rax,4)
	jg	.L7
	addl	$1, 8064(%rsp,%rdx,4)
.L8:
	movq	%rdi, %r13
	cmpq	%r9, %rdi
	je	.L4
	addq	$4, %rdi
	jmp	.L6
.L4:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%rbx,%rax,4), %edx
	cmpl	%ecx, %edx
	jle	.L11
	movl	%eax, %r12d
	movl	%edx, %ecx
.L11:
	addq	$1, %rax
	cmpq	$1000, %rax
	jne	.L12
	xorl	%eax, %eax
	leal	1(%r12), %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	12072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$12088, %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
.L20:
	.cfi_restore_state
	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,i,j,k,A[1001]={0},B[1001]={0},ans[1001]={0},ANS=0,aans;
    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    for(i=0;i<m;i++){
        scanf("%d",&B[i]);
    }
    for(i=0;i<m;i++){
        for(j=0;j<n;j++){
            if(A[j]<=B[i]){
                ans[j]++;
                break;
            }
        }
    }
    for(i=0;i<1000;i++){
        if(ans[i]>ANS){
            ANS=ans[i];
            aans=i;
        }
    }
    printf("%d\n",aans+1);
    return 0;
}
4 3
5
3
1
4
4
3
2

2

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,i,j,k,A[1001]={0},B[1001]={0},ans[1001]={0},ANS=0,aans;
    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    for(i=0;i<m;i++){
        scanf("%d",&B[i]);
    }
    for(i=0;i<m;i++){
        for(j=0;j<n;j++){
            if(A[j]<=B[i]){
                ans[j]++;
                break;
            }
        }
    }
    for(i=0;i<1000;i++){
        if(ans[i]>ANS){
            ANS=ans[i];
            aans=i;
        }
    }
    printf("%d\n",aans+1);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.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	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3888, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12048(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-8032(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -12056(%rbp)
	leaq	-12068(%rbp), %rdx
	leaq	-12072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12064(%rbp)
	jmp	.L2
.L3:
	leaq	-12048(%rbp), %rdx
	movl	-12064(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12064(%rbp)
.L2:
	movl	-12072(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L3
	movl	$0, -12064(%rbp)
	jmp	.L4
.L5:
	leaq	-8032(%rbp), %rdx
	movl	-12064(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12064(%rbp)
.L4:
	movl	-12068(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L5
	movl	$0, -12064(%rbp)
	jmp	.L6
.L11:
	movl	$0, -12060(%rbp)
	jmp	.L7
.L10:
	movl	-12060(%rbp), %eax
	cltq
	movl	-12048(%rbp,%rax,4), %edx
	movl	-12064(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	-12060(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-12060(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	jmp	.L9
.L8:
	addl	$1, -12060(%rbp)
.L7:
	movl	-12072(%rbp), %eax
	cmpl	%eax, -12060(%rbp)
	jl	.L10
.L9:
	addl	$1, -12064(%rbp)
.L6:
	movl	-12068(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L11
	movl	$0, -12064(%rbp)
	jmp	.L12
.L14:
	movl	-12064(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cmpl	%eax, -12056(%rbp)
	jge	.L13
	movl	-12064(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, -12056(%rbp)
	movl	-12064(%rbp), %eax
	movl	%eax, -12052(%rbp)
.L13:
	addl	$1, -12064(%rbp)
.L12:
	cmpl	$999, -12064(%rbp)
	jle	.L14
	movl	-12052(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	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	.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%d"
.LC1:
	.string	"%d"
.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	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3888, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12048(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-8032(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -12056(%rbp)
	leaq	-12068(%rbp), %rdx
	leaq	-12072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12064(%rbp)
	jmp	.L2
.L3:
	leaq	-12048(%rbp), %rdx
	movl	-12064(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12064(%rbp)
.L2:
	movl	-12072(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L3
	movl	$0, -12064(%rbp)
	jmp	.L4
.L5:
	leaq	-8032(%rbp), %rdx
	movl	-12064(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12064(%rbp)
.L4:
	movl	-12068(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L5
	movl	$0, -12064(%rbp)
	jmp	.L6
.L11:
	movl	$0, -12060(%rbp)
	jmp	.L7
.L10:
	movl	-12060(%rbp), %eax
	cltq
	movl	-12048(%rbp,%rax,4), %edx
	movl	-12064(%rbp), %eax
	cltq
	movl	-8032(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	-12060(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-12060(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	jmp	.L9
.L8:
	addl	$1, -12060(%rbp)
.L7:
	movl	-12072(%rbp), %eax
	cmpl	%eax, -12060(%rbp)
	jl	.L10
.L9:
	addl	$1, -12064(%rbp)
.L6:
	movl	-12068(%rbp), %eax
	cmpl	%eax, -12064(%rbp)
	jl	.L11
	movl	$0, -12064(%rbp)
	jmp	.L12
.L14:
	movl	-12064(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cmpl	%eax, -12056(%rbp)
	jge	.L13
	movl	-12064(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, -12056(%rbp)
	movl	-12064(%rbp), %eax
	movl	%eax, -12052(%rbp)
.L13:
	addl	$1, -12064(%rbp)
.L12:
	cmpl	$999, -12064(%rbp)
	jle	.L14
	movl	-12052(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	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	.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:
