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 n, map[1001][5], mp, mq, mr, mc, i, f;
  while(scanf("%d", &n) && n){
    for(i = 0; i < n; ++i){
      scanf("%d%d%d%d", &map[i][0], &map[i][1], &map[i][2], &map[i][3]);
      map[i][4] = map[i][1] * 4 + map[i][2] * 9 + map[i][3] * 4;
    }

    scanf("%d%d%d%d", &mp, &mq, &mr, &mc);
    f = 0;
    for(i = 0; i < n; ++i){
      if(map[i][1] <= mp && map[i][2] <= mq && map[i][3] <= mr && map[i][4] <= mc){
	printf("%d\n", map[i][0]);
	f = 1;
      }
    }
    if(!f) puts("NA");
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"NA"
.LC3:
	.string	"%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
	leaq	-16384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3680, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L9:
	movl	$0, -20040(%rbp)
	jmp	.L3
.L4:
	leaq	-20032(%rbp), %rcx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$12, %rax
	leaq	(%rcx,%rax), %rdi
	leaq	-20032(%rbp), %rcx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$8, %rax
	addq	%rax, %rcx
	leaq	-20032(%rbp), %rsi
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$4, %rax
	leaq	(%rsi,%rax), %rdx
	leaq	-20032(%rbp), %r8
	movl	-20040(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%r8, %rax
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20028, %rax
	movl	(%rax), %eax
	leal	0(,%rax,4), %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20024, %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	sall	$3, %eax
	addl	%edx, %eax
	addl	%eax, %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20020, %rax
	movl	(%rax), %eax
	sall	$2, %eax
	addl	%eax, %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20016, %rax
	movl	%ecx, (%rax)
	addl	$1, -20040(%rbp)
.L3:
	movl	-20060(%rbp), %eax
	cmpl	%eax, -20040(%rbp)
	jl	.L4
	leaq	-20044(%rbp), %rsi
	leaq	-20048(%rbp), %rcx
	leaq	-20052(%rbp), %rdx
	leaq	-20056(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20036(%rbp)
	movl	$0, -20040(%rbp)
	jmp	.L5
.L7:
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20028, %rax
	movl	(%rax), %edx
	movl	-20056(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20024, %rax
	movl	(%rax), %edx
	movl	-20052(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20020, %rax
	movl	(%rax), %edx
	movl	-20048(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20016, %rax
	movl	(%rax), %edx
	movl	-20044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20032, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -20036(%rbp)
.L6:
	addl	$1, -20040(%rbp)
.L5:
	movl	-20060(%rbp), %eax
	cmpl	%eax, -20040(%rbp)
	jl	.L7
	cmpl	$0, -20036(%rbp)
	jne	.L2
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-20060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L8
	movl	-20060(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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%d%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.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	$3688, %rsp
	.cfi_def_cfa_offset 20128
	leaq	.LC3(%rip), %r12
	leaq	.LC0(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 20056(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r13
.L2:
	leaq	28(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L9
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L9
	leaq	36(%rsp), %rbx
	movl	$0, %r15d
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rdx
	leaq	4(%rbx), %rcx
	leaq	-4(%rbx), %rsi
	movq	%rbp, %rdi
	leaq	8(%rbx), %r8
	xorl	%eax, %eax
	addl	$1, %r15d
	addq	$20, %rbx
	call	__isoc99_scanf@PLT
	movl	-16(%rbx), %eax
	movl	-20(%rbx), %edx
	leal	(%rax,%rax,8), %eax
	leal	(%rax,%rdx,4), %eax
	movl	-12(%rbx), %edx
	leal	(%rax,%rdx,4), %eax
	movl	%eax, -8(%rbx)
	cmpl	%r15d, 12(%rsp)
	jg	.L3
.L11:
	leaq	24(%rsp), %rcx
	leaq	20(%rsp), %rdx
	movq	%r14, %r8
	movq	%rbp, %rdi
	leaq	16(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	32(%rsp), %rbx
	xorl	%edx, %edx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	16(%rsp), %edi
	cmpl	%edi, 4(%rbx)
	jg	.L5
	movl	20(%rsp), %edi
	cmpl	%edi, 8(%rbx)
	jg	.L5
	movl	24(%rsp), %ecx
	cmpl	%ecx, 12(%rbx)
	jg	.L5
	movl	28(%rsp), %esi
	cmpl	%esi, 16(%rbx)
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %r15d
	addq	$20, %rbx
	cmpl	%eax, %r15d
	jl	.L6
	testl	%edx, %edx
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L27:
	movl	(%rbx), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	movl	$1, %edx
	jmp	.L5
.L9:
	movq	20056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$20072, %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
.L28:
	.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%d%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.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	$3688, %rsp
	.cfi_def_cfa_offset 20128
	leaq	.LC3(%rip), %r12
	leaq	.LC0(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 20056(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r13
.L2:
	leaq	28(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L9
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L9
	leaq	36(%rsp), %rbx
	movl	$0, %r15d
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rdx
	leaq	4(%rbx), %rcx
	leaq	-4(%rbx), %rsi
	movq	%rbp, %rdi
	leaq	8(%rbx), %r8
	xorl	%eax, %eax
	addl	$1, %r15d
	addq	$20, %rbx
	call	__isoc99_scanf@PLT
	movl	-16(%rbx), %eax
	movl	-20(%rbx), %edx
	leal	(%rax,%rax,8), %eax
	leal	(%rax,%rdx,4), %eax
	movl	-12(%rbx), %edx
	leal	(%rax,%rdx,4), %eax
	movl	%eax, -8(%rbx)
	cmpl	%r15d, 12(%rsp)
	jg	.L3
.L11:
	leaq	24(%rsp), %rcx
	leaq	20(%rsp), %rdx
	movq	%r14, %r8
	movq	%rbp, %rdi
	leaq	16(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	leaq	32(%rsp), %rbx
	xorl	%edx, %edx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	16(%rsp), %edi
	cmpl	%edi, 4(%rbx)
	jg	.L5
	movl	20(%rsp), %edi
	cmpl	%edi, 8(%rbx)
	jg	.L5
	movl	24(%rsp), %ecx
	cmpl	%ecx, 12(%rbx)
	jg	.L5
	movl	28(%rsp), %esi
	cmpl	%esi, 16(%rbx)
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %r15d
	addq	$20, %rbx
	cmpl	%eax, %r15d
	jl	.L6
	testl	%edx, %edx
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L27:
	movl	(%rbx), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	movl	$1, %edx
	jmp	.L5
.L9:
	movq	20056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$20072, %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
.L28:
	.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 n, map[1001][5], mp, mq, mr, mc, i, f;
  while(scanf("%d", &n) && n){
    for(i = 0; i < n; ++i){
      scanf("%d%d%d%d", &map[i][0], &map[i][1], &map[i][2], &map[i][3]);
      map[i][4] = map[i][1] * 4 + map[i][2] * 9 + map[i][3] * 4;
    }

    scanf("%d%d%d%d", &mp, &mq, &mr, &mc);
    f = 0;
    for(i = 0; i < n; ++i){
      if(map[i][1] <= mp && map[i][2] <= mq && map[i][3] <= mr && map[i][4] <= mc){
	printf("%d\n", map[i][0]);
	f = 1;
      }
    }
    if(!f) puts("NA");
  }
  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 n, map[1001][5], mp, mq, mr, mc, i, f;
  while(scanf("%d", &n) && n){
    for(i = 0; i < n; ++i){
      scanf("%d%d%d%d", &map[i][0], &map[i][1], &map[i][2], &map[i][3]);
      map[i][4] = map[i][1] * 4 + map[i][2] * 9 + map[i][3] * 4;
    }

    scanf("%d%d%d%d", &mp, &mq, &mr, &mc);
    f = 0;
    for(i = 0; i < n; ++i){
      if(map[i][1] <= mp && map[i][2] <= mq && map[i][3] <= mr && map[i][4] <= mc){
	printf("%d\n", map[i][0]);
	f = 1;
      }
    }
    if(!f) puts("NA");
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"NA"
.LC3:
	.string	"%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
	leaq	-16384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3680, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L9:
	movl	$0, -20040(%rbp)
	jmp	.L3
.L4:
	leaq	-20032(%rbp), %rcx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$12, %rax
	leaq	(%rcx,%rax), %rdi
	leaq	-20032(%rbp), %rcx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$8, %rax
	addq	%rax, %rcx
	leaq	-20032(%rbp), %rsi
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$4, %rax
	leaq	(%rsi,%rax), %rdx
	leaq	-20032(%rbp), %r8
	movl	-20040(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%r8, %rax
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20028, %rax
	movl	(%rax), %eax
	leal	0(,%rax,4), %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20024, %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	sall	$3, %eax
	addl	%edx, %eax
	addl	%eax, %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20020, %rax
	movl	(%rax), %eax
	sall	$2, %eax
	addl	%eax, %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20016, %rax
	movl	%ecx, (%rax)
	addl	$1, -20040(%rbp)
.L3:
	movl	-20060(%rbp), %eax
	cmpl	%eax, -20040(%rbp)
	jl	.L4
	leaq	-20044(%rbp), %rsi
	leaq	-20048(%rbp), %rcx
	leaq	-20052(%rbp), %rdx
	leaq	-20056(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20036(%rbp)
	movl	$0, -20040(%rbp)
	jmp	.L5
.L7:
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20028, %rax
	movl	(%rax), %edx
	movl	-20056(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20024, %rax
	movl	(%rax), %edx
	movl	-20052(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20020, %rax
	movl	(%rax), %edx
	movl	-20048(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20016, %rax
	movl	(%rax), %edx
	movl	-20044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20032, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -20036(%rbp)
.L6:
	addl	$1, -20040(%rbp)
.L5:
	movl	-20060(%rbp), %eax
	cmpl	%eax, -20040(%rbp)
	jl	.L7
	cmpl	$0, -20036(%rbp)
	jne	.L2
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-20060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L8
	movl	-20060(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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%d%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"NA"
.LC3:
	.string	"%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
	leaq	-16384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3680, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L9:
	movl	$0, -20040(%rbp)
	jmp	.L3
.L4:
	leaq	-20032(%rbp), %rcx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$12, %rax
	leaq	(%rcx,%rax), %rdi
	leaq	-20032(%rbp), %rcx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$8, %rax
	addq	%rax, %rcx
	leaq	-20032(%rbp), %rsi
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	$4, %rax
	leaq	(%rsi,%rax), %rdx
	leaq	-20032(%rbp), %r8
	movl	-20040(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%r8, %rax
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20028, %rax
	movl	(%rax), %eax
	leal	0(,%rax,4), %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20024, %rax
	movl	(%rax), %edx
	movl	%edx, %eax
	sall	$3, %eax
	addl	%edx, %eax
	addl	%eax, %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20020, %rax
	movl	(%rax), %eax
	sall	$2, %eax
	addl	%eax, %ecx
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20016, %rax
	movl	%ecx, (%rax)
	addl	$1, -20040(%rbp)
.L3:
	movl	-20060(%rbp), %eax
	cmpl	%eax, -20040(%rbp)
	jl	.L4
	leaq	-20044(%rbp), %rsi
	leaq	-20048(%rbp), %rcx
	leaq	-20052(%rbp), %rdx
	leaq	-20056(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20036(%rbp)
	movl	$0, -20040(%rbp)
	jmp	.L5
.L7:
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20028, %rax
	movl	(%rax), %edx
	movl	-20056(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20024, %rax
	movl	(%rax), %edx
	movl	-20052(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20020, %rax
	movl	(%rax), %edx
	movl	-20048(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20016, %rax
	movl	(%rax), %edx
	movl	-20044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L6
	movl	-20040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$20032, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -20036(%rbp)
.L6:
	addl	$1, -20040(%rbp)
.L5:
	movl	-20060(%rbp), %eax
	cmpl	%eax, -20040(%rbp)
	jl	.L7
	cmpl	$0, -20036(%rbp)
	jne	.L2
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-20060(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L8
	movl	-20060(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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:
