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

```c
double M[12][4096],r,t;D[12],n;
double dfs(p,f){if(M[p][f]<0){
int i=0;
for(M[p][f]=0;i<n;i++)if(!(f&1<<i)&&(t=dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i]),M[p][f]<t))M[p][f]=t;
}return M[p][f];}
main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r>l?"NA":"OK")){
for(d=n=0;getchar()-10;d+=D[n++]*2)scanf("%d",D+n);
for(i=0;i<n;i++)for(j=0;j<1<<n;j++)M[i][j]=-1;
for(r=i=0;i<n;)t=dfs(i++,1<<i),r=r>t?r:t;
}exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	M
	.bss
	.align 32
	.type	M, @object
	.size	M, 393216
M:
	.zero	393216
	.globl	r
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 48
D:
	.zero	48
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm1
	pxor	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L2
	movl	$0, -4(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	pxor	%xmm0, %xmm0
	movsd	%xmm0, (%rdx,%rax)
	jmp	.L4
.L7:
	movl	-4(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L5
	movl	-4(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dfs
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	addsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	addsd	%xmm0, %xmm1
	movsd	%xmm1, -32(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	D(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	addsd	%xmm0, %xmm2
	movapd	%xmm2, %xmm1
	movsd	-32(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, t(%rip)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm1
	movsd	t(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	t(%rip), %xmm0
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
.L5:
	addl	$1, -4(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
.L2:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC1:
	.string	"%d"
.LC3:
	.string	"NA"
.LC4:
	.string	"OK"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L12
.L27:
	movl	$0, n(%rip)
	movl	n(%rip), %eax
	movl	%eax, -16(%rbp)
	jmp	.L13
.L14:
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, n(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %eax
	addl	%eax, -16(%rbp)
.L13:
	movl	$0, %eax
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L14
	movl	$0, -8(%rbp)
	jmp	.L15
.L18:
	movl	$0, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L16:
	movl	n(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	addl	$1, -8(%rbp)
.L15:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L18
	movl	$0, -8(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, r(%rip)
	jmp	.L19
.L23:
	movl	-8(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	-8(%rbp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, -8(%rbp)
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dfs
	movq	%xmm0, %rax
	movq	%rax, t(%rip)
	movsd	r(%rip), %xmm0
	movsd	t(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L30
	movsd	r(%rip), %xmm0
	jmp	.L22
.L30:
	movsd	t(%rip), %xmm0
.L22:
	movsd	%xmm0, r(%rip)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L23
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-16(%rbp), %xmm0
	movsd	r(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movl	-4(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L31
	leaq	.LC3(%rip), %rax
	jmp	.L26
.L31:
	leaq	.LC4(%rip), %rax
.L26:
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L27
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	-1074790400
	.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	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rdx
	pxor	%xmm2, %xmm2
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	M(%rip), %r14
	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
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %r13
	salq	$12, %r13
	addq	%rdx, %r13
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movsd	(%r14,%r13,8), %xmm0
	comisd	%xmm0, %xmm2
	ja	.L20
.L1:
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	movslq	n(%rip), %r15
	movq	$0x000000000, (%r14,%r13,8)
	pxor	%xmm0, %xmm0
	testl	%r15d, %r15d
	jle	.L1
	movq	%rdx, %r12
	xorl	%ebx, %ebx
.L11:
	btl	%ebx, %r12d
	movl	%ebx, %edi
	jnc	.L21
.L5:
	addq	$1, %rbx
	cmpq	%r15, %rbx
	jne	.L11
	salq	$12, %rbp
	addq	%rdx, %rbp
	movsd	(%r14,%rbp,8), %xmm0
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movl	%r12d, %esi
	xorl	%eax, %eax
	movq	%rdx, (%rsp)
	btsl	%ebx, %esi
	call	dfs
	leaq	D(%rip), %rcx
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	movl	(%rcx,%rbp,4), %eax
	movl	(%rcx,%rbx,4), %esi
	movq	(%rsp), %rdx
	cvtsi2sdl	%eax, %xmm1
	imull	%esi, %eax
	addsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%esi, %xmm0
	addsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L17
	sqrtsd	%xmm0, %xmm0
.L8:
	addsd	%xmm0, %xmm0
	subsd	%xmm0, %xmm1
	comisd	(%r14,%r13,8), %xmm1
	movsd	%xmm1, t(%rip)
	jbe	.L5
	movsd	%xmm1, (%r14,%r13,8)
	jmp	.L5
.L17:
	movq	%rdx, 8(%rsp)
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movq	8(%rsp), %rdx
	movsd	(%rsp), %xmm1
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"NA"
.LC2:
	.string	"OK"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC3(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	D(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%edi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L23:
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L44
	movl	$0, n(%rip)
	xorl	%ebx, %ebx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movslq	n(%rip), %rax
	movq	%r12, %rdi
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %rax
	leal	1(%rax), %edx
	movl	0(%rbp,%rax,4), %eax
	movl	%edx, n(%rip)
	leal	(%rbx,%rax,2), %ebx
.L24:
	xorl	%eax, %eax
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L25
	movl	n(%rip), %r13d
	testl	%r13d, %r13d
	jle	.L26
	movl	$1, %r8d
	movl	%r13d, %ecx
	sall	%cl, %r8d
	testl	%r8d, %r8d
	jle	.L27
	movl	%r8d, %eax
	leaq	M(%rip), %rcx
	movl	%r8d, %edi
	xorl	%r14d, %r14d
	shrl	%eax
	movsd	.LC5(%rip), %xmm0
	movq	%rcx, %rsi
	andl	$-2, %edi
	leal	-1(%rax), %r9d
	addq	$1, %r9
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L28:
	leaq	(%r9,%rsi), %r10
	movq	%rsi, %rax
	testl	%r13d, %r13d
	je	.L45
	.p2align 4,,10
	.p2align 3
.L29:
	movapd	.LC4(%rip), %xmm2
	addq	$16, %rax
	movaps	%xmm2, -16(%rax)
	cmpq	%r10, %rax
	jne	.L29
	movslq	%edi, %r10
	cmpl	%edi, %r8d
	je	.L30
.L31:
	movslq	%r14d, %rax
	salq	$12, %rax
	addq	%r10, %rax
	movsd	%xmm0, (%rcx,%rax,8)
.L30:
	addl	$1, %r14d
	addq	$32768, %rsi
	cmpl	%r13d, %r14d
	jne	.L28
.L27:
	movq	$0x000000000, r(%rip)
	xorl	%r14d, %r14d
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%r14d, %ecx
	movl	%r15d, %esi
	movl	%r14d, %edi
	xorl	%eax, %eax
	sall	%cl, %esi
	addl	$1, %r14d
	call	dfs
	movsd	r(%rip), %xmm1
	movsd	%xmm0, t(%rip)
	maxsd	%xmm0, %xmm1
	movsd	%xmm1, r(%rip)
	cmpl	%r13d, %r14d
	jne	.L34
.L37:
	pxor	%xmm0, %xmm0
	leaq	.LC1(%rip), %rdi
	leaq	.LC2(%rip), %rax
	cvtsi2sdl	%ebx, %xmm0
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	12(%rsp), %xmm1
	comisd	%xmm1, %xmm0
	cmovbe	%rax, %rdi
	call	puts@PLT
	jmp	.L23
.L45:
	xorl	%r10d, %r10d
	jmp	.L31
.L44:
	xorl	%edi, %edi
	call	exit@PLT
.L26:
	movq	$0x000000000, r(%rip)
	pxor	%xmm1, %xmm1
	jmp	.L37
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 48
D:
	.zero	48
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.globl	r
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.globl	M
	.align 32
	.type	M, @object
	.size	M, 393216
M:
	.zero	393216
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	0
	.long	-1074790400
	.long	0
	.long	-1074790400
	.set	.LC5,.LC4
	.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	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rdx
	pxor	%xmm2, %xmm2
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	M(%rip), %r14
	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
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %r13
	salq	$12, %r13
	addq	%rdx, %r13
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movsd	(%r14,%r13,8), %xmm0
	comisd	%xmm0, %xmm2
	ja	.L20
.L1:
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	movslq	n(%rip), %r15
	movq	$0x000000000, (%r14,%r13,8)
	pxor	%xmm0, %xmm0
	testl	%r15d, %r15d
	jle	.L1
	movq	%rdx, %r12
	xorl	%ebx, %ebx
.L11:
	btl	%ebx, %r12d
	movl	%ebx, %edi
	jnc	.L21
.L5:
	addq	$1, %rbx
	cmpq	%r15, %rbx
	jne	.L11
	salq	$12, %rbp
	addq	%rdx, %rbp
	movsd	(%r14,%rbp,8), %xmm0
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movl	%r12d, %esi
	xorl	%eax, %eax
	movq	%rdx, (%rsp)
	btsl	%ebx, %esi
	call	dfs
	leaq	D(%rip), %rcx
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	movl	(%rcx,%rbp,4), %eax
	movl	(%rcx,%rbx,4), %esi
	movq	(%rsp), %rdx
	cvtsi2sdl	%eax, %xmm1
	imull	%esi, %eax
	addsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%esi, %xmm0
	addsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L17
	sqrtsd	%xmm0, %xmm0
.L8:
	addsd	%xmm0, %xmm0
	subsd	%xmm0, %xmm1
	comisd	(%r14,%r13,8), %xmm1
	movsd	%xmm1, t(%rip)
	jbe	.L5
	movsd	%xmm1, (%r14,%r13,8)
	jmp	.L5
.L17:
	movq	%rdx, 8(%rsp)
	movsd	%xmm1, (%rsp)
	call	sqrt@PLT
	movq	8(%rsp), %rdx
	movsd	(%rsp), %xmm1
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"NA"
.LC2:
	.string	"OK"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC3(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	D(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%edi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L23:
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L44
	movl	$0, n(%rip)
	xorl	%ebx, %ebx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movslq	n(%rip), %rax
	movq	%r12, %rdi
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %rax
	leal	1(%rax), %edx
	movl	0(%rbp,%rax,4), %eax
	movl	%edx, n(%rip)
	leal	(%rbx,%rax,2), %ebx
.L24:
	xorl	%eax, %eax
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L25
	movl	n(%rip), %r13d
	testl	%r13d, %r13d
	jle	.L26
	movl	$1, %r8d
	movl	%r13d, %ecx
	sall	%cl, %r8d
	testl	%r8d, %r8d
	jle	.L27
	movl	%r8d, %eax
	leaq	M(%rip), %rcx
	movl	%r8d, %edi
	xorl	%r14d, %r14d
	shrl	%eax
	movsd	.LC5(%rip), %xmm0
	movq	%rcx, %rsi
	andl	$-2, %edi
	leal	-1(%rax), %r9d
	addq	$1, %r9
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L28:
	leaq	(%r9,%rsi), %r10
	movq	%rsi, %rax
	testl	%r13d, %r13d
	je	.L45
	.p2align 4,,10
	.p2align 3
.L29:
	movapd	.LC4(%rip), %xmm2
	addq	$16, %rax
	movaps	%xmm2, -16(%rax)
	cmpq	%r10, %rax
	jne	.L29
	movslq	%edi, %r10
	cmpl	%edi, %r8d
	je	.L30
.L31:
	movslq	%r14d, %rax
	salq	$12, %rax
	addq	%r10, %rax
	movsd	%xmm0, (%rcx,%rax,8)
.L30:
	addl	$1, %r14d
	addq	$32768, %rsi
	cmpl	%r13d, %r14d
	jne	.L28
.L27:
	movq	$0x000000000, r(%rip)
	xorl	%r14d, %r14d
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%r14d, %ecx
	movl	%r15d, %esi
	movl	%r14d, %edi
	xorl	%eax, %eax
	sall	%cl, %esi
	addl	$1, %r14d
	call	dfs
	movsd	r(%rip), %xmm1
	movsd	%xmm0, t(%rip)
	maxsd	%xmm0, %xmm1
	movsd	%xmm1, r(%rip)
	cmpl	%r13d, %r14d
	jne	.L34
.L37:
	pxor	%xmm0, %xmm0
	leaq	.LC1(%rip), %rdi
	leaq	.LC2(%rip), %rax
	cvtsi2sdl	%ebx, %xmm0
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	12(%rsp), %xmm1
	comisd	%xmm1, %xmm0
	cmovbe	%rax, %rdi
	call	puts@PLT
	jmp	.L23
.L45:
	xorl	%r10d, %r10d
	jmp	.L31
.L44:
	xorl	%edi, %edi
	call	exit@PLT
.L26:
	movq	$0x000000000, r(%rip)
	pxor	%xmm1, %xmm1
	jmp	.L37
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 48
D:
	.zero	48
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.globl	r
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.globl	M
	.align 32
	.type	M, @object
	.size	M, 393216
M:
	.zero	393216
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	0
	.long	-1074790400
	.long	0
	.long	-1074790400
	.set	.LC5,.LC4
	.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:

double M[12][4096],r,t;D[12],n;
double dfs(p,f){if(M[p][f]<0){
int i=0;
for(M[p][f]=0;i<n;i++)if(!(f&1<<i)&&(t=dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i]),M[p][f]<t))M[p][f]=t;
}return M[p][f];}
main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r>l?"NA":"OK")){
for(d=n=0;getchar()-10;d+=D[n++]*2)scanf("%d",D+n);
for(i=0;i<n;i++)for(j=0;j<1<<n;j++)M[i][j]=-1;
for(r=i=0;i<n;)t=dfs(i++,1<<i),r=r>t?r:t;
}exit(0);}
30 4 5 6
8 5 5 5
50 3 3 3 10 10
49 3 3 3 10 10
 30 3 5 6
6 5 5 5
50 3 3 3 13 10
49 3 3 3 10 10
 3 3 5 6
5 5 5 5
37 3 3 3 4 10
4 1 3 3 10 10
 3 3 5 2
5 10 5 5
37 3 3 3 4 3
4 1 3 3 10 10
 30 4 5 6
30 5 5 5
50 3 3 3 10 10
49 3 3 3 4 10
 30 4 5 6
30 5 5 5
41 3 3 3 7 10
49 3 3 3 4 10
 30 7 5 6
30 5 5 5
41 3 3 3 7 10
49 3 3 3 4 12
 30 7 5 6
30 5 5 5
41 3 3 3 7 10
10 3 3 3 4 12
 53 4 5 6
7 5 2 2
73 3 0 3 10 10
94 3 3 4 10 10
 0 1 8 4
18 5 1 3
55 4 6 9 6 1
2 1 1 0 10 57

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

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

```c
double M[12][4096],r,t;D[12],n;
double dfs(p,f){if(M[p][f]<0){
int i=0;
for(M[p][f]=0;i<n;i++)if(!(f&1<<i)&&(t=dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i]),M[p][f]<t))M[p][f]=t;
}return M[p][f];}
main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r>l?"NA":"OK")){
for(d=n=0;getchar()-10;d+=D[n++]*2)scanf("%d",D+n);
for(i=0;i<n;i++)for(j=0;j<1<<n;j++)M[i][j]=-1;
for(r=i=0;i<n;)t=dfs(i++,1<<i),r=r>t?r:t;
}exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	M
	.bss
	.align 32
	.type	M, @object
	.size	M, 393216
M:
	.zero	393216
	.globl	r
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 48
D:
	.zero	48
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm1
	pxor	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L2
	movl	$0, -4(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	pxor	%xmm0, %xmm0
	movsd	%xmm0, (%rdx,%rax)
	jmp	.L4
.L7:
	movl	-4(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L5
	movl	-4(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dfs
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	addsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	addsd	%xmm0, %xmm1
	movsd	%xmm1, -32(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	D(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	addsd	%xmm0, %xmm2
	movapd	%xmm2, %xmm1
	movsd	-32(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, t(%rip)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm1
	movsd	t(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	t(%rip), %xmm0
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
.L5:
	addl	$1, -4(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
.L2:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC1:
	.string	"%d"
.LC3:
	.string	"NA"
.LC4:
	.string	"OK"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L12
.L27:
	movl	$0, n(%rip)
	movl	n(%rip), %eax
	movl	%eax, -16(%rbp)
	jmp	.L13
.L14:
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, n(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %eax
	addl	%eax, -16(%rbp)
.L13:
	movl	$0, %eax
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L14
	movl	$0, -8(%rbp)
	jmp	.L15
.L18:
	movl	$0, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L16:
	movl	n(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	addl	$1, -8(%rbp)
.L15:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L18
	movl	$0, -8(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, r(%rip)
	jmp	.L19
.L23:
	movl	-8(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	-8(%rbp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, -8(%rbp)
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dfs
	movq	%xmm0, %rax
	movq	%rax, t(%rip)
	movsd	r(%rip), %xmm0
	movsd	t(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L30
	movsd	r(%rip), %xmm0
	jmp	.L22
.L30:
	movsd	t(%rip), %xmm0
.L22:
	movsd	%xmm0, r(%rip)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L23
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-16(%rbp), %xmm0
	movsd	r(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movl	-4(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L31
	leaq	.LC3(%rip), %rax
	jmp	.L26
.L31:
	leaq	.LC4(%rip), %rax
.L26:
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L27
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	-1074790400
	.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	M
	.bss
	.align 32
	.type	M, @object
	.size	M, 393216
M:
	.zero	393216
	.globl	r
	.align 8
	.type	r, @object
	.size	r, 8
r:
	.zero	8
	.globl	t
	.align 8
	.type	t, @object
	.size	t, 8
t:
	.zero	8
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 48
D:
	.zero	48
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm1
	pxor	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L2
	movl	$0, -4(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	pxor	%xmm0, %xmm0
	movsd	%xmm0, (%rdx,%rax)
	jmp	.L4
.L7:
	movl	-4(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L5
	movl	-4(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	orl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dfs
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	addsd	%xmm0, %xmm1
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	addsd	%xmm0, %xmm1
	movsd	%xmm1, -32(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	D(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	pxor	%xmm3, %xmm3
	cvtsi2sdl	%eax, %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	movapd	%xmm0, %xmm2
	addsd	%xmm0, %xmm2
	movapd	%xmm2, %xmm1
	movsd	-32(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, t(%rip)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm1
	movsd	t(%rip), %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L5
	movsd	t(%rip), %xmm0
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	%xmm0, (%rdx,%rax)
.L5:
	addl	$1, -4(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L7
.L2:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	(%rdx,%rax), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dfs, .-dfs
	.section	.rodata
.LC1:
	.string	"%d"
.LC3:
	.string	"NA"
.LC4:
	.string	"OK"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L12
.L27:
	movl	$0, n(%rip)
	movl	n(%rip), %eax
	movl	%eax, -16(%rbp)
	jmp	.L13
.L14:
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, n(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	D(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %eax
	addl	%eax, -16(%rbp)
.L13:
	movl	$0, %eax
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L14
	movl	$0, -8(%rbp)
	jmp	.L15
.L18:
	movl	$0, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	salq	$12, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	M(%rip), %rax
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L16:
	movl	n(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	addl	$1, -8(%rbp)
.L15:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L18
	movl	$0, -8(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, r(%rip)
	jmp	.L19
.L23:
	movl	-8(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	-8(%rbp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, -8(%rbp)
	movl	%edx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	dfs
	movq	%xmm0, %rax
	movq	%rax, t(%rip)
	movsd	r(%rip), %xmm0
	movsd	t(%rip), %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L30
	movsd	r(%rip), %xmm0
	jmp	.L22
.L30:
	movsd	t(%rip), %xmm0
.L22:
	movsd	%xmm0, r(%rip)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L23
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-16(%rbp), %xmm0
	movsd	r(%rip), %xmm1
	subsd	%xmm1, %xmm0
	movl	-4(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L31
	leaq	.LC3(%rip), %rax
	jmp	.L26
.L31:
	leaq	.LC4(%rip), %rax
.L26:
	movq	%rax, %rdi
	call	puts@PLT
.L12:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L27
	movl	$0, %edi
	call	exit@PLT
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	-1074790400
	.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:
