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>          // printf(), scanf()
#include <stdbool.h>

#define MAX_N 10
#define MAX_M 10
#define MAX_G 9

int sx, sy;
int n;
int scx[MAX_N], scy[MAX_N];

bool
b_survival()
{
	bool field[MAX_M][MAX_M];
	int px[MAX_G], py[MAX_G];
	static const int dx2[12] = {-1, 0, 1, 2, 2, 2,-1, 0, 1,-2,-2,-2};
	static const int dy2[12] = {-2,-2,-2,-1, 0, 1, 2, 2, 2,-1, 0, 1};

	int ix = 0;
	px[ix] = sx, py[ix] = sy;
	ix++;

	for (int u = 0; u < n; ++u)
	{
		for (int dy = -1; dy <= 1; ++dy)
		{
			for (int dx = -1; dx <= 1; ++dx)
			{
				int nx = scx[u] + dx, ny = scy[u] + dy;
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M)
					field[ny][nx] = false;
			}
		}

		for (int i = 0; i < ix; ++i)
		{
			for (int j = 0; j < 12; ++j)
			{
				int nx = px[i] + dx2[j], ny = py[i] + dy2[j];
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M)
					field[ny][nx] = true;
			}
		}

		ix = 0;
		for (int dy = -1; dy <= 1; ++dy)
		{
			for (int dx = -1; dx <= 1; ++dx)
			{
				int nx = scx[u] + dx, ny = scy[u] + dy;
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M && field[ny][nx])
				{
					px[ix] = nx;
					py[ix] = ny;
					ix++;
				}
			}
		}

		if (ix == 0)
			return false;
	}

	return true;
}

int
main(int argc, char **argv)
{
	int lineno = 0;
	while (true)
	{
		lineno++;
		scanf("%d%d", &sx, &sy);
		if (sx == 0 && sy == 0)
			break;

		lineno++;
		scanf("%d", &n);

		lineno++;
		for (int i = 0; i < n; ++i)
			scanf("%d%d", &scx[i], &scy[i]);

		printf("%s\n", b_survival() ? "OK" : "NA");
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sx
	.bss
	.align 4
	.type	sx, @object
	.size	sx, 4
sx:
	.zero	4
	.globl	sy
	.align 4
	.type	sy, @object
	.size	sy, 4
sy:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	scx
	.align 32
	.type	scx, @object
	.size	scx, 40
scx:
	.zero	40
	.globl	scy
	.align 32
	.type	scy, @object
	.size	scy, 40
scy:
	.zero	40
	.text
	.globl	b_survival
	.type	b_survival, @function
b_survival:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -264(%rbp)
	movl	sx(%rip), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movl	sy(%rip), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -264(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L2
.L20:
	movl	$-1, -256(%rbp)
	jmp	.L3
.L7:
	movl	$-1, -252(%rbp)
	jmp	.L4
.L6:
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-252(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -216(%rbp)
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-256(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -212(%rbp)
	cmpl	$0, -216(%rbp)
	js	.L5
	cmpl	$9, -216(%rbp)
	jg	.L5
	cmpl	$0, -212(%rbp)
	js	.L5
	cmpl	$9, -212(%rbp)
	jg	.L5
	movl	-216(%rbp), %eax
	movslq	%eax, %rcx
	movl	-212(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movb	$0, (%rax)
.L5:
	addl	$1, -252(%rbp)
.L4:
	cmpl	$1, -252(%rbp)
	jle	.L6
	addl	$1, -256(%rbp)
.L3:
	cmpl	$1, -256(%rbp)
	jle	.L7
	movl	$0, -248(%rbp)
	jmp	.L8
.L12:
	movl	$0, -244(%rbp)
	jmp	.L9
.L11:
	movl	-248(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %ecx
	movl	-244(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx2.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -224(%rbp)
	movl	-248(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %ecx
	movl	-244(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy2.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -220(%rbp)
	cmpl	$0, -224(%rbp)
	js	.L10
	cmpl	$9, -224(%rbp)
	jg	.L10
	cmpl	$0, -220(%rbp)
	js	.L10
	cmpl	$9, -220(%rbp)
	jg	.L10
	movl	-224(%rbp), %eax
	movslq	%eax, %rcx
	movl	-220(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movb	$1, (%rax)
.L10:
	addl	$1, -244(%rbp)
.L9:
	cmpl	$11, -244(%rbp)
	jle	.L11
	addl	$1, -248(%rbp)
.L8:
	movl	-248(%rbp), %eax
	cmpl	-264(%rbp), %eax
	jl	.L12
	movl	$0, -264(%rbp)
	movl	$-1, -240(%rbp)
	jmp	.L13
.L17:
	movl	$-1, -236(%rbp)
	jmp	.L14
.L16:
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-236(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -232(%rbp)
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-240(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -228(%rbp)
	cmpl	$0, -232(%rbp)
	js	.L15
	cmpl	$9, -232(%rbp)
	jg	.L15
	cmpl	$0, -228(%rbp)
	js	.L15
	cmpl	$9, -228(%rbp)
	jg	.L15
	movl	-232(%rbp), %eax
	movslq	%eax, %rcx
	movl	-228(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L15
	movl	-264(%rbp), %eax
	cltq
	movl	-232(%rbp), %edx
	movl	%edx, -208(%rbp,%rax,4)
	movl	-264(%rbp), %eax
	cltq
	movl	-228(%rbp), %edx
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -264(%rbp)
.L15:
	addl	$1, -236(%rbp)
.L14:
	cmpl	$1, -236(%rbp)
	jle	.L16
	addl	$1, -240(%rbp)
.L13:
	cmpl	$1, -240(%rbp)
	jle	.L17
	cmpl	$0, -264(%rbp)
	jne	.L18
	movl	$0, %eax
	jmp	.L21
.L18:
	addl	$1, -260(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L20
	movl	$1, %eax
.L21:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	b_survival, .-b_survival
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
	.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, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -8(%rbp)
.L30:
	addl	$1, -8(%rbp)
	leaq	sy(%rip), %rax
	movq	%rax, %rdx
	leaq	sx(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	sx(%rip), %eax
	testl	%eax, %eax
	jne	.L24
	movl	sy(%rip), %eax
	testl	%eax, %eax
	je	.L33
.L24:
	addl	$1, -8(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L26
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	scx(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L26:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L27
	movl	$0, %eax
	call	b_survival
	testb	%al, %al
	je	.L28
	leaq	.LC2(%rip), %rax
	jmp	.L29
.L28:
	leaq	.LC3(%rip), %rax
.L29:
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L30
.L33:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 32
	.type	dx2.1, @object
	.size	dx2.1, 48
dx2.1:
	.long	-1
	.long	0
	.long	1
	.long	2
	.long	2
	.long	2
	.long	-1
	.long	0
	.long	1
	.long	-2
	.long	-2
	.long	-2
	.align 32
	.type	dy2.0, @object
	.size	dy2.0, 48
dy2.0:
	.long	-2
	.long	-2
	.long	-2
	.long	-1
	.long	0
	.long	1
	.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:
```

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	b_survival
	.type	b_survival, @function
b_survival:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$296, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 280(%rsp)
	movl	sx(%rip), %eax
	movl	%eax, 80(%rsp)
	movl	sy(%rip), %eax
	movl	%eax, 128(%rsp)
	movslq	n(%rip), %rax
	testl	%eax, %eax
	jle	.L2
	movq	%rax, 72(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	128(%rsp), %rax
	movq	$0, 32(%rsp)
	movl	$1, 24(%rsp)
	movq	%rax, 16(%rsp)
.L3:
	movq	32(%rsp), %rax
	leaq	scx(%rip), %rcx
	leaq	scy(%rip), %rdi
	movl	(%rcx,%rax,4), %ecx
	movl	(%rdi,%rax,4), %eax
	movl	%ecx, 28(%rsp)
	subl	$1, %ecx
	movl	%eax, 40(%rsp)
	subl	$1, %eax
	cmpl	$9, %ecx
	setbe	%dil
	cmpl	$9, %eax
	movl	%ecx, 48(%rsp)
	setbe	%cl
	movl	%eax, 52(%rsp)
	movl	%ecx, %eax
	andb	%dil, %al
	movb	%al, 65(%rsp)
	jne	.L173
.L30:
	cmpl	$9, 28(%rsp)
	movl	%ecx, %ebx
	setbe	%al
	andb	%al, %bl
	movb	%bl, 69(%rsp)
	jne	.L174
.L31:
	movl	28(%rsp), %ebx
	addl	$1, %ebx
	cmpl	$9, %ebx
	movl	%ebx, 44(%rsp)
	setbe	%dl
	andb	%dl, %cl
	movb	%cl, 63(%rsp)
	jne	.L175
.L32:
	cmpl	$9, 40(%rsp)
	movl	%edi, %ebx
	setbe	%cl
	andb	%cl, %bl
	movb	%bl, 68(%rsp)
	jne	.L176
.L33:
	movl	%eax, %ebx
	andb	%cl, %bl
	movb	%bl, 64(%rsp)
	jne	.L177
.L34:
	andb	%dl, %cl
	movb	%cl, 67(%rsp)
	jne	.L178
.L35:
	movl	40(%rsp), %ebx
	addl	$1, %ebx
	movl	%ebx, %esi
	movl	%ebx, 56(%rsp)
	notl	%esi
	shrl	$31, %esi
	cmpl	$9, %ebx
	setbe	%cl
	setle	%r8b
	andb	%cl, %dil
	movb	%dil, 62(%rsp)
	jne	.L179
.L36:
	andb	%al, %cl
	movb	%cl, 66(%rsp)
	jne	.L180
.L37:
	movl	%edx, %eax
	andl	%esi, %eax
	andb	%al, %r8b
	movb	%al, 70(%rsp)
	movb	%r8b, 71(%rsp)
	jne	.L181
.L38:
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	8(%rsp), %rax
	movq	16(%rsp), %rbx
	movl	(%rax,%rcx,4), %eax
	movslq	(%rbx,%rcx,4), %rdx
	leal	-1(%rax), %r10d
	leal	-2(%rdx), %esi
	cmpl	$9, %r10d
	setbe	%r11b
	cmpl	$9, %esi
	setbe	%dil
	testb	%r11b, %r11b
	je	.L4
	testb	%dil, %dil
	je	.L4
	movslq	%esi, %r9
	movslq	%r10d, %r8
	leaq	(%r9,%r9,4), %r9
	leaq	288(%rsp,%r9,2), %r9
	movb	$1, -112(%r8,%r9)
.L4:
	cmpl	$9, %eax
	setbe	%r14b
	ja	.L5
	testb	%dil, %dil
	je	.L5
	movslq	%esi, %r9
	movslq	%eax, %r8
	leaq	(%r9,%r9,4), %r9
	leaq	288(%rsp,%r9,2), %r9
	movb	$1, -112(%r8,%r9)
.L5:
	leal	1(%rax), %r9d
	cmpl	$9, %r9d
	setbe	%r13b
	ja	.L6
	testb	%dil, %dil
	je	.L6
	movslq	%esi, %rsi
	movslq	%r9d, %rdi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %r8
	movb	$1, -112(%rdi,%r8)
.L6:
	leal	2(%rax), %r15d
	leal	-1(%rdx), %r8d
	cmpl	$9, %r15d
	setbe	%sil
	cmpl	$9, %r8d
	setbe	%bpl
	testb	%sil, %sil
	je	.L7
	testb	%bpl, %bpl
	je	.L7
	movslq	%r8d, %rbx
	movslq	%r15d, %rdi
	leaq	(%rbx,%rbx,4), %rbx
	leaq	288(%rsp,%rbx,2), %rbx
	movb	$1, -112(%rdi,%rbx)
.L7:
	cmpl	$9, %edx
	setbe	%bl
	testb	%sil, %sil
	je	.L8
	testb	%bl, %bl
	je	.L8
	movslq	%edx, %r12
	movslq	%r15d, %rdi
	leaq	(%r12,%r12,4), %r12
	leaq	288(%rsp,%r12,2), %r12
	movb	$1, -112(%rdi,%r12)
.L8:
	leal	1(%rdx), %edi
	cmpl	$9, %edi
	setbe	%r12b
	ja	.L9
	testb	%sil, %sil
	je	.L9
	movslq	%edi, %rsi
	movslq	%r15d, %r15
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$1, -112(%r15,%rsi)
.L9:
	leal	2(%rdx), %esi
	cmpl	$9, %esi
	setbe	%r15b
	testb	%r11b, %r11b
	je	.L10
	testb	%r15b, %r15b
	je	.L10
	movslq	%esi, %r11
	movslq	%r10d, %r10
	leaq	(%r11,%r11,4), %r11
	leaq	288(%rsp,%r11,2), %r11
	movb	$1, -112(%r10,%r11)
.L10:
	testb	%r14b, %r14b
	je	.L11
	testb	%r15b, %r15b
	je	.L11
	movslq	%esi, %r11
	movslq	%eax, %r10
	leaq	(%r11,%r11,4), %r11
	leaq	288(%rsp,%r11,2), %r11
	movb	$1, -112(%r10,%r11)
.L11:
	testb	%r13b, %r13b
	je	.L12
	testb	%r15b, %r15b
	je	.L12
	movslq	%esi, %rsi
	movslq	%r9d, %r9
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$1, -112(%r9,%rsi)
.L12:
	subl	$2, %eax
	cmpl	$9, %eax
	setbe	%sil
	ja	.L14
	testb	%bpl, %bpl
	je	.L13
	movslq	%r8d, %r8
	movslq	%eax, %r9
	leaq	(%r8,%r8,4), %r8
	leaq	288(%rsp,%r8,2), %r10
	movb	$1, -112(%r9,%r10)
.L13:
	testb	%sil, %sil
	je	.L14
	testb	%bl, %bl
	je	.L14
	leaq	(%rdx,%rdx,4), %rdx
	movslq	%eax, %r8
	leaq	288(%rsp,%rdx,2), %r9
	movb	$1, -112(%r8,%r9)
.L14:
	testb	%r12b, %r12b
	je	.L15
	testb	%sil, %sil
	je	.L15
	movslq	%edi, %rdi
	cltq
	leaq	(%rdi,%rdi,4), %rdx
	leaq	288(%rsp,%rdx,2), %rdx
	movb	$1, -112(%rax,%rdx)
.L15:
	addq	$1, %rcx
	cmpl	%ecx, 24(%rsp)
	jg	.L16
	cmpb	$0, 65(%rsp)
	movl	$0, 24(%rsp)
	movl	$1, %eax
	jne	.L182
.L17:
	cmpb	$0, 69(%rsp)
	jne	.L183
.L18:
	cmpb	$0, 63(%rsp)
	jne	.L184
.L19:
	cmpb	$0, 68(%rsp)
	jne	.L185
.L20:
	cmpb	$0, 64(%rsp)
	jne	.L186
.L21:
	cmpb	$0, 67(%rsp)
	jne	.L187
.L22:
	cmpb	$0, 62(%rsp)
	jne	.L188
.L23:
	cmpb	$0, 66(%rsp)
	jne	.L189
.L24:
	cmpb	$0, 70(%rsp)
	je	.L28
	cmpb	$0, 71(%rsp)
	jne	.L190
.L28:
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L44
.L27:
	addq	$1, 32(%rsp)
	movq	32(%rsp), %rax
	cmpq	%rax, 72(%rsp)
	jne	.L3
.L2:
	movl	$1, %eax
.L1:
	movq	280(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L191
	addq	$296, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L181:
	.cfi_restore_state
	movslq	56(%rsp), %rdi
	movslq	44(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rdx
	leaq	288(%rsp,%rdx,2), %rdx
	movb	$0, -112(%rax,%rdx)
	jmp	.L38
.L188:
	movslq	56(%rsp), %rdi
	movslq	48(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rdx
	movq	%rax, %rcx
	movq	%rdi, %rbx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L23
	movslq	24(%rsp), %rax
	movq	%rax, %rdi
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %edi
	cmpb	$0, 66(%rsp)
	movl	%ebx, 128(%rsp,%rax,4)
	movl	%edi, 24(%rsp)
	je	.L24
.L189:
	movslq	56(%rsp), %rdi
	movslq	28(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rdx
	movq	%rax, %rcx
	movq	%rdi, %rbx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L25
	movslq	24(%rsp), %rax
	movq	%rax, %rdi
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %edi
	cmpb	$0, 70(%rsp)
	movl	%ebx, 128(%rsp,%rax,4)
	movl	%edi, 24(%rsp)
	je	.L27
	movslq	44(%rsp), %rax
	cmpb	$0, -112(%rdx,%rax)
	je	.L27
.L40:
	movslq	24(%rsp), %rax
	movl	44(%rsp), %edi
	movq	%rax, %rcx
	movl	%edi, 80(%rsp,%rax,4)
	movl	56(%rsp), %edi
	addl	$1, %ecx
	movl	%edi, 128(%rsp,%rax,4)
	movl	%ecx, 24(%rsp)
	jmp	.L27
.L187:
	movslq	40(%rsp), %rdx
	movslq	44(%rsp), %rax
	movq	%rdx, %rbx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, %rcx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L22
	movslq	24(%rsp), %rax
	movq	%rax, %rdi
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %edi
	movl	%ebx, 128(%rsp,%rax,4)
	movl	%edi, 24(%rsp)
	jmp	.L22
.L180:
	movslq	56(%rsp), %rdi
	movslq	28(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rcx
	leaq	288(%rsp,%rcx,2), %rcx
	movb	$0, -112(%rax,%rcx)
	jmp	.L37
.L182:
	movslq	52(%rsp), %rcx
	movslq	48(%rsp), %rdx
	movq	%rcx, %rbx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	288(%rsp,%rcx,2), %rcx
	cmpb	$0, -112(%rdx,%rcx)
	je	.L17
	cmpb	$0, 69(%rsp)
	movl	%edx, 80(%rsp)
	movl	$2, %eax
	movl	%ebx, 128(%rsp)
	movl	$1, 24(%rsp)
	je	.L18
.L183:
	movslq	52(%rsp), %rcx
	movslq	28(%rsp), %rdx
	movq	%rcx, %rbx
	leaq	(%rcx,%rcx,4), %rcx
	movq	%rdx, %rdi
	leaq	288(%rsp,%rcx,2), %rcx
	cmpb	$0, -112(%rdx,%rcx)
	je	.L18
	movslq	24(%rsp), %rdx
	cmpb	$0, 63(%rsp)
	movl	%eax, 24(%rsp)
	movl	%edi, 80(%rsp,%rdx,4)
	movl	%ebx, 128(%rsp,%rdx,4)
	je	.L19
.L184:
	movslq	52(%rsp), %rdx
	movslq	44(%rsp), %rax
	movq	%rdx, %rdi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, %rcx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L19
	movslq	24(%rsp), %rax
	movq	%rax, %rbx
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %ebx
	cmpb	$0, 68(%rsp)
	movl	%edi, 128(%rsp,%rax,4)
	movl	%ebx, 24(%rsp)
	je	.L20
.L185:
	movslq	40(%rsp), %rdx
	movslq	48(%rsp), %rax
	movq	%rdx, %rdi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, %rcx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L20
	movslq	24(%rsp), %rax
	movq	%rax, %rbx
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %ebx
	cmpb	$0, 64(%rsp)
	movl	%edi, 128(%rsp,%rax,4)
	movl	%ebx, 24(%rsp)
	je	.L21
.L186:
	movslq	40(%rsp), %rdx
	movslq	28(%rsp), %rax
	movq	%rdx, %rdi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, %rcx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L21
	movslq	24(%rsp), %rax
	movq	%rax, %rdx
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %edx
	movl	%edi, 128(%rsp,%rax,4)
	movl	%edx, 24(%rsp)
	jmp	.L21
.L179:
	movslq	%ebx, %rdi
	movslq	48(%rsp), %r9
	leaq	(%rdi,%rdi,4), %rdi
	leaq	288(%rsp,%rdi,2), %rdi
	movb	$0, -112(%r9,%rdi)
	jmp	.L36
.L178:
	movslq	40(%rsp), %rsi
	movslq	44(%rsp), %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$0, -112(%rcx,%rsi)
	jmp	.L35
.L177:
	movslq	40(%rsp), %r8
	movslq	28(%rsp), %rsi
	leaq	(%r8,%r8,4), %r8
	leaq	288(%rsp,%r8,2), %r8
	movb	$0, -112(%rsi,%r8)
	jmp	.L34
.L176:
	movslq	40(%rsp), %r8
	movslq	48(%rsp), %rsi
	leaq	(%r8,%r8,4), %r8
	leaq	288(%rsp,%r8,2), %r8
	movb	$0, -112(%rsi,%r8)
	jmp	.L33
.L175:
	movslq	52(%rsp), %rsi
	movslq	%ebx, %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$0, -112(%rcx,%rsi)
	jmp	.L32
.L173:
	movslq	52(%rsp), %rdx
	movslq	48(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	288(%rsp,%rdx,2), %rdx
	movb	$0, -112(%rax,%rdx)
	jmp	.L30
.L174:
	movslq	52(%rsp), %rsi
	movslq	28(%rsp), %rdx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$0, -112(%rdx,%rsi)
	jmp	.L31
.L25:
	cmpb	$0, 70(%rsp)
	je	.L28
.L39:
	movslq	44(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rdx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	jne	.L40
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jne	.L27
.L44:
	xorl	%eax, %eax
	jmp	.L1
.L190:
	movslq	56(%rsp), %rdi
	jmp	.L39
.L191:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	b_survival, .-b_survival
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"OK"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	sy(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	sx(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	scy(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L199:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	sx(%rip), %eax
	orl	sy(%rip), %eax
	je	.L193
	leaq	n(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	leaq	scx(%rip), %r15
	testl	%eax, %eax
	jle	.L198
	.p2align 4,,10
	.p2align 3
.L197:
	leaq	0(%rbp,%r14,4), %rdx
	movq	%r15, %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	addq	$1, %r14
	addq	$4, %r15
	cmpl	%r14d, n(%rip)
	jg	.L197
.L198:
	xorl	%eax, %eax
	call	b_survival
	leaq	.LC1(%rip), %rdi
	testb	%al, %al
	leaq	.LC0(%rip), %rax
	cmovne	%rax, %rdi
	call	puts@PLT
	jmp	.L199
	.p2align 4,,10
	.p2align 3
.L193:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	scy
	.bss
	.align 32
	.type	scy, @object
	.size	scy, 40
scy:
	.zero	40
	.globl	scx
	.align 32
	.type	scx, @object
	.size	scx, 40
scx:
	.zero	40
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	sy
	.align 4
	.type	sy, @object
	.size	sy, 4
sy:
	.zero	4
	.globl	sx
	.align 4
	.type	sx, @object
	.size	sx, 4
sx:
	.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	b_survival
	.type	b_survival, @function
b_survival:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$296, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 280(%rsp)
	movl	sx(%rip), %eax
	movl	%eax, 80(%rsp)
	movl	sy(%rip), %eax
	movl	%eax, 128(%rsp)
	movslq	n(%rip), %rax
	testl	%eax, %eax
	jle	.L2
	movq	%rax, 72(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	128(%rsp), %rax
	movq	$0, 32(%rsp)
	movl	$1, 24(%rsp)
	movq	%rax, 16(%rsp)
.L3:
	movq	32(%rsp), %rax
	leaq	scx(%rip), %rcx
	leaq	scy(%rip), %rdi
	movl	(%rcx,%rax,4), %ecx
	movl	(%rdi,%rax,4), %eax
	movl	%ecx, 28(%rsp)
	subl	$1, %ecx
	movl	%eax, 40(%rsp)
	subl	$1, %eax
	cmpl	$9, %ecx
	setbe	%dil
	cmpl	$9, %eax
	movl	%ecx, 48(%rsp)
	setbe	%cl
	movl	%eax, 52(%rsp)
	movl	%ecx, %eax
	andb	%dil, %al
	movb	%al, 65(%rsp)
	jne	.L173
.L30:
	cmpl	$9, 28(%rsp)
	movl	%ecx, %ebx
	setbe	%al
	andb	%al, %bl
	movb	%bl, 69(%rsp)
	jne	.L174
.L31:
	movl	28(%rsp), %ebx
	addl	$1, %ebx
	cmpl	$9, %ebx
	movl	%ebx, 44(%rsp)
	setbe	%dl
	andb	%dl, %cl
	movb	%cl, 63(%rsp)
	jne	.L175
.L32:
	cmpl	$9, 40(%rsp)
	movl	%edi, %ebx
	setbe	%cl
	andb	%cl, %bl
	movb	%bl, 68(%rsp)
	jne	.L176
.L33:
	movl	%eax, %ebx
	andb	%cl, %bl
	movb	%bl, 64(%rsp)
	jne	.L177
.L34:
	andb	%dl, %cl
	movb	%cl, 67(%rsp)
	jne	.L178
.L35:
	movl	40(%rsp), %ebx
	addl	$1, %ebx
	movl	%ebx, %esi
	movl	%ebx, 56(%rsp)
	notl	%esi
	shrl	$31, %esi
	cmpl	$9, %ebx
	setbe	%cl
	setle	%r8b
	andb	%cl, %dil
	movb	%dil, 62(%rsp)
	jne	.L179
.L36:
	andb	%al, %cl
	movb	%cl, 66(%rsp)
	jne	.L180
.L37:
	movl	%edx, %eax
	andl	%esi, %eax
	andb	%al, %r8b
	movb	%al, 70(%rsp)
	movb	%r8b, 71(%rsp)
	jne	.L181
.L38:
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	8(%rsp), %rax
	movq	16(%rsp), %rbx
	movl	(%rax,%rcx,4), %eax
	movslq	(%rbx,%rcx,4), %rdx
	leal	-1(%rax), %r10d
	leal	-2(%rdx), %esi
	cmpl	$9, %r10d
	setbe	%r11b
	cmpl	$9, %esi
	setbe	%dil
	testb	%r11b, %r11b
	je	.L4
	testb	%dil, %dil
	je	.L4
	movslq	%esi, %r9
	movslq	%r10d, %r8
	leaq	(%r9,%r9,4), %r9
	leaq	288(%rsp,%r9,2), %r9
	movb	$1, -112(%r8,%r9)
.L4:
	cmpl	$9, %eax
	setbe	%r14b
	ja	.L5
	testb	%dil, %dil
	je	.L5
	movslq	%esi, %r9
	movslq	%eax, %r8
	leaq	(%r9,%r9,4), %r9
	leaq	288(%rsp,%r9,2), %r9
	movb	$1, -112(%r8,%r9)
.L5:
	leal	1(%rax), %r9d
	cmpl	$9, %r9d
	setbe	%r13b
	ja	.L6
	testb	%dil, %dil
	je	.L6
	movslq	%esi, %rsi
	movslq	%r9d, %rdi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %r8
	movb	$1, -112(%rdi,%r8)
.L6:
	leal	2(%rax), %r15d
	leal	-1(%rdx), %r8d
	cmpl	$9, %r15d
	setbe	%sil
	cmpl	$9, %r8d
	setbe	%bpl
	testb	%sil, %sil
	je	.L7
	testb	%bpl, %bpl
	je	.L7
	movslq	%r8d, %rbx
	movslq	%r15d, %rdi
	leaq	(%rbx,%rbx,4), %rbx
	leaq	288(%rsp,%rbx,2), %rbx
	movb	$1, -112(%rdi,%rbx)
.L7:
	cmpl	$9, %edx
	setbe	%bl
	testb	%sil, %sil
	je	.L8
	testb	%bl, %bl
	je	.L8
	movslq	%edx, %r12
	movslq	%r15d, %rdi
	leaq	(%r12,%r12,4), %r12
	leaq	288(%rsp,%r12,2), %r12
	movb	$1, -112(%rdi,%r12)
.L8:
	leal	1(%rdx), %edi
	cmpl	$9, %edi
	setbe	%r12b
	ja	.L9
	testb	%sil, %sil
	je	.L9
	movslq	%edi, %rsi
	movslq	%r15d, %r15
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$1, -112(%r15,%rsi)
.L9:
	leal	2(%rdx), %esi
	cmpl	$9, %esi
	setbe	%r15b
	testb	%r11b, %r11b
	je	.L10
	testb	%r15b, %r15b
	je	.L10
	movslq	%esi, %r11
	movslq	%r10d, %r10
	leaq	(%r11,%r11,4), %r11
	leaq	288(%rsp,%r11,2), %r11
	movb	$1, -112(%r10,%r11)
.L10:
	testb	%r14b, %r14b
	je	.L11
	testb	%r15b, %r15b
	je	.L11
	movslq	%esi, %r11
	movslq	%eax, %r10
	leaq	(%r11,%r11,4), %r11
	leaq	288(%rsp,%r11,2), %r11
	movb	$1, -112(%r10,%r11)
.L11:
	testb	%r13b, %r13b
	je	.L12
	testb	%r15b, %r15b
	je	.L12
	movslq	%esi, %rsi
	movslq	%r9d, %r9
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$1, -112(%r9,%rsi)
.L12:
	subl	$2, %eax
	cmpl	$9, %eax
	setbe	%sil
	ja	.L14
	testb	%bpl, %bpl
	je	.L13
	movslq	%r8d, %r8
	movslq	%eax, %r9
	leaq	(%r8,%r8,4), %r8
	leaq	288(%rsp,%r8,2), %r10
	movb	$1, -112(%r9,%r10)
.L13:
	testb	%sil, %sil
	je	.L14
	testb	%bl, %bl
	je	.L14
	leaq	(%rdx,%rdx,4), %rdx
	movslq	%eax, %r8
	leaq	288(%rsp,%rdx,2), %r9
	movb	$1, -112(%r8,%r9)
.L14:
	testb	%r12b, %r12b
	je	.L15
	testb	%sil, %sil
	je	.L15
	movslq	%edi, %rdi
	cltq
	leaq	(%rdi,%rdi,4), %rdx
	leaq	288(%rsp,%rdx,2), %rdx
	movb	$1, -112(%rax,%rdx)
.L15:
	addq	$1, %rcx
	cmpl	%ecx, 24(%rsp)
	jg	.L16
	cmpb	$0, 65(%rsp)
	movl	$0, 24(%rsp)
	movl	$1, %eax
	jne	.L182
.L17:
	cmpb	$0, 69(%rsp)
	jne	.L183
.L18:
	cmpb	$0, 63(%rsp)
	jne	.L184
.L19:
	cmpb	$0, 68(%rsp)
	jne	.L185
.L20:
	cmpb	$0, 64(%rsp)
	jne	.L186
.L21:
	cmpb	$0, 67(%rsp)
	jne	.L187
.L22:
	cmpb	$0, 62(%rsp)
	jne	.L188
.L23:
	cmpb	$0, 66(%rsp)
	jne	.L189
.L24:
	cmpb	$0, 70(%rsp)
	je	.L28
	cmpb	$0, 71(%rsp)
	jne	.L190
.L28:
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L44
.L27:
	addq	$1, 32(%rsp)
	movq	32(%rsp), %rax
	cmpq	%rax, 72(%rsp)
	jne	.L3
.L2:
	movl	$1, %eax
.L1:
	movq	280(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L191
	addq	$296, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L181:
	.cfi_restore_state
	movslq	56(%rsp), %rdi
	movslq	44(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rdx
	leaq	288(%rsp,%rdx,2), %rdx
	movb	$0, -112(%rax,%rdx)
	jmp	.L38
.L188:
	movslq	56(%rsp), %rdi
	movslq	48(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rdx
	movq	%rax, %rcx
	movq	%rdi, %rbx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L23
	movslq	24(%rsp), %rax
	movq	%rax, %rdi
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %edi
	cmpb	$0, 66(%rsp)
	movl	%ebx, 128(%rsp,%rax,4)
	movl	%edi, 24(%rsp)
	je	.L24
.L189:
	movslq	56(%rsp), %rdi
	movslq	28(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rdx
	movq	%rax, %rcx
	movq	%rdi, %rbx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L25
	movslq	24(%rsp), %rax
	movq	%rax, %rdi
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %edi
	cmpb	$0, 70(%rsp)
	movl	%ebx, 128(%rsp,%rax,4)
	movl	%edi, 24(%rsp)
	je	.L27
	movslq	44(%rsp), %rax
	cmpb	$0, -112(%rdx,%rax)
	je	.L27
.L40:
	movslq	24(%rsp), %rax
	movl	44(%rsp), %edi
	movq	%rax, %rcx
	movl	%edi, 80(%rsp,%rax,4)
	movl	56(%rsp), %edi
	addl	$1, %ecx
	movl	%edi, 128(%rsp,%rax,4)
	movl	%ecx, 24(%rsp)
	jmp	.L27
.L187:
	movslq	40(%rsp), %rdx
	movslq	44(%rsp), %rax
	movq	%rdx, %rbx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, %rcx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L22
	movslq	24(%rsp), %rax
	movq	%rax, %rdi
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %edi
	movl	%ebx, 128(%rsp,%rax,4)
	movl	%edi, 24(%rsp)
	jmp	.L22
.L180:
	movslq	56(%rsp), %rdi
	movslq	28(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rcx
	leaq	288(%rsp,%rcx,2), %rcx
	movb	$0, -112(%rax,%rcx)
	jmp	.L37
.L182:
	movslq	52(%rsp), %rcx
	movslq	48(%rsp), %rdx
	movq	%rcx, %rbx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	288(%rsp,%rcx,2), %rcx
	cmpb	$0, -112(%rdx,%rcx)
	je	.L17
	cmpb	$0, 69(%rsp)
	movl	%edx, 80(%rsp)
	movl	$2, %eax
	movl	%ebx, 128(%rsp)
	movl	$1, 24(%rsp)
	je	.L18
.L183:
	movslq	52(%rsp), %rcx
	movslq	28(%rsp), %rdx
	movq	%rcx, %rbx
	leaq	(%rcx,%rcx,4), %rcx
	movq	%rdx, %rdi
	leaq	288(%rsp,%rcx,2), %rcx
	cmpb	$0, -112(%rdx,%rcx)
	je	.L18
	movslq	24(%rsp), %rdx
	cmpb	$0, 63(%rsp)
	movl	%eax, 24(%rsp)
	movl	%edi, 80(%rsp,%rdx,4)
	movl	%ebx, 128(%rsp,%rdx,4)
	je	.L19
.L184:
	movslq	52(%rsp), %rdx
	movslq	44(%rsp), %rax
	movq	%rdx, %rdi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, %rcx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L19
	movslq	24(%rsp), %rax
	movq	%rax, %rbx
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %ebx
	cmpb	$0, 68(%rsp)
	movl	%edi, 128(%rsp,%rax,4)
	movl	%ebx, 24(%rsp)
	je	.L20
.L185:
	movslq	40(%rsp), %rdx
	movslq	48(%rsp), %rax
	movq	%rdx, %rdi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, %rcx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L20
	movslq	24(%rsp), %rax
	movq	%rax, %rbx
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %ebx
	cmpb	$0, 64(%rsp)
	movl	%edi, 128(%rsp,%rax,4)
	movl	%ebx, 24(%rsp)
	je	.L21
.L186:
	movslq	40(%rsp), %rdx
	movslq	28(%rsp), %rax
	movq	%rdx, %rdi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rax, %rcx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	je	.L21
	movslq	24(%rsp), %rax
	movq	%rax, %rdx
	movl	%ecx, 80(%rsp,%rax,4)
	addl	$1, %edx
	movl	%edi, 128(%rsp,%rax,4)
	movl	%edx, 24(%rsp)
	jmp	.L21
.L179:
	movslq	%ebx, %rdi
	movslq	48(%rsp), %r9
	leaq	(%rdi,%rdi,4), %rdi
	leaq	288(%rsp,%rdi,2), %rdi
	movb	$0, -112(%r9,%rdi)
	jmp	.L36
.L178:
	movslq	40(%rsp), %rsi
	movslq	44(%rsp), %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$0, -112(%rcx,%rsi)
	jmp	.L35
.L177:
	movslq	40(%rsp), %r8
	movslq	28(%rsp), %rsi
	leaq	(%r8,%r8,4), %r8
	leaq	288(%rsp,%r8,2), %r8
	movb	$0, -112(%rsi,%r8)
	jmp	.L34
.L176:
	movslq	40(%rsp), %r8
	movslq	48(%rsp), %rsi
	leaq	(%r8,%r8,4), %r8
	leaq	288(%rsp,%r8,2), %r8
	movb	$0, -112(%rsi,%r8)
	jmp	.L33
.L175:
	movslq	52(%rsp), %rsi
	movslq	%ebx, %rcx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$0, -112(%rcx,%rsi)
	jmp	.L32
.L173:
	movslq	52(%rsp), %rdx
	movslq	48(%rsp), %rax
	leaq	(%rdx,%rdx,4), %rdx
	leaq	288(%rsp,%rdx,2), %rdx
	movb	$0, -112(%rax,%rdx)
	jmp	.L30
.L174:
	movslq	52(%rsp), %rsi
	movslq	28(%rsp), %rdx
	leaq	(%rsi,%rsi,4), %rsi
	leaq	288(%rsp,%rsi,2), %rsi
	movb	$0, -112(%rdx,%rsi)
	jmp	.L31
.L25:
	cmpb	$0, 70(%rsp)
	je	.L28
.L39:
	movslq	44(%rsp), %rax
	leaq	(%rdi,%rdi,4), %rdx
	leaq	288(%rsp,%rdx,2), %rdx
	cmpb	$0, -112(%rax,%rdx)
	jne	.L40
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jne	.L27
.L44:
	xorl	%eax, %eax
	jmp	.L1
.L190:
	movslq	56(%rsp), %rdi
	jmp	.L39
.L191:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	b_survival, .-b_survival
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"OK"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	sy(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	sx(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	scy(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L199:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	sx(%rip), %eax
	orl	sy(%rip), %eax
	je	.L193
	leaq	n(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	leaq	scx(%rip), %r15
	testl	%eax, %eax
	jle	.L198
	.p2align 4,,10
	.p2align 3
.L197:
	leaq	0(%rbp,%r14,4), %rdx
	movq	%r15, %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	addq	$1, %r14
	addq	$4, %r15
	cmpl	%r14d, n(%rip)
	jg	.L197
.L198:
	xorl	%eax, %eax
	call	b_survival
	leaq	.LC1(%rip), %rdi
	testb	%al, %al
	leaq	.LC0(%rip), %rax
	cmovne	%rax, %rdi
	call	puts@PLT
	jmp	.L199
	.p2align 4,,10
	.p2align 3
.L193:
	addq	$8, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	scy
	.bss
	.align 32
	.type	scy, @object
	.size	scy, 40
scy:
	.zero	40
	.globl	scx
	.align 32
	.type	scx, @object
	.size	scx, 40
scx:
	.zero	40
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	sy
	.align 4
	.type	sy, @object
	.size	sy, 4
sy:
	.zero	4
	.globl	sx
	.align 4
	.type	sx, @object
	.size	sx, 4
sx:
	.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>          // printf(), scanf()
#include <stdbool.h>

#define MAX_N 10
#define MAX_M 10
#define MAX_G 9

int sx, sy;
int n;
int scx[MAX_N], scy[MAX_N];

bool
b_survival()
{
	bool field[MAX_M][MAX_M];
	int px[MAX_G], py[MAX_G];
	static const int dx2[12] = {-1, 0, 1, 2, 2, 2,-1, 0, 1,-2,-2,-2};
	static const int dy2[12] = {-2,-2,-2,-1, 0, 1, 2, 2, 2,-1, 0, 1};

	int ix = 0;
	px[ix] = sx, py[ix] = sy;
	ix++;

	for (int u = 0; u < n; ++u)
	{
		for (int dy = -1; dy <= 1; ++dy)
		{
			for (int dx = -1; dx <= 1; ++dx)
			{
				int nx = scx[u] + dx, ny = scy[u] + dy;
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M)
					field[ny][nx] = false;
			}
		}

		for (int i = 0; i < ix; ++i)
		{
			for (int j = 0; j < 12; ++j)
			{
				int nx = px[i] + dx2[j], ny = py[i] + dy2[j];
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M)
					field[ny][nx] = true;
			}
		}

		ix = 0;
		for (int dy = -1; dy <= 1; ++dy)
		{
			for (int dx = -1; dx <= 1; ++dx)
			{
				int nx = scx[u] + dx, ny = scy[u] + dy;
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M && field[ny][nx])
				{
					px[ix] = nx;
					py[ix] = ny;
					ix++;
				}
			}
		}

		if (ix == 0)
			return false;
	}

	return true;
}

int
main(int argc, char **argv)
{
	int lineno = 0;
	while (true)
	{
		lineno++;
		scanf("%d%d", &sx, &sy);
		if (sx == 0 && sy == 0)
			break;

		lineno++;
		scanf("%d", &n);

		lineno++;
		for (int i = 0; i < n; ++i)
			scanf("%d%d", &scx[i], &scy[i]);

		printf("%s\n", b_survival() ? "OK" : "NA");
	}

	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>          // printf(), scanf()
#include <stdbool.h>

#define MAX_N 10
#define MAX_M 10
#define MAX_G 9

int sx, sy;
int n;
int scx[MAX_N], scy[MAX_N];

bool
b_survival()
{
	bool field[MAX_M][MAX_M];
	int px[MAX_G], py[MAX_G];
	static const int dx2[12] = {-1, 0, 1, 2, 2, 2,-1, 0, 1,-2,-2,-2};
	static const int dy2[12] = {-2,-2,-2,-1, 0, 1, 2, 2, 2,-1, 0, 1};

	int ix = 0;
	px[ix] = sx, py[ix] = sy;
	ix++;

	for (int u = 0; u < n; ++u)
	{
		for (int dy = -1; dy <= 1; ++dy)
		{
			for (int dx = -1; dx <= 1; ++dx)
			{
				int nx = scx[u] + dx, ny = scy[u] + dy;
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M)
					field[ny][nx] = false;
			}
		}

		for (int i = 0; i < ix; ++i)
		{
			for (int j = 0; j < 12; ++j)
			{
				int nx = px[i] + dx2[j], ny = py[i] + dy2[j];
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M)
					field[ny][nx] = true;
			}
		}

		ix = 0;
		for (int dy = -1; dy <= 1; ++dy)
		{
			for (int dx = -1; dx <= 1; ++dx)
			{
				int nx = scx[u] + dx, ny = scy[u] + dy;
				if (0 <= nx && nx < MAX_M && 0 <= ny && ny < MAX_M && field[ny][nx])
				{
					px[ix] = nx;
					py[ix] = ny;
					ix++;
				}
			}
		}

		if (ix == 0)
			return false;
	}

	return true;
}

int
main(int argc, char **argv)
{
	int lineno = 0;
	while (true)
	{
		lineno++;
		scanf("%d%d", &sx, &sy);
		if (sx == 0 && sy == 0)
			break;

		lineno++;
		scanf("%d", &n);

		lineno++;
		for (int i = 0; i < n; ++i)
			scanf("%d%d", &scx[i], &scy[i]);

		printf("%s\n", b_survival() ? "OK" : "NA");
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sx
	.bss
	.align 4
	.type	sx, @object
	.size	sx, 4
sx:
	.zero	4
	.globl	sy
	.align 4
	.type	sy, @object
	.size	sy, 4
sy:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	scx
	.align 32
	.type	scx, @object
	.size	scx, 40
scx:
	.zero	40
	.globl	scy
	.align 32
	.type	scy, @object
	.size	scy, 40
scy:
	.zero	40
	.text
	.globl	b_survival
	.type	b_survival, @function
b_survival:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -264(%rbp)
	movl	sx(%rip), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movl	sy(%rip), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -264(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L2
.L20:
	movl	$-1, -256(%rbp)
	jmp	.L3
.L7:
	movl	$-1, -252(%rbp)
	jmp	.L4
.L6:
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-252(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -216(%rbp)
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-256(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -212(%rbp)
	cmpl	$0, -216(%rbp)
	js	.L5
	cmpl	$9, -216(%rbp)
	jg	.L5
	cmpl	$0, -212(%rbp)
	js	.L5
	cmpl	$9, -212(%rbp)
	jg	.L5
	movl	-216(%rbp), %eax
	movslq	%eax, %rcx
	movl	-212(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movb	$0, (%rax)
.L5:
	addl	$1, -252(%rbp)
.L4:
	cmpl	$1, -252(%rbp)
	jle	.L6
	addl	$1, -256(%rbp)
.L3:
	cmpl	$1, -256(%rbp)
	jle	.L7
	movl	$0, -248(%rbp)
	jmp	.L8
.L12:
	movl	$0, -244(%rbp)
	jmp	.L9
.L11:
	movl	-248(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %ecx
	movl	-244(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx2.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -224(%rbp)
	movl	-248(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %ecx
	movl	-244(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy2.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -220(%rbp)
	cmpl	$0, -224(%rbp)
	js	.L10
	cmpl	$9, -224(%rbp)
	jg	.L10
	cmpl	$0, -220(%rbp)
	js	.L10
	cmpl	$9, -220(%rbp)
	jg	.L10
	movl	-224(%rbp), %eax
	movslq	%eax, %rcx
	movl	-220(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movb	$1, (%rax)
.L10:
	addl	$1, -244(%rbp)
.L9:
	cmpl	$11, -244(%rbp)
	jle	.L11
	addl	$1, -248(%rbp)
.L8:
	movl	-248(%rbp), %eax
	cmpl	-264(%rbp), %eax
	jl	.L12
	movl	$0, -264(%rbp)
	movl	$-1, -240(%rbp)
	jmp	.L13
.L17:
	movl	$-1, -236(%rbp)
	jmp	.L14
.L16:
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-236(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -232(%rbp)
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-240(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -228(%rbp)
	cmpl	$0, -232(%rbp)
	js	.L15
	cmpl	$9, -232(%rbp)
	jg	.L15
	cmpl	$0, -228(%rbp)
	js	.L15
	cmpl	$9, -228(%rbp)
	jg	.L15
	movl	-232(%rbp), %eax
	movslq	%eax, %rcx
	movl	-228(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L15
	movl	-264(%rbp), %eax
	cltq
	movl	-232(%rbp), %edx
	movl	%edx, -208(%rbp,%rax,4)
	movl	-264(%rbp), %eax
	cltq
	movl	-228(%rbp), %edx
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -264(%rbp)
.L15:
	addl	$1, -236(%rbp)
.L14:
	cmpl	$1, -236(%rbp)
	jle	.L16
	addl	$1, -240(%rbp)
.L13:
	cmpl	$1, -240(%rbp)
	jle	.L17
	cmpl	$0, -264(%rbp)
	jne	.L18
	movl	$0, %eax
	jmp	.L21
.L18:
	addl	$1, -260(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L20
	movl	$1, %eax
.L21:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	b_survival, .-b_survival
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
	.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, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -8(%rbp)
.L30:
	addl	$1, -8(%rbp)
	leaq	sy(%rip), %rax
	movq	%rax, %rdx
	leaq	sx(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	sx(%rip), %eax
	testl	%eax, %eax
	jne	.L24
	movl	sy(%rip), %eax
	testl	%eax, %eax
	je	.L33
.L24:
	addl	$1, -8(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L26
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	scx(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L26:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L27
	movl	$0, %eax
	call	b_survival
	testb	%al, %al
	je	.L28
	leaq	.LC2(%rip), %rax
	jmp	.L29
.L28:
	leaq	.LC3(%rip), %rax
.L29:
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L30
.L33:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 32
	.type	dx2.1, @object
	.size	dx2.1, 48
dx2.1:
	.long	-1
	.long	0
	.long	1
	.long	2
	.long	2
	.long	2
	.long	-1
	.long	0
	.long	1
	.long	-2
	.long	-2
	.long	-2
	.align 32
	.type	dy2.0, @object
	.size	dy2.0, 48
dy2.0:
	.long	-2
	.long	-2
	.long	-2
	.long	-1
	.long	0
	.long	1
	.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:
```

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	sx
	.bss
	.align 4
	.type	sx, @object
	.size	sx, 4
sx:
	.zero	4
	.globl	sy
	.align 4
	.type	sy, @object
	.size	sy, 4
sy:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	scx
	.align 32
	.type	scx, @object
	.size	scx, 40
scx:
	.zero	40
	.globl	scy
	.align 32
	.type	scy, @object
	.size	scy, 40
scy:
	.zero	40
	.text
	.globl	b_survival
	.type	b_survival, @function
b_survival:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -264(%rbp)
	movl	sx(%rip), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	%edx, -208(%rbp,%rax,4)
	movl	sy(%rip), %edx
	movl	-264(%rbp), %eax
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -264(%rbp)
	movl	$0, -260(%rbp)
	jmp	.L2
.L20:
	movl	$-1, -256(%rbp)
	jmp	.L3
.L7:
	movl	$-1, -252(%rbp)
	jmp	.L4
.L6:
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-252(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -216(%rbp)
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-256(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -212(%rbp)
	cmpl	$0, -216(%rbp)
	js	.L5
	cmpl	$9, -216(%rbp)
	jg	.L5
	cmpl	$0, -212(%rbp)
	js	.L5
	cmpl	$9, -212(%rbp)
	jg	.L5
	movl	-216(%rbp), %eax
	movslq	%eax, %rcx
	movl	-212(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movb	$0, (%rax)
.L5:
	addl	$1, -252(%rbp)
.L4:
	cmpl	$1, -252(%rbp)
	jle	.L6
	addl	$1, -256(%rbp)
.L3:
	cmpl	$1, -256(%rbp)
	jle	.L7
	movl	$0, -248(%rbp)
	jmp	.L8
.L12:
	movl	$0, -244(%rbp)
	jmp	.L9
.L11:
	movl	-248(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %ecx
	movl	-244(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dx2.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -224(%rbp)
	movl	-248(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %ecx
	movl	-244(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dy2.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -220(%rbp)
	cmpl	$0, -224(%rbp)
	js	.L10
	cmpl	$9, -224(%rbp)
	jg	.L10
	cmpl	$0, -220(%rbp)
	js	.L10
	cmpl	$9, -220(%rbp)
	jg	.L10
	movl	-224(%rbp), %eax
	movslq	%eax, %rcx
	movl	-220(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movb	$1, (%rax)
.L10:
	addl	$1, -244(%rbp)
.L9:
	cmpl	$11, -244(%rbp)
	jle	.L11
	addl	$1, -248(%rbp)
.L8:
	movl	-248(%rbp), %eax
	cmpl	-264(%rbp), %eax
	jl	.L12
	movl	$0, -264(%rbp)
	movl	$-1, -240(%rbp)
	jmp	.L13
.L17:
	movl	$-1, -236(%rbp)
	jmp	.L14
.L16:
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scx(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-236(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -232(%rbp)
	movl	-260(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-240(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -228(%rbp)
	cmpl	$0, -232(%rbp)
	js	.L15
	cmpl	$9, -232(%rbp)
	jg	.L15
	cmpl	$0, -228(%rbp)
	js	.L15
	cmpl	$9, -228(%rbp)
	jg	.L15
	movl	-232(%rbp), %eax
	movslq	%eax, %rcx
	movl	-228(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$112, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L15
	movl	-264(%rbp), %eax
	cltq
	movl	-232(%rbp), %edx
	movl	%edx, -208(%rbp,%rax,4)
	movl	-264(%rbp), %eax
	cltq
	movl	-228(%rbp), %edx
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -264(%rbp)
.L15:
	addl	$1, -236(%rbp)
.L14:
	cmpl	$1, -236(%rbp)
	jle	.L16
	addl	$1, -240(%rbp)
.L13:
	cmpl	$1, -240(%rbp)
	jle	.L17
	cmpl	$0, -264(%rbp)
	jne	.L18
	movl	$0, %eax
	jmp	.L21
.L18:
	addl	$1, -260(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -260(%rbp)
	jl	.L20
	movl	$1, %eax
.L21:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	b_survival, .-b_survival
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
	.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, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -8(%rbp)
.L30:
	addl	$1, -8(%rbp)
	leaq	sy(%rip), %rax
	movq	%rax, %rdx
	leaq	sx(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	sx(%rip), %eax
	testl	%eax, %eax
	jne	.L24
	movl	sy(%rip), %eax
	testl	%eax, %eax
	je	.L33
.L24:
	addl	$1, -8(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L26
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	scy(%rip), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	scx(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L26:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L27
	movl	$0, %eax
	call	b_survival
	testb	%al, %al
	je	.L28
	leaq	.LC2(%rip), %rax
	jmp	.L29
.L28:
	leaq	.LC3(%rip), %rax
.L29:
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L30
.L33:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 32
	.type	dx2.1, @object
	.size	dx2.1, 48
dx2.1:
	.long	-1
	.long	0
	.long	1
	.long	2
	.long	2
	.long	2
	.long	-1
	.long	0
	.long	1
	.long	-2
	.long	-2
	.long	-2
	.align 32
	.type	dy2.0, @object
	.size	dy2.0, 48
dy2.0:
	.long	-2
	.long	-2
	.long	-2
	.long	-1
	.long	0
	.long	1
	.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:
