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 i,N,M,input,target,idx;
    scanf( "%d" , &N );
    int k[ N + 1 ];
    int d[2020] = {};
    
    for( i = 1 ; i <= N; i++ ){
        scanf( "%d" , &input );
        k[i] = input;
        d[input] = 1;
    }

    scanf( "%d" , &M );
    for( i = 1 ; i <= M; i++ ){
        scanf( "%d" , &input );
        idx = k[input];
        if( d[idx + 1] == 1 || idx + 1 > 2019 ){
            continue;   
        }
        
        d[idx] = 0;//printf("%d" , d[idx] );
        d[idx+1] = 1;//printf("%d" , d[idx+1] );
        k[input]++;
    }
    
    for( i = 0 ; i < 2020 ; i++ ){
        if( d[i] == 1 ){
            printf( "%d\n" , i );
        }
    }
    
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4056, %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	-8180(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8180(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8160(%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
.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, -8152(%rbp)
	leaq	-8144(%rbp), %rdx
	movl	$0, %eax
	movl	$1010, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -8168(%rbp)
	jmp	.L5
.L6:
	leaq	-8172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8172(%rbp), %ecx
	movq	-8152(%rbp), %rax
	movl	-8168(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-8172(%rbp), %eax
	cltq
	movl	$1, -8144(%rbp,%rax,4)
	addl	$1, -8168(%rbp)
.L5:
	movl	-8180(%rbp), %eax
	cmpl	%eax, -8168(%rbp)
	jle	.L6
	leaq	-8176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8168(%rbp)
	jmp	.L7
.L11:
	leaq	-8172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8172(%rbp), %edx
	movq	-8152(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -8164(%rbp)
	movl	-8164(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-8144(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L17
	cmpl	$2018, -8164(%rbp)
	jg	.L17
	movl	-8164(%rbp), %eax
	cltq
	movl	$0, -8144(%rbp,%rax,4)
	movl	-8164(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$1, -8144(%rbp,%rax,4)
	movl	-8172(%rbp), %eax
	movq	-8152(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-8152(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
	jmp	.L10
.L17:
	nop
.L10:
	addl	$1, -8168(%rbp)
.L7:
	movl	-8176(%rbp), %eax
	cmpl	%eax, -8168(%rbp)
	jle	.L11
	movl	$0, -8168(%rbp)
	jmp	.L12
.L14:
	movl	-8168(%rbp), %eax
	cltq
	movl	-8144(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	-8168(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	addl	$1, -8168(%rbp)
.L12:
	cmpl	$2019, -8168(%rbp)
	jle	.L14
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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"
.LC2:
	.string	"%d\n"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4024, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-8156(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movl	-8156(%rbp), %edx
	movq	%rsp, %rsi
	leal	1(%rdx), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L21
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L22
.L4:
	leaq	-8144(%rbp), %r12
	movl	$1010, %ecx
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%r12, %rdi
	rep stosq
	testl	%edx, %edx
	jle	.L5
	movl	$1, %r15d
	leaq	-8148(%rbp), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-8148(%rbp), %rax
	movl	%eax, (%rbx,%r15,4)
	addq	$1, %r15
	movl	$1, -8144(%rbp,%rax,4)
	cmpl	%r15d, -8156(%rbp)
	jge	.L6
.L5:
	leaq	-8152(%rbp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-8152(%rbp), %eax
	testl	%eax, %eax
	jle	.L7
	movl	$1, %r15d
	leaq	-8148(%rbp), %r14
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-8148(%rbp), %rcx
	movslq	(%rbx,%rcx,4), %rax
	leal	1(%rax), %esi
	movslq	%esi, %rdi
	cmpl	$1, -8144(%rbp,%rdi,4)
	je	.L8
	cmpl	$2018, %eax
	jg	.L8
	movq	.LC1(%rip), %rdi
	addl	$1, %r15d
	movq	%rdi, (%r12,%rax,4)
	movl	%esi, (%rbx,%rcx,4)
	cmpl	-8152(%rbp), %r15d
	jle	.L10
.L7:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r13
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rbx
	cmpq	$2020, %rbx
	je	.L23
.L12:
	cmpl	$1, (%r12,%rbx,4)
	movl	%ebx, %edx
	jne	.L11
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	$2020, %rbx
	jne	.L12
.L23:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L24
	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
.L8:
	.cfi_restore_state
	addl	$1, %r15d
	cmpl	%r15d, -8152(%rbp)
	jge	.L10
	jmp	.L7
.L22:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1
	.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"
.LC2:
	.string	"%d\n"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4024, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-8156(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movl	-8156(%rbp), %edx
	movq	%rsp, %rsi
	leal	1(%rdx), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L21:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L21
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L22
.L4:
	leaq	-8144(%rbp), %r12
	movl	$1010, %ecx
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%r12, %rdi
	rep stosq
	testl	%edx, %edx
	jle	.L5
	movl	$1, %r15d
	leaq	-8148(%rbp), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-8148(%rbp), %rax
	movl	%eax, (%rbx,%r15,4)
	addq	$1, %r15
	movl	$1, -8144(%rbp,%rax,4)
	cmpl	%r15d, -8156(%rbp)
	jge	.L6
.L5:
	leaq	-8152(%rbp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-8152(%rbp), %eax
	testl	%eax, %eax
	jle	.L7
	movl	$1, %r15d
	leaq	-8148(%rbp), %r14
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-8148(%rbp), %rcx
	movslq	(%rbx,%rcx,4), %rax
	leal	1(%rax), %esi
	movslq	%esi, %rdi
	cmpl	$1, -8144(%rbp,%rdi,4)
	je	.L8
	cmpl	$2018, %eax
	jg	.L8
	movq	.LC1(%rip), %rdi
	addl	$1, %r15d
	movq	%rdi, (%r12,%rax,4)
	movl	%esi, (%rbx,%rcx,4)
	cmpl	-8152(%rbp), %r15d
	jle	.L10
.L7:
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r13
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	addq	$1, %rbx
	cmpq	$2020, %rbx
	je	.L23
.L12:
	cmpl	$1, (%r12,%rbx,4)
	movl	%ebx, %edx
	jne	.L11
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	$2020, %rbx
	jne	.L12
.L23:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L24
	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
.L8:
	.cfi_restore_state
	addl	$1, %r15d
	cmpl	%r15d, -8152(%rbp)
	jge	.L10
	jmp	.L7
.L22:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1
	.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 i,N,M,input,target,idx;
    scanf( "%d" , &N );
    int k[ N + 1 ];
    int d[2020] = {};
    
    for( i = 1 ; i <= N; i++ ){
        scanf( "%d" , &input );
        k[i] = input;
        d[input] = 1;
    }

    scanf( "%d" , &M );
    for( i = 1 ; i <= M; i++ ){
        scanf( "%d" , &input );
        idx = k[input];
        if( d[idx + 1] == 1 || idx + 1 > 2019 ){
            continue;   
        }
        
        d[idx] = 0;//printf("%d" , d[idx] );
        d[idx+1] = 1;//printf("%d" , d[idx+1] );
        k[input]++;
    }
    
    for( i = 0 ; i < 2020 ; i++ ){
        if( d[i] == 1 ){
            printf( "%d\n" , i );
        }
    }
    
}

3
2 3 6
2
1 3

2
3
7

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 i,N,M,input,target,idx;
    scanf( "%d" , &N );
    int k[ N + 1 ];
    int d[2020] = {};
    
    for( i = 1 ; i <= N; i++ ){
        scanf( "%d" , &input );
        k[i] = input;
        d[input] = 1;
    }

    scanf( "%d" , &M );
    for( i = 1 ; i <= M; i++ ){
        scanf( "%d" , &input );
        idx = k[input];
        if( d[idx + 1] == 1 || idx + 1 > 2019 ){
            continue;   
        }
        
        d[idx] = 0;//printf("%d" , d[idx] );
        d[idx+1] = 1;//printf("%d" , d[idx+1] );
        k[input]++;
    }
    
    for( i = 0 ; i < 2020 ; i++ ){
        if( d[i] == 1 ){
            printf( "%d\n" , i );
        }
    }
    
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4056, %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	-8180(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8180(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8160(%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
.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, -8152(%rbp)
	leaq	-8144(%rbp), %rdx
	movl	$0, %eax
	movl	$1010, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -8168(%rbp)
	jmp	.L5
.L6:
	leaq	-8172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8172(%rbp), %ecx
	movq	-8152(%rbp), %rax
	movl	-8168(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-8172(%rbp), %eax
	cltq
	movl	$1, -8144(%rbp,%rax,4)
	addl	$1, -8168(%rbp)
.L5:
	movl	-8180(%rbp), %eax
	cmpl	%eax, -8168(%rbp)
	jle	.L6
	leaq	-8176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8168(%rbp)
	jmp	.L7
.L11:
	leaq	-8172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8172(%rbp), %edx
	movq	-8152(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -8164(%rbp)
	movl	-8164(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-8144(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L17
	cmpl	$2018, -8164(%rbp)
	jg	.L17
	movl	-8164(%rbp), %eax
	cltq
	movl	$0, -8144(%rbp,%rax,4)
	movl	-8164(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$1, -8144(%rbp,%rax,4)
	movl	-8172(%rbp), %eax
	movq	-8152(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-8152(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
	jmp	.L10
.L17:
	nop
.L10:
	addl	$1, -8168(%rbp)
.L7:
	movl	-8176(%rbp), %eax
	cmpl	%eax, -8168(%rbp)
	jle	.L11
	movl	$0, -8168(%rbp)
	jmp	.L12
.L14:
	movl	-8168(%rbp), %eax
	cltq
	movl	-8144(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	-8168(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	addl	$1, -8168(%rbp)
.L12:
	cmpl	$2019, -8168(%rbp)
	jle	.L14
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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"
.LC1:
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4056, %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	-8180(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8180(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8160(%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
.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, -8152(%rbp)
	leaq	-8144(%rbp), %rdx
	movl	$0, %eax
	movl	$1010, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -8168(%rbp)
	jmp	.L5
.L6:
	leaq	-8172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8172(%rbp), %ecx
	movq	-8152(%rbp), %rax
	movl	-8168(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-8172(%rbp), %eax
	cltq
	movl	$1, -8144(%rbp,%rax,4)
	addl	$1, -8168(%rbp)
.L5:
	movl	-8180(%rbp), %eax
	cmpl	%eax, -8168(%rbp)
	jle	.L6
	leaq	-8176(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -8168(%rbp)
	jmp	.L7
.L11:
	leaq	-8172(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8172(%rbp), %edx
	movq	-8152(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -8164(%rbp)
	movl	-8164(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-8144(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L17
	cmpl	$2018, -8164(%rbp)
	jg	.L17
	movl	-8164(%rbp), %eax
	cltq
	movl	$0, -8144(%rbp,%rax,4)
	movl	-8164(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$1, -8144(%rbp,%rax,4)
	movl	-8172(%rbp), %eax
	movq	-8152(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %ecx
	movq	-8152(%rbp), %rdx
	cltq
	movl	%ecx, (%rdx,%rax,4)
	jmp	.L10
.L17:
	nop
.L10:
	addl	$1, -8168(%rbp)
.L7:
	movl	-8176(%rbp), %eax
	cmpl	%eax, -8168(%rbp)
	jle	.L11
	movl	$0, -8168(%rbp)
	jmp	.L12
.L14:
	movl	-8168(%rbp), %eax
	cltq
	movl	-8144(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	-8168(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	addl	$1, -8168(%rbp)
.L12:
	cmpl	$2019, -8168(%rbp)
	jle	.L14
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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:
