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

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
#include<math.h>
//#include<string.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
int main() {
	int d, w, h, r, n;
	double dw, wh, dh;
	while (~fscanf(stdin, "%d%d%d", &d, &w, &h), d || w || h) {
		dw = sqrt(d*d + w*w);
		wh = sqrt(w*w + h*h);
		dh = sqrt(d*d + h*h);
		fscanf(stdin, "%d", &n);
		while (n--) {
			fscanf(stdin, "%d", &r);
			r *= 2;
			if (dw < r || wh < r || dh < r) puts("OK");
			else puts("NA");
		}
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
.LC4:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rax
	leaq	44(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movq	24(%rsp), %rdx
	movq	%r15, %r8
	movq	%r14, %rcx
	xorl	%eax, %eax
	movq	stdin(%rip), %rdi
	leaq	.LC4(%rip), %rsi
	call	__isoc99_fscanf@PLT
	movl	36(%rsp), %edx
	movl	40(%rsp), %eax
	movl	%edx, %ebp
	orl	%eax, %ebp
	jne	.L18
	movl	44(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L33
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	movapd	%xmm1, %xmm0
.L19:
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, (%rsp)
.L5:
	imull	%ebx, %ebx
	pxor	%xmm0, %xmm0
	addl	%ebx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L28
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 8(%rsp)
.L8:
	addl	%ebp, %ebx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L29
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 16(%rsp)
.L11:
	movq	stdin(%rip), %rdi
	leaq	.LC1(%rip), %rbx
	leaq	52(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	leaq	48(%rsp), %rbp
	leaq	.LC3(%rip), %r13
	call	__isoc99_fscanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rdi
	call	puts@PLT
.L16:
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
.L12:
	movq	stdin(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	call	__isoc99_fscanf@PLT
	movl	48(%rsp), %eax
	pxor	%xmm0, %xmm0
	addl	%eax, %eax
	cvtsi2sdl	%eax, %xmm0
	comisd	(%rsp), %xmm0
	movl	%eax, 48(%rsp)
	ja	.L13
	comisd	8(%rsp), %xmm0
	ja	.L13
	comisd	16(%rsp), %xmm0
	ja	.L13
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	imull	%edx, %edx
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movl	44(%rsp), %ebx
	imull	%eax, %eax
	pxor	%xmm1, %xmm1
	movl	%edx, %ebp
	leal	(%rdx,%rax), %edx
	cvtsi2sdl	%edx, %xmm0
	ucomisd	%xmm0, %xmm5
	jbe	.L19
	movl	%eax, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %eax
	movsd	%xmm0, (%rsp)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$72, %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
.L29:
	.cfi_restore_state
	call	sqrt@PLT
	movsd	%xmm0, 16(%rsp)
	jmp	.L11
.L28:
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movsd	%xmm0, 8(%rsp)
	jmp	.L8
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
.LC4:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rax
	leaq	44(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movq	24(%rsp), %rdx
	movq	%r15, %r8
	movq	%r14, %rcx
	xorl	%eax, %eax
	movq	stdin(%rip), %rdi
	leaq	.LC4(%rip), %rsi
	call	__isoc99_fscanf@PLT
	movl	36(%rsp), %edx
	movl	40(%rsp), %eax
	movl	%edx, %ebp
	orl	%eax, %ebp
	jne	.L18
	movl	44(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L33
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	movapd	%xmm1, %xmm0
.L19:
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, (%rsp)
.L5:
	imull	%ebx, %ebx
	pxor	%xmm0, %xmm0
	addl	%ebx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L28
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 8(%rsp)
.L8:
	addl	%ebp, %ebx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L29
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 16(%rsp)
.L11:
	movq	stdin(%rip), %rdi
	leaq	.LC1(%rip), %rbx
	leaq	52(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	leaq	48(%rsp), %rbp
	leaq	.LC3(%rip), %r13
	call	__isoc99_fscanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rdi
	call	puts@PLT
.L16:
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
.L12:
	movq	stdin(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	call	__isoc99_fscanf@PLT
	movl	48(%rsp), %eax
	pxor	%xmm0, %xmm0
	addl	%eax, %eax
	cvtsi2sdl	%eax, %xmm0
	comisd	(%rsp), %xmm0
	movl	%eax, 48(%rsp)
	ja	.L13
	comisd	8(%rsp), %xmm0
	ja	.L13
	comisd	16(%rsp), %xmm0
	ja	.L13
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	imull	%edx, %edx
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movl	44(%rsp), %ebx
	imull	%eax, %eax
	pxor	%xmm1, %xmm1
	movl	%edx, %ebp
	leal	(%rdx,%rax), %edx
	cvtsi2sdl	%edx, %xmm0
	ucomisd	%xmm0, %xmm5
	jbe	.L19
	movl	%eax, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %eax
	movsd	%xmm0, (%rsp)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$72, %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
.L29:
	.cfi_restore_state
	call	sqrt@PLT
	movsd	%xmm0, 16(%rsp)
	jmp	.L11
.L28:
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movsd	%xmm0, 8(%rsp)
	jmp	.L8
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
.LC4:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rax
	leaq	44(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movq	24(%rsp), %rdx
	movq	%r15, %r8
	movq	%r14, %rcx
	xorl	%eax, %eax
	movq	stdin(%rip), %rdi
	leaq	.LC4(%rip), %rsi
	call	__isoc99_fscanf@PLT
	movl	36(%rsp), %edx
	movl	40(%rsp), %eax
	movl	%edx, %ebp
	orl	%eax, %ebp
	jne	.L18
	movl	44(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L33
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	movapd	%xmm1, %xmm0
.L19:
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, (%rsp)
.L5:
	imull	%ebx, %ebx
	pxor	%xmm0, %xmm0
	addl	%ebx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L28
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 8(%rsp)
.L8:
	addl	%ebp, %ebx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L29
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 16(%rsp)
.L11:
	movq	stdin(%rip), %rdi
	leaq	.LC1(%rip), %rbx
	leaq	52(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	leaq	48(%rsp), %rbp
	leaq	.LC3(%rip), %r13
	call	__isoc99_fscanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rdi
	call	puts@PLT
.L16:
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
.L12:
	movq	stdin(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	call	__isoc99_fscanf@PLT
	movl	48(%rsp), %eax
	pxor	%xmm0, %xmm0
	addl	%eax, %eax
	cvtsi2sdl	%eax, %xmm0
	comisd	(%rsp), %xmm0
	movl	%eax, 48(%rsp)
	ja	.L13
	comisd	8(%rsp), %xmm0
	ja	.L13
	comisd	16(%rsp), %xmm0
	ja	.L13
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	imull	%edx, %edx
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movl	44(%rsp), %ebx
	imull	%eax, %eax
	pxor	%xmm1, %xmm1
	movl	%edx, %ebp
	leal	(%rdx,%rax), %edx
	cvtsi2sdl	%edx, %xmm0
	ucomisd	%xmm0, %xmm5
	jbe	.L19
	movl	%eax, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %eax
	movsd	%xmm0, (%rsp)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$72, %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
.L29:
	.cfi_restore_state
	call	sqrt@PLT
	movsd	%xmm0, 16(%rsp)
	jmp	.L11
.L28:
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movsd	%xmm0, 8(%rsp)
	jmp	.L8
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
#include<math.h>
//#include<string.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
int main() {
	int d, w, h, r, n;
	double dw, wh, dh;
	while (~fscanf(stdin, "%d%d%d", &d, &w, &h), d || w || h) {
		dw = sqrt(d*d + w*w);
		wh = sqrt(w*w + h*h);
		dh = sqrt(d*d + h*h);
		fscanf(stdin, "%d", &n);
		while (n--) {
			fscanf(stdin, "%d", &r);
			r *= 2;
			if (dw < r || wh < r || dh < r) puts("OK");
			else puts("NA");
		}
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
#include<math.h>
//#include<string.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
int main() {
	int d, w, h, r, n;
	double dw, wh, dh;
	while (~fscanf(stdin, "%d%d%d", &d, &w, &h), d || w || h) {
		dw = sqrt(d*d + w*w);
		wh = sqrt(w*w + h*h);
		dh = sqrt(d*d + h*h);
		fscanf(stdin, "%d", &n);
		while (n--) {
			fscanf(stdin, "%d", &r);
			r *= 2;
			if (dw < r || wh < r || dh < r) puts("OK");
			else puts("NA");
		}
	}
	return 0;
}```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

10 6 8
5
4
1
6
2
5
0 0 0
 10 6 8
5
4
0
0
2
5
0 0 0
 10 6 8
5
4
0
0
2
7
0 0 0
 10 6 8
5
1
8
6
2
5
0 0 0
 10 6 4
5
4
0
-1
2
7
0 0 0
 10 6 4
5
4
0
-1
4
7
0 0 0
 10 3 8
5
4
0
6
2
5
0 0 0
 10 6 8
5
1
8
3
2
5
0 0 0
 10 2 8
5
1
8
11
2
5
0 0 0
 10 6 7
5
4
1
-2
8
7
0 0 0

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

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

```c
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
#include<math.h>
//#include<string.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
int main() {
	int d, w, h, r, n;
	double dw, wh, dh;
	while (~fscanf(stdin, "%d%d%d", &d, &w, &h), d || w || h) {
		dw = sqrt(d*d + w*w);
		wh = sqrt(w*w + h*h);
		dh = sqrt(d*d + h*h);
		fscanf(stdin, "%d", &n);
		while (n--) {
			fscanf(stdin, "%d", &r);
			r *= 2;
			if (dw < r || wh < r || dh < r) puts("OK");
			else puts("NA");
		}
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
.LC4:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rax
	leaq	44(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movq	24(%rsp), %rdx
	movq	%r15, %r8
	movq	%r14, %rcx
	xorl	%eax, %eax
	movq	stdin(%rip), %rdi
	leaq	.LC4(%rip), %rsi
	call	__isoc99_fscanf@PLT
	movl	36(%rsp), %edx
	movl	40(%rsp), %eax
	movl	%edx, %ebp
	orl	%eax, %ebp
	jne	.L18
	movl	44(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L33
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	movapd	%xmm1, %xmm0
.L19:
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, (%rsp)
.L5:
	imull	%ebx, %ebx
	pxor	%xmm0, %xmm0
	addl	%ebx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L28
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 8(%rsp)
.L8:
	addl	%ebp, %ebx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L29
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 16(%rsp)
.L11:
	movq	stdin(%rip), %rdi
	leaq	.LC1(%rip), %rbx
	leaq	52(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	leaq	48(%rsp), %rbp
	leaq	.LC3(%rip), %r13
	call	__isoc99_fscanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rdi
	call	puts@PLT
.L16:
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
.L12:
	movq	stdin(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	call	__isoc99_fscanf@PLT
	movl	48(%rsp), %eax
	pxor	%xmm0, %xmm0
	addl	%eax, %eax
	cvtsi2sdl	%eax, %xmm0
	comisd	(%rsp), %xmm0
	movl	%eax, 48(%rsp)
	ja	.L13
	comisd	8(%rsp), %xmm0
	ja	.L13
	comisd	16(%rsp), %xmm0
	ja	.L13
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	imull	%edx, %edx
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movl	44(%rsp), %ebx
	imull	%eax, %eax
	pxor	%xmm1, %xmm1
	movl	%edx, %ebp
	leal	(%rdx,%rax), %edx
	cvtsi2sdl	%edx, %xmm0
	ucomisd	%xmm0, %xmm5
	jbe	.L19
	movl	%eax, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %eax
	movsd	%xmm0, (%rsp)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$72, %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
.L29:
	.cfi_restore_state
	call	sqrt@PLT
	movsd	%xmm0, 16(%rsp)
	jmp	.L11
.L28:
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movsd	%xmm0, 8(%rsp)
	jmp	.L8
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"OK"
.LC3:
	.string	"NA"
.LC4:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rax
	leaq	44(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movq	24(%rsp), %rdx
	movq	%r15, %r8
	movq	%r14, %rcx
	xorl	%eax, %eax
	movq	stdin(%rip), %rdi
	leaq	.LC4(%rip), %rsi
	call	__isoc99_fscanf@PLT
	movl	36(%rsp), %edx
	movl	40(%rsp), %eax
	movl	%edx, %ebp
	orl	%eax, %ebp
	jne	.L18
	movl	44(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L33
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	movapd	%xmm1, %xmm0
.L19:
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, (%rsp)
.L5:
	imull	%ebx, %ebx
	pxor	%xmm0, %xmm0
	addl	%ebx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L28
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 8(%rsp)
.L8:
	addl	%ebp, %ebx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm1
	ja	.L29
	sqrtsd	%xmm0, %xmm0
	movsd	%xmm0, 16(%rsp)
.L11:
	movq	stdin(%rip), %rdi
	leaq	.LC1(%rip), %rbx
	leaq	52(%rsp), %rdx
	xorl	%eax, %eax
	movq	%rbx, %rsi
	leaq	48(%rsp), %rbp
	leaq	.LC3(%rip), %r13
	call	__isoc99_fscanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rdi
	call	puts@PLT
.L16:
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
.L12:
	movq	stdin(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	call	__isoc99_fscanf@PLT
	movl	48(%rsp), %eax
	pxor	%xmm0, %xmm0
	addl	%eax, %eax
	cvtsi2sdl	%eax, %xmm0
	comisd	(%rsp), %xmm0
	movl	%eax, 48(%rsp)
	ja	.L13
	comisd	8(%rsp), %xmm0
	ja	.L13
	comisd	16(%rsp), %xmm0
	ja	.L13
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L18:
	imull	%edx, %edx
	pxor	%xmm0, %xmm0
	pxor	%xmm5, %xmm5
	movl	44(%rsp), %ebx
	imull	%eax, %eax
	pxor	%xmm1, %xmm1
	movl	%edx, %ebp
	leal	(%rdx,%rax), %edx
	cvtsi2sdl	%edx, %xmm0
	ucomisd	%xmm0, %xmm5
	jbe	.L19
	movl	%eax, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %eax
	movsd	%xmm0, (%rsp)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L33:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$72, %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
.L29:
	.cfi_restore_state
	call	sqrt@PLT
	movsd	%xmm0, 16(%rsp)
	jmp	.L11
.L28:
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movsd	16(%rsp), %xmm1
	movsd	%xmm0, 8(%rsp)
	jmp	.L8
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```