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>

int
main(int argc, char **argv)
{
	int d, w, h;
	double a, b;
	int r;
	int n;

	while (true)
	{
		scanf("%d %d %d", &d, &w, &h);
		if (d == 0 && w == 0 && h == 0)
			break;

		if (d < w)
		{
			if (d < h) /* d < w ? h */
			{
				a = d;
				b = (w < h) ? w : h;
			}
			else /* h <= d < w ? */
			{
				a = h;
				b = d;
			}
		}
		else /* w <= d ? */
		{
			if (w < h) /* w <= d ? h */
			{
				a = w;
				b = (d < h) ? d : h;
			}
			else /* h <= w <= d ? */
			{
				a = h;
				b = w;
			}
		}

		a /= 2;
		b /= 2;
		scanf("%d", &n);
		while (n--)
		{
			scanf("%d", &r);
			if (a * a + b * b < r * r)
				printf("OK\n");
			else
				printf("NA\n");
		}
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC2:
	.string	"%d"
.LC3:
	.string	"OK"
.LC4:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -52(%rbp)
	movq	%rsi, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L2:
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-44(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L5:
	movl	-36(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-44(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L4:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-36(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
.L6:
	movsd	-24(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-16(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L8
.L11:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	mulsd	%xmm0, %xmm1
	movsd	-16(%rbp), %xmm0
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	movl	-32(%rbp), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L17:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L11
	jmp	.L12
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC2:
	.string	"%d"
.LC3:
	.string	"OK"
.LC4:
	.string	"NA"
	.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
	leaq	.LC4(%rip), %r13
	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
	leaq	.LC2(%rip), %rbx
	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
.L9:
	movq	24(%rsp), %rsi
	movq	%r15, %rcx
	movq	%r14, %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	movl	40(%rsp), %edx
	movl	%eax, %ecx
	orl	%edx, %ecx
	movl	44(%rsp), %ecx
	jne	.L2
	testl	%ecx, %ecx
	je	.L25
.L4:
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%edx, %xmm2
	cmpl	%ecx, %edx
	jge	.L7
	cmpl	%ecx, %eax
	pxor	%xmm0, %xmm0
	movapd	%xmm2, %xmm1
	cmovg	%ecx, %eax
	cvtsi2sdl	%eax, %xmm0
.L6:
	mulsd	.LC1(%rip), %xmm1
	leaq	52(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	mulsd	.LC1(%rip), %xmm0
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, 16(%rsp)
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L9
	movsd	8(%rsp), %xmm1
	movsd	16(%rsp), %xmm0
	leaq	48(%rsp), %rbp
	leaq	.LC3(%rip), %r12
	mulsd	%xmm1, %xmm1
	mulsd	%xmm0, %xmm0
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	pxor	%xmm1, %xmm1
	movq	%r12, %rdi
	movsd	8(%rsp), %xmm0
	addsd	16(%rsp), %xmm0
	imull	%eax, %eax
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm0, %xmm1
	ja	.L23
	movq	%r13, %rdi
.L23:
	call	puts@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	cmpl	%edx, %eax
	jge	.L4
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	cmpl	%ecx, %eax
	jge	.L7
	cmpl	%ecx, %edx
	pxor	%xmm0, %xmm0
	movapd	%xmm2, %xmm1
	cmovg	%ecx, %edx
	cvtsi2sdl	%edx, %xmm0
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	pxor	%xmm1, %xmm1
	movapd	%xmm2, %xmm0
	cvtsi2sdl	%ecx, %xmm1
	jmp	.L6
.L25:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	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
.L26:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC2:
	.string	"%d"
.LC3:
	.string	"OK"
.LC4:
	.string	"NA"
	.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
	leaq	.LC4(%rip), %r13
	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
	leaq	.LC2(%rip), %rbx
	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
.L9:
	movq	24(%rsp), %rsi
	movq	%r15, %rcx
	movq	%r14, %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	movl	40(%rsp), %edx
	movl	%eax, %ecx
	orl	%edx, %ecx
	movl	44(%rsp), %ecx
	jne	.L2
	testl	%ecx, %ecx
	je	.L25
.L4:
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%edx, %xmm2
	cmpl	%ecx, %edx
	jge	.L7
	cmpl	%ecx, %eax
	pxor	%xmm0, %xmm0
	movapd	%xmm2, %xmm1
	cmovg	%ecx, %eax
	cvtsi2sdl	%eax, %xmm0
.L6:
	mulsd	.LC1(%rip), %xmm1
	leaq	52(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	mulsd	.LC1(%rip), %xmm0
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, 16(%rsp)
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L9
	movsd	8(%rsp), %xmm1
	movsd	16(%rsp), %xmm0
	leaq	48(%rsp), %rbp
	leaq	.LC3(%rip), %r12
	mulsd	%xmm1, %xmm1
	mulsd	%xmm0, %xmm0
	movsd	%xmm1, 8(%rsp)
	movsd	%xmm0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	pxor	%xmm1, %xmm1
	movq	%r12, %rdi
	movsd	8(%rsp), %xmm0
	addsd	16(%rsp), %xmm0
	imull	%eax, %eax
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm0, %xmm1
	ja	.L23
	movq	%r13, %rdi
.L23:
	call	puts@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	cmpl	%edx, %eax
	jge	.L4
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	cmpl	%ecx, %eax
	jge	.L7
	cmpl	%ecx, %edx
	pxor	%xmm0, %xmm0
	movapd	%xmm2, %xmm1
	cmovg	%ecx, %edx
	cvtsi2sdl	%edx, %xmm0
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	pxor	%xmm1, %xmm1
	movapd	%xmm2, %xmm0
	cvtsi2sdl	%ecx, %xmm1
	jmp	.L6
.L25:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	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
.L26:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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>

int
main(int argc, char **argv)
{
	int d, w, h;
	double a, b;
	int r;
	int n;

	while (true)
	{
		scanf("%d %d %d", &d, &w, &h);
		if (d == 0 && w == 0 && h == 0)
			break;

		if (d < w)
		{
			if (d < h) /* d < w ? h */
			{
				a = d;
				b = (w < h) ? w : h;
			}
			else /* h <= d < w ? */
			{
				a = h;
				b = d;
			}
		}
		else /* w <= d ? */
		{
			if (w < h) /* w <= d ? h */
			{
				a = w;
				b = (d < h) ? d : h;
			}
			else /* h <= w <= d ? */
			{
				a = h;
				b = w;
			}
		}

		a /= 2;
		b /= 2;
		scanf("%d", &n);
		while (n--)
		{
			scanf("%d", &r);
			if (a * a + b * b < r * r)
				printf("OK\n");
			else
				printf("NA\n");
		}
	}

	return 0;
}
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 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>

int
main(int argc, char **argv)
{
	int d, w, h;
	double a, b;
	int r;
	int n;

	while (true)
	{
		scanf("%d %d %d", &d, &w, &h);
		if (d == 0 && w == 0 && h == 0)
			break;

		if (d < w)
		{
			if (d < h) /* d < w ? h */
			{
				a = d;
				b = (w < h) ? w : h;
			}
			else /* h <= d < w ? */
			{
				a = h;
				b = d;
			}
		}
		else /* w <= d ? */
		{
			if (w < h) /* w <= d ? h */
			{
				a = w;
				b = (d < h) ? d : h;
			}
			else /* h <= w <= d ? */
			{
				a = h;
				b = w;
			}
		}

		a /= 2;
		b /= 2;
		scanf("%d", &n);
		while (n--)
		{
			scanf("%d", &r);
			if (a * a + b * b < r * r)
				printf("OK\n");
			else
				printf("NA\n");
		}
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC2:
	.string	"%d"
.LC3:
	.string	"OK"
.LC4:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -52(%rbp)
	movq	%rsi, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L2:
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-44(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L5:
	movl	-36(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-44(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L4:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-36(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
.L6:
	movsd	-24(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-16(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L8
.L11:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	mulsd	%xmm0, %xmm1
	movsd	-16(%rbp), %xmm0
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	movl	-32(%rbp), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L17:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L11
	jmp	.L12
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.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
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC2:
	.string	"%d"
.LC3:
	.string	"OK"
.LC4:
	.string	"NA"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -52(%rbp)
	movq	%rsi, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L12:
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L2:
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-44(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L5:
	movl	-36(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-44(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L4:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
	jmp	.L6
.L7:
	movl	-36(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-40(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movsd	%xmm0, -16(%rbp)
.L6:
	movsd	-24(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	-16(%rbp), %xmm0
	movsd	.LC1(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L8
.L11:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movsd	-24(%rbp), %xmm0
	movapd	%xmm0, %xmm1
	mulsd	%xmm0, %xmm1
	movsd	-16(%rbp), %xmm0
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	movl	-32(%rbp), %edx
	movl	-32(%rbp), %eax
	imull	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	comisd	%xmm1, %xmm0
	jbe	.L17
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L17:
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L11
	jmp	.L12
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.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:
