Given the following C code and 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;}```

Assembly Code:

```assembly
	.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:
```

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	"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
```assembly
	.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:
```
```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;}```
Given the following C 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;}```

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:

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 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;}```

Assembly Code:

```assembly
	.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:
```

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	"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:
```