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

```c
p[]={-1,0,1,-2,2,-2,2,-2,2,-1,0,1};
P[]={-2,-2,-2,-1,-1,0,0,1,1,2,2,2};
s[]={-1,0,1,-1,0,1,-1,0,1};
S[]={-1,-1,-1,0,0,0,1,1,1};
m[10],M[10];
int D(x,y,d,n){
int i=0,j;
for(;i<12;i++)for(j=0;j<9;j++)if(
	x+p[i]==m[d]+s[j]&&y+P[i]==M[d]+S[j]&&
	0<=x+p[i]&&x+p[i]<10&&
	0<=y+P[i]&&y+P[i]<10
){
	if(d==n-1||D(x+p[i],y+P[i],d+1,n))return 1;
}
return 0;
}
main(X,Y,n,i,x,y){for(;scanf("%d%d%d",&X,&Y,&n)>2;puts(D(X,Y,0,n)?"OK":"NA"))for(i=0;i<n;i++)scanf("%d%d",m+i,M+i);exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.data
	.align 32
	.type	p, @object
	.size	p, 48
p:
	.long	-1
	.long	0
	.long	1
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-1
	.long	0
	.long	1
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 48
P:
	.long	-2
	.long	-2
	.long	-2
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	2
	.long	2
	.long	2
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 36
s:
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 36
S:
	.long	-1
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	0
	.long	1
	.long	1
	.long	1
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 40
m:
	.zero	40
	.globl	M
	.align 32
	.type	M, @object
	.size	M, 40
M:
	.zero	40
	.text
	.globl	D
	.type	D, @function
D:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jne	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jne	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jg	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jg	.L4
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -28(%rbp)
	je	.L5
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	P(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-24(%rbp), %eax
	leal	(%rcx,%rax), %esi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	leal	(%rcx,%rax), %edi
	movl	-32(%rbp), %eax
	movl	%eax, %ecx
	movl	$0, %eax
	call	D
	testl	%eax, %eax
	je	.L4
.L5:
	movl	$1, %eax
	jmp	.L6
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$8, -4(%rbp)
	jle	.L7
	addl	$1, -8(%rbp)
.L2:
	cmpl	$11, -8(%rbp)
	jle	.L8
	movl	$0, %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"OK"
.LC2:
	.string	"NA"
.LC3:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	%r9d, -24(%rbp)
	jmp	.L10
.L15:
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -16(%rbp)
.L11:
	movl	-12(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %esi
	movl	-4(%rbp), %eax
	movl	%edx, %ecx
	movl	$0, %edx
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	testl	%eax, %eax
	je	.L13
	leaq	.LC1(%rip), %rax
	jmp	.L14
.L13:
	leaq	.LC2(%rip), %rax
.L14:
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	leaq	-12(%rbp), %rcx
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$2, %eax
	jg	.L15
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	D
	.type	D, @function
D:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	m(%rip), %rax
	movl	%edi, %r10d
	leal	-1(%rcx), %r11d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	M(%rip), %r15
	leaq	p(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %r9
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	P(%rip), %rbx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	(%rax,%r13,4), %eax
	movl	s(%rip), %edi
	movl	4+S(%rip), %edx
	addl	%eax, %edi
	movl	%edi, 4(%rsp)
	movl	S(%rip), %edi
	movl	%edx, 48(%rsp)
	movl	12+s(%rip), %edx
	movl	%edi, 44(%rsp)
	movl	4+s(%rip), %edi
	addl	%eax, %edx
	addl	%eax, %edi
	movl	%edx, 16(%rsp)
	movl	12+S(%rip), %edx
	movl	%edi, 8(%rsp)
	movl	8+s(%rip), %edi
	movl	%edx, 56(%rsp)
	movl	20+s(%rip), %edx
	addl	%eax, %edi
	movl	%edi, 12(%rsp)
	movl	8+S(%rip), %edi
	addl	%eax, %edx
	movl	%edx, 24(%rsp)
	movl	20+S(%rip), %edx
	movl	%edi, 52(%rsp)
	movl	16+s(%rip), %edi
	movl	%edx, 64(%rsp)
	addl	%eax, %edi
	movl	%edi, 20(%rsp)
	movl	16+S(%rip), %edi
	movl	%edi, 60(%rsp)
	movl	24+s(%rip), %edi
	movl	28+s(%rip), %edx
	addl	%eax, %edi
	addl	%eax, %edx
	addl	32+s(%rip), %eax
	movl	%edi, 28(%rsp)
	movl	%edx, 36(%rsp)
	movl	24+S(%rip), %edi
	movl	%eax, 32(%rsp)
	movl	28+S(%rip), %edx
	movl	32+S(%rip), %eax
	movl	%edi, 68(%rsp)
	movl	%edx, 72(%rsp)
	movl	%eax, 40(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	8(%rsp), %ebp
	je	.L136
.L24:
	cmpl	12(%rsp), %ebp
	je	.L137
.L25:
	cmpl	16(%rsp), %ebp
	je	.L138
.L26:
	cmpl	20(%rsp), %ebp
	je	.L139
.L27:
	cmpl	24(%rsp), %ebp
	je	.L140
.L28:
	cmpl	28(%rsp), %ebp
	je	.L141
.L29:
	cmpl	36(%rsp), %ebp
	je	.L142
.L30:
	cmpl	32(%rsp), %ebp
	je	.L143
.L3:
	addq	$4, %rbx
	leaq	48+P(%rip), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	je	.L32
.L2:
	movl	(%r14), %ebp
	addl	%r10d, %ebp
	cmpl	$9, %ebp
	setbe	%r8b
	cmpl	%r9d, %r11d
	je	.L144
	cmpl	4(%rsp), %ebp
	jne	.L23
	movl	(%rbx), %esi
	movl	44(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L23
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L23
	movl	4(%rsp), %edi
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L23
.L48:
	addq	$104, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %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
	.p2align 4,,10
	.p2align 3
.L136:
	.cfi_restore_state
	movl	(%rbx), %esi
	movl	48(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L24
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L24
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L24
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L137:
	movl	(%rbx), %esi
	movl	52(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L25
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L25
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L25
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L138:
	movl	(%rbx), %esi
	movl	56(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L26
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L26
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L26
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L139:
	movl	(%rbx), %esi
	movl	60(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L27
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L27
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L27
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L140:
	movl	(%rbx), %esi
	movl	64(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L28
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L28
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L28
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L141:
	movl	(%rbx), %esi
	movl	68(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L29
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L29
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L29
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L142:
	movl	(%rbx), %esi
	movl	72(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L30
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L30
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L30
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L143:
	movl	(%rbx), %esi
	movl	40(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L3
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L3
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 88(%rsp)
	movl	%r11d, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movl	84(%rsp), %r11d
	movl	88(%rsp), %r10d
	je	.L3
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L32:
	addq	$104, %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
.L144:
	.cfi_restore_state
	cmpl	4(%rsp), %ebp
	je	.L145
.L7:
	cmpl	8(%rsp), %ebp
	je	.L146
.L9:
	cmpl	12(%rsp), %ebp
	je	.L147
.L11:
	cmpl	16(%rsp), %ebp
	je	.L148
.L13:
	cmpl	20(%rsp), %ebp
	je	.L149
.L15:
	cmpl	24(%rsp), %ebp
	je	.L150
.L17:
	cmpl	28(%rsp), %ebp
	je	.L151
.L19:
	cmpl	36(%rsp), %ebp
	je	.L152
.L21:
	cmpl	32(%rsp), %ebp
	jne	.L3
.L153:
	movl	(%rbx), %eax
	movl	40(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L3
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	je	.L3
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L152:
	movl	(%rbx), %eax
	movl	72(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L21
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	32(%rsp), %ebp
	jne	.L3
	jmp	.L153
.L145:
	movl	(%rbx), %eax
	movslq	%r11d, %rdx
	movl	44(%rsp), %edi
	addl	(%r15,%rdx,4), %edi
	addl	%r12d, %eax
	cmpl	%eax, %edi
	jne	.L7
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	8(%rsp), %ebp
	jne	.L9
.L146:
	movl	(%rbx), %eax
	movl	48(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L9
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	12(%rsp), %ebp
	jne	.L11
.L147:
	movl	(%rbx), %eax
	movl	52(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L11
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	16(%rsp), %ebp
	jne	.L13
.L148:
	movl	(%rbx), %eax
	movl	56(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L13
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	20(%rsp), %ebp
	jne	.L15
.L149:
	movl	(%rbx), %eax
	movl	60(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L15
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	24(%rsp), %ebp
	jne	.L17
.L150:
	movl	(%rbx), %eax
	movl	64(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L17
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	28(%rsp), %ebp
	jne	.L19
.L151:
	movl	(%rbx), %eax
	movl	68(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L19
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	je	.L19
	jmp	.L48
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"NA"
.LC1:
	.string	"OK"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	subq	$488, %rsp
	.cfi_def_cfa_offset 544
	leaq	468(%rsp), %rax
	movl	%edi, 476(%rsp)
	movq	%rax, 328(%rsp)
	leaq	472(%rsp), %rax
	movq	%rax, 336(%rsp)
	leaq	476(%rsp), %rax
	movl	%esi, 472(%rsp)
	movl	%edx, 468(%rsp)
	movq	%rax, 344(%rsp)
	.p2align 4,,10
	.p2align 3
.L155:
	movq	328(%rsp), %rcx
	movq	336(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	movq	344(%rsp), %rsi
	call	scanf@PLT
	cmpl	$2, %eax
	jle	.L189
	movl	468(%rsp), %ecx
	leaq	m(%rip), %r13
	xorl	%r12d, %r12d
	leaq	M(%rip), %rbp
	leaq	.LC2(%rip), %rbx
	testl	%ecx, %ecx
	jle	.L191
	.p2align 4,,10
	.p2align 3
.L156:
	leaq	0(%rbp,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	468(%rsp), %ecx
	addq	$1, %r12
	addq	$4, %r13
	cmpl	%r12d, %ecx
	jg	.L156
.L191:
	movl	472(%rsp), %eax
	leaq	36+s(%rip), %r11
	movl	%eax, 76(%rsp)
	movl	476(%rsp), %eax
	movl	%eax, 188(%rsp)
	movl	m(%rip), %eax
	movl	%eax, 8(%rsp)
	movl	M(%rip), %eax
	movl	%eax, 96(%rsp)
	movl	4+m(%rip), %eax
	movl	%eax, 16(%rsp)
	movl	4+M(%rip), %eax
	movl	%eax, 100(%rsp)
	movl	8+m(%rip), %eax
	movl	%eax, 24(%rsp)
	movl	8+M(%rip), %eax
	movl	%eax, 136(%rsp)
	movl	12+m(%rip), %eax
	movl	%eax, 28(%rsp)
	movl	12+M(%rip), %eax
	movl	%eax, 140(%rsp)
	movl	16+m(%rip), %eax
	movl	%eax, 284(%rsp)
	movl	16+M(%rip), %eax
	movl	%eax, 164(%rsp)
	movl	20+m(%rip), %eax
	movl	%eax, 288(%rsp)
	movl	20+M(%rip), %eax
	movl	%eax, 172(%rsp)
	movl	24+m(%rip), %eax
	movl	%eax, 292(%rsp)
	movl	24+M(%rip), %eax
	movl	%eax, 180(%rsp)
	movl	28+m(%rip), %edx
	movl	s(%rip), %eax
	movl	S(%rip), %edi
	movl	4+s(%rip), %ebx
	addl	%edx, %eax
	movl	%eax, 312(%rsp)
	movl	28+M(%rip), %eax
	addl	%edx, %ebx
	movl	%ebx, 212(%rsp)
	movl	8+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 232(%rsp)
	movl	4+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 216(%rsp)
	movl	12+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 236(%rsp)
	movl	8+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 220(%rsp)
	movl	16+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 240(%rsp)
	movl	12+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 224(%rsp)
	movl	20+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 244(%rsp)
	movl	16+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 316(%rsp)
	movl	24+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 248(%rsp)
	movl	20+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 320(%rsp)
	movl	28+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 252(%rsp)
	movl	24+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 324(%rsp)
	addl	%eax, %edi
	movl	%edi, 256(%rsp)
	movl	28+S(%rip), %edi
	addl	32+s(%rip), %edx
	addl	%eax, %edi
	addl	32+S(%rip), %eax
	movl	%edx, 228(%rsp)
	movl	%eax, 280(%rsp)
	leaq	P(%rip), %rax
	movq	%rax, 40(%rsp)
	leaq	p(%rip), %rax
	movl	%edi, 260(%rsp)
	movq	%rax, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L157:
	movq	48(%rsp), %rdx
	leaq	s(%rip), %r10
	movl	188(%rsp), %eax
	leaq	S(%rip), %r9
	addl	(%rdx), %eax
	cmpl	$9, %eax
	movl	%eax, (%rsp)
	movq	%r10, %rax
	movq	%r9, %r10
	setbe	161(%rsp)
	movq	%rax, %r9
	jmp	.L188
	.p2align 4,,10
	.p2align 3
.L158:
	addq	$4, %r9
	addq	$4, %r10
	cmpq	%r9, %r11
	je	.L332
.L188:
	movl	8(%rsp), %eax
	addl	(%r9), %eax
	cmpl	%eax, (%rsp)
	jne	.L158
	movq	40(%rsp), %rax
	movl	76(%rsp), %edx
	addl	(%rax), %edx
	movl	96(%rsp), %eax
	addl	(%r10), %eax
	movl	%edx, 32(%rsp)
	cmpl	%edx, %eax
	jne	.L158
	cmpl	$9, %edx
	setbe	%al
	testb	%al, 161(%rsp)
	je	.L158
	cmpl	$1, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movq	%r10, 264(%rsp)
	movq	%rax, 56(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 64(%rsp)
	movq	%r9, 272(%rsp)
	.p2align 4,,10
	.p2align 3
.L160:
	movq	64(%rsp), %rdi
	leaq	s(%rip), %r10
	movl	(%rsp), %eax
	leaq	S(%rip), %r9
	addl	(%rdi), %eax
	cmpl	$9, %eax
	movl	%eax, 4(%rsp)
	movq	%r10, %rax
	movq	%r9, %r10
	setbe	162(%rsp)
	movq	%rax, %r9
	jmp	.L187
	.p2align 4,,10
	.p2align 3
.L161:
	addq	$4, %r9
	addq	$4, %r10
	cmpq	%r9, %r11
	je	.L333
.L187:
	movl	16(%rsp), %eax
	addl	(%r9), %eax
	cmpl	%eax, 4(%rsp)
	jne	.L161
	movq	56(%rsp), %rax
	movl	32(%rsp), %edi
	addl	(%rax), %edi
	movl	100(%rsp), %eax
	addl	(%r10), %eax
	movl	%edi, 36(%rsp)
	cmpl	%edi, %eax
	jne	.L161
	cmpl	$9, %edi
	setbe	%al
	testb	%al, 162(%rsp)
	je	.L161
	cmpl	$2, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movq	%r10, 296(%rsp)
	movq	%rax, 80(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 88(%rsp)
	movq	%r9, 304(%rsp)
	.p2align 4,,10
	.p2align 3
.L162:
	movq	88(%rsp), %rbx
	leaq	s(%rip), %r10
	movl	4(%rsp), %eax
	leaq	S(%rip), %r9
	addl	(%rbx), %eax
	cmpl	$9, %eax
	movl	%eax, 12(%rsp)
	movq	%r10, %rax
	movq	%r9, %r10
	setbe	163(%rsp)
	movq	%rax, %r9
	jmp	.L186
	.p2align 4,,10
	.p2align 3
.L163:
	addq	$4, %r9
	addq	$4, %r10
	cmpq	%r9, %r11
	je	.L334
.L186:
	movl	24(%rsp), %eax
	addl	(%r9), %eax
	cmpl	%eax, 12(%rsp)
	jne	.L163
	movq	80(%rsp), %rax
	movl	36(%rsp), %esi
	addl	(%rax), %esi
	movl	136(%rsp), %eax
	addl	(%r10), %eax
	movl	%esi, 72(%rsp)
	cmpl	%esi, %eax
	jne	.L163
	cmpl	$9, %esi
	setbe	%al
	testb	%al, 163(%rsp)
	je	.L163
	cmpl	$3, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movq	%r10, 352(%rsp)
	movq	%rax, 104(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 112(%rsp)
	movq	%r9, 360(%rsp)
	.p2align 4,,10
	.p2align 3
.L164:
	movq	112(%rsp), %rax
	movl	12(%rsp), %r8d
	leaq	s(%rip), %r9
	leaq	S(%rip), %r10
	addl	(%rax), %r8d
	cmpl	$9, %r8d
	movl	%r8d, 20(%rsp)
	movq	%r9, %r8
	movq	%r10, %r9
	setbe	200(%rsp)
	jmp	.L185
	.p2align 4,,10
	.p2align 3
.L165:
	addq	$4, %r8
	addq	$4, %r9
	cmpq	%r8, %r11
	je	.L335
.L185:
	movl	28(%rsp), %eax
	addl	(%r8), %eax
	cmpl	%eax, 20(%rsp)
	jne	.L165
	movq	104(%rsp), %rax
	movl	72(%rsp), %r10d
	addl	(%rax), %r10d
	movl	140(%rsp), %eax
	addl	(%r9), %eax
	cmpl	%r10d, %eax
	jne	.L165
	cmpl	$9, %r10d
	setbe	%al
	testb	%al, 200(%rsp)
	je	.L165
	cmpl	$4, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movq	%r9, 368(%rsp)
	movq	%rax, 120(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 128(%rsp)
	movq	%r8, 376(%rsp)
	movl	%r10d, 168(%rsp)
	movl	284(%rsp), %r10d
	.p2align 4,,10
	.p2align 3
.L166:
	movq	128(%rsp), %rax
	leaq	s(%rip), %r9
	movl	20(%rsp), %r15d
	leaq	S(%rip), %r8
	addl	(%rax), %r15d
	movq	%r9, %rax
	movl	%r10d, %r9d
	cmpl	$9, %r15d
	movl	%r15d, %r10d
	movq	%rax, %r15
	setbe	201(%rsp)
	jmp	.L184
	.p2align 4,,10
	.p2align 3
.L167:
	addq	$4, %r15
	addq	$4, %r8
	cmpq	%r15, %r11
	je	.L336
.L184:
	movl	(%r15), %eax
	addl	%r9d, %eax
	cmpl	%eax, %r10d
	jne	.L167
	movq	120(%rsp), %rax
	movl	168(%rsp), %r14d
	addl	(%rax), %r14d
	movl	164(%rsp), %eax
	addl	(%r8), %eax
	cmpl	%r14d, %eax
	jne	.L167
	cmpl	$9, %r14d
	setbe	%al
	testb	%al, 201(%rsp)
	je	.L167
	cmpl	$5, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movl	%r9d, 400(%rsp)
	movq	%rax, 144(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 152(%rsp)
	movl	%r14d, 176(%rsp)
	movq	%r8, 384(%rsp)
	movq	%r15, 392(%rsp)
	movl	%r10d, 204(%rsp)
	movl	288(%rsp), %r10d
	.p2align 4,,10
	.p2align 3
.L168:
	movq	152(%rsp), %rax
	movl	204(%rsp), %r15d
	leaq	S(%rip), %r9
	leaq	s(%rip), %r8
	movq	%r8, %rbx
	movq	%r9, %r8
	movl	%r10d, %r9d
	addl	(%rax), %r15d
	cmpl	$9, %r15d
	movl	%r15d, %r10d
	setbe	202(%rsp)
	jmp	.L183
	.p2align 4,,10
	.p2align 3
.L169:
	addq	$4, %rbx
	addq	$4, %r8
	cmpq	%rbx, %r11
	je	.L337
.L183:
	movl	(%rbx), %eax
	addl	%r9d, %eax
	cmpl	%eax, %r10d
	jne	.L169
	movq	144(%rsp), %rax
	movl	176(%rsp), %r15d
	addl	(%rax), %r15d
	movl	172(%rsp), %eax
	addl	(%r8), %eax
	cmpl	%r15d, %eax
	jne	.L169
	cmpl	$9, %r15d
	setbe	%al
	testb	%al, 202(%rsp)
	je	.L169
	cmpl	$6, %ecx
	je	.L216
	movq	%r8, 408(%rsp)
	leaq	P(%rip), %rax
	leaq	p(%rip), %rdx
	movq	%rbx, 416(%rsp)
	movl	%r15d, 184(%rsp)
	movl	292(%rsp), %r15d
	movl	%r10d, 208(%rsp)
	movq	%rdx, %r10
	movl	%r9d, 404(%rsp)
	movq	%rax, %r9
	.p2align 4,,10
	.p2align 3
.L170:
	movl	208(%rsp), %r12d
	addl	(%r10), %r12d
	movq	%r10, 192(%rsp)
	leaq	S(%rip), %rbp
	cmpl	$9, %r12d
	leaq	s(%rip), %rbx
	setbe	203(%rsp)
	jmp	.L182
	.p2align 4,,10
	.p2align 3
.L171:
	addq	$4, %rbx
	addq	$4, %rbp
	cmpq	%rbx, %r11
	je	.L338
.L182:
	movl	(%rbx), %eax
	addl	%r15d, %eax
	cmpl	%eax, %r12d
	jne	.L171
	movl	184(%rsp), %r14d
	movl	180(%rsp), %eax
	addl	(%r9), %r14d
	addl	0(%rbp), %eax
	cmpl	%r14d, %eax
	jne	.L171
	cmpl	$9, %r14d
	setbe	%al
	testb	%al, 203(%rsp)
	je	.L171
	cmpl	$7, %ecx
	je	.L216
	leaq	P(%rip), %r8
	leaq	p(%rip), %r10
	movl	%r15d, 448(%rsp)
	movl	312(%rsp), %r15d
	movq	%r9, 424(%rsp)
	movq	%r10, %r13
	movl	320(%rsp), %r9d
	movq	%rbx, 440(%rsp)
	movl	324(%rsp), %r10d
	movq	%r8, %rbx
	movq	%rbp, 432(%rsp)
	movl	316(%rsp), %r8d
	jmp	.L172
	.p2align 4,,10
	.p2align 3
.L173:
	cmpl	212(%rsp), %ebp
	je	.L339
.L174:
	cmpl	216(%rsp), %ebp
	je	.L340
.L175:
	cmpl	220(%rsp), %ebp
	je	.L341
.L176:
	cmpl	224(%rsp), %ebp
	je	.L342
.L177:
	cmpl	%r8d, %ebp
	je	.L343
.L178:
	cmpl	%r9d, %ebp
	je	.L344
.L179:
	cmpl	%r10d, %ebp
	je	.L345
.L180:
	cmpl	228(%rsp), %ebp
	je	.L346
.L181:
	addq	$4, %rbx
	leaq	48+P(%rip), %rax
	addq	$4, %r13
	cmpq	%rbx, %rax
	je	.L323
.L172:
	movl	0(%r13), %ebp
	addl	%r12d, %ebp
	cmpl	%r15d, %ebp
	jne	.L173
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %r15d
	setbe	%al
	testb	%al, %dl
	je	.L173
	cmpl	232(%rsp), %esi
	jne	.L173
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%r15d, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L173
.L216:
	leaq	.LC1(%rip), %rdi
	jmp	.L159
	.p2align 4,,10
	.p2align 3
.L332:
	addq	$4, 48(%rsp)
	movq	48(%rsp), %rax
	leaq	48+p(%rip), %rdi
	addq	$4, 40(%rsp)
	cmpq	%rax, %rdi
	jne	.L157
	leaq	.LC0(%rip), %rdi
.L159:
	call	puts@PLT
	jmp	.L155
	.p2align 4,,10
	.p2align 3
.L333:
	addq	$4, 64(%rsp)
	movq	64(%rsp), %rax
	leaq	48+p(%rip), %rbx
	addq	$4, 56(%rsp)
	cmpq	%rax, %rbx
	jne	.L160
	movq	264(%rsp), %r10
	movq	272(%rsp), %r9
	jmp	.L158
	.p2align 4,,10
	.p2align 3
.L334:
	addq	$4, 88(%rsp)
	movq	88(%rsp), %rax
	leaq	48+p(%rip), %rdx
	addq	$4, 80(%rsp)
	cmpq	%rax, %rdx
	jne	.L162
	movq	296(%rsp), %r10
	movq	304(%rsp), %r9
	jmp	.L161
	.p2align 4,,10
	.p2align 3
.L335:
	addq	$4, 112(%rsp)
	movq	112(%rsp), %rax
	leaq	48+p(%rip), %rbx
	addq	$4, 104(%rsp)
	cmpq	%rax, %rbx
	jne	.L164
	movq	352(%rsp), %r10
	movq	360(%rsp), %r9
	jmp	.L163
	.p2align 4,,10
	.p2align 3
.L336:
	leaq	48+p(%rip), %rdi
	addq	$4, 120(%rsp)
	movl	%r9d, %r10d
	addq	$4, 128(%rsp)
	movq	128(%rsp), %rax
	cmpq	%rax, %rdi
	jne	.L166
	movq	368(%rsp), %r9
	movq	376(%rsp), %r8
	jmp	.L165
	.p2align 4,,10
	.p2align 3
.L337:
	addq	$4, 152(%rsp)
	movq	152(%rsp), %rax
	leaq	48+p(%rip), %rbx
	movl	%r9d, %r10d
	addq	$4, 144(%rsp)
	cmpq	%rax, %rbx
	jne	.L168
	movl	204(%rsp), %r10d
	movl	400(%rsp), %r9d
	movq	384(%rsp), %r8
	movq	392(%rsp), %r15
	jmp	.L167
	.p2align 4,,10
	.p2align 3
.L338:
	movq	192(%rsp), %r10
	leaq	48+p(%rip), %rax
	addq	$4, %r9
	addq	$4, %r10
	cmpq	%r10, %rax
	jne	.L170
	movl	208(%rsp), %r10d
	movl	404(%rsp), %r9d
	movq	408(%rsp), %r8
	movq	416(%rsp), %rbx
	jmp	.L169
	.p2align 4,,10
	.p2align 3
.L343:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L178
	cmpl	252(%rsp), %esi
	jne	.L178
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L178
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L342:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L177
	cmpl	248(%rsp), %esi
	jne	.L177
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L177
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L341:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L176
	cmpl	244(%rsp), %esi
	jne	.L176
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L176
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L340:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %ebp
	setbe	%dl
	cmpl	$9, %esi
	setbe	%al
	testb	%al, %dl
	je	.L175
	cmpl	240(%rsp), %esi
	jne	.L175
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L175
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L339:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %ebp
	setbe	%dl
	cmpl	$9, %esi
	setbe	%al
	testb	%al, %dl
	je	.L174
	cmpl	236(%rsp), %esi
	jne	.L174
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L174
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L344:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L179
	cmpl	256(%rsp), %esi
	jne	.L179
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L179
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L346:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %ebp
	setbe	%dl
	cmpl	$9, %esi
	setbe	%al
	testb	%al, %dl
	je	.L181
	cmpl	280(%rsp), %esi
	jne	.L181
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L181
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L345:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L180
	cmpl	260(%rsp), %esi
	jne	.L180
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L180
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L323:
	movl	448(%rsp), %r15d
	movq	424(%rsp), %r9
	movq	432(%rsp), %rbp
	movq	440(%rsp), %rbx
	jmp	.L171
.L189:
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	M
	.bss
	.align 32
	.type	M, @object
	.size	M, 40
M:
	.zero	40
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 40
m:
	.zero	40
	.globl	S
	.data
	.align 32
	.type	S, @object
	.size	S, 36
S:
	.long	-1
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	0
	.long	1
	.long	1
	.long	1
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 36
s:
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 48
P:
	.long	-2
	.long	-2
	.long	-2
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	2
	.long	2
	.long	2
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 48
p:
	.long	-1
	.long	0
	.long	1
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-1
	.long	0
	.long	1
	.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
	.p2align 4
	.globl	D
	.type	D, @function
D:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	m(%rip), %rax
	movl	%edi, %r10d
	leal	-1(%rcx), %r11d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	M(%rip), %r15
	leaq	p(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %r9
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	P(%rip), %rbx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	(%rax,%r13,4), %eax
	movl	s(%rip), %edi
	movl	4+S(%rip), %edx
	addl	%eax, %edi
	movl	%edi, 4(%rsp)
	movl	S(%rip), %edi
	movl	%edx, 48(%rsp)
	movl	12+s(%rip), %edx
	movl	%edi, 44(%rsp)
	movl	4+s(%rip), %edi
	addl	%eax, %edx
	addl	%eax, %edi
	movl	%edx, 16(%rsp)
	movl	12+S(%rip), %edx
	movl	%edi, 8(%rsp)
	movl	8+s(%rip), %edi
	movl	%edx, 56(%rsp)
	movl	20+s(%rip), %edx
	addl	%eax, %edi
	movl	%edi, 12(%rsp)
	movl	8+S(%rip), %edi
	addl	%eax, %edx
	movl	%edx, 24(%rsp)
	movl	20+S(%rip), %edx
	movl	%edi, 52(%rsp)
	movl	16+s(%rip), %edi
	movl	%edx, 64(%rsp)
	addl	%eax, %edi
	movl	%edi, 20(%rsp)
	movl	16+S(%rip), %edi
	movl	%edi, 60(%rsp)
	movl	24+s(%rip), %edi
	movl	28+s(%rip), %edx
	addl	%eax, %edi
	addl	%eax, %edx
	addl	32+s(%rip), %eax
	movl	%edi, 28(%rsp)
	movl	%edx, 36(%rsp)
	movl	24+S(%rip), %edi
	movl	%eax, 32(%rsp)
	movl	28+S(%rip), %edx
	movl	32+S(%rip), %eax
	movl	%edi, 68(%rsp)
	movl	%edx, 72(%rsp)
	movl	%eax, 40(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	8(%rsp), %ebp
	je	.L136
.L24:
	cmpl	12(%rsp), %ebp
	je	.L137
.L25:
	cmpl	16(%rsp), %ebp
	je	.L138
.L26:
	cmpl	20(%rsp), %ebp
	je	.L139
.L27:
	cmpl	24(%rsp), %ebp
	je	.L140
.L28:
	cmpl	28(%rsp), %ebp
	je	.L141
.L29:
	cmpl	36(%rsp), %ebp
	je	.L142
.L30:
	cmpl	32(%rsp), %ebp
	je	.L143
.L3:
	addq	$4, %rbx
	leaq	48+P(%rip), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	je	.L32
.L2:
	movl	(%r14), %ebp
	addl	%r10d, %ebp
	cmpl	$9, %ebp
	setbe	%r8b
	cmpl	%r9d, %r11d
	je	.L144
	cmpl	4(%rsp), %ebp
	jne	.L23
	movl	(%rbx), %esi
	movl	44(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L23
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L23
	movl	4(%rsp), %edi
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L23
.L48:
	addq	$104, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %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
	.p2align 4,,10
	.p2align 3
.L136:
	.cfi_restore_state
	movl	(%rbx), %esi
	movl	48(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L24
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L24
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L24
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L137:
	movl	(%rbx), %esi
	movl	52(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L25
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L25
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L25
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L138:
	movl	(%rbx), %esi
	movl	56(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L26
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L26
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L26
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L139:
	movl	(%rbx), %esi
	movl	60(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L27
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L27
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L27
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L140:
	movl	(%rbx), %esi
	movl	64(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L28
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L28
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L28
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L141:
	movl	(%rbx), %esi
	movl	68(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L29
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L29
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L29
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L142:
	movl	(%rbx), %esi
	movl	72(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L30
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L30
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 92(%rsp)
	movl	%r11d, 88(%rsp)
	movb	%r8b, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movzbl	84(%rsp), %r8d
	movl	88(%rsp), %r11d
	movl	92(%rsp), %r10d
	je	.L30
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L143:
	movl	(%rbx), %esi
	movl	40(%rsp), %eax
	addl	(%r15,%r13,4), %eax
	addl	%r12d, %esi
	cmpl	%esi, %eax
	jne	.L3
	cmpl	$9, %esi
	setbe	%al
	testb	%r8b, %al
	je	.L3
	leal	1(%r9), %edx
	xorl	%eax, %eax
	movl	%ebp, %edi
	movl	%r10d, 88(%rsp)
	movl	%r11d, 84(%rsp)
	movl	%r9d, 80(%rsp)
	movl	%ecx, 76(%rsp)
	call	D
	movl	76(%rsp), %ecx
	movl	80(%rsp), %r9d
	testl	%eax, %eax
	movl	84(%rsp), %r11d
	movl	88(%rsp), %r10d
	je	.L3
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L32:
	addq	$104, %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
.L144:
	.cfi_restore_state
	cmpl	4(%rsp), %ebp
	je	.L145
.L7:
	cmpl	8(%rsp), %ebp
	je	.L146
.L9:
	cmpl	12(%rsp), %ebp
	je	.L147
.L11:
	cmpl	16(%rsp), %ebp
	je	.L148
.L13:
	cmpl	20(%rsp), %ebp
	je	.L149
.L15:
	cmpl	24(%rsp), %ebp
	je	.L150
.L17:
	cmpl	28(%rsp), %ebp
	je	.L151
.L19:
	cmpl	36(%rsp), %ebp
	je	.L152
.L21:
	cmpl	32(%rsp), %ebp
	jne	.L3
.L153:
	movl	(%rbx), %eax
	movl	40(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L3
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	je	.L3
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L152:
	movl	(%rbx), %eax
	movl	72(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L21
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	32(%rsp), %ebp
	jne	.L3
	jmp	.L153
.L145:
	movl	(%rbx), %eax
	movslq	%r11d, %rdx
	movl	44(%rsp), %edi
	addl	(%r15,%rdx,4), %edi
	addl	%r12d, %eax
	cmpl	%eax, %edi
	jne	.L7
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	8(%rsp), %ebp
	jne	.L9
.L146:
	movl	(%rbx), %eax
	movl	48(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L9
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	12(%rsp), %ebp
	jne	.L11
.L147:
	movl	(%rbx), %eax
	movl	52(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L11
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	16(%rsp), %ebp
	jne	.L13
.L148:
	movl	(%rbx), %eax
	movl	56(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L13
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	20(%rsp), %ebp
	jne	.L15
.L149:
	movl	(%rbx), %eax
	movl	60(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L15
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	24(%rsp), %ebp
	jne	.L17
.L150:
	movl	(%rbx), %eax
	movl	64(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L17
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	jne	.L48
	cmpl	28(%rsp), %ebp
	jne	.L19
.L151:
	movl	(%rbx), %eax
	movl	68(%rsp), %edx
	addl	(%r15,%r13,4), %edx
	addl	%r12d, %eax
	cmpl	%eax, %edx
	jne	.L19
	cmpl	$9, %eax
	setbe	%al
	testb	%r8b, %al
	je	.L19
	jmp	.L48
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"NA"
.LC1:
	.string	"OK"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	subq	$488, %rsp
	.cfi_def_cfa_offset 544
	leaq	468(%rsp), %rax
	movl	%edi, 476(%rsp)
	movq	%rax, 328(%rsp)
	leaq	472(%rsp), %rax
	movq	%rax, 336(%rsp)
	leaq	476(%rsp), %rax
	movl	%esi, 472(%rsp)
	movl	%edx, 468(%rsp)
	movq	%rax, 344(%rsp)
	.p2align 4,,10
	.p2align 3
.L155:
	movq	328(%rsp), %rcx
	movq	336(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	movq	344(%rsp), %rsi
	call	scanf@PLT
	cmpl	$2, %eax
	jle	.L189
	movl	468(%rsp), %ecx
	leaq	m(%rip), %r13
	xorl	%r12d, %r12d
	leaq	M(%rip), %rbp
	leaq	.LC2(%rip), %rbx
	testl	%ecx, %ecx
	jle	.L191
	.p2align 4,,10
	.p2align 3
.L156:
	leaq	0(%rbp,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	468(%rsp), %ecx
	addq	$1, %r12
	addq	$4, %r13
	cmpl	%r12d, %ecx
	jg	.L156
.L191:
	movl	472(%rsp), %eax
	leaq	36+s(%rip), %r11
	movl	%eax, 76(%rsp)
	movl	476(%rsp), %eax
	movl	%eax, 188(%rsp)
	movl	m(%rip), %eax
	movl	%eax, 8(%rsp)
	movl	M(%rip), %eax
	movl	%eax, 96(%rsp)
	movl	4+m(%rip), %eax
	movl	%eax, 16(%rsp)
	movl	4+M(%rip), %eax
	movl	%eax, 100(%rsp)
	movl	8+m(%rip), %eax
	movl	%eax, 24(%rsp)
	movl	8+M(%rip), %eax
	movl	%eax, 136(%rsp)
	movl	12+m(%rip), %eax
	movl	%eax, 28(%rsp)
	movl	12+M(%rip), %eax
	movl	%eax, 140(%rsp)
	movl	16+m(%rip), %eax
	movl	%eax, 284(%rsp)
	movl	16+M(%rip), %eax
	movl	%eax, 164(%rsp)
	movl	20+m(%rip), %eax
	movl	%eax, 288(%rsp)
	movl	20+M(%rip), %eax
	movl	%eax, 172(%rsp)
	movl	24+m(%rip), %eax
	movl	%eax, 292(%rsp)
	movl	24+M(%rip), %eax
	movl	%eax, 180(%rsp)
	movl	28+m(%rip), %edx
	movl	s(%rip), %eax
	movl	S(%rip), %edi
	movl	4+s(%rip), %ebx
	addl	%edx, %eax
	movl	%eax, 312(%rsp)
	movl	28+M(%rip), %eax
	addl	%edx, %ebx
	movl	%ebx, 212(%rsp)
	movl	8+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 232(%rsp)
	movl	4+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 216(%rsp)
	movl	12+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 236(%rsp)
	movl	8+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 220(%rsp)
	movl	16+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 240(%rsp)
	movl	12+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 224(%rsp)
	movl	20+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 244(%rsp)
	movl	16+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 316(%rsp)
	movl	24+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 248(%rsp)
	movl	20+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 320(%rsp)
	movl	28+s(%rip), %ebx
	addl	%eax, %edi
	movl	%edi, 252(%rsp)
	movl	24+S(%rip), %edi
	addl	%edx, %ebx
	movl	%ebx, 324(%rsp)
	addl	%eax, %edi
	movl	%edi, 256(%rsp)
	movl	28+S(%rip), %edi
	addl	32+s(%rip), %edx
	addl	%eax, %edi
	addl	32+S(%rip), %eax
	movl	%edx, 228(%rsp)
	movl	%eax, 280(%rsp)
	leaq	P(%rip), %rax
	movq	%rax, 40(%rsp)
	leaq	p(%rip), %rax
	movl	%edi, 260(%rsp)
	movq	%rax, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L157:
	movq	48(%rsp), %rdx
	leaq	s(%rip), %r10
	movl	188(%rsp), %eax
	leaq	S(%rip), %r9
	addl	(%rdx), %eax
	cmpl	$9, %eax
	movl	%eax, (%rsp)
	movq	%r10, %rax
	movq	%r9, %r10
	setbe	161(%rsp)
	movq	%rax, %r9
	jmp	.L188
	.p2align 4,,10
	.p2align 3
.L158:
	addq	$4, %r9
	addq	$4, %r10
	cmpq	%r9, %r11
	je	.L332
.L188:
	movl	8(%rsp), %eax
	addl	(%r9), %eax
	cmpl	%eax, (%rsp)
	jne	.L158
	movq	40(%rsp), %rax
	movl	76(%rsp), %edx
	addl	(%rax), %edx
	movl	96(%rsp), %eax
	addl	(%r10), %eax
	movl	%edx, 32(%rsp)
	cmpl	%edx, %eax
	jne	.L158
	cmpl	$9, %edx
	setbe	%al
	testb	%al, 161(%rsp)
	je	.L158
	cmpl	$1, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movq	%r10, 264(%rsp)
	movq	%rax, 56(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 64(%rsp)
	movq	%r9, 272(%rsp)
	.p2align 4,,10
	.p2align 3
.L160:
	movq	64(%rsp), %rdi
	leaq	s(%rip), %r10
	movl	(%rsp), %eax
	leaq	S(%rip), %r9
	addl	(%rdi), %eax
	cmpl	$9, %eax
	movl	%eax, 4(%rsp)
	movq	%r10, %rax
	movq	%r9, %r10
	setbe	162(%rsp)
	movq	%rax, %r9
	jmp	.L187
	.p2align 4,,10
	.p2align 3
.L161:
	addq	$4, %r9
	addq	$4, %r10
	cmpq	%r9, %r11
	je	.L333
.L187:
	movl	16(%rsp), %eax
	addl	(%r9), %eax
	cmpl	%eax, 4(%rsp)
	jne	.L161
	movq	56(%rsp), %rax
	movl	32(%rsp), %edi
	addl	(%rax), %edi
	movl	100(%rsp), %eax
	addl	(%r10), %eax
	movl	%edi, 36(%rsp)
	cmpl	%edi, %eax
	jne	.L161
	cmpl	$9, %edi
	setbe	%al
	testb	%al, 162(%rsp)
	je	.L161
	cmpl	$2, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movq	%r10, 296(%rsp)
	movq	%rax, 80(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 88(%rsp)
	movq	%r9, 304(%rsp)
	.p2align 4,,10
	.p2align 3
.L162:
	movq	88(%rsp), %rbx
	leaq	s(%rip), %r10
	movl	4(%rsp), %eax
	leaq	S(%rip), %r9
	addl	(%rbx), %eax
	cmpl	$9, %eax
	movl	%eax, 12(%rsp)
	movq	%r10, %rax
	movq	%r9, %r10
	setbe	163(%rsp)
	movq	%rax, %r9
	jmp	.L186
	.p2align 4,,10
	.p2align 3
.L163:
	addq	$4, %r9
	addq	$4, %r10
	cmpq	%r9, %r11
	je	.L334
.L186:
	movl	24(%rsp), %eax
	addl	(%r9), %eax
	cmpl	%eax, 12(%rsp)
	jne	.L163
	movq	80(%rsp), %rax
	movl	36(%rsp), %esi
	addl	(%rax), %esi
	movl	136(%rsp), %eax
	addl	(%r10), %eax
	movl	%esi, 72(%rsp)
	cmpl	%esi, %eax
	jne	.L163
	cmpl	$9, %esi
	setbe	%al
	testb	%al, 163(%rsp)
	je	.L163
	cmpl	$3, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movq	%r10, 352(%rsp)
	movq	%rax, 104(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 112(%rsp)
	movq	%r9, 360(%rsp)
	.p2align 4,,10
	.p2align 3
.L164:
	movq	112(%rsp), %rax
	movl	12(%rsp), %r8d
	leaq	s(%rip), %r9
	leaq	S(%rip), %r10
	addl	(%rax), %r8d
	cmpl	$9, %r8d
	movl	%r8d, 20(%rsp)
	movq	%r9, %r8
	movq	%r10, %r9
	setbe	200(%rsp)
	jmp	.L185
	.p2align 4,,10
	.p2align 3
.L165:
	addq	$4, %r8
	addq	$4, %r9
	cmpq	%r8, %r11
	je	.L335
.L185:
	movl	28(%rsp), %eax
	addl	(%r8), %eax
	cmpl	%eax, 20(%rsp)
	jne	.L165
	movq	104(%rsp), %rax
	movl	72(%rsp), %r10d
	addl	(%rax), %r10d
	movl	140(%rsp), %eax
	addl	(%r9), %eax
	cmpl	%r10d, %eax
	jne	.L165
	cmpl	$9, %r10d
	setbe	%al
	testb	%al, 200(%rsp)
	je	.L165
	cmpl	$4, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movq	%r9, 368(%rsp)
	movq	%rax, 120(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 128(%rsp)
	movq	%r8, 376(%rsp)
	movl	%r10d, 168(%rsp)
	movl	284(%rsp), %r10d
	.p2align 4,,10
	.p2align 3
.L166:
	movq	128(%rsp), %rax
	leaq	s(%rip), %r9
	movl	20(%rsp), %r15d
	leaq	S(%rip), %r8
	addl	(%rax), %r15d
	movq	%r9, %rax
	movl	%r10d, %r9d
	cmpl	$9, %r15d
	movl	%r15d, %r10d
	movq	%rax, %r15
	setbe	201(%rsp)
	jmp	.L184
	.p2align 4,,10
	.p2align 3
.L167:
	addq	$4, %r15
	addq	$4, %r8
	cmpq	%r15, %r11
	je	.L336
.L184:
	movl	(%r15), %eax
	addl	%r9d, %eax
	cmpl	%eax, %r10d
	jne	.L167
	movq	120(%rsp), %rax
	movl	168(%rsp), %r14d
	addl	(%rax), %r14d
	movl	164(%rsp), %eax
	addl	(%r8), %eax
	cmpl	%r14d, %eax
	jne	.L167
	cmpl	$9, %r14d
	setbe	%al
	testb	%al, 201(%rsp)
	je	.L167
	cmpl	$5, %ecx
	je	.L216
	leaq	P(%rip), %rax
	movl	%r9d, 400(%rsp)
	movq	%rax, 144(%rsp)
	leaq	p(%rip), %rax
	movq	%rax, 152(%rsp)
	movl	%r14d, 176(%rsp)
	movq	%r8, 384(%rsp)
	movq	%r15, 392(%rsp)
	movl	%r10d, 204(%rsp)
	movl	288(%rsp), %r10d
	.p2align 4,,10
	.p2align 3
.L168:
	movq	152(%rsp), %rax
	movl	204(%rsp), %r15d
	leaq	S(%rip), %r9
	leaq	s(%rip), %r8
	movq	%r8, %rbx
	movq	%r9, %r8
	movl	%r10d, %r9d
	addl	(%rax), %r15d
	cmpl	$9, %r15d
	movl	%r15d, %r10d
	setbe	202(%rsp)
	jmp	.L183
	.p2align 4,,10
	.p2align 3
.L169:
	addq	$4, %rbx
	addq	$4, %r8
	cmpq	%rbx, %r11
	je	.L337
.L183:
	movl	(%rbx), %eax
	addl	%r9d, %eax
	cmpl	%eax, %r10d
	jne	.L169
	movq	144(%rsp), %rax
	movl	176(%rsp), %r15d
	addl	(%rax), %r15d
	movl	172(%rsp), %eax
	addl	(%r8), %eax
	cmpl	%r15d, %eax
	jne	.L169
	cmpl	$9, %r15d
	setbe	%al
	testb	%al, 202(%rsp)
	je	.L169
	cmpl	$6, %ecx
	je	.L216
	movq	%r8, 408(%rsp)
	leaq	P(%rip), %rax
	leaq	p(%rip), %rdx
	movq	%rbx, 416(%rsp)
	movl	%r15d, 184(%rsp)
	movl	292(%rsp), %r15d
	movl	%r10d, 208(%rsp)
	movq	%rdx, %r10
	movl	%r9d, 404(%rsp)
	movq	%rax, %r9
	.p2align 4,,10
	.p2align 3
.L170:
	movl	208(%rsp), %r12d
	addl	(%r10), %r12d
	movq	%r10, 192(%rsp)
	leaq	S(%rip), %rbp
	cmpl	$9, %r12d
	leaq	s(%rip), %rbx
	setbe	203(%rsp)
	jmp	.L182
	.p2align 4,,10
	.p2align 3
.L171:
	addq	$4, %rbx
	addq	$4, %rbp
	cmpq	%rbx, %r11
	je	.L338
.L182:
	movl	(%rbx), %eax
	addl	%r15d, %eax
	cmpl	%eax, %r12d
	jne	.L171
	movl	184(%rsp), %r14d
	movl	180(%rsp), %eax
	addl	(%r9), %r14d
	addl	0(%rbp), %eax
	cmpl	%r14d, %eax
	jne	.L171
	cmpl	$9, %r14d
	setbe	%al
	testb	%al, 203(%rsp)
	je	.L171
	cmpl	$7, %ecx
	je	.L216
	leaq	P(%rip), %r8
	leaq	p(%rip), %r10
	movl	%r15d, 448(%rsp)
	movl	312(%rsp), %r15d
	movq	%r9, 424(%rsp)
	movq	%r10, %r13
	movl	320(%rsp), %r9d
	movq	%rbx, 440(%rsp)
	movl	324(%rsp), %r10d
	movq	%r8, %rbx
	movq	%rbp, 432(%rsp)
	movl	316(%rsp), %r8d
	jmp	.L172
	.p2align 4,,10
	.p2align 3
.L173:
	cmpl	212(%rsp), %ebp
	je	.L339
.L174:
	cmpl	216(%rsp), %ebp
	je	.L340
.L175:
	cmpl	220(%rsp), %ebp
	je	.L341
.L176:
	cmpl	224(%rsp), %ebp
	je	.L342
.L177:
	cmpl	%r8d, %ebp
	je	.L343
.L178:
	cmpl	%r9d, %ebp
	je	.L344
.L179:
	cmpl	%r10d, %ebp
	je	.L345
.L180:
	cmpl	228(%rsp), %ebp
	je	.L346
.L181:
	addq	$4, %rbx
	leaq	48+P(%rip), %rax
	addq	$4, %r13
	cmpq	%rbx, %rax
	je	.L323
.L172:
	movl	0(%r13), %ebp
	addl	%r12d, %ebp
	cmpl	%r15d, %ebp
	jne	.L173
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %r15d
	setbe	%al
	testb	%al, %dl
	je	.L173
	cmpl	232(%rsp), %esi
	jne	.L173
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%r15d, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L173
.L216:
	leaq	.LC1(%rip), %rdi
	jmp	.L159
	.p2align 4,,10
	.p2align 3
.L332:
	addq	$4, 48(%rsp)
	movq	48(%rsp), %rax
	leaq	48+p(%rip), %rdi
	addq	$4, 40(%rsp)
	cmpq	%rax, %rdi
	jne	.L157
	leaq	.LC0(%rip), %rdi
.L159:
	call	puts@PLT
	jmp	.L155
	.p2align 4,,10
	.p2align 3
.L333:
	addq	$4, 64(%rsp)
	movq	64(%rsp), %rax
	leaq	48+p(%rip), %rbx
	addq	$4, 56(%rsp)
	cmpq	%rax, %rbx
	jne	.L160
	movq	264(%rsp), %r10
	movq	272(%rsp), %r9
	jmp	.L158
	.p2align 4,,10
	.p2align 3
.L334:
	addq	$4, 88(%rsp)
	movq	88(%rsp), %rax
	leaq	48+p(%rip), %rdx
	addq	$4, 80(%rsp)
	cmpq	%rax, %rdx
	jne	.L162
	movq	296(%rsp), %r10
	movq	304(%rsp), %r9
	jmp	.L161
	.p2align 4,,10
	.p2align 3
.L335:
	addq	$4, 112(%rsp)
	movq	112(%rsp), %rax
	leaq	48+p(%rip), %rbx
	addq	$4, 104(%rsp)
	cmpq	%rax, %rbx
	jne	.L164
	movq	352(%rsp), %r10
	movq	360(%rsp), %r9
	jmp	.L163
	.p2align 4,,10
	.p2align 3
.L336:
	leaq	48+p(%rip), %rdi
	addq	$4, 120(%rsp)
	movl	%r9d, %r10d
	addq	$4, 128(%rsp)
	movq	128(%rsp), %rax
	cmpq	%rax, %rdi
	jne	.L166
	movq	368(%rsp), %r9
	movq	376(%rsp), %r8
	jmp	.L165
	.p2align 4,,10
	.p2align 3
.L337:
	addq	$4, 152(%rsp)
	movq	152(%rsp), %rax
	leaq	48+p(%rip), %rbx
	movl	%r9d, %r10d
	addq	$4, 144(%rsp)
	cmpq	%rax, %rbx
	jne	.L168
	movl	204(%rsp), %r10d
	movl	400(%rsp), %r9d
	movq	384(%rsp), %r8
	movq	392(%rsp), %r15
	jmp	.L167
	.p2align 4,,10
	.p2align 3
.L338:
	movq	192(%rsp), %r10
	leaq	48+p(%rip), %rax
	addq	$4, %r9
	addq	$4, %r10
	cmpq	%r10, %rax
	jne	.L170
	movl	208(%rsp), %r10d
	movl	404(%rsp), %r9d
	movq	408(%rsp), %r8
	movq	416(%rsp), %rbx
	jmp	.L169
	.p2align 4,,10
	.p2align 3
.L343:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L178
	cmpl	252(%rsp), %esi
	jne	.L178
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L178
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L342:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L177
	cmpl	248(%rsp), %esi
	jne	.L177
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L177
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L341:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L176
	cmpl	244(%rsp), %esi
	jne	.L176
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L176
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L340:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %ebp
	setbe	%dl
	cmpl	$9, %esi
	setbe	%al
	testb	%al, %dl
	je	.L175
	cmpl	240(%rsp), %esi
	jne	.L175
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L175
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L339:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %ebp
	setbe	%dl
	cmpl	$9, %esi
	setbe	%al
	testb	%al, %dl
	je	.L174
	cmpl	236(%rsp), %esi
	jne	.L174
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L174
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L344:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L179
	cmpl	256(%rsp), %esi
	jne	.L179
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L179
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L346:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %ebp
	setbe	%dl
	cmpl	$9, %esi
	setbe	%al
	testb	%al, %dl
	je	.L181
	cmpl	280(%rsp), %esi
	jne	.L181
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L181
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L345:
	movl	(%rbx), %esi
	addl	%r14d, %esi
	cmpl	$9, %esi
	setbe	%dl
	cmpl	$9, %ebp
	setbe	%al
	testb	%al, %dl
	je	.L180
	cmpl	260(%rsp), %esi
	jne	.L180
	movl	%r10d, 464(%rsp)
	movl	%r9d, 460(%rsp)
	movl	%r8d, 456(%rsp)
	cmpl	$8, %ecx
	je	.L216
	xorl	%eax, %eax
	movl	$8, %edx
	movl	%ebp, %edi
	movl	%ecx, 452(%rsp)
	call	D
	movl	452(%rsp), %ecx
	movl	456(%rsp), %r8d
	leaq	36+s(%rip), %r11
	testl	%eax, %eax
	movl	460(%rsp), %r9d
	movl	464(%rsp), %r10d
	je	.L180
	jmp	.L216
	.p2align 4,,10
	.p2align 3
.L323:
	movl	448(%rsp), %r15d
	movq	424(%rsp), %r9
	movq	432(%rsp), %rbp
	movq	440(%rsp), %rbx
	jmp	.L171
.L189:
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	M
	.bss
	.align 32
	.type	M, @object
	.size	M, 40
M:
	.zero	40
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 40
m:
	.zero	40
	.globl	S
	.data
	.align 32
	.type	S, @object
	.size	S, 36
S:
	.long	-1
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	0
	.long	1
	.long	1
	.long	1
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 36
s:
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 48
P:
	.long	-2
	.long	-2
	.long	-2
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	2
	.long	2
	.long	2
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 48
p:
	.long	-1
	.long	0
	.long	1
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-1
	.long	0
	.long	1
	.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:

p[]={-1,0,1,-2,2,-2,2,-2,2,-1,0,1};
P[]={-2,-2,-2,-1,-1,0,0,1,1,2,2,2};
s[]={-1,0,1,-1,0,1,-1,0,1};
S[]={-1,-1,-1,0,0,0,1,1,1};
m[10],M[10];
int D(x,y,d,n){
int i=0,j;
for(;i<12;i++)for(j=0;j<9;j++)if(
	x+p[i]==m[d]+s[j]&&y+P[i]==M[d]+S[j]&&
	0<=x+p[i]&&x+p[i]<10&&
	0<=y+P[i]&&y+P[i]<10
){
	if(d==n-1||D(x+p[i],y+P[i],d+1,n))return 1;
}
return 0;
}
main(X,Y,n,i,x,y){for(;scanf("%d%d%d",&X,&Y,&n)>2;puts(D(X,Y,0,n)?"OK":"NA"))for(i=0;i<n;i++)scanf("%d%d",m+i,M+i);exit(0);}
6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 8 3
6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 7 7 7 8 6 9 0
0 0
 6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 3 3
6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 7 7 7 8 6 9 0
0 0
 6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 3 3
6 1
10
6 4 3 3 1 2 0 10 4 6 1 8 5 7 7 7 8 6 9 0
0 0
 6 1
10
6 4 3 3 1 2 0 5 4 0 1 8 5 9 7 7 8 6 8 3
6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 9 0
0 0
 6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 8 3
6 1
10
6 4 3 3 1 1 0 5 4 6 1 8 5 7 7 7 8 6 9 0
0 0
 6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 3 3
6 1
10
6 4 3 3 1 2 0 5 4 6 0 8 5 7 7 7 8 6 9 0
0 0
 6 1
10
6 4 3 3 1 4 0 5 4 6 1 8 5 9 7 7 8 6 3 3
6 1
10
6 4 3 3 1 2 0 10 4 6 1 8 5 7 7 7 8 6 9 0
0 0
 10 1
10
6 4 3 3 1 2 0 5 4 0 1 8 5 9 7 7 8 6 8 3
6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 9 0
0 0
 6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 8 3
6 1
10
6 4 3 3 1 1 0 5 4 6 1 8 5 14 7 7 8 6 9 0
0 0
 6 1
10
6 4 3 3 1 2 0 5 4 6 1 8 5 9 7 7 8 6 3 3
6 1
10
6 4 3 3 1 1 0 5 4 6 0 8 5 7 7 7 8 6 9 0
0 0

OK
NA
 NA
NA
 NA
NA
 NA
NA
 OK
NA
 NA
NA
 NA
NA
 NA
NA
 OK
NA
 NA
NA

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

```c
p[]={-1,0,1,-2,2,-2,2,-2,2,-1,0,1};
P[]={-2,-2,-2,-1,-1,0,0,1,1,2,2,2};
s[]={-1,0,1,-1,0,1,-1,0,1};
S[]={-1,-1,-1,0,0,0,1,1,1};
m[10],M[10];
int D(x,y,d,n){
int i=0,j;
for(;i<12;i++)for(j=0;j<9;j++)if(
	x+p[i]==m[d]+s[j]&&y+P[i]==M[d]+S[j]&&
	0<=x+p[i]&&x+p[i]<10&&
	0<=y+P[i]&&y+P[i]<10
){
	if(d==n-1||D(x+p[i],y+P[i],d+1,n))return 1;
}
return 0;
}
main(X,Y,n,i,x,y){for(;scanf("%d%d%d",&X,&Y,&n)>2;puts(D(X,Y,0,n)?"OK":"NA"))for(i=0;i<n;i++)scanf("%d%d",m+i,M+i);exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.data
	.align 32
	.type	p, @object
	.size	p, 48
p:
	.long	-1
	.long	0
	.long	1
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-1
	.long	0
	.long	1
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 48
P:
	.long	-2
	.long	-2
	.long	-2
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	2
	.long	2
	.long	2
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 36
s:
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 36
S:
	.long	-1
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	0
	.long	1
	.long	1
	.long	1
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 40
m:
	.zero	40
	.globl	M
	.align 32
	.type	M, @object
	.size	M, 40
M:
	.zero	40
	.text
	.globl	D
	.type	D, @function
D:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jne	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jne	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jg	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jg	.L4
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -28(%rbp)
	je	.L5
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	P(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-24(%rbp), %eax
	leal	(%rcx,%rax), %esi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	leal	(%rcx,%rax), %edi
	movl	-32(%rbp), %eax
	movl	%eax, %ecx
	movl	$0, %eax
	call	D
	testl	%eax, %eax
	je	.L4
.L5:
	movl	$1, %eax
	jmp	.L6
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$8, -4(%rbp)
	jle	.L7
	addl	$1, -8(%rbp)
.L2:
	cmpl	$11, -8(%rbp)
	jle	.L8
	movl	$0, %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"OK"
.LC2:
	.string	"NA"
.LC3:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	%r9d, -24(%rbp)
	jmp	.L10
.L15:
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -16(%rbp)
.L11:
	movl	-12(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %esi
	movl	-4(%rbp), %eax
	movl	%edx, %ecx
	movl	$0, %edx
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	testl	%eax, %eax
	je	.L13
	leaq	.LC1(%rip), %rax
	jmp	.L14
.L13:
	leaq	.LC2(%rip), %rax
.L14:
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	leaq	-12(%rbp), %rcx
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$2, %eax
	jg	.L15
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.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	p
	.data
	.align 32
	.type	p, @object
	.size	p, 48
p:
	.long	-1
	.long	0
	.long	1
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-2
	.long	2
	.long	-1
	.long	0
	.long	1
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 48
P:
	.long	-2
	.long	-2
	.long	-2
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	2
	.long	2
	.long	2
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 36
s:
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.long	-1
	.long	0
	.long	1
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 36
S:
	.long	-1
	.long	-1
	.long	-1
	.long	0
	.long	0
	.long	0
	.long	1
	.long	1
	.long	1
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 40
m:
	.zero	40
	.globl	M
	.align 32
	.type	M, @object
	.size	M, 40
M:
	.zero	40
	.text
	.globl	D
	.type	D, @function
D:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jne	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%esi, %eax
	cmpl	%eax, %ecx
	jne	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jg	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jg	.L4
	movl	-32(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -28(%rbp)
	je	.L5
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	P(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-24(%rbp), %eax
	leal	(%rcx,%rax), %esi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	-20(%rbp), %eax
	leal	(%rcx,%rax), %edi
	movl	-32(%rbp), %eax
	movl	%eax, %ecx
	movl	$0, %eax
	call	D
	testl	%eax, %eax
	je	.L4
.L5:
	movl	$1, %eax
	jmp	.L6
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$8, -4(%rbp)
	jle	.L7
	addl	$1, -8(%rbp)
.L2:
	cmpl	$11, -8(%rbp)
	jle	.L8
	movl	$0, %eax
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	D, .-D
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"OK"
.LC2:
	.string	"NA"
.LC3:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	%r9d, -24(%rbp)
	jmp	.L10
.L15:
	movl	$0, -16(%rbp)
	jmp	.L11
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	M(%rip), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -16(%rbp)
.L11:
	movl	-12(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %esi
	movl	-4(%rbp), %eax
	movl	%edx, %ecx
	movl	$0, %edx
	movl	%eax, %edi
	movl	$0, %eax
	call	D
	testl	%eax, %eax
	je	.L13
	leaq	.LC1(%rip), %rax
	jmp	.L14
.L13:
	leaq	.LC2(%rip), %rax
.L14:
	movq	%rax, %rdi
	call	puts@PLT
.L10:
	leaq	-12(%rbp), %rcx
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$2, %eax
	jg	.L15
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.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:
