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 i[1000],p[1000],q[1000],r[1000],P,Q,R,C,n,j,a[1000],b[1000],c[1000],d;
	
	while(1){
		scanf("%d",&n);
		if(n==0){
			break;
		}
		for(j=0;j<n;j++){
			scanf("%d%d%d%d",&i[j],&p[j],&q[j],&r[j]);
			a[j]=(p[j]+r[j])*4;
			b[j]=q[j]*9;
			c[j]=a[j]+b[j];
		}
		scanf("%d%d%d%d",&P,&Q,&R,&C);
		
		d=0;
		
		for(j=0;j<n;j++){
			if(P>=p[j] && Q>=q[j] && R>=r[j] && C>=c[j]){
				printf("%d\n",i[j]);
				d++;
			}
			if(j==n-1){
				if(d==0){
					printf("NA\n");
				}
			}
		}
	}
	
return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"NA"
	.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
	leaq	-24576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-28028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28028(%rbp), %eax
	testl	%eax, %eax
	je	.L14
	movl	$0, -28024(%rbp)
	jmp	.L4
.L5:
	leaq	-16016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rsi
	leaq	-20016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-24016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-28016(%rbp), %rdi
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	-16016(%rbp,%rax,4), %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -12016(%rbp,%rax,4)
	movl	-28024(%rbp), %eax
	cltq
	movl	-20016(%rbp,%rax,4), %edx
	movl	%edx, %eax
	sall	$3, %eax
	addl	%eax, %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -8016(%rbp,%rax,4)
	movl	-28024(%rbp), %eax
	cltq
	movl	-12016(%rbp,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -28024(%rbp)
.L4:
	movl	-28028(%rbp), %eax
	cmpl	%eax, -28024(%rbp)
	jl	.L5
	leaq	-28032(%rbp), %rsi
	leaq	-28036(%rbp), %rcx
	leaq	-28040(%rbp), %rdx
	leaq	-28044(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28020(%rbp)
	movl	$0, -28024(%rbp)
	jmp	.L6
.L9:
	movl	-28024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,4), %edx
	movl	-28044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-20016(%rbp,%rax,4), %edx
	movl	-28040(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-16016(%rbp,%rax,4), %edx
	movl	-28036(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-28032(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-28016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28020(%rbp)
.L7:
	movl	-28028(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -28024(%rbp)
	jne	.L8
	cmpl	$0, -28020(%rbp)
	jne	.L8
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	addl	$1, -28024(%rbp)
.L6:
	movl	-28028(%rbp), %eax
	cmpl	%eax, -28024(%rbp)
	jl	.L9
	jmp	.L10
.L14:
	nop
	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	"%d%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"NA"
	.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
	leaq	-16384(%rsp), %r11
	.cfi_def_cfa 11, 16440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3704, %rsp
	.cfi_def_cfa_offset 20144
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 20072(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L7:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L6
	leaq	64(%rsp), %rax
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	movq	%rax, 8(%rsp)
	leaq	16064(%rsp), %rax
	leaq	12064(%rsp), %r13
	movq	%rax, 16(%rsp)
	leaq	8064(%rsp), %r14
	leaq	4064(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	8(%rsp), %rax
	leaq	(%r14,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %r15d
	leaq	0(%rbp,%rbx), %rdx
	leaq	0(%r13,%rbx), %r8
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r14,%rbx), %edx
	movl	0(%r13,%rbx), %eax
	movq	16(%rsp), %rdi
	addl	0(%rbp,%rbx), %eax
	leal	(%rdx,%rdx,8), %edx
	leal	(%rdx,%rax,4), %eax
	movl	%eax, (%rdi,%rbx)
	addq	$4, %rbx
	cmpl	%r15d, 60(%rsp)
	jg	.L3
.L6:
	leaq	52(%rsp), %rcx
	leaq	48(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	leaq	56(%rsp), %r8
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	leaq	4064(%rsp), %rbp
	testl	%eax, %eax
	jg	.L4
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jle	.L7
.L4:
	movl	44(%rsp), %ecx
	cmpl	%ecx, 0(%rbp,%rbx,4)
	jg	.L8
	movl	48(%rsp), %edi
	cmpl	%edi, 8064(%rsp,%rbx,4)
	jg	.L8
	movl	52(%rsp), %esi
	cmpl	%esi, 12064(%rsp,%rbx,4)
	jg	.L8
	movl	56(%rsp), %esi
	cmpl	%esi, 16064(%rsp,%rbx,4)
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-1(%rax), %edx
	cmpl	%ebx, %edx
	jne	.L9
	testl	%r13d, %r13d
	jne	.L9
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	movl	60(%rsp), %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L19:
	movl	64(%rsp,%rbx,4), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r13d
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movl	60(%rsp), %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	20072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$20088, %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"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"NA"
	.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
	leaq	-16384(%rsp), %r11
	.cfi_def_cfa 11, 16440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3704, %rsp
	.cfi_def_cfa_offset 20144
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 20072(%rsp)
	xorl	%eax, %eax
	leaq	60(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L7:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L6
	leaq	64(%rsp), %rax
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	movq	%rax, 8(%rsp)
	leaq	16064(%rsp), %rax
	leaq	12064(%rsp), %r13
	movq	%rax, 16(%rsp)
	leaq	8064(%rsp), %r14
	leaq	4064(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	8(%rsp), %rax
	leaq	(%r14,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %r15d
	leaq	0(%rbp,%rbx), %rdx
	leaq	0(%r13,%rbx), %r8
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r14,%rbx), %edx
	movl	0(%r13,%rbx), %eax
	movq	16(%rsp), %rdi
	addl	0(%rbp,%rbx), %eax
	leal	(%rdx,%rdx,8), %edx
	leal	(%rdx,%rax,4), %eax
	movl	%eax, (%rdi,%rbx)
	addq	$4, %rbx
	cmpl	%r15d, 60(%rsp)
	jg	.L3
.L6:
	leaq	52(%rsp), %rcx
	leaq	48(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	leaq	56(%rsp), %r8
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %eax
	leaq	4064(%rsp), %rbp
	testl	%eax, %eax
	jg	.L4
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jle	.L7
.L4:
	movl	44(%rsp), %ecx
	cmpl	%ecx, 0(%rbp,%rbx,4)
	jg	.L8
	movl	48(%rsp), %edi
	cmpl	%edi, 8064(%rsp,%rbx,4)
	jg	.L8
	movl	52(%rsp), %esi
	cmpl	%esi, 12064(%rsp,%rbx,4)
	jg	.L8
	movl	56(%rsp), %esi
	cmpl	%esi, 16064(%rsp,%rbx,4)
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-1(%rax), %edx
	cmpl	%ebx, %edx
	jne	.L9
	testl	%r13d, %r13d
	jne	.L9
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	movl	60(%rsp), %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L19:
	movl	64(%rsp,%rbx,4), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r13d
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movl	60(%rsp), %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	20072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$20088, %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(){
	int i[1000],p[1000],q[1000],r[1000],P,Q,R,C,n,j,a[1000],b[1000],c[1000],d;
	
	while(1){
		scanf("%d",&n);
		if(n==0){
			break;
		}
		for(j=0;j<n;j++){
			scanf("%d%d%d%d",&i[j],&p[j],&q[j],&r[j]);
			a[j]=(p[j]+r[j])*4;
			b[j]=q[j]*9;
			c[j]=a[j]+b[j];
		}
		scanf("%d%d%d%d",&P,&Q,&R,&C);
		
		d=0;
		
		for(j=0;j<n;j++){
			if(P>=p[j] && Q>=q[j] && R>=r[j] && C>=c[j]){
				printf("%d\n",i[j]);
				d++;
			}
			if(j==n-1){
				if(d==0){
					printf("NA\n");
				}
			}
		}
	}
	
return 0;
}
4
1 7 14 47
2 5 35 55
3 6 3 59
4 6 5 15
10 15 50 110
2
1 8 10 78
2 4 18 33
10 10 50 300
0
 4
1 7 14 47
2 7 35 55
3 6 3 78
4 2 7 15
10 15 50 110
2
1 8 10 215
0 4 8 33
4 10 50 300
0
 4
1 7 14 47
2 5 35 55
3 6 3 59
4 6 5 15
10 15 50 318
2
1 8 10 78
2 4 18 33
10 10 50 300
0
 4
1 7 24 67
2 7 35 55
3 7 3 78
8 2 9 16
8 15 50 110
2
1 8 10 254
1 3 9 33
4 10 50 300
0
 4
0 5 24 67
0 7 35 15
3 14 1 74
4 2 9 18
8 29 50 100
0
1 8 10 254
1 7 9 33
3 1 28 300
0
 4
1 7 24 67
2 7 35 55
3 7 3 78
8 2 9 16
8 15 50 100
2
1 8 10 254
2 3 9 33
4 10 50 300
0
 4
1 3 14 47
0 7 35 55
3 6 3 14
4 2 7 31
10 15 50 110
2
1 8 10 254
1 5 8 33
4 2 50 300
0
 4
0 5 24 100
0 14 48 15
3 14 0 74
2 2 2 9
5 29 102 111
2
1 1 10 147
0 7 3 0
3 1 33 278
0
 4
1 5 24 67
4 7 35 45
3 3 1 78
4 1 1 18
3 15 50 101
0
1 8 3 397
1 7 4 33
4 1 28 553
0
 4
0 3 24 100
0 14 25 15
3 14 0 23
0 1 2 9
9 37 73 111
2
1 8 5 254
0 7 7 33
2 1 31 278
0

NA
NA
 NA
0
 4
NA
 NA
1
 NA
 NA
2
 3
NA
 2
NA
 4
 0
NA

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 i[1000],p[1000],q[1000],r[1000],P,Q,R,C,n,j,a[1000],b[1000],c[1000],d;
	
	while(1){
		scanf("%d",&n);
		if(n==0){
			break;
		}
		for(j=0;j<n;j++){
			scanf("%d%d%d%d",&i[j],&p[j],&q[j],&r[j]);
			a[j]=(p[j]+r[j])*4;
			b[j]=q[j]*9;
			c[j]=a[j]+b[j];
		}
		scanf("%d%d%d%d",&P,&Q,&R,&C);
		
		d=0;
		
		for(j=0;j<n;j++){
			if(P>=p[j] && Q>=q[j] && R>=r[j] && C>=c[j]){
				printf("%d\n",i[j]);
				d++;
			}
			if(j==n-1){
				if(d==0){
					printf("NA\n");
				}
			}
		}
	}
	
return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"NA"
	.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
	leaq	-24576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-28028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28028(%rbp), %eax
	testl	%eax, %eax
	je	.L14
	movl	$0, -28024(%rbp)
	jmp	.L4
.L5:
	leaq	-16016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rsi
	leaq	-20016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-24016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-28016(%rbp), %rdi
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	-16016(%rbp,%rax,4), %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -12016(%rbp,%rax,4)
	movl	-28024(%rbp), %eax
	cltq
	movl	-20016(%rbp,%rax,4), %edx
	movl	%edx, %eax
	sall	$3, %eax
	addl	%eax, %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -8016(%rbp,%rax,4)
	movl	-28024(%rbp), %eax
	cltq
	movl	-12016(%rbp,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -28024(%rbp)
.L4:
	movl	-28028(%rbp), %eax
	cmpl	%eax, -28024(%rbp)
	jl	.L5
	leaq	-28032(%rbp), %rsi
	leaq	-28036(%rbp), %rcx
	leaq	-28040(%rbp), %rdx
	leaq	-28044(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28020(%rbp)
	movl	$0, -28024(%rbp)
	jmp	.L6
.L9:
	movl	-28024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,4), %edx
	movl	-28044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-20016(%rbp,%rax,4), %edx
	movl	-28040(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-16016(%rbp,%rax,4), %edx
	movl	-28036(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-28032(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-28016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28020(%rbp)
.L7:
	movl	-28028(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -28024(%rbp)
	jne	.L8
	cmpl	$0, -28020(%rbp)
	jne	.L8
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	addl	$1, -28024(%rbp)
.L6:
	movl	-28028(%rbp), %eax
	cmpl	%eax, -28024(%rbp)
	jl	.L9
	jmp	.L10
.L14:
	nop
	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	"%d%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"NA"
	.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
	leaq	-24576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3472, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-28028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28028(%rbp), %eax
	testl	%eax, %eax
	je	.L14
	movl	$0, -28024(%rbp)
	jmp	.L4
.L5:
	leaq	-16016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rsi
	leaq	-20016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-24016(%rbp), %rdx
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-28016(%rbp), %rdi
	movl	-28024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	-16016(%rbp,%rax,4), %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -12016(%rbp,%rax,4)
	movl	-28024(%rbp), %eax
	cltq
	movl	-20016(%rbp,%rax,4), %edx
	movl	%edx, %eax
	sall	$3, %eax
	addl	%eax, %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -8016(%rbp,%rax,4)
	movl	-28024(%rbp), %eax
	cltq
	movl	-12016(%rbp,%rax,4), %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-28024(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -28024(%rbp)
.L4:
	movl	-28028(%rbp), %eax
	cmpl	%eax, -28024(%rbp)
	jl	.L5
	leaq	-28032(%rbp), %rsi
	leaq	-28036(%rbp), %rcx
	leaq	-28040(%rbp), %rdx
	leaq	-28044(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28020(%rbp)
	movl	$0, -28024(%rbp)
	jmp	.L6
.L9:
	movl	-28024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,4), %edx
	movl	-28044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-20016(%rbp,%rax,4), %edx
	movl	-28040(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-16016(%rbp,%rax,4), %edx
	movl	-28036(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-28032(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	-28024(%rbp), %eax
	cltq
	movl	-28016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -28020(%rbp)
.L7:
	movl	-28028(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -28024(%rbp)
	jne	.L8
	cmpl	$0, -28020(%rbp)
	jne	.L8
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	addl	$1, -28024(%rbp)
.L6:
	movl	-28028(%rbp), %eax
	cmpl	%eax, -28024(%rbp)
	jl	.L9
	jmp	.L10
.L14:
	nop
	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:
