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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int i,j,n,step,set,safe;
int x,y,spr[15][2],mark[15][3][3],mat[30][30];

void check(int x,int y){
	if(abs(spr[step][0]-x)<2 && abs(spr[step][1]-y)<2){
		mark[step][x-spr[step][0]+1][y-spr[step][1]+1]=set;
		safe=1;
	}
}

void marking(int x,int y){
	int k;
	for(k=-1;k<2;k++){
		check(x+2,y+k);
		check(x-2,y+k);
		check(x+k,y+2);
		check(x+k,y-2);
	}
}

int main(){
	while(scanf("%d %d",&y,&x)*(x+y)){
		scanf("%d",&n);
		set++;
		for(i=0;i<n;i++){scanf("%d %d",&spr[i][1],&spr[i][0]);}
		spr[n][1]=spr[0][1];spr[n][0]=spr[0][0];
		for(step=0;step<n;step++){
			safe=0;
			if(step==0)marking(x,y);
			else{
				for(i=0;i<3;i++){
					for(j=0;j<3;j++){
						if(mark[step-1][i][j]==set)marking(spr[step-1][0]+i-1,spr[step-1][1]+j-1);
					}
				}
			}
			if(safe==0)break;
		}
		if(step>=n) printf("OK\n"); else printf("NA\n");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	step
	.align 4
	.type	step, @object
	.size	step, 4
step:
	.zero	4
	.globl	set
	.align 4
	.type	set, @object
	.size	set, 4
set:
	.zero	4
	.globl	safe
	.align 4
	.type	safe, @object
	.size	safe, 4
safe:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	spr
	.align 32
	.type	spr, @object
	.size	spr, 120
spr:
	.zero	120
	.globl	mark
	.align 32
	.type	mark, @object
	.size	mark, 540
mark:
	.zero	540
	.globl	mat
	.align 32
	.type	mat, @object
	.size	mat, 3600
mat:
	.zero	3600
	.text
	.globl	check
	.type	check, @function
check:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-4(%rbp), %eax
	cmpl	$-1, %eax
	jl	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-4(%rbp), %eax
	cmpl	$1, %eax
	jg	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-8(%rbp), %eax
	cmpl	$-1, %eax
	jl	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-8(%rbp), %eax
	cmpl	$1, %eax
	jg	.L3
	movl	step(%rip), %eax
	movl	step(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	spr(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-4(%rbp), %edx
	subl	%ecx, %edx
	leal	1(%rdx), %esi
	movl	step(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+spr(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-8(%rbp), %edx
	subl	%ecx, %edx
	addl	$1, %edx
	movl	set(%rip), %ecx
	movslq	%edx, %rdi
	cltq
	movslq	%esi, %rsi
	movq	%rax, %rdx
	salq	$3, %rdx
	addq	%rax, %rdx
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mark(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$1, safe(%rip)
.L3:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	check, .-check
	.globl	marking
	.type	marking, @function
marking:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$-1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$2, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	subl	$2, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %eax
	leal	2(%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %eax
	leal	-2(%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	addl	$1, -4(%rbp)
.L5:
	cmpl	$1, -4(%rbp)
	jle	.L6
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	marking, .-marking
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L8
.L23:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	set(%rip), %eax
	addl	$1, %eax
	movl	%eax, set(%rip)
	movl	$0, i(%rip)
	jmp	.L9
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rcx
	leaq	spr(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L10
	movl	n(%rip), %edx
	movl	4+spr(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+spr(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	n(%rip), %edx
	movl	spr(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	spr(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, step(%rip)
	jmp	.L11
.L21:
	movl	$0, safe(%rip)
	movl	step(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	y(%rip), %edx
	movl	x(%rip), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	marking
	jmp	.L13
.L12:
	movl	$0, i(%rip)
	jmp	.L14
.L18:
	movl	$0, j(%rip)
	jmp	.L15
.L17:
	movl	step(%rip), %eax
	leal	-1(%rax), %ecx
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$3, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mark(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	set(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	movl	step(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	addl	%edx, %eax
	leal	-1(%rax), %edx
	movl	step(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	spr(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	i(%rip), %eax
	addl	%ecx, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	marking
.L16:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L15:
	movl	j(%rip), %eax
	cmpl	$2, %eax
	jle	.L17
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L14:
	movl	i(%rip), %eax
	cmpl	$2, %eax
	jle	.L18
.L13:
	movl	safe(%rip), %eax
	testl	%eax, %eax
	je	.L25
	movl	step(%rip), %eax
	addl	$1, %eax
	movl	%eax, step(%rip)
.L11:
	movl	step(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L21
	jmp	.L20
.L25:
	nop
.L20:
	movl	step(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L22:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	leaq	x(%rip), %rax
	movq	%rax, %rdx
	leaq	y(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	x(%rip), %ecx
	movl	y(%rip), %edx
	addl	%ecx, %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	check
	.type	check, @function
check:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	step(%rip), %rdx
	leaq	spr(%rip), %rcx
	movl	(%rcx,%rdx,8), %r8d
	movl	%r8d, %eax
	subl	%edi, %eax
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L1
	movl	4(%rcx,%rdx,8), %ecx
	movl	%ecx, %eax
	subl	%esi, %eax
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L1
	subl	%r8d, %edi
	subl	%ecx, %esi
	leaq	(%rdx,%rdx,8), %rax
	movl	set(%rip), %ecx
	movl	$1, safe(%rip)
	addl	$1, %edi
	addl	$1, %esi
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	leaq	(%rdi,%rdi,2), %rdx
	addq	%rdx, %rax
	leaq	mark(%rip), %rdx
	addq	%rsi, %rax
	movl	%ecx, (%rdx,%rax,4)
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	check, .-check
	.p2align 4
	.globl	marking
	.type	marking, @function
marking:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	step(%rip), %rax
	leal	2(%rdi), %r8d
	movl	%edi, %ecx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	spr(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %edx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	set(%rip), %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	(%rdi,%rax,8), %esi
	leal	-2(%rcx), %ebx
	movl	%esi, %r9d
	leal	1(%rsi), %r10d
	subl	%r8d, %r9d
	subl	%esi, %r8d
	subl	%ebx, %r10d
	leal	1(%r8), %r11d
	addl	$1, %r9d
	leal	-1(%rdx), %r8d
	movl	%r11d, -12(%rsp)
	leal	2(%rdx), %r11d
	cmpl	$2, %r9d
	ja	.L56
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %ebp
	subl	%r8d, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L57
	xorl	%r8d, %r8d
.L12:
	leal	-1(%rcx), %ebp
	movl	%esi, %r13d
	subl	%ebp, %r13d
	addl	$1, %r13d
	cmpl	$2, %r13d
	ja	.L15
.L7:
	movl	4(%rdi,%rax,8), %r14d
	movl	%r14d, %r13d
	subl	%r11d, %r13d
	addl	$1, %r13d
	cmpl	$2, %r13d
	ja	.L14
	movl	%r11d, %r13d
	leaq	mark(%rip), %r8
	subl	%r14d, %r13d
	addl	$1, %r13d
	movslq	%r13d, %r15
	leaq	(%rax,%rax,8), %r13
	movq	%r15, -8(%rsp)
	movl	%ebp, %r15d
	subl	%esi, %r15d
	addl	$1, %r15d
	movslq	%r15d, %r15
	leaq	(%r15,%r15,2), %r15
	addq	%r15, %r13
	addq	-8(%rsp), %r13
	movl	%r12d, (%r8,%r13,4)
	movl	$1, %r8d
.L14:
	leal	-2(%rdx), %r13d
	movl	%r14d, %r15d
	subl	%r13d, %r15d
	addl	$1, %r15d
	cmpl	$2, %r15d
	ja	.L8
	subl	%esi, %ebp
	subl	%r14d, %r13d
	leaq	mark(%rip), %r8
	leal	1(%rbp), %r14d
	addl	$1, %r13d
	leaq	(%rax,%rax,8), %rbp
	movslq	%r14d, %r14
	movslq	%r13d, %r13
	leaq	(%r14,%r14,2), %r14
	addq	%r14, %rbp
	addq	%r13, %rbp
	movl	%r12d, (%r8,%rbp,4)
	movl	$1, %r8d
.L8:
	cmpl	$2, %r9d
	jbe	.L15
.L16:
	cmpl	$2, %r10d
	jbe	.L39
	movl	%esi, %ebp
	subl	%ecx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L17
.L26:
	movl	%esi, %r10d
	leal	1(%rcx), %r9d
	subl	%ecx, %r10d
	cmpl	$2, %r10d
	jbe	.L29
.L31:
	testb	%r8b, %r8b
	jne	.L30
	popq	%rbx
	.cfi_remember_state
	.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
.L56:
	.cfi_restore_state
	cmpl	$2, %r10d
	ja	.L9
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %ebp
	subl	%r8d, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L58
	leal	-1(%rcx), %ebp
	movl	%esi, %r13d
	xorl	%r8d, %r8d
	subl	%ebp, %r13d
	addl	$1, %r13d
	cmpl	$2, %r13d
	jbe	.L7
.L39:
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %ebp
	subl	%edx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L59
	movl	%esi, %ebp
	subl	%ecx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L17
	leal	1(%rdx), %ebp
.L35:
	movl	4(%rdi,%rax,8), %r10d
	movl	%r10d, %r9d
	subl	%ebp, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L26
	subl	%r10d, %ebp
	leaq	mark(%rip), %r8
	addl	$1, %ebp
	movslq	%ebp, %rbp
.L27:
	subl	%esi, %ebx
	leaq	(%rax,%rax,8), %r9
	leal	1(%rbx), %r10d
	movslq	%r10d, %r10
	leaq	(%r10,%r10,2), %r10
	addq	%r10, %r9
	addq	%rbp, %r9
	movl	%r12d, (%r8,%r9,4)
.L52:
	movl	%esi, %r8d
	leal	1(%rcx), %r9d
	subl	%ecx, %r8d
	cmpl	$2, %r8d
	ja	.L30
	movl	$1, %r8d
.L29:
	movl	4(%rdi,%rax,8), %edi
	movl	%edi, %ecx
	subl	%r11d, %ecx
	addl	$1, %ecx
	cmpl	$2, %ecx
	ja	.L32
	movl	%r9d, %r10d
	subl	%edi, %r11d
	leaq	(%rax,%rax,8), %rcx
	subl	$2, %edx
	subl	%esi, %r10d
	addl	$1, %r11d
	leaq	mark(%rip), %r8
	addl	$1, %r10d
	movslq	%r11d, %r11
	movslq	%r10d, %r10
	leaq	(%r10,%r10,2), %r10
	addq	%r10, %rcx
	addq	%r11, %rcx
	movl	%r12d, (%r8,%rcx,4)
	movl	%edi, %ecx
	subl	%edx, %ecx
	addl	$1, %ecx
	cmpl	$2, %ecx
	ja	.L30
.L34:
	subl	%esi, %r9d
	subl	%edi, %edx
	leaq	(%rax,%rax,8), %rax
	leal	1(%r9), %ecx
	addl	$1, %edx
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	leaq	(%rcx,%rcx,2), %rcx
	addq	%rcx, %rax
	addq	%rdx, %rax
	movl	%r12d, (%r8,%rax,4)
.L30:
	movl	$1, safe(%rip)
	popq	%rbx
	.cfi_remember_state
	.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
.L9:
	.cfi_restore_state
	leal	-1(%rcx), %ebp
	movl	%esi, %r8d
	subl	%ebp, %r8d
	addl	$1, %r8d
	cmpl	$2, %r8d
	movl	$0, %r8d
	ja	.L16
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L57:
	movslq	-12(%rsp), %r14
	subl	%r13d, %r8d
	leaq	(%rax,%rax,8), %r13
	leal	1(%r8), %ebp
	leaq	mark(%rip), %r8
	leaq	(%r14,%r14,2), %r14
	movslq	%ebp, %rbp
	addq	%r14, %r13
	addq	%rbp, %r13
	movl	%r12d, (%r8,%r13,4)
	cmpl	$2, %r10d
	ja	.L60
.L11:
	movl	%ebx, %r14d
	leaq	(%rax,%rax,8), %r13
	subl	%esi, %r14d
	addl	$1, %r14d
	movslq	%r14d, %r14
	leaq	(%r14,%r14,2), %r14
	addq	%r14, %r13
	addq	%r13, %rbp
	movl	%r12d, (%r8,%rbp,4)
	leal	-1(%rcx), %ebp
	movl	%esi, %r8d
	subl	%ebp, %r8d
	addl	$1, %r8d
	cmpl	$2, %r8d
	movl	$1, %r8d
	jbe	.L7
	cmpl	$2, %r9d
	ja	.L16
	.p2align 4,,10
	.p2align 3
.L15:
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %ebp
	subl	%edx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L22
	movslq	-12(%rsp), %r14
	movl	%edx, %ebp
	leaq	mark(%rip), %r8
	subl	%r13d, %ebp
	leaq	(%rax,%rax,8), %r13
	addl	$1, %ebp
	leaq	(%r14,%r14,2), %r14
	movslq	%ebp, %rbp
	addq	%r14, %r13
	addq	%rbp, %r13
	movl	%r12d, (%r8,%r13,4)
	cmpl	$2, %r10d
	ja	.L61
.L21:
	movl	%ebx, %r14d
	leaq	(%rax,%rax,8), %r13
	subl	%esi, %r14d
	addl	$1, %r14d
	movslq	%r14d, %r14
	leaq	(%r14,%r14,2), %r14
	addq	%r14, %r13
	addq	%r13, %rbp
	movl	%r12d, (%r8,%rbp,4)
	movl	%esi, %ebp
	movl	$1, %r8d
	subl	%ecx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L18
.L17:
	movl	4(%rdi,%rax,8), %ebp
	movl	%ebp, %r13d
	subl	%r11d, %r13d
	addl	$1, %r13d
	cmpl	$2, %r13d
	ja	.L24
	movl	%ecx, %r15d
	movl	%r11d, %r14d
	leaq	(%rax,%rax,8), %r13
	subl	%esi, %r15d
	subl	%ebp, %r14d
	leaq	mark(%rip), %r8
	addl	$1, %r15d
	addl	$1, %r14d
	movslq	%r15d, %r15
	movslq	%r14d, %r14
	leaq	(%r15,%r15,2), %r15
	addq	%r15, %r13
	addq	%r14, %r13
	movl	%r12d, (%r8,%r13,4)
	movl	$1, %r8d
.L24:
	leal	-2(%rdx), %r13d
	movl	%ebp, %r14d
	subl	%r13d, %r14d
	addl	$1, %r14d
	cmpl	$2, %r14d
	ja	.L18
	movl	%ecx, %r14d
	subl	%ebp, %r13d
	leaq	mark(%rip), %r8
	subl	%esi, %r14d
	leal	1(%r13), %ebp
	leaq	(%rax,%rax,8), %r13
	addl	$1, %r14d
	movslq	%ebp, %rbp
	movslq	%r14d, %r14
	leaq	(%r14,%r14,2), %r14
	addq	%r14, %r13
	addq	%r13, %rbp
	movl	%r12d, (%r8,%rbp,4)
	movl	$1, %r8d
.L18:
	leal	1(%rdx), %ebp
	cmpl	$2, %r9d
	jbe	.L37
	cmpl	$2, %r10d
	jbe	.L35
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L61:
	movl	$1, %r8d
.L22:
	movl	%esi, %ebp
	subl	%ecx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L17
	leal	1(%rdx), %ebp
.L37:
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %r9d
	subl	%ebp, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L26
	subl	%r13d, %ebp
	movslq	-12(%rsp), %r13
	leaq	(%rax,%rax,8), %r9
	leaq	mark(%rip), %r8
	addl	$1, %ebp
	leaq	0(%r13,%r13,2), %r13
	movslq	%ebp, %rbp
	addq	%r13, %r9
	addq	%rbp, %r9
	movl	%r12d, (%r8,%r9,4)
	cmpl	$2, %r10d
	jbe	.L27
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L32:
	subl	$2, %edx
	movl	%edi, %ecx
	subl	%edx, %ecx
	addl	$1, %ecx
	cmpl	$2, %ecx
	ja	.L31
	leaq	mark(%rip), %r8
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L60:
	movl	$1, %r8d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L58:
	subl	%r13d, %r8d
	leal	1(%r8), %ebp
	leaq	mark(%rip), %r8
	movslq	%ebp, %rbp
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L59:
	movl	%edx, %ebp
	leaq	mark(%rip), %r8
	subl	%r13d, %ebp
	addl	$1, %ebp
	movslq	%ebp, %rbp
	jmp	.L21
	.cfi_endproc
.LFE52:
	.size	marking, .-marking
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	mark(%rip), %r15
	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	$200, %rsp
	.cfi_def_cfa_offset 256
.L63:
	leaq	x(%rip), %rdx
	leaq	y(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	y(%rip), %eax
	addl	x(%rip), %eax
	imull	%r8d, %eax
	testl	%eax, %eax
	je	.L174
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rax
	addl	$1, set(%rip)
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L64
	xorl	%eax, %eax
	leaq	spr(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L65:
	cltq
	leaq	.LC1(%rip), %rdi
	salq	$3, %rax
	leaq	(%rax,%rbx), %rdx
	leaq	4(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %edx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L65
	movslq	%edx, %rax
	movq	spr(%rip), %rdx
	movl	%eax, 84(%rsp)
	movq	%rdx, (%rbx,%rax,8)
	movl	$0, step(%rip)
	testl	%eax, %eax
	jle	.L67
	movl	spr(%rip), %r9d
	movl	x(%rip), %r8d
	leaq	spr(%rip), %r13
	movq	$-36, 64(%rsp)
	movl	y(%rip), %eax
	movb	$0, 91(%rsp)
	leal	1(%r9), %edx
	leal	2(%r8), %edi
	movl	$0, 72(%rsp)
	movl	set(%rip), %r12d
	movl	%edx, %ebx
	leal	-2(%r8), %r10d
	leal	-1(%rax), %esi
	subl	%edi, %ebx
	subl	%r9d, %edi
	movl	%ebx, 76(%rsp)
	movl	%edx, %ebx
	addl	$1, %edi
	subl	%r10d, %ebx
	movl	%edi, 128(%rsp)
	leal	-1(%r8), %edi
	movl	%ebx, 80(%rsp)
	movl	4+spr(%rip), %ebx
	leal	1(%rbx), %ecx
	movl	%ebx, 148(%rsp)
	movl	%ecx, %r14d
	movl	%ecx, %ebp
	subl	%esi, %r14d
	subl	%ebx, %esi
	movl	%r14d, 116(%rsp)
	movl	%edx, %r14d
	leal	1(%rsi), %r11d
	leal	2(%rax), %esi
	subl	%edi, %r14d
	subl	%r9d, %edi
	subl	%esi, %ebp
	subl	%ebx, %esi
	addl	$1, %edi
	movl	%r14d, 108(%rsp)
	leal	-2(%rax), %r14d
	subl	%r8d, %edx
	movl	%edi, 160(%rsp)
	leal	1(%rsi), %edi
	movl	%ecx, %esi
	subl	%eax, %ecx
	subl	%r14d, %esi
	movl	%ecx, 120(%rsp)
	leal	1(%rax), %ecx
	movl	%esi, 136(%rsp)
	movl	%r14d, %esi
	subl	%ebx, %ecx
	subl	%ebx, %esi
	movl	%ecx, 172(%rsp)
	addl	$1, %esi
	movl	%edx, 112(%rsp)
	leal	1(%r8), %edx
	movl	%esi, 180(%rsp)
	movl	%ecx, %esi
	movl	%ebx, %ecx
	subl	%r14d, %ebx
	subl	%eax, %ecx
	leal	1(%rsi), %eax
	subl	%r9d, %edx
	movl	%r11d, 176(%rsp)
	movl	%eax, 164(%rsp)
	movl	%r9d, %eax
	xorl	%esi, %esi
	subl	%r8d, %eax
	movl	%r14d, 140(%rsp)
	movl	%eax, 104(%rsp)
	movl	%ebx, %eax
	addl	$1, %eax
	movl	%ebp, 92(%rsp)
	movl	%eax, 100(%rsp)
	leal	1(%rdx), %eax
	movl	%eax, 168(%rsp)
	movl	%r10d, %eax
	subl	%r9d, %eax
	movl	%edi, 132(%rsp)
	addl	$1, %eax
	movl	%edx, 144(%rsp)
	cltq
	movl	%ecx, 124(%rsp)
	leaq	(%rax,%rax,2), %rbx
	movslq	%r11d, %rax
	addq	%rbx, %rax
	movq	%rbx, 152(%rsp)
	movq	%rax, 184(%rsp)
	movq	%r13, 56(%rsp)
	jmp	.L116
	.p2align 4,,10
	.p2align 3
.L176:
	cmpl	$2, 76(%rsp)
	ja	.L69
	cmpl	$2, 116(%rsp)
	ja	.L139
	movslq	128(%rsp), %rax
	movslq	176(%rsp), %rdx
	leaq	(%rax,%rax,2), %rax
	addq	%rdx, %rax
	cmpl	$2, 80(%rsp)
	movl	%r12d, (%r15,%rax,4)
	jbe	.L74
	movl	$1, (%rsp)
.L70:
	cmpl	$2, 108(%rsp)
	ja	.L132
.L71:
	cmpl	$2, 92(%rsp)
	ja	.L76
	movslq	160(%rsp), %rax
	movslq	132(%rsp), %rdx
	movl	$1, (%rsp)
	leaq	(%rax,%rax,2), %rax
	addq	%rdx, %rax
	movl	%r12d, (%r15,%rax,4)
.L76:
	cmpl	$2, 136(%rsp)
	ja	.L72
	movslq	160(%rsp), %rax
	movslq	180(%rsp), %rdx
	movl	$1, (%rsp)
	leaq	(%rax,%rax,2), %rax
	addq	%rdx, %rax
	movl	%r12d, (%r15,%rax,4)
.L72:
	cmpl	$2, 76(%rsp)
	jbe	.L132
.L77:
	cmpl	$2, 80(%rsp)
	jbe	.L131
	cmpl	$2, 112(%rsp)
	ja	.L86
.L79:
	cmpl	$2, 92(%rsp)
	ja	.L84
	movslq	144(%rsp), %rax
	movslq	132(%rsp), %rdx
	movl	$1, (%rsp)
	leaq	(%rax,%rax,2), %rax
	addq	%rdx, %rax
	movl	%r12d, (%r15,%rax,4)
.L84:
	cmpl	$2, 100(%rsp)
	ja	.L80
	movl	140(%rsp), %eax
	movslq	144(%rsp), %rdx
	movl	$1, (%rsp)
	subl	148(%rsp), %eax
	addl	$1, %eax
	leaq	(%rdx,%rdx,2), %rdx
	cltq
	addq	%rax, %rdx
	movl	%r12d, (%r15,%rdx,4)
.L80:
	cmpl	$2, 76(%rsp)
	jbe	.L130
	cmpl	$2, 80(%rsp)
	ja	.L86
.L129:
	cmpl	$2, 124(%rsp)
	ja	.L86
	movslq	164(%rsp), %rax
.L91:
	addq	152(%rsp), %rax
	cmpl	$2, 104(%rsp)
	movl	%r12d, (%r15,%rax,4)
	ja	.L88
	cmpl	$2, 92(%rsp)
	jbe	.L89
	cmpl	$2, 100(%rsp)
	ja	.L88
.L172:
	movslq	168(%rsp), %rax
.L90:
	movl	140(%rsp), %edx
	subl	148(%rsp), %edx
	leaq	(%rax,%rax,2), %rax
	addl	$1, %edx
	movslq	%edx, %rdx
	addq	%rdx, %rax
	movl	%r12d, (%r15,%rax,4)
	.p2align 4,,10
	.p2align 3
.L88:
	addl	$1, 72(%rsp)
	movl	72(%rsp), %eax
	addq	$36, 64(%rsp)
	addq	$8, 56(%rsp)
	movb	$1, 91(%rsp)
	cmpl	%eax, 84(%rsp)
	je	.L175
	movl	%eax, 96(%rsp)
.L116:
	movl	72(%rsp), %edx
	testl	%edx, %edx
	je	.L176
	movq	64(%rsp), %rax
	movl	$0, (%rsp)
	movq	$0, 16(%rsp)
	leaq	(%r15,%rax), %r11
	movslq	72(%rsp), %rax
	movq	%r11, %r13
	movq	%rax, 48(%rsp)
	leaq	(%rax,%rax,8), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L114:
	movl	16(%rsp), %eax
	movq	56(%rsp), %r14
	xorl	%r10d, %r10d
	movl	%eax, 40(%rsp)
	jmp	.L113
	.p2align 4,,10
	.p2align 3
.L94:
	addq	$1, %r10
	cmpq	$3, %r10
	je	.L177
.L113:
	cmpl	%r12d, 0(%r13,%r10,4)
	jne	.L94
	movl	(%r14), %ecx
	movl	40(%rsp), %edx
	addl	-8(%r14), %edx
	movl	-4(%r14), %esi
	leal	-1(%rdx), %eax
	movl	%ecx, %r8d
	leal	1(%rdx), %r11d
	movl	%ecx, %ebx
	movl	%eax, 32(%rsp)
	leal	-3(%rdx), %eax
	addl	%r10d, %esi
	subl	%edx, %ebx
	subl	%eax, %r8d
	movl	%r11d, 44(%rsp)
	leal	-1(%rsi), %r9d
	leal	-2(%rsi), %edi
	leal	1(%r8), %ebp
	movl	%eax, 36(%rsp)
	movl	%ebp, 12(%rsp)
	cmpl	$2, %ebx
	ja	.L95
	movl	4(%r14), %eax
	movl	%eax, %r8d
	subl	%edi, %r8d
	addl	$1, %r8d
	cmpl	$2, %r8d
	ja	.L96
	movl	%r11d, %r8d
	subl	%eax, %edi
	subl	%ecx, %r8d
	addl	$1, %edi
	addl	$1, %r8d
	movslq	%edi, %rdi
	movslq	%r8d, %r8
	leaq	(%r8,%r8,2), %r8
	addq	24(%rsp), %r8
	addq	%rdi, %r8
	movl	%r12d, (%r15,%r8,4)
	cmpl	$2, %ebp
	jbe	.L97
	movl	$1, (%rsp)
.L96:
	leal	-2(%rdx), %r11d
	movl	%ecx, %ebp
	leal	1(%rsi), %edi
	subl	%r11d, %ebp
	leal	-3(%rsi), %r8d
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L137
.L136:
	movl	%eax, %ebp
	subl	%edi, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L101
	movl	%edi, %ebp
	subl	%eax, %ebp
	addl	$1, %ebp
	movslq	%ebp, %rbp
	movq	%rbp, (%rsp)
	movl	%r11d, %ebp
	subl	%ecx, %ebp
	addl	$1, %ebp
	movslq	%ebp, %rbp
	leaq	0(%rbp,%rbp,2), %rbp
	addq	24(%rsp), %rbp
	addq	(%rsp), %rbp
	movl	$1, (%rsp)
	movl	%r12d, (%r15,%rbp,4)
.L101:
	movl	%eax, %ebp
	subl	%r8d, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L100
	movl	%r8d, %ebp
	subl	%ecx, %r11d
	movl	$1, (%rsp)
	subl	%eax, %ebp
	leal	1(%r11), %eax
	addl	$1, %ebp
	cltq
	movslq	%ebp, %rbp
	leaq	(%rax,%rax,2), %rax
	addq	24(%rsp), %rax
	addq	%rbp, %rax
	movl	%r12d, (%r15,%rax,4)
.L100:
	cmpl	$2, %ebx
	jbe	.L178
	cmpl	$2, 12(%rsp)
	jbe	.L179
	movl	%ecx, %eax
	subl	32(%rsp), %eax
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L110
	movl	4(%r14), %eax
.L133:
	movl	%eax, %r9d
	subl	%edi, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L108
	movl	32(%rsp), %r9d
	movl	%edi, %r11d
	movl	$1, (%rsp)
	subl	%eax, %r11d
	subl	%ecx, %r9d
	addl	$1, %r11d
	addl	$1, %r9d
	movslq	%r11d, %r11
	movslq	%r9d, %r9
	leaq	(%r9,%r9,2), %r9
	addq	24(%rsp), %r9
	addq	%r11, %r9
	movl	%r12d, (%r15,%r9,4)
.L108:
	movl	%eax, %r9d
	subl	%r8d, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L107
	movl	32(%rsp), %r11d
	movl	%r8d, %r9d
	movl	$1, (%rsp)
	subl	%eax, %r9d
	subl	%ecx, %r11d
	addl	$1, %r9d
	addl	$1, %r11d
	movslq	%r9d, %r9
	movslq	%r11d, %r11
	leaq	(%r11,%r11,2), %r11
	addq	24(%rsp), %r11
	addq	%r9, %r11
	movl	%r12d, (%r15,%r11,4)
.L107:
	cmpl	$2, %ebx
	jbe	.L135
	cmpl	$2, 12(%rsp)
	ja	.L110
.L134:
	movl	%eax, %r9d
	subl	%esi, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L110
	subl	%eax, %esi
	addl	$1, %esi
	movslq	%esi, %rsi
.L111:
	movl	36(%rsp), %r9d
	movq	48(%rsp), %rax
	subl	%ecx, %r9d
	leaq	(%rax,%rax,8), %rax
	addl	$1, %r9d
	movslq	%r9d, %r9
	leaq	(%r9,%r9,2), %r9
	addq	%r9, %rax
	addq	%rsi, %rax
	movl	%r12d, (%r15,%rax,4)
.L173:
	movl	$1, (%rsp)
.L110:
	movl	%ecx, %eax
	subl	%edx, %eax
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L94
	movl	4(%r14), %eax
	movl	%eax, %esi
	subl	%edi, %esi
	addl	$1, %esi
	cmpl	$2, %esi
	ja	.L112
	movl	%edx, %esi
	subl	%eax, %edi
	movl	$1, (%rsp)
	subl	%ecx, %esi
	addl	$1, %edi
	addl	$1, %esi
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	leaq	(%rsi,%rsi,2), %rsi
	addq	24(%rsp), %rsi
	addq	%rdi, %rsi
	movl	%r12d, (%r15,%rsi,4)
.L112:
	movl	%eax, %esi
	subl	%r8d, %esi
	addl	$1, %esi
	cmpl	$2, %esi
	ja	.L94
	subl	%ecx, %edx
	subl	%eax, %r8d
	addq	$1, %r10
	movl	$1, (%rsp)
	leal	1(%rdx), %eax
	leal	1(%r8), %esi
	cltq
	movslq	%esi, %rsi
	leaq	(%rax,%rax,2), %rax
	addq	24(%rsp), %rax
	addq	%rsi, %rax
	movl	%r12d, (%r15,%rax,4)
	cmpq	$3, %r10
	jne	.L113
	.p2align 4,,10
	.p2align 3
.L177:
	addq	$1, 16(%rsp)
	movq	16(%rsp), %rax
	addq	$12, %r13
	cmpq	$3, %rax
	jne	.L114
	movl	$1, %esi
.L92:
	movl	(%rsp), %eax
	testl	%eax, %eax
	jne	.L88
	movl	$0, safe(%rip)
	cmpb	$0, 91(%rsp)
	je	.L121
	movl	96(%rsp), %eax
	movl	%eax, step(%rip)
.L121:
	testb	%sil, %sil
	je	.L122
	movl	$3, i(%rip)
	movl	$3, j(%rip)
.L122:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L178:
	movl	4(%r14), %eax
.L137:
	movl	%eax, %r11d
	subl	%r9d, %r11d
	addl	$1, %r11d
	cmpl	$2, %r11d
	ja	.L103
	movl	44(%rsp), %r11d
	subl	%eax, %r9d
	addl	$1, %r9d
	subl	%ecx, %r11d
	movslq	%r9d, %r9
	addl	$1, %r11d
	movslq	%r11d, %r11
	leaq	(%r11,%r11,2), %r11
	addq	24(%rsp), %r11
	addq	%r9, %r11
	cmpl	$2, 12(%rsp)
	movl	%r12d, (%r15,%r11,4)
	jbe	.L104
	movl	$1, (%rsp)
.L103:
	movl	%ecx, %r9d
	subl	32(%rsp), %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	jbe	.L133
.L135:
	movl	%eax, %r9d
	subl	%esi, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L110
	subl	%eax, %esi
	movl	44(%rsp), %eax
	addl	$1, %esi
	subl	%ecx, %eax
	movslq	%esi, %rsi
	addl	$1, %eax
	cltq
	leaq	(%rax,%rax,2), %rax
	addq	24(%rsp), %rax
	addq	%rsi, %rax
	cmpl	$2, 12(%rsp)
	movl	%r12d, (%r15,%rax,4)
	jbe	.L111
	jmp	.L173
	.p2align 4,,10
	.p2align 3
.L95:
	cmpl	$2, 12(%rsp)
	ja	.L98
	movl	4(%r14), %eax
	movl	%eax, %r8d
	subl	%edi, %r8d
	addl	$1, %r8d
	cmpl	$2, %r8d
	ja	.L99
	subl	%eax, %edi
	addl	$1, %edi
	movslq	%edi, %rdi
.L97:
	movl	36(%rsp), %r8d
	movq	48(%rsp), %rax
	movl	$1, (%rsp)
	subl	%ecx, %r8d
	leaq	(%rax,%rax,8), %rax
	addl	$1, %r8d
	movslq	%r8d, %r8
	leaq	(%r8,%r8,2), %r8
	addq	%r8, %rax
	addq	%rdi, %rax
	movl	%r12d, (%r15,%rax,4)
.L98:
	leal	-2(%rdx), %r11d
	movl	%ecx, %eax
	leal	1(%rsi), %edi
	subl	%r11d, %eax
	leal	-3(%rsi), %r8d
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L100
	movl	4(%r14), %eax
	jmp	.L136
	.p2align 4,,10
	.p2align 3
.L179:
	movl	4(%r14), %eax
	movl	%eax, %r11d
	subl	%r9d, %r11d
	addl	$1, %r11d
	cmpl	$2, %r11d
	ja	.L106
.L180:
	subl	%eax, %r9d
	addl	$1, %r9d
	movslq	%r9d, %r9
.L104:
	movl	36(%rsp), %ebp
	movq	48(%rsp), %r11
	movl	$1, (%rsp)
	subl	%ecx, %ebp
	leaq	(%r11,%r11,8), %r11
	addl	$1, %ebp
	movslq	%ebp, %rbp
	leaq	0(%rbp,%rbp,2), %rbp
	addq	%rbp, %r11
	addq	%r9, %r11
	movl	%ecx, %r9d
	subl	32(%rsp), %r9d
	addl	$1, %r9d
	movl	%r12d, (%r15,%r11,4)
	cmpl	$2, %r9d
	ja	.L107
	jmp	.L133
	.p2align 4,,10
	.p2align 3
.L99:
	leal	-2(%rdx), %r11d
	movl	%ecx, %ebp
	leal	1(%rsi), %edi
	subl	%r11d, %ebp
	leal	-3(%rsi), %r8d
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L136
	movl	%eax, %r11d
	subl	%r9d, %r11d
	addl	$1, %r11d
	cmpl	$2, %r11d
	jbe	.L180
.L106:
	movl	%ecx, %r9d
	subl	32(%rsp), %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	jbe	.L133
	jmp	.L134
	.p2align 4,,10
	.p2align 3
.L86:
	cmpl	$2, 104(%rsp)
	ja	.L92
	cmpl	$2, 92(%rsp)
	jbe	.L89
.L93:
	cmpl	$2, 100(%rsp)
	ja	.L92
	jmp	.L172
.L132:
	cmpl	$2, 120(%rsp)
	ja	.L78
	movslq	128(%rsp), %rdx
	movslq	172(%rsp), %rax
	leaq	(%rdx,%rdx,2), %rdx
	addq	%rax, %rdx
	cmpl	$2, 80(%rsp)
	movl	%r12d, (%r15,%rdx,4)
	jbe	.L82
	movl	$1, (%rsp)
.L78:
	cmpl	$2, 112(%rsp)
	jbe	.L79
.L130:
	cmpl	$2, 124(%rsp)
	ja	.L86
	movslq	128(%rsp), %rdx
	movslq	164(%rsp), %rax
	leaq	(%rdx,%rdx,2), %rdx
	addq	%rax, %rdx
	cmpl	$2, 80(%rsp)
	movl	%r12d, (%r15,%rdx,4)
	jbe	.L91
	cmpl	$2, 104(%rsp)
	ja	.L88
	cmpl	$2, 92(%rsp)
	movl	$1, (%rsp)
	ja	.L93
.L89:
	movslq	168(%rsp), %rax
	movslq	132(%rsp), %rcx
	leaq	(%rax,%rax,2), %rdx
	addq	%rcx, %rdx
	cmpl	$2, 100(%rsp)
	movl	%r12d, (%r15,%rdx,4)
	ja	.L88
	jmp	.L90
.L69:
	cmpl	$2, 80(%rsp)
	ja	.L73
	cmpl	$2, 116(%rsp)
	jbe	.L74
	cmpl	$2, 108(%rsp)
	jbe	.L148
	movl	$0, (%rsp)
.L131:
	cmpl	$2, 120(%rsp)
	ja	.L168
	movslq	172(%rsp), %rax
.L82:
	addq	152(%rsp), %rax
	cmpl	$2, 112(%rsp)
	movl	$1, (%rsp)
	movl	%r12d, (%r15,%rax,4)
	jbe	.L79
	jmp	.L80
.L73:
	cmpl	$2, 108(%rsp)
	jbe	.L148
	movl	$0, (%rsp)
	jmp	.L77
.L74:
	movq	184(%rsp), %rax
	cmpl	$2, 108(%rsp)
	movl	$1, (%rsp)
	movl	%r12d, (%r15,%rax,4)
	jbe	.L71
	jmp	.L72
.L139:
	movl	$0, (%rsp)
	jmp	.L70
.L148:
	movl	$0, (%rsp)
	jmp	.L71
.L168:
	cmpl	$2, 112(%rsp)
	ja	.L129
	jmp	.L79
.L175:
	movl	$1, safe(%rip)
	movl	84(%rsp), %eax
	movl	%eax, step(%rip)
	testb	%sil, %sil
	je	.L67
	movl	$3, i(%rip)
	movl	$3, j(%rip)
.L67:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L63
.L174:
	addq	$200, %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
.L64:
	.cfi_restore_state
	movq	spr(%rip), %rdx
	leaq	spr(%rip), %rbx
	movq	%rdx, (%rbx,%rax,8)
	movl	$0, step(%rip)
	jmp	.L67
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	mat
	.bss
	.align 32
	.type	mat, @object
	.size	mat, 3600
mat:
	.zero	3600
	.globl	mark
	.align 32
	.type	mark, @object
	.size	mark, 540
mark:
	.zero	540
	.globl	spr
	.align 32
	.type	spr, @object
	.size	spr, 120
spr:
	.zero	120
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	safe
	.align 4
	.type	safe, @object
	.size	safe, 4
safe:
	.zero	4
	.globl	set
	.align 4
	.type	set, @object
	.size	set, 4
set:
	.zero	4
	.globl	step
	.align 4
	.type	step, @object
	.size	step, 4
step:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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	check
	.type	check, @function
check:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	step(%rip), %rdx
	leaq	spr(%rip), %rcx
	movl	(%rcx,%rdx,8), %r8d
	movl	%r8d, %eax
	subl	%edi, %eax
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L1
	movl	4(%rcx,%rdx,8), %ecx
	movl	%ecx, %eax
	subl	%esi, %eax
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L1
	subl	%r8d, %edi
	subl	%ecx, %esi
	leaq	(%rdx,%rdx,8), %rax
	movl	set(%rip), %ecx
	movl	$1, safe(%rip)
	addl	$1, %edi
	addl	$1, %esi
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	leaq	(%rdi,%rdi,2), %rdx
	addq	%rdx, %rax
	leaq	mark(%rip), %rdx
	addq	%rsi, %rax
	movl	%ecx, (%rdx,%rax,4)
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	check, .-check
	.p2align 4
	.globl	marking
	.type	marking, @function
marking:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	step(%rip), %rax
	leal	2(%rdi), %r8d
	movl	%edi, %ecx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	spr(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %edx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	set(%rip), %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	(%rdi,%rax,8), %esi
	leal	-2(%rcx), %ebx
	movl	%esi, %r9d
	leal	1(%rsi), %r10d
	subl	%r8d, %r9d
	subl	%esi, %r8d
	subl	%ebx, %r10d
	leal	1(%r8), %r11d
	addl	$1, %r9d
	leal	-1(%rdx), %r8d
	movl	%r11d, -12(%rsp)
	leal	2(%rdx), %r11d
	cmpl	$2, %r9d
	ja	.L56
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %ebp
	subl	%r8d, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L57
	xorl	%r8d, %r8d
.L12:
	leal	-1(%rcx), %ebp
	movl	%esi, %r13d
	subl	%ebp, %r13d
	addl	$1, %r13d
	cmpl	$2, %r13d
	ja	.L15
.L7:
	movl	4(%rdi,%rax,8), %r14d
	movl	%r14d, %r13d
	subl	%r11d, %r13d
	addl	$1, %r13d
	cmpl	$2, %r13d
	ja	.L14
	movl	%r11d, %r13d
	leaq	mark(%rip), %r8
	subl	%r14d, %r13d
	addl	$1, %r13d
	movslq	%r13d, %r15
	leaq	(%rax,%rax,8), %r13
	movq	%r15, -8(%rsp)
	movl	%ebp, %r15d
	subl	%esi, %r15d
	addl	$1, %r15d
	movslq	%r15d, %r15
	leaq	(%r15,%r15,2), %r15
	addq	%r15, %r13
	addq	-8(%rsp), %r13
	movl	%r12d, (%r8,%r13,4)
	movl	$1, %r8d
.L14:
	leal	-2(%rdx), %r13d
	movl	%r14d, %r15d
	subl	%r13d, %r15d
	addl	$1, %r15d
	cmpl	$2, %r15d
	ja	.L8
	subl	%esi, %ebp
	subl	%r14d, %r13d
	leaq	mark(%rip), %r8
	leal	1(%rbp), %r14d
	addl	$1, %r13d
	leaq	(%rax,%rax,8), %rbp
	movslq	%r14d, %r14
	movslq	%r13d, %r13
	leaq	(%r14,%r14,2), %r14
	addq	%r14, %rbp
	addq	%r13, %rbp
	movl	%r12d, (%r8,%rbp,4)
	movl	$1, %r8d
.L8:
	cmpl	$2, %r9d
	jbe	.L15
.L16:
	cmpl	$2, %r10d
	jbe	.L39
	movl	%esi, %ebp
	subl	%ecx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L17
.L26:
	movl	%esi, %r10d
	leal	1(%rcx), %r9d
	subl	%ecx, %r10d
	cmpl	$2, %r10d
	jbe	.L29
.L31:
	testb	%r8b, %r8b
	jne	.L30
	popq	%rbx
	.cfi_remember_state
	.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
.L56:
	.cfi_restore_state
	cmpl	$2, %r10d
	ja	.L9
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %ebp
	subl	%r8d, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L58
	leal	-1(%rcx), %ebp
	movl	%esi, %r13d
	xorl	%r8d, %r8d
	subl	%ebp, %r13d
	addl	$1, %r13d
	cmpl	$2, %r13d
	jbe	.L7
.L39:
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %ebp
	subl	%edx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L59
	movl	%esi, %ebp
	subl	%ecx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L17
	leal	1(%rdx), %ebp
.L35:
	movl	4(%rdi,%rax,8), %r10d
	movl	%r10d, %r9d
	subl	%ebp, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L26
	subl	%r10d, %ebp
	leaq	mark(%rip), %r8
	addl	$1, %ebp
	movslq	%ebp, %rbp
.L27:
	subl	%esi, %ebx
	leaq	(%rax,%rax,8), %r9
	leal	1(%rbx), %r10d
	movslq	%r10d, %r10
	leaq	(%r10,%r10,2), %r10
	addq	%r10, %r9
	addq	%rbp, %r9
	movl	%r12d, (%r8,%r9,4)
.L52:
	movl	%esi, %r8d
	leal	1(%rcx), %r9d
	subl	%ecx, %r8d
	cmpl	$2, %r8d
	ja	.L30
	movl	$1, %r8d
.L29:
	movl	4(%rdi,%rax,8), %edi
	movl	%edi, %ecx
	subl	%r11d, %ecx
	addl	$1, %ecx
	cmpl	$2, %ecx
	ja	.L32
	movl	%r9d, %r10d
	subl	%edi, %r11d
	leaq	(%rax,%rax,8), %rcx
	subl	$2, %edx
	subl	%esi, %r10d
	addl	$1, %r11d
	leaq	mark(%rip), %r8
	addl	$1, %r10d
	movslq	%r11d, %r11
	movslq	%r10d, %r10
	leaq	(%r10,%r10,2), %r10
	addq	%r10, %rcx
	addq	%r11, %rcx
	movl	%r12d, (%r8,%rcx,4)
	movl	%edi, %ecx
	subl	%edx, %ecx
	addl	$1, %ecx
	cmpl	$2, %ecx
	ja	.L30
.L34:
	subl	%esi, %r9d
	subl	%edi, %edx
	leaq	(%rax,%rax,8), %rax
	leal	1(%r9), %ecx
	addl	$1, %edx
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	leaq	(%rcx,%rcx,2), %rcx
	addq	%rcx, %rax
	addq	%rdx, %rax
	movl	%r12d, (%r8,%rax,4)
.L30:
	movl	$1, safe(%rip)
	popq	%rbx
	.cfi_remember_state
	.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
.L9:
	.cfi_restore_state
	leal	-1(%rcx), %ebp
	movl	%esi, %r8d
	subl	%ebp, %r8d
	addl	$1, %r8d
	cmpl	$2, %r8d
	movl	$0, %r8d
	ja	.L16
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L57:
	movslq	-12(%rsp), %r14
	subl	%r13d, %r8d
	leaq	(%rax,%rax,8), %r13
	leal	1(%r8), %ebp
	leaq	mark(%rip), %r8
	leaq	(%r14,%r14,2), %r14
	movslq	%ebp, %rbp
	addq	%r14, %r13
	addq	%rbp, %r13
	movl	%r12d, (%r8,%r13,4)
	cmpl	$2, %r10d
	ja	.L60
.L11:
	movl	%ebx, %r14d
	leaq	(%rax,%rax,8), %r13
	subl	%esi, %r14d
	addl	$1, %r14d
	movslq	%r14d, %r14
	leaq	(%r14,%r14,2), %r14
	addq	%r14, %r13
	addq	%r13, %rbp
	movl	%r12d, (%r8,%rbp,4)
	leal	-1(%rcx), %ebp
	movl	%esi, %r8d
	subl	%ebp, %r8d
	addl	$1, %r8d
	cmpl	$2, %r8d
	movl	$1, %r8d
	jbe	.L7
	cmpl	$2, %r9d
	ja	.L16
	.p2align 4,,10
	.p2align 3
.L15:
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %ebp
	subl	%edx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L22
	movslq	-12(%rsp), %r14
	movl	%edx, %ebp
	leaq	mark(%rip), %r8
	subl	%r13d, %ebp
	leaq	(%rax,%rax,8), %r13
	addl	$1, %ebp
	leaq	(%r14,%r14,2), %r14
	movslq	%ebp, %rbp
	addq	%r14, %r13
	addq	%rbp, %r13
	movl	%r12d, (%r8,%r13,4)
	cmpl	$2, %r10d
	ja	.L61
.L21:
	movl	%ebx, %r14d
	leaq	(%rax,%rax,8), %r13
	subl	%esi, %r14d
	addl	$1, %r14d
	movslq	%r14d, %r14
	leaq	(%r14,%r14,2), %r14
	addq	%r14, %r13
	addq	%r13, %rbp
	movl	%r12d, (%r8,%rbp,4)
	movl	%esi, %ebp
	movl	$1, %r8d
	subl	%ecx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L18
.L17:
	movl	4(%rdi,%rax,8), %ebp
	movl	%ebp, %r13d
	subl	%r11d, %r13d
	addl	$1, %r13d
	cmpl	$2, %r13d
	ja	.L24
	movl	%ecx, %r15d
	movl	%r11d, %r14d
	leaq	(%rax,%rax,8), %r13
	subl	%esi, %r15d
	subl	%ebp, %r14d
	leaq	mark(%rip), %r8
	addl	$1, %r15d
	addl	$1, %r14d
	movslq	%r15d, %r15
	movslq	%r14d, %r14
	leaq	(%r15,%r15,2), %r15
	addq	%r15, %r13
	addq	%r14, %r13
	movl	%r12d, (%r8,%r13,4)
	movl	$1, %r8d
.L24:
	leal	-2(%rdx), %r13d
	movl	%ebp, %r14d
	subl	%r13d, %r14d
	addl	$1, %r14d
	cmpl	$2, %r14d
	ja	.L18
	movl	%ecx, %r14d
	subl	%ebp, %r13d
	leaq	mark(%rip), %r8
	subl	%esi, %r14d
	leal	1(%r13), %ebp
	leaq	(%rax,%rax,8), %r13
	addl	$1, %r14d
	movslq	%ebp, %rbp
	movslq	%r14d, %r14
	leaq	(%r14,%r14,2), %r14
	addq	%r14, %r13
	addq	%r13, %rbp
	movl	%r12d, (%r8,%rbp,4)
	movl	$1, %r8d
.L18:
	leal	1(%rdx), %ebp
	cmpl	$2, %r9d
	jbe	.L37
	cmpl	$2, %r10d
	jbe	.L35
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L61:
	movl	$1, %r8d
.L22:
	movl	%esi, %ebp
	subl	%ecx, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L17
	leal	1(%rdx), %ebp
.L37:
	movl	4(%rdi,%rax,8), %r13d
	movl	%r13d, %r9d
	subl	%ebp, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L26
	subl	%r13d, %ebp
	movslq	-12(%rsp), %r13
	leaq	(%rax,%rax,8), %r9
	leaq	mark(%rip), %r8
	addl	$1, %ebp
	leaq	0(%r13,%r13,2), %r13
	movslq	%ebp, %rbp
	addq	%r13, %r9
	addq	%rbp, %r9
	movl	%r12d, (%r8,%r9,4)
	cmpl	$2, %r10d
	jbe	.L27
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L32:
	subl	$2, %edx
	movl	%edi, %ecx
	subl	%edx, %ecx
	addl	$1, %ecx
	cmpl	$2, %ecx
	ja	.L31
	leaq	mark(%rip), %r8
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L60:
	movl	$1, %r8d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L58:
	subl	%r13d, %r8d
	leal	1(%r8), %ebp
	leaq	mark(%rip), %r8
	movslq	%ebp, %rbp
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L59:
	movl	%edx, %ebp
	leaq	mark(%rip), %r8
	subl	%r13d, %ebp
	addl	$1, %ebp
	movslq	%ebp, %rbp
	jmp	.L21
	.cfi_endproc
.LFE52:
	.size	marking, .-marking
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	mark(%rip), %r15
	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	$200, %rsp
	.cfi_def_cfa_offset 256
.L63:
	leaq	x(%rip), %rdx
	leaq	y(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	%eax, %r8d
	movl	y(%rip), %eax
	addl	x(%rip), %eax
	imull	%r8d, %eax
	testl	%eax, %eax
	je	.L174
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rax
	addl	$1, set(%rip)
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L64
	xorl	%eax, %eax
	leaq	spr(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L65:
	cltq
	leaq	.LC1(%rip), %rdi
	salq	$3, %rax
	leaq	(%rax,%rbx), %rdx
	leaq	4(%rax,%rbx), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	n(%rip), %edx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L65
	movslq	%edx, %rax
	movq	spr(%rip), %rdx
	movl	%eax, 84(%rsp)
	movq	%rdx, (%rbx,%rax,8)
	movl	$0, step(%rip)
	testl	%eax, %eax
	jle	.L67
	movl	spr(%rip), %r9d
	movl	x(%rip), %r8d
	leaq	spr(%rip), %r13
	movq	$-36, 64(%rsp)
	movl	y(%rip), %eax
	movb	$0, 91(%rsp)
	leal	1(%r9), %edx
	leal	2(%r8), %edi
	movl	$0, 72(%rsp)
	movl	set(%rip), %r12d
	movl	%edx, %ebx
	leal	-2(%r8), %r10d
	leal	-1(%rax), %esi
	subl	%edi, %ebx
	subl	%r9d, %edi
	movl	%ebx, 76(%rsp)
	movl	%edx, %ebx
	addl	$1, %edi
	subl	%r10d, %ebx
	movl	%edi, 128(%rsp)
	leal	-1(%r8), %edi
	movl	%ebx, 80(%rsp)
	movl	4+spr(%rip), %ebx
	leal	1(%rbx), %ecx
	movl	%ebx, 148(%rsp)
	movl	%ecx, %r14d
	movl	%ecx, %ebp
	subl	%esi, %r14d
	subl	%ebx, %esi
	movl	%r14d, 116(%rsp)
	movl	%edx, %r14d
	leal	1(%rsi), %r11d
	leal	2(%rax), %esi
	subl	%edi, %r14d
	subl	%r9d, %edi
	subl	%esi, %ebp
	subl	%ebx, %esi
	addl	$1, %edi
	movl	%r14d, 108(%rsp)
	leal	-2(%rax), %r14d
	subl	%r8d, %edx
	movl	%edi, 160(%rsp)
	leal	1(%rsi), %edi
	movl	%ecx, %esi
	subl	%eax, %ecx
	subl	%r14d, %esi
	movl	%ecx, 120(%rsp)
	leal	1(%rax), %ecx
	movl	%esi, 136(%rsp)
	movl	%r14d, %esi
	subl	%ebx, %ecx
	subl	%ebx, %esi
	movl	%ecx, 172(%rsp)
	addl	$1, %esi
	movl	%edx, 112(%rsp)
	leal	1(%r8), %edx
	movl	%esi, 180(%rsp)
	movl	%ecx, %esi
	movl	%ebx, %ecx
	subl	%r14d, %ebx
	subl	%eax, %ecx
	leal	1(%rsi), %eax
	subl	%r9d, %edx
	movl	%r11d, 176(%rsp)
	movl	%eax, 164(%rsp)
	movl	%r9d, %eax
	xorl	%esi, %esi
	subl	%r8d, %eax
	movl	%r14d, 140(%rsp)
	movl	%eax, 104(%rsp)
	movl	%ebx, %eax
	addl	$1, %eax
	movl	%ebp, 92(%rsp)
	movl	%eax, 100(%rsp)
	leal	1(%rdx), %eax
	movl	%eax, 168(%rsp)
	movl	%r10d, %eax
	subl	%r9d, %eax
	movl	%edi, 132(%rsp)
	addl	$1, %eax
	movl	%edx, 144(%rsp)
	cltq
	movl	%ecx, 124(%rsp)
	leaq	(%rax,%rax,2), %rbx
	movslq	%r11d, %rax
	addq	%rbx, %rax
	movq	%rbx, 152(%rsp)
	movq	%rax, 184(%rsp)
	movq	%r13, 56(%rsp)
	jmp	.L116
	.p2align 4,,10
	.p2align 3
.L176:
	cmpl	$2, 76(%rsp)
	ja	.L69
	cmpl	$2, 116(%rsp)
	ja	.L139
	movslq	128(%rsp), %rax
	movslq	176(%rsp), %rdx
	leaq	(%rax,%rax,2), %rax
	addq	%rdx, %rax
	cmpl	$2, 80(%rsp)
	movl	%r12d, (%r15,%rax,4)
	jbe	.L74
	movl	$1, (%rsp)
.L70:
	cmpl	$2, 108(%rsp)
	ja	.L132
.L71:
	cmpl	$2, 92(%rsp)
	ja	.L76
	movslq	160(%rsp), %rax
	movslq	132(%rsp), %rdx
	movl	$1, (%rsp)
	leaq	(%rax,%rax,2), %rax
	addq	%rdx, %rax
	movl	%r12d, (%r15,%rax,4)
.L76:
	cmpl	$2, 136(%rsp)
	ja	.L72
	movslq	160(%rsp), %rax
	movslq	180(%rsp), %rdx
	movl	$1, (%rsp)
	leaq	(%rax,%rax,2), %rax
	addq	%rdx, %rax
	movl	%r12d, (%r15,%rax,4)
.L72:
	cmpl	$2, 76(%rsp)
	jbe	.L132
.L77:
	cmpl	$2, 80(%rsp)
	jbe	.L131
	cmpl	$2, 112(%rsp)
	ja	.L86
.L79:
	cmpl	$2, 92(%rsp)
	ja	.L84
	movslq	144(%rsp), %rax
	movslq	132(%rsp), %rdx
	movl	$1, (%rsp)
	leaq	(%rax,%rax,2), %rax
	addq	%rdx, %rax
	movl	%r12d, (%r15,%rax,4)
.L84:
	cmpl	$2, 100(%rsp)
	ja	.L80
	movl	140(%rsp), %eax
	movslq	144(%rsp), %rdx
	movl	$1, (%rsp)
	subl	148(%rsp), %eax
	addl	$1, %eax
	leaq	(%rdx,%rdx,2), %rdx
	cltq
	addq	%rax, %rdx
	movl	%r12d, (%r15,%rdx,4)
.L80:
	cmpl	$2, 76(%rsp)
	jbe	.L130
	cmpl	$2, 80(%rsp)
	ja	.L86
.L129:
	cmpl	$2, 124(%rsp)
	ja	.L86
	movslq	164(%rsp), %rax
.L91:
	addq	152(%rsp), %rax
	cmpl	$2, 104(%rsp)
	movl	%r12d, (%r15,%rax,4)
	ja	.L88
	cmpl	$2, 92(%rsp)
	jbe	.L89
	cmpl	$2, 100(%rsp)
	ja	.L88
.L172:
	movslq	168(%rsp), %rax
.L90:
	movl	140(%rsp), %edx
	subl	148(%rsp), %edx
	leaq	(%rax,%rax,2), %rax
	addl	$1, %edx
	movslq	%edx, %rdx
	addq	%rdx, %rax
	movl	%r12d, (%r15,%rax,4)
	.p2align 4,,10
	.p2align 3
.L88:
	addl	$1, 72(%rsp)
	movl	72(%rsp), %eax
	addq	$36, 64(%rsp)
	addq	$8, 56(%rsp)
	movb	$1, 91(%rsp)
	cmpl	%eax, 84(%rsp)
	je	.L175
	movl	%eax, 96(%rsp)
.L116:
	movl	72(%rsp), %edx
	testl	%edx, %edx
	je	.L176
	movq	64(%rsp), %rax
	movl	$0, (%rsp)
	movq	$0, 16(%rsp)
	leaq	(%r15,%rax), %r11
	movslq	72(%rsp), %rax
	movq	%r11, %r13
	movq	%rax, 48(%rsp)
	leaq	(%rax,%rax,8), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L114:
	movl	16(%rsp), %eax
	movq	56(%rsp), %r14
	xorl	%r10d, %r10d
	movl	%eax, 40(%rsp)
	jmp	.L113
	.p2align 4,,10
	.p2align 3
.L94:
	addq	$1, %r10
	cmpq	$3, %r10
	je	.L177
.L113:
	cmpl	%r12d, 0(%r13,%r10,4)
	jne	.L94
	movl	(%r14), %ecx
	movl	40(%rsp), %edx
	addl	-8(%r14), %edx
	movl	-4(%r14), %esi
	leal	-1(%rdx), %eax
	movl	%ecx, %r8d
	leal	1(%rdx), %r11d
	movl	%ecx, %ebx
	movl	%eax, 32(%rsp)
	leal	-3(%rdx), %eax
	addl	%r10d, %esi
	subl	%edx, %ebx
	subl	%eax, %r8d
	movl	%r11d, 44(%rsp)
	leal	-1(%rsi), %r9d
	leal	-2(%rsi), %edi
	leal	1(%r8), %ebp
	movl	%eax, 36(%rsp)
	movl	%ebp, 12(%rsp)
	cmpl	$2, %ebx
	ja	.L95
	movl	4(%r14), %eax
	movl	%eax, %r8d
	subl	%edi, %r8d
	addl	$1, %r8d
	cmpl	$2, %r8d
	ja	.L96
	movl	%r11d, %r8d
	subl	%eax, %edi
	subl	%ecx, %r8d
	addl	$1, %edi
	addl	$1, %r8d
	movslq	%edi, %rdi
	movslq	%r8d, %r8
	leaq	(%r8,%r8,2), %r8
	addq	24(%rsp), %r8
	addq	%rdi, %r8
	movl	%r12d, (%r15,%r8,4)
	cmpl	$2, %ebp
	jbe	.L97
	movl	$1, (%rsp)
.L96:
	leal	-2(%rdx), %r11d
	movl	%ecx, %ebp
	leal	1(%rsi), %edi
	subl	%r11d, %ebp
	leal	-3(%rsi), %r8d
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L137
.L136:
	movl	%eax, %ebp
	subl	%edi, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L101
	movl	%edi, %ebp
	subl	%eax, %ebp
	addl	$1, %ebp
	movslq	%ebp, %rbp
	movq	%rbp, (%rsp)
	movl	%r11d, %ebp
	subl	%ecx, %ebp
	addl	$1, %ebp
	movslq	%ebp, %rbp
	leaq	0(%rbp,%rbp,2), %rbp
	addq	24(%rsp), %rbp
	addq	(%rsp), %rbp
	movl	$1, (%rsp)
	movl	%r12d, (%r15,%rbp,4)
.L101:
	movl	%eax, %ebp
	subl	%r8d, %ebp
	addl	$1, %ebp
	cmpl	$2, %ebp
	ja	.L100
	movl	%r8d, %ebp
	subl	%ecx, %r11d
	movl	$1, (%rsp)
	subl	%eax, %ebp
	leal	1(%r11), %eax
	addl	$1, %ebp
	cltq
	movslq	%ebp, %rbp
	leaq	(%rax,%rax,2), %rax
	addq	24(%rsp), %rax
	addq	%rbp, %rax
	movl	%r12d, (%r15,%rax,4)
.L100:
	cmpl	$2, %ebx
	jbe	.L178
	cmpl	$2, 12(%rsp)
	jbe	.L179
	movl	%ecx, %eax
	subl	32(%rsp), %eax
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L110
	movl	4(%r14), %eax
.L133:
	movl	%eax, %r9d
	subl	%edi, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L108
	movl	32(%rsp), %r9d
	movl	%edi, %r11d
	movl	$1, (%rsp)
	subl	%eax, %r11d
	subl	%ecx, %r9d
	addl	$1, %r11d
	addl	$1, %r9d
	movslq	%r11d, %r11
	movslq	%r9d, %r9
	leaq	(%r9,%r9,2), %r9
	addq	24(%rsp), %r9
	addq	%r11, %r9
	movl	%r12d, (%r15,%r9,4)
.L108:
	movl	%eax, %r9d
	subl	%r8d, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L107
	movl	32(%rsp), %r11d
	movl	%r8d, %r9d
	movl	$1, (%rsp)
	subl	%eax, %r9d
	subl	%ecx, %r11d
	addl	$1, %r9d
	addl	$1, %r11d
	movslq	%r9d, %r9
	movslq	%r11d, %r11
	leaq	(%r11,%r11,2), %r11
	addq	24(%rsp), %r11
	addq	%r9, %r11
	movl	%r12d, (%r15,%r11,4)
.L107:
	cmpl	$2, %ebx
	jbe	.L135
	cmpl	$2, 12(%rsp)
	ja	.L110
.L134:
	movl	%eax, %r9d
	subl	%esi, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L110
	subl	%eax, %esi
	addl	$1, %esi
	movslq	%esi, %rsi
.L111:
	movl	36(%rsp), %r9d
	movq	48(%rsp), %rax
	subl	%ecx, %r9d
	leaq	(%rax,%rax,8), %rax
	addl	$1, %r9d
	movslq	%r9d, %r9
	leaq	(%r9,%r9,2), %r9
	addq	%r9, %rax
	addq	%rsi, %rax
	movl	%r12d, (%r15,%rax,4)
.L173:
	movl	$1, (%rsp)
.L110:
	movl	%ecx, %eax
	subl	%edx, %eax
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L94
	movl	4(%r14), %eax
	movl	%eax, %esi
	subl	%edi, %esi
	addl	$1, %esi
	cmpl	$2, %esi
	ja	.L112
	movl	%edx, %esi
	subl	%eax, %edi
	movl	$1, (%rsp)
	subl	%ecx, %esi
	addl	$1, %edi
	addl	$1, %esi
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	leaq	(%rsi,%rsi,2), %rsi
	addq	24(%rsp), %rsi
	addq	%rdi, %rsi
	movl	%r12d, (%r15,%rsi,4)
.L112:
	movl	%eax, %esi
	subl	%r8d, %esi
	addl	$1, %esi
	cmpl	$2, %esi
	ja	.L94
	subl	%ecx, %edx
	subl	%eax, %r8d
	addq	$1, %r10
	movl	$1, (%rsp)
	leal	1(%rdx), %eax
	leal	1(%r8), %esi
	cltq
	movslq	%esi, %rsi
	leaq	(%rax,%rax,2), %rax
	addq	24(%rsp), %rax
	addq	%rsi, %rax
	movl	%r12d, (%r15,%rax,4)
	cmpq	$3, %r10
	jne	.L113
	.p2align 4,,10
	.p2align 3
.L177:
	addq	$1, 16(%rsp)
	movq	16(%rsp), %rax
	addq	$12, %r13
	cmpq	$3, %rax
	jne	.L114
	movl	$1, %esi
.L92:
	movl	(%rsp), %eax
	testl	%eax, %eax
	jne	.L88
	movl	$0, safe(%rip)
	cmpb	$0, 91(%rsp)
	je	.L121
	movl	96(%rsp), %eax
	movl	%eax, step(%rip)
.L121:
	testb	%sil, %sil
	je	.L122
	movl	$3, i(%rip)
	movl	$3, j(%rip)
.L122:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L178:
	movl	4(%r14), %eax
.L137:
	movl	%eax, %r11d
	subl	%r9d, %r11d
	addl	$1, %r11d
	cmpl	$2, %r11d
	ja	.L103
	movl	44(%rsp), %r11d
	subl	%eax, %r9d
	addl	$1, %r9d
	subl	%ecx, %r11d
	movslq	%r9d, %r9
	addl	$1, %r11d
	movslq	%r11d, %r11
	leaq	(%r11,%r11,2), %r11
	addq	24(%rsp), %r11
	addq	%r9, %r11
	cmpl	$2, 12(%rsp)
	movl	%r12d, (%r15,%r11,4)
	jbe	.L104
	movl	$1, (%rsp)
.L103:
	movl	%ecx, %r9d
	subl	32(%rsp), %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	jbe	.L133
.L135:
	movl	%eax, %r9d
	subl	%esi, %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	ja	.L110
	subl	%eax, %esi
	movl	44(%rsp), %eax
	addl	$1, %esi
	subl	%ecx, %eax
	movslq	%esi, %rsi
	addl	$1, %eax
	cltq
	leaq	(%rax,%rax,2), %rax
	addq	24(%rsp), %rax
	addq	%rsi, %rax
	cmpl	$2, 12(%rsp)
	movl	%r12d, (%r15,%rax,4)
	jbe	.L111
	jmp	.L173
	.p2align 4,,10
	.p2align 3
.L95:
	cmpl	$2, 12(%rsp)
	ja	.L98
	movl	4(%r14), %eax
	movl	%eax, %r8d
	subl	%edi, %r8d
	addl	$1, %r8d
	cmpl	$2, %r8d
	ja	.L99
	subl	%eax, %edi
	addl	$1, %edi
	movslq	%edi, %rdi
.L97:
	movl	36(%rsp), %r8d
	movq	48(%rsp), %rax
	movl	$1, (%rsp)
	subl	%ecx, %r8d
	leaq	(%rax,%rax,8), %rax
	addl	$1, %r8d
	movslq	%r8d, %r8
	leaq	(%r8,%r8,2), %r8
	addq	%r8, %rax
	addq	%rdi, %rax
	movl	%r12d, (%r15,%rax,4)
.L98:
	leal	-2(%rdx), %r11d
	movl	%ecx, %eax
	leal	1(%rsi), %edi
	subl	%r11d, %eax
	leal	-3(%rsi), %r8d
	addl	$1, %eax
	cmpl	$2, %eax
	ja	.L100
	movl	4(%r14), %eax
	jmp	.L136
	.p2align 4,,10
	.p2align 3
.L179:
	movl	4(%r14), %eax
	movl	%eax, %r11d
	subl	%r9d, %r11d
	addl	$1, %r11d
	cmpl	$2, %r11d
	ja	.L106
.L180:
	subl	%eax, %r9d
	addl	$1, %r9d
	movslq	%r9d, %r9
.L104:
	movl	36(%rsp), %ebp
	movq	48(%rsp), %r11
	movl	$1, (%rsp)
	subl	%ecx, %ebp
	leaq	(%r11,%r11,8), %r11
	addl	$1, %ebp
	movslq	%ebp, %rbp
	leaq	0(%rbp,%rbp,2), %rbp
	addq	%rbp, %r11
	addq	%r9, %r11
	movl	%ecx, %r9d
	subl	32(%rsp), %r9d
	addl	$1, %r9d
	movl	%r12d, (%r15,%r11,4)
	cmpl	$2, %r9d
	ja	.L107
	jmp	.L133
	.p2align 4,,10
	.p2align 3
.L99:
	leal	-2(%rdx), %r11d
	movl	%ecx, %ebp
	leal	1(%rsi), %edi
	subl	%r11d, %ebp
	leal	-3(%rsi), %r8d
	addl	$1, %ebp
	cmpl	$2, %ebp
	jbe	.L136
	movl	%eax, %r11d
	subl	%r9d, %r11d
	addl	$1, %r11d
	cmpl	$2, %r11d
	jbe	.L180
.L106:
	movl	%ecx, %r9d
	subl	32(%rsp), %r9d
	addl	$1, %r9d
	cmpl	$2, %r9d
	jbe	.L133
	jmp	.L134
	.p2align 4,,10
	.p2align 3
.L86:
	cmpl	$2, 104(%rsp)
	ja	.L92
	cmpl	$2, 92(%rsp)
	jbe	.L89
.L93:
	cmpl	$2, 100(%rsp)
	ja	.L92
	jmp	.L172
.L132:
	cmpl	$2, 120(%rsp)
	ja	.L78
	movslq	128(%rsp), %rdx
	movslq	172(%rsp), %rax
	leaq	(%rdx,%rdx,2), %rdx
	addq	%rax, %rdx
	cmpl	$2, 80(%rsp)
	movl	%r12d, (%r15,%rdx,4)
	jbe	.L82
	movl	$1, (%rsp)
.L78:
	cmpl	$2, 112(%rsp)
	jbe	.L79
.L130:
	cmpl	$2, 124(%rsp)
	ja	.L86
	movslq	128(%rsp), %rdx
	movslq	164(%rsp), %rax
	leaq	(%rdx,%rdx,2), %rdx
	addq	%rax, %rdx
	cmpl	$2, 80(%rsp)
	movl	%r12d, (%r15,%rdx,4)
	jbe	.L91
	cmpl	$2, 104(%rsp)
	ja	.L88
	cmpl	$2, 92(%rsp)
	movl	$1, (%rsp)
	ja	.L93
.L89:
	movslq	168(%rsp), %rax
	movslq	132(%rsp), %rcx
	leaq	(%rax,%rax,2), %rdx
	addq	%rcx, %rdx
	cmpl	$2, 100(%rsp)
	movl	%r12d, (%r15,%rdx,4)
	ja	.L88
	jmp	.L90
.L69:
	cmpl	$2, 80(%rsp)
	ja	.L73
	cmpl	$2, 116(%rsp)
	jbe	.L74
	cmpl	$2, 108(%rsp)
	jbe	.L148
	movl	$0, (%rsp)
.L131:
	cmpl	$2, 120(%rsp)
	ja	.L168
	movslq	172(%rsp), %rax
.L82:
	addq	152(%rsp), %rax
	cmpl	$2, 112(%rsp)
	movl	$1, (%rsp)
	movl	%r12d, (%r15,%rax,4)
	jbe	.L79
	jmp	.L80
.L73:
	cmpl	$2, 108(%rsp)
	jbe	.L148
	movl	$0, (%rsp)
	jmp	.L77
.L74:
	movq	184(%rsp), %rax
	cmpl	$2, 108(%rsp)
	movl	$1, (%rsp)
	movl	%r12d, (%r15,%rax,4)
	jbe	.L71
	jmp	.L72
.L139:
	movl	$0, (%rsp)
	jmp	.L70
.L148:
	movl	$0, (%rsp)
	jmp	.L71
.L168:
	cmpl	$2, 112(%rsp)
	ja	.L129
	jmp	.L79
.L175:
	movl	$1, safe(%rip)
	movl	84(%rsp), %eax
	movl	%eax, step(%rip)
	testb	%sil, %sil
	je	.L67
	movl	$3, i(%rip)
	movl	$3, j(%rip)
.L67:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L63
.L174:
	addq	$200, %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
.L64:
	.cfi_restore_state
	movq	spr(%rip), %rdx
	leaq	spr(%rip), %rbx
	movq	%rdx, (%rbx,%rax,8)
	movl	$0, step(%rip)
	jmp	.L67
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	mat
	.bss
	.align 32
	.type	mat, @object
	.size	mat, 3600
mat:
	.zero	3600
	.globl	mark
	.align 32
	.type	mark, @object
	.size	mark, 540
mark:
	.zero	540
	.globl	spr
	.align 32
	.type	spr, @object
	.size	spr, 120
spr:
	.zero	120
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	safe
	.align 4
	.type	safe, @object
	.size	safe, 4
safe:
	.zero	4
	.globl	set
	.align 4
	.type	set, @object
	.size	set, 4
set:
	.zero	4
	.globl	step
	.align 4
	.type	step, @object
	.size	step, 4
step:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int i,j,n,step,set,safe;
int x,y,spr[15][2],mark[15][3][3],mat[30][30];

void check(int x,int y){
	if(abs(spr[step][0]-x)<2 && abs(spr[step][1]-y)<2){
		mark[step][x-spr[step][0]+1][y-spr[step][1]+1]=set;
		safe=1;
	}
}

void marking(int x,int y){
	int k;
	for(k=-1;k<2;k++){
		check(x+2,y+k);
		check(x-2,y+k);
		check(x+k,y+2);
		check(x+k,y-2);
	}
}

int main(){
	while(scanf("%d %d",&y,&x)*(x+y)){
		scanf("%d",&n);
		set++;
		for(i=0;i<n;i++){scanf("%d %d",&spr[i][1],&spr[i][0]);}
		spr[n][1]=spr[0][1];spr[n][0]=spr[0][0];
		for(step=0;step<n;step++){
			safe=0;
			if(step==0)marking(x,y);
			else{
				for(i=0;i<3;i++){
					for(j=0;j<3;j++){
						if(mark[step-1][i][j]==set)marking(spr[step-1][0]+i-1,spr[step-1][1]+j-1);
					}
				}
			}
			if(safe==0)break;
		}
		if(step>=n) printf("OK\n"); else printf("NA\n");
	}
	return 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
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int i,j,n,step,set,safe;
int x,y,spr[15][2],mark[15][3][3],mat[30][30];

void check(int x,int y){
	if(abs(spr[step][0]-x)<2 && abs(spr[step][1]-y)<2){
		mark[step][x-spr[step][0]+1][y-spr[step][1]+1]=set;
		safe=1;
	}
}

void marking(int x,int y){
	int k;
	for(k=-1;k<2;k++){
		check(x+2,y+k);
		check(x-2,y+k);
		check(x+k,y+2);
		check(x+k,y-2);
	}
}

int main(){
	while(scanf("%d %d",&y,&x)*(x+y)){
		scanf("%d",&n);
		set++;
		for(i=0;i<n;i++){scanf("%d %d",&spr[i][1],&spr[i][0]);}
		spr[n][1]=spr[0][1];spr[n][0]=spr[0][0];
		for(step=0;step<n;step++){
			safe=0;
			if(step==0)marking(x,y);
			else{
				for(i=0;i<3;i++){
					for(j=0;j<3;j++){
						if(mark[step-1][i][j]==set)marking(spr[step-1][0]+i-1,spr[step-1][1]+j-1);
					}
				}
			}
			if(safe==0)break;
		}
		if(step>=n) printf("OK\n"); else printf("NA\n");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	step
	.align 4
	.type	step, @object
	.size	step, 4
step:
	.zero	4
	.globl	set
	.align 4
	.type	set, @object
	.size	set, 4
set:
	.zero	4
	.globl	safe
	.align 4
	.type	safe, @object
	.size	safe, 4
safe:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	spr
	.align 32
	.type	spr, @object
	.size	spr, 120
spr:
	.zero	120
	.globl	mark
	.align 32
	.type	mark, @object
	.size	mark, 540
mark:
	.zero	540
	.globl	mat
	.align 32
	.type	mat, @object
	.size	mat, 3600
mat:
	.zero	3600
	.text
	.globl	check
	.type	check, @function
check:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-4(%rbp), %eax
	cmpl	$-1, %eax
	jl	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-4(%rbp), %eax
	cmpl	$1, %eax
	jg	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-8(%rbp), %eax
	cmpl	$-1, %eax
	jl	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-8(%rbp), %eax
	cmpl	$1, %eax
	jg	.L3
	movl	step(%rip), %eax
	movl	step(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	spr(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-4(%rbp), %edx
	subl	%ecx, %edx
	leal	1(%rdx), %esi
	movl	step(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+spr(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-8(%rbp), %edx
	subl	%ecx, %edx
	addl	$1, %edx
	movl	set(%rip), %ecx
	movslq	%edx, %rdi
	cltq
	movslq	%esi, %rsi
	movq	%rax, %rdx
	salq	$3, %rdx
	addq	%rax, %rdx
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mark(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$1, safe(%rip)
.L3:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	check, .-check
	.globl	marking
	.type	marking, @function
marking:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$-1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$2, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	subl	$2, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %eax
	leal	2(%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %eax
	leal	-2(%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	addl	$1, -4(%rbp)
.L5:
	cmpl	$1, -4(%rbp)
	jle	.L6
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	marking, .-marking
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L8
.L23:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	set(%rip), %eax
	addl	$1, %eax
	movl	%eax, set(%rip)
	movl	$0, i(%rip)
	jmp	.L9
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rcx
	leaq	spr(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L10
	movl	n(%rip), %edx
	movl	4+spr(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+spr(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	n(%rip), %edx
	movl	spr(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	spr(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, step(%rip)
	jmp	.L11
.L21:
	movl	$0, safe(%rip)
	movl	step(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	y(%rip), %edx
	movl	x(%rip), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	marking
	jmp	.L13
.L12:
	movl	$0, i(%rip)
	jmp	.L14
.L18:
	movl	$0, j(%rip)
	jmp	.L15
.L17:
	movl	step(%rip), %eax
	leal	-1(%rax), %ecx
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$3, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mark(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	set(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	movl	step(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	addl	%edx, %eax
	leal	-1(%rax), %edx
	movl	step(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	spr(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	i(%rip), %eax
	addl	%ecx, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	marking
.L16:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L15:
	movl	j(%rip), %eax
	cmpl	$2, %eax
	jle	.L17
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L14:
	movl	i(%rip), %eax
	cmpl	$2, %eax
	jle	.L18
.L13:
	movl	safe(%rip), %eax
	testl	%eax, %eax
	je	.L25
	movl	step(%rip), %eax
	addl	$1, %eax
	movl	%eax, step(%rip)
.L11:
	movl	step(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L21
	jmp	.L20
.L25:
	nop
.L20:
	movl	step(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L22:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	leaq	x(%rip), %rax
	movq	%rax, %rdx
	leaq	y(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	x(%rip), %ecx
	movl	y(%rip), %edx
	addl	%ecx, %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	step
	.align 4
	.type	step, @object
	.size	step, 4
step:
	.zero	4
	.globl	set
	.align 4
	.type	set, @object
	.size	set, 4
set:
	.zero	4
	.globl	safe
	.align 4
	.type	safe, @object
	.size	safe, 4
safe:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	spr
	.align 32
	.type	spr, @object
	.size	spr, 120
spr:
	.zero	120
	.globl	mark
	.align 32
	.type	mark, @object
	.size	mark, 540
mark:
	.zero	540
	.globl	mat
	.align 32
	.type	mat, @object
	.size	mat, 3600
mat:
	.zero	3600
	.text
	.globl	check
	.type	check, @function
check:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-4(%rbp), %eax
	cmpl	$-1, %eax
	jl	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-4(%rbp), %eax
	cmpl	$1, %eax
	jg	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-8(%rbp), %eax
	cmpl	$-1, %eax
	jl	.L3
	movl	step(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-8(%rbp), %eax
	cmpl	$1, %eax
	jg	.L3
	movl	step(%rip), %eax
	movl	step(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	spr(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-4(%rbp), %edx
	subl	%ecx, %edx
	leal	1(%rdx), %esi
	movl	step(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+spr(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-8(%rbp), %edx
	subl	%ecx, %edx
	addl	$1, %edx
	movl	set(%rip), %ecx
	movslq	%edx, %rdi
	cltq
	movslq	%esi, %rsi
	movq	%rax, %rdx
	salq	$3, %rdx
	addq	%rax, %rdx
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mark(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$1, safe(%rip)
.L3:
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	check, .-check
	.globl	marking
	.type	marking, @function
marking:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$-1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$2, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	subl	$2, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %eax
	leal	2(%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	movl	-24(%rbp), %eax
	leal	-2(%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	addl	$1, -4(%rbp)
.L5:
	cmpl	$1, -4(%rbp)
	jle	.L6
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	marking, .-marking
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L8
.L23:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	set(%rip), %eax
	addl	$1, %eax
	movl	%eax, set(%rip)
	movl	$0, i(%rip)
	jmp	.L9
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	spr(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rcx
	leaq	spr(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L10
	movl	n(%rip), %edx
	movl	4+spr(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+spr(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	n(%rip), %edx
	movl	spr(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	spr(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, step(%rip)
	jmp	.L11
.L21:
	movl	$0, safe(%rip)
	movl	step(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	y(%rip), %edx
	movl	x(%rip), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	marking
	jmp	.L13
.L12:
	movl	$0, i(%rip)
	jmp	.L14
.L18:
	movl	$0, j(%rip)
	jmp	.L15
.L17:
	movl	step(%rip), %eax
	leal	-1(%rax), %ecx
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movq	%rax, %rdx
	salq	$3, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mark(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	set(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	movl	step(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+spr(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	addl	%edx, %eax
	leal	-1(%rax), %edx
	movl	step(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	spr(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	i(%rip), %eax
	addl	%ecx, %eax
	subl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	marking
.L16:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L15:
	movl	j(%rip), %eax
	cmpl	$2, %eax
	jle	.L17
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L14:
	movl	i(%rip), %eax
	cmpl	$2, %eax
	jle	.L18
.L13:
	movl	safe(%rip), %eax
	testl	%eax, %eax
	je	.L25
	movl	step(%rip), %eax
	addl	$1, %eax
	movl	%eax, step(%rip)
.L11:
	movl	step(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L21
	jmp	.L20
.L25:
	nop
.L20:
	movl	step(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L22:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	leaq	x(%rip), %rax
	movq	%rax, %rdx
	leaq	y(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	x(%rip), %ecx
	movl	y(%rip), %edx
	addl	%ecx, %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
