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

```c
char*z,a[2][204];n,m,i,p;main(c){for(;m=scanf("%d %[^\n] %[^\n]",&n,a,a+1)*n;printf(m>n?"NA\n":"%d\n",m))for(i=2;i--;m=c)for(c=p=0;z=p+p+a[c+i&1],c<m&&*z>49|n+~p;)p+=p<n&*z<50?*z-49|z[2]-49?++c,2:1:-1;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	z
	.bss
	.align 8
	.type	z, @object
	.size	z, 8
z:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.section	.rodata
.LC0:
	.string	"NA\n"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %[^\n] %[^\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	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L15:
	movl	$2, i(%rip)
	jmp	.L3
.L12:
	movl	$0, p(%rip)
	movl	p(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L11:
	movl	p(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	setl	%dl
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	setle	%al
	andl	%edx, %eax
	testb	%al, %al
	je	.L5
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-49(%rax), %edx
	movq	z(%rip), %rax
	addq	$2, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$49, %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	addl	$1, -4(%rbp)
	movl	$2, %edx
	jmp	.L8
.L6:
	movl	$1, %edx
	jmp	.L8
.L5:
	movl	$-1, %edx
.L8:
	movl	p(%rip), %eax
	addl	%edx, %eax
	movl	%eax, p(%rip)
.L4:
	movl	i(%rip), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	andl	$1, %eax
	cltq
	imulq	$204, %rax, %rax
	leaq	a(%rip), %rdx
	addq	%rax, %rdx
	movl	p(%rip), %eax
	addl	%eax, %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, z(%rip)
	movl	m(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L9
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	setg	%al
	movzbl	%al, %edx
	movl	p(%rip), %eax
	notl	%eax
	movl	%eax, %ecx
	movl	n(%rip), %eax
	addl	%ecx, %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	testl	%eax, %eax
	jne	.L11
	movl	-4(%rbp), %eax
	movl	%eax, m(%rip)
.L3:
	movl	i(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, i(%rip)
	testl	%eax, %eax
	jne	.L12
	movl	m(%rip), %edx
	movl	m(%rip), %ecx
	movl	n(%rip), %eax
	cmpl	%eax, %ecx
	jle	.L13
	leaq	.LC0(%rip), %rax
	jmp	.L14
.L13:
	leaq	.LC1(%rip), %rax
.L14:
	movl	%edx, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	204+a(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %edx
	imull	%edx, %eax
	movl	%eax, m(%rip)
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	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	"NA\n"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %[^\n] %[^\n]"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	a(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$-1, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	204(%r15), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	n(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%r12, %rcx
	movq	%r15, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	n(%rip), %esi
	imull	%esi, %eax
	movl	%eax, m(%rip)
	movl	%eax, %r8d
	testl	%eax, %eax
	je	.L25
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edi, %rax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	imulq	$204, %rax, %rax
	addq	%r15, %rax
	testl	%r8d, %r8d
	jg	.L3
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	2(%rax), %r10d
	movsbl	%r9b, %eax
	leal	-49(%rax), %r9d
	movl	$1, %eax
	subl	$49, %r10d
	orl	%r10d, %r9d
	je	.L5
	addl	$1, %ecx
	movl	$2, %eax
.L5:
	addl	%eax, %edx
	leal	(%rcx,%rdi), %eax
	andl	$1, %eax
	leal	(%rdx,%rdx), %r9d
	imulq	$204, %rax, %rax
	movslq	%r9d, %r9
	addq	%r9, %rax
	addq	%r15, %rax
	cmpl	%ecx, %r8d
	jle	.L13
.L3:
	movzbl	(%rax), %r9d
	movl	%edx, %r10d
	xorl	%r11d, %r11d
	notl	%r10d
	addl	%esi, %r10d
	cmpb	$49, %r9b
	setg	%r11b
	orl	%r11d, %r10d
	je	.L13
	cmpl	%edx, %esi
	jle	.L17
	cmpb	$49, %r9b
	jle	.L6
.L17:
	movl	$-1, %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %r8d
.L4:
	testl	%edi, %edi
	je	.L27
	xorl	%edi, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L27:
	cmpl	%r8d, %esi
	movl	%r8d, %esi
	leaq	.LC1(%rip), %rdi
	movq	%rax, z(%rip)
	cmovl	%r13, %rdi
	xorl	%eax, %eax
	movl	%r8d, m(%rip)
	movl	%r14d, i(%rip)
	movl	%edx, p(%rip)
	call	printf@PLT
	jmp	.L2
.L26:
	xorl	%r8d, %r8d
	jmp	.L4
.L25:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	z
	.align 8
	.type	z, @object
	.size	z, 8
z:
	.zero	8
	.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	"NA\n"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %[^\n] %[^\n]"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	a(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$-1, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	204(%r15), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	n(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%r12, %rcx
	movq	%r15, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	n(%rip), %esi
	imull	%esi, %eax
	movl	%eax, m(%rip)
	movl	%eax, %r8d
	testl	%eax, %eax
	je	.L25
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edi, %rax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	imulq	$204, %rax, %rax
	addq	%r15, %rax
	testl	%r8d, %r8d
	jg	.L3
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L6:
	movsbl	2(%rax), %r10d
	movsbl	%r9b, %eax
	leal	-49(%rax), %r9d
	movl	$1, %eax
	subl	$49, %r10d
	orl	%r10d, %r9d
	je	.L5
	addl	$1, %ecx
	movl	$2, %eax
.L5:
	addl	%eax, %edx
	leal	(%rcx,%rdi), %eax
	andl	$1, %eax
	leal	(%rdx,%rdx), %r9d
	imulq	$204, %rax, %rax
	movslq	%r9d, %r9
	addq	%r9, %rax
	addq	%r15, %rax
	cmpl	%ecx, %r8d
	jle	.L13
.L3:
	movzbl	(%rax), %r9d
	movl	%edx, %r10d
	xorl	%r11d, %r11d
	notl	%r10d
	addl	%esi, %r10d
	cmpb	$49, %r9b
	setg	%r11b
	orl	%r11d, %r10d
	je	.L13
	cmpl	%edx, %esi
	jle	.L17
	cmpb	$49, %r9b
	jle	.L6
.L17:
	movl	$-1, %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %r8d
.L4:
	testl	%edi, %edi
	je	.L27
	xorl	%edi, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L27:
	cmpl	%r8d, %esi
	movl	%r8d, %esi
	leaq	.LC1(%rip), %rdi
	movq	%rax, z(%rip)
	cmovl	%r13, %rdi
	xorl	%eax, %eax
	movl	%r8d, m(%rip)
	movl	%r14d, i(%rip)
	movl	%edx, p(%rip)
	call	printf@PLT
	jmp	.L2
.L26:
	xorl	%r8d, %r8d
	jmp	.L4
.L25:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	z
	.align 8
	.type	z, @object
	.size	z, 8
z:
	.zero	8
	.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:

char*z,a[2][204];n,m,i,p;main(c){for(;m=scanf("%d %[^\n] %[^\n]",&n,a,a+1)*n;printf(m>n?"NA\n":"%d\n",m))for(i=2;i--;m=c)for(c=p=0;z=p+p+a[c+i&1],c<m&&*z>49|n+~p;)p+=p<n&*z<50?*z-49|z[2]-49?++c,2:1:-1;}
8
0 0 0 2 2 2 0 0
1 1 1 1 1 0 0 0
4
1 1 2 2
0 0 2 2
0
 8
0 0 0 2 2 2 0 0
1 1 1 1 1 0 0 0
2
1 1 2 2
0 0 2 2
0
 8
0 0 0 2 2 2 0 0
0 1 1 1 1 0 0 0
2
1 1 2 2
0 0 2 2
0
 8
0 0 0 2 2 2 0 1
1 1 1 1 0 0 0 0
4
1 1 2 2
0 0 2 2
0
 8
0 0 0 2 2 2 0 0
1 1 2 1 1 0 0 0
2
1 1 2 2
0 0 2 2
0
 8
0 0 0 2 2 1 0 0
1 1 1 1 1 0 0 -1
4
1 1 2 3
0 0 2 2
0
 8
0 0 0 2 2 1 1 0
1 0 1 1 1 0 0 -1
4
1 1 4 5
-1 0 2 2
0
 8
0 0 0 2 2 1 1 0
1 0 1 1 1 0 0 -1
4
1 1 4 5
-1 0 2 1
0
 8
0 0 0 2 2 2 0 -1
1 1 1 1 2 0 0 1
2
1 1 2 2
0 0 2 2
0
 8
0 0 0 2 2 2 0 1
1 1 1 1 0 0 0 0
4
1 0 2 1
0 0 2 2
0

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

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

```c
char*z,a[2][204];n,m,i,p;main(c){for(;m=scanf("%d %[^\n] %[^\n]",&n,a,a+1)*n;printf(m>n?"NA\n":"%d\n",m))for(i=2;i--;m=c)for(c=p=0;z=p+p+a[c+i&1],c<m&&*z>49|n+~p;)p+=p<n&*z<50?*z-49|z[2]-49?++c,2:1:-1;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	z
	.bss
	.align 8
	.type	z, @object
	.size	z, 8
z:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.section	.rodata
.LC0:
	.string	"NA\n"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %[^\n] %[^\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	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L15:
	movl	$2, i(%rip)
	jmp	.L3
.L12:
	movl	$0, p(%rip)
	movl	p(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L11:
	movl	p(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	setl	%dl
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	setle	%al
	andl	%edx, %eax
	testb	%al, %al
	je	.L5
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-49(%rax), %edx
	movq	z(%rip), %rax
	addq	$2, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$49, %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	addl	$1, -4(%rbp)
	movl	$2, %edx
	jmp	.L8
.L6:
	movl	$1, %edx
	jmp	.L8
.L5:
	movl	$-1, %edx
.L8:
	movl	p(%rip), %eax
	addl	%edx, %eax
	movl	%eax, p(%rip)
.L4:
	movl	i(%rip), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	andl	$1, %eax
	cltq
	imulq	$204, %rax, %rax
	leaq	a(%rip), %rdx
	addq	%rax, %rdx
	movl	p(%rip), %eax
	addl	%eax, %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, z(%rip)
	movl	m(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L9
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	setg	%al
	movzbl	%al, %edx
	movl	p(%rip), %eax
	notl	%eax
	movl	%eax, %ecx
	movl	n(%rip), %eax
	addl	%ecx, %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	testl	%eax, %eax
	jne	.L11
	movl	-4(%rbp), %eax
	movl	%eax, m(%rip)
.L3:
	movl	i(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, i(%rip)
	testl	%eax, %eax
	jne	.L12
	movl	m(%rip), %edx
	movl	m(%rip), %ecx
	movl	n(%rip), %eax
	cmpl	%eax, %ecx
	jle	.L13
	leaq	.LC0(%rip), %rax
	jmp	.L14
.L13:
	leaq	.LC1(%rip), %rax
.L14:
	movl	%edx, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	204+a(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %edx
	imull	%edx, %eax
	movl	%eax, m(%rip)
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	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
	.globl	z
	.bss
	.align 8
	.type	z, @object
	.size	z, 8
z:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.section	.rodata
.LC0:
	.string	"NA\n"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %[^\n] %[^\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	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L15:
	movl	$2, i(%rip)
	jmp	.L3
.L12:
	movl	$0, p(%rip)
	movl	p(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L11:
	movl	p(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	setl	%dl
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	setle	%al
	andl	%edx, %eax
	testb	%al, %al
	je	.L5
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	leal	-49(%rax), %edx
	movq	z(%rip), %rax
	addq	$2, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$49, %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	addl	$1, -4(%rbp)
	movl	$2, %edx
	jmp	.L8
.L6:
	movl	$1, %edx
	jmp	.L8
.L5:
	movl	$-1, %edx
.L8:
	movl	p(%rip), %eax
	addl	%edx, %eax
	movl	%eax, p(%rip)
.L4:
	movl	i(%rip), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	andl	$1, %eax
	cltq
	imulq	$204, %rax, %rax
	leaq	a(%rip), %rdx
	addq	%rax, %rdx
	movl	p(%rip), %eax
	addl	%eax, %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, z(%rip)
	movl	m(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L9
	movq	z(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	setg	%al
	movzbl	%al, %edx
	movl	p(%rip), %eax
	notl	%eax
	movl	%eax, %ecx
	movl	n(%rip), %eax
	addl	%ecx, %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	testl	%eax, %eax
	jne	.L11
	movl	-4(%rbp), %eax
	movl	%eax, m(%rip)
.L3:
	movl	i(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, i(%rip)
	testl	%eax, %eax
	jne	.L12
	movl	m(%rip), %edx
	movl	m(%rip), %ecx
	movl	n(%rip), %eax
	cmpl	%eax, %ecx
	jle	.L13
	leaq	.LC0(%rip), %rax
	jmp	.L14
.L13:
	leaq	.LC1(%rip), %rax
.L14:
	movl	%edx, %esi
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	204+a(%rip), %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %edx
	imull	%edx, %eax
	movl	%eax, m(%rip)
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	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:
