Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void)
{
	int n,s[1001],p[1001],q[1001],r[1001],c[1001],w,x,y,z,i,flg;
	while(1){
		scanf("%d",&n);
		if(n==0)	break;
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&s[i],&p[i],&q[i],&r[i]);
			c[i]=p[i]*4+q[i]*9+r[i]*4;
		}
		scanf("%d %d %d %d",&w,&x,&y,&z);
		flg=1;
		for(i=0;i<n;i++){
			if(p[i]<=w&&q[i]<=x&&r[i]<=y&&c[i]<=z){
				printf("%d\n",s[i]);
				flg=0;
			}
		}
		if(flg==1)	printf("NA\n");
	}
	return 0;
}
			
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"NA"
.LC3:
	.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
	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	$3768, %rsp
	.cfi_def_cfa_offset 20208
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 20136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
.L7:
	leaq	12112(%rsp), %r14
	movq	%r14, %r15
	.p2align 4,,10
	.p2align 3
.L9:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L6
	leaq	64(%rsp), %rax
	leaq	8096(%rsp), %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 16(%rsp)
	leaq	16128(%rsp), %rax
	leaq	4080(%rsp), %rbp
	movq	%rax, 8(%rsp)
	movq	%r15, %rax
	movq	%r13, %r15
	movq	%rax, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	16(%rsp), %rax
	leaq	(%r15,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %r14d
	leaq	0(%rbp,%rbx), %rdx
	leaq	0(%r13,%rbx), %r8
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r15,%rbx), %eax
	movl	0(%rbp,%rbx), %edx
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,8), %eax
	leal	(%rax,%rdx,4), %eax
	movl	0(%r13,%rbx), %edx
	leal	(%rax,%rdx,4), %eax
	movl	%eax, (%rdi,%rbx)
	addq	$4, %rbx
	cmpl	%r14d, 44(%rsp)
	jg	.L3
	movq	%r13, %r15
.L6:
	leaq	56(%rsp), %rcx
	leaq	52(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	leaq	60(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	xorl	%ebx, %ebx
	movl	$1, %edx
	leaq	4080(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movl	48(%rsp), %edi
	cmpl	%edi, 0(%rbp,%rbx,4)
	jg	.L8
	movl	52(%rsp), %ecx
	cmpl	%ecx, 8096(%rsp,%rbx,4)
	jg	.L8
	movl	56(%rsp), %esi
	cmpl	%esi, (%r15,%rbx,4)
	jg	.L8
	movl	60(%rsp), %esi
	cmpl	%esi, 16128(%rsp,%rbx,4)
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L4
	cmpl	$1, %edx
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	64(%rsp,%rbx,4), %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	44(%rsp), %eax
	xorl	%edx, %edx
	jmp	.L8
.L2:
	movq	20136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$20152, %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
.L21:
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"NA"
.LC3:
	.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
	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	$3768, %rsp
	.cfi_def_cfa_offset 20208
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 20136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
.L7:
	leaq	12112(%rsp), %r14
	movq	%r14, %r15
	.p2align 4,,10
	.p2align 3
.L9:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L6
	leaq	64(%rsp), %rax
	leaq	8096(%rsp), %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 16(%rsp)
	leaq	16128(%rsp), %rax
	leaq	4080(%rsp), %rbp
	movq	%rax, 8(%rsp)
	movq	%r15, %rax
	movq	%r13, %r15
	movq	%rax, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	16(%rsp), %rax
	leaq	(%r15,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %r14d
	leaq	0(%rbp,%rbx), %rdx
	leaq	0(%r13,%rbx), %r8
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r15,%rbx), %eax
	movl	0(%rbp,%rbx), %edx
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,8), %eax
	leal	(%rax,%rdx,4), %eax
	movl	0(%r13,%rbx), %edx
	leal	(%rax,%rdx,4), %eax
	movl	%eax, (%rdi,%rbx)
	addq	$4, %rbx
	cmpl	%r14d, 44(%rsp)
	jg	.L3
	movq	%r13, %r15
.L6:
	leaq	56(%rsp), %rcx
	leaq	52(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	leaq	60(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	xorl	%ebx, %ebx
	movl	$1, %edx
	leaq	4080(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movl	48(%rsp), %edi
	cmpl	%edi, 0(%rbp,%rbx,4)
	jg	.L8
	movl	52(%rsp), %ecx
	cmpl	%ecx, 8096(%rsp,%rbx,4)
	jg	.L8
	movl	56(%rsp), %esi
	cmpl	%esi, (%r15,%rbx,4)
	jg	.L8
	movl	60(%rsp), %esi
	cmpl	%esi, 16128(%rsp,%rbx,4)
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L4
	cmpl	$1, %edx
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	64(%rsp,%rbx,4), %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	44(%rsp), %eax
	xorl	%edx, %edx
	jmp	.L8
.L2:
	movq	20136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$20152, %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
.L21:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"NA"
.LC3:
	.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
	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	$3768, %rsp
	.cfi_def_cfa_offset 20208
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 20136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
.L7:
	leaq	12112(%rsp), %r14
	movq	%r14, %r15
	.p2align 4,,10
	.p2align 3
.L9:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L6
	leaq	64(%rsp), %rax
	leaq	8096(%rsp), %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 16(%rsp)
	leaq	16128(%rsp), %rax
	leaq	4080(%rsp), %rbp
	movq	%rax, 8(%rsp)
	movq	%r15, %rax
	movq	%r13, %r15
	movq	%rax, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	16(%rsp), %rax
	leaq	(%r15,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %r14d
	leaq	0(%rbp,%rbx), %rdx
	leaq	0(%r13,%rbx), %r8
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r15,%rbx), %eax
	movl	0(%rbp,%rbx), %edx
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,8), %eax
	leal	(%rax,%rdx,4), %eax
	movl	0(%r13,%rbx), %edx
	leal	(%rax,%rdx,4), %eax
	movl	%eax, (%rdi,%rbx)
	addq	$4, %rbx
	cmpl	%r14d, 44(%rsp)
	jg	.L3
	movq	%r13, %r15
.L6:
	leaq	56(%rsp), %rcx
	leaq	52(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	leaq	60(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	xorl	%ebx, %ebx
	movl	$1, %edx
	leaq	4080(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movl	48(%rsp), %edi
	cmpl	%edi, 0(%rbp,%rbx,4)
	jg	.L8
	movl	52(%rsp), %ecx
	cmpl	%ecx, 8096(%rsp,%rbx,4)
	jg	.L8
	movl	56(%rsp), %esi
	cmpl	%esi, (%r15,%rbx,4)
	jg	.L8
	movl	60(%rsp), %esi
	cmpl	%esi, 16128(%rsp,%rbx,4)
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L4
	cmpl	$1, %edx
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	64(%rsp,%rbx,4), %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	44(%rsp), %eax
	xorl	%edx, %edx
	jmp	.L8
.L2:
	movq	20136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$20152, %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
.L21:
	.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:
```
```c
#include<stdio.h>
int main(void)
{
	int n,s[1001],p[1001],q[1001],r[1001],c[1001],w,x,y,z,i,flg;
	while(1){
		scanf("%d",&n);
		if(n==0)	break;
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&s[i],&p[i],&q[i],&r[i]);
			c[i]=p[i]*4+q[i]*9+r[i]*4;
		}
		scanf("%d %d %d %d",&w,&x,&y,&z);
		flg=1;
		for(i=0;i<n;i++){
			if(p[i]<=w&&q[i]<=x&&r[i]<=y&&c[i]<=z){
				printf("%d\n",s[i]);
				flg=0;
			}
		}
		if(flg==1)	printf("NA\n");
	}
	return 0;
}
			
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void)
{
	int n,s[1001],p[1001],q[1001],r[1001],c[1001],w,x,y,z,i,flg;
	while(1){
		scanf("%d",&n);
		if(n==0)	break;
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&s[i],&p[i],&q[i],&r[i]);
			c[i]=p[i]*4+q[i]*9+r[i]*4;
		}
		scanf("%d %d %d %d",&w,&x,&y,&z);
		flg=1;
		for(i=0;i<n;i++){
			if(p[i]<=w&&q[i]<=x&&r[i]<=y&&c[i]<=z){
				printf("%d\n",s[i]);
				flg=0;
			}
		}
		if(flg==1)	printf("NA\n");
	}
	return 0;
}
			
```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void)
{
	int n,s[1001],p[1001],q[1001],r[1001],c[1001],w,x,y,z,i,flg;
	while(1){
		scanf("%d",&n);
		if(n==0)	break;
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&s[i],&p[i],&q[i],&r[i]);
			c[i]=p[i]*4+q[i]*9+r[i]*4;
		}
		scanf("%d %d %d %d",&w,&x,&y,&z);
		flg=1;
		for(i=0;i<n;i++){
			if(p[i]<=w&&q[i]<=x&&r[i]<=y&&c[i]<=z){
				printf("%d\n",s[i]);
				flg=0;
			}
		}
		if(flg==1)	printf("NA\n");
	}
	return 0;
}
			
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"NA"
.LC3:
	.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
	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	$3768, %rsp
	.cfi_def_cfa_offset 20208
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 20136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
.L7:
	leaq	12112(%rsp), %r14
	movq	%r14, %r15
	.p2align 4,,10
	.p2align 3
.L9:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L6
	leaq	64(%rsp), %rax
	leaq	8096(%rsp), %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 16(%rsp)
	leaq	16128(%rsp), %rax
	leaq	4080(%rsp), %rbp
	movq	%rax, 8(%rsp)
	movq	%r15, %rax
	movq	%r13, %r15
	movq	%rax, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	16(%rsp), %rax
	leaq	(%r15,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %r14d
	leaq	0(%rbp,%rbx), %rdx
	leaq	0(%r13,%rbx), %r8
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r15,%rbx), %eax
	movl	0(%rbp,%rbx), %edx
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,8), %eax
	leal	(%rax,%rdx,4), %eax
	movl	0(%r13,%rbx), %edx
	leal	(%rax,%rdx,4), %eax
	movl	%eax, (%rdi,%rbx)
	addq	$4, %rbx
	cmpl	%r14d, 44(%rsp)
	jg	.L3
	movq	%r13, %r15
.L6:
	leaq	56(%rsp), %rcx
	leaq	52(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	leaq	60(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	xorl	%ebx, %ebx
	movl	$1, %edx
	leaq	4080(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movl	48(%rsp), %edi
	cmpl	%edi, 0(%rbp,%rbx,4)
	jg	.L8
	movl	52(%rsp), %ecx
	cmpl	%ecx, 8096(%rsp,%rbx,4)
	jg	.L8
	movl	56(%rsp), %esi
	cmpl	%esi, (%r15,%rbx,4)
	jg	.L8
	movl	60(%rsp), %esi
	cmpl	%esi, 16128(%rsp,%rbx,4)
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L4
	cmpl	$1, %edx
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	64(%rsp,%rbx,4), %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	44(%rsp), %eax
	xorl	%edx, %edx
	jmp	.L8
.L2:
	movq	20136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$20152, %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
.L21:
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"NA"
.LC3:
	.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
	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	$3768, %rsp
	.cfi_def_cfa_offset 20208
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 20136(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
.L7:
	leaq	12112(%rsp), %r14
	movq	%r14, %r15
	.p2align 4,,10
	.p2align 3
.L9:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L6
	leaq	64(%rsp), %rax
	leaq	8096(%rsp), %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 16(%rsp)
	leaq	16128(%rsp), %rax
	leaq	4080(%rsp), %rbp
	movq	%rax, 8(%rsp)
	movq	%r15, %rax
	movq	%r13, %r15
	movq	%rax, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	16(%rsp), %rax
	leaq	(%r15,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %r14d
	leaq	0(%rbp,%rbx), %rdx
	leaq	0(%r13,%rbx), %r8
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r15,%rbx), %eax
	movl	0(%rbp,%rbx), %edx
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,8), %eax
	leal	(%rax,%rdx,4), %eax
	movl	0(%r13,%rbx), %edx
	leal	(%rax,%rdx,4), %eax
	movl	%eax, (%rdi,%rbx)
	addq	$4, %rbx
	cmpl	%r14d, 44(%rsp)
	jg	.L3
	movq	%r13, %r15
.L6:
	leaq	56(%rsp), %rcx
	leaq	52(%rsp), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	leaq	60(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	xorl	%ebx, %ebx
	movl	$1, %edx
	leaq	4080(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movl	48(%rsp), %edi
	cmpl	%edi, 0(%rbp,%rbx,4)
	jg	.L8
	movl	52(%rsp), %ecx
	cmpl	%ecx, 8096(%rsp,%rbx,4)
	jg	.L8
	movl	56(%rsp), %esi
	cmpl	%esi, (%r15,%rbx,4)
	jg	.L8
	movl	60(%rsp), %esi
	cmpl	%esi, 16128(%rsp,%rbx,4)
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L4
	cmpl	$1, %edx
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	64(%rsp,%rbx,4), %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	44(%rsp), %eax
	xorl	%edx, %edx
	jmp	.L8
.L2:
	movq	20136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$20152, %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
.L21:
	.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:
```