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

```c
#include <stdio.h>
#include <math.h>

int main(void) {
  int d, w, h, n, r;

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

    scanf("%d", &n);
    while (n--) {
      scanf("%d", &r);
      if (sqrt(d * d + w * w) / 2 < r)
	printf("OK\n");
      else if (sqrt(w * w + h * h) / 2 < r)
	printf("OK\n");
      else if (sqrt(d * d + h * h) / 2 < r)
	printf("OK\n");
      else
	printf("NA\n");
    }
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC4:
	.string	"OK"
.LC5:
	.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
	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	.LC1(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %r15
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	leaq	48(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
	leaq	52(%rsp), %rbp
	leaq	.LC4(%rip), %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L28:
	movl	44(%rsp), %ecx
	pxor	%xmm0, %xmm0
	pxor	%xmm3, %xmm3
	imull	%ecx, %ecx
	addl	%ecx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L29
	sqrtsd	%xmm0, %xmm0
.L12:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leal	(%rdx,%rcx), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm4
	ja	.L30
	sqrtsd	%xmm0, %xmm0
.L16:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm2, %xmm2
	imull	%eax, %eax
	movl	%eax, %edx
	movl	40(%rsp), %eax
	imull	%eax, %eax
	leal	(%rdx,%rax), %ecx
	cvtsi2sdl	%ecx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L27
	sqrtsd	%xmm0, %xmm0
.L6:
	mulsd	.LC3(%rip), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	52(%rsp), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L28
.L13:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
.L27:
	.cfi_restore_state
	movl	%eax, 16(%rsp)
	movl	%edx, 8(%rsp)
	call	sqrt@PLT
	movl	16(%rsp), %eax
	movl	8(%rsp), %edx
	jmp	.L6
.L29:
	movl	%ecx, 28(%rsp)
	movl	%edx, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %edx
	jmp	.L12
.L30:
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	jmp	.L16
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.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:
```

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
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC4:
	.string	"OK"
.LC5:
	.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
	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	.LC1(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %r15
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	leaq	48(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
	leaq	52(%rsp), %rbp
	leaq	.LC4(%rip), %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L28:
	movl	44(%rsp), %ecx
	pxor	%xmm0, %xmm0
	pxor	%xmm3, %xmm3
	imull	%ecx, %ecx
	addl	%ecx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L29
	sqrtsd	%xmm0, %xmm0
.L12:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leal	(%rdx,%rcx), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm4
	ja	.L30
	sqrtsd	%xmm0, %xmm0
.L16:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm2, %xmm2
	imull	%eax, %eax
	movl	%eax, %edx
	movl	40(%rsp), %eax
	imull	%eax, %eax
	leal	(%rdx,%rax), %ecx
	cvtsi2sdl	%ecx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L27
	sqrtsd	%xmm0, %xmm0
.L6:
	mulsd	.LC3(%rip), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	52(%rsp), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L28
.L13:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
.L27:
	.cfi_restore_state
	movl	%eax, 16(%rsp)
	movl	%edx, 8(%rsp)
	call	sqrt@PLT
	movl	16(%rsp), %eax
	movl	8(%rsp), %edx
	jmp	.L6
.L29:
	movl	%ecx, 28(%rsp)
	movl	%edx, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %edx
	jmp	.L12
.L30:
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	jmp	.L16
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC4:
	.string	"OK"
.LC5:
	.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
	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	.LC1(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %r15
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	leaq	48(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
	leaq	52(%rsp), %rbp
	leaq	.LC4(%rip), %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L28:
	movl	44(%rsp), %ecx
	pxor	%xmm0, %xmm0
	pxor	%xmm3, %xmm3
	imull	%ecx, %ecx
	addl	%ecx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L29
	sqrtsd	%xmm0, %xmm0
.L12:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leal	(%rdx,%rcx), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm4
	ja	.L30
	sqrtsd	%xmm0, %xmm0
.L16:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm2, %xmm2
	imull	%eax, %eax
	movl	%eax, %edx
	movl	40(%rsp), %eax
	imull	%eax, %eax
	leal	(%rdx,%rax), %ecx
	cvtsi2sdl	%ecx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L27
	sqrtsd	%xmm0, %xmm0
.L6:
	mulsd	.LC3(%rip), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	52(%rsp), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L28
.L13:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
.L27:
	.cfi_restore_state
	movl	%eax, 16(%rsp)
	movl	%edx, 8(%rsp)
	call	sqrt@PLT
	movl	16(%rsp), %eax
	movl	8(%rsp), %edx
	jmp	.L6
.L29:
	movl	%ecx, 28(%rsp)
	movl	%edx, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %edx
	jmp	.L12
.L30:
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	jmp	.L16
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.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:
```
```c
#include <stdio.h>
#include <math.h>

int main(void) {
  int d, w, h, n, r;

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

    scanf("%d", &n);
    while (n--) {
      scanf("%d", &r);
      if (sqrt(d * d + w * w) / 2 < r)
	printf("OK\n");
      else if (sqrt(w * w + h * h) / 2 < r)
	printf("OK\n");
      else if (sqrt(d * d + h * h) / 2 < r)
	printf("OK\n");
      else
	printf("NA\n");
    }
  }
  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <math.h>

int main(void) {
  int d, w, h, n, r;

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

    scanf("%d", &n);
    while (n--) {
      scanf("%d", &r);
      if (sqrt(d * d + w * w) / 2 < r)
	printf("OK\n");
      else if (sqrt(w * w + h * h) / 2 < r)
	printf("OK\n");
      else if (sqrt(d * d + h * h) / 2 < r)
	printf("OK\n");
      else
	printf("NA\n");
    }
  }
  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
#include <stdio.h>
#include <math.h>

int main(void) {
  int d, w, h, n, r;

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

    scanf("%d", &n);
    while (n--) {
      scanf("%d", &r);
      if (sqrt(d * d + w * w) / 2 < r)
	printf("OK\n");
      else if (sqrt(w * w + h * h) / 2 < r)
	printf("OK\n");
      else if (sqrt(d * d + h * h) / 2 < r)
	printf("OK\n");
      else
	printf("NA\n");
    }
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC4:
	.string	"OK"
.LC5:
	.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
	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	.LC1(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %r15
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	leaq	48(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
	leaq	52(%rsp), %rbp
	leaq	.LC4(%rip), %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L28:
	movl	44(%rsp), %ecx
	pxor	%xmm0, %xmm0
	pxor	%xmm3, %xmm3
	imull	%ecx, %ecx
	addl	%ecx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L29
	sqrtsd	%xmm0, %xmm0
.L12:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leal	(%rdx,%rcx), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm4
	ja	.L30
	sqrtsd	%xmm0, %xmm0
.L16:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm2, %xmm2
	imull	%eax, %eax
	movl	%eax, %edx
	movl	40(%rsp), %eax
	imull	%eax, %eax
	leal	(%rdx,%rax), %ecx
	cvtsi2sdl	%ecx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L27
	sqrtsd	%xmm0, %xmm0
.L6:
	mulsd	.LC3(%rip), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	52(%rsp), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L28
.L13:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
.L27:
	.cfi_restore_state
	movl	%eax, 16(%rsp)
	movl	%edx, 8(%rsp)
	call	sqrt@PLT
	movl	16(%rsp), %eax
	movl	8(%rsp), %edx
	jmp	.L6
.L29:
	movl	%ecx, 28(%rsp)
	movl	%edx, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %edx
	jmp	.L12
.L30:
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	jmp	.L16
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.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:
```

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
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC4:
	.string	"OK"
.LC5:
	.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
	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	.LC1(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %r15
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	leaq	48(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
	leaq	52(%rsp), %rbp
	leaq	.LC4(%rip), %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L28:
	movl	44(%rsp), %ecx
	pxor	%xmm0, %xmm0
	pxor	%xmm3, %xmm3
	imull	%ecx, %ecx
	addl	%ecx, %eax
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm3
	ja	.L29
	sqrtsd	%xmm0, %xmm0
.L12:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leal	(%rdx,%rcx), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2sdl	%eax, %xmm0
	ucomisd	%xmm0, %xmm4
	ja	.L30
	sqrtsd	%xmm0, %xmm0
.L16:
	mulsd	.LC3(%rip), %xmm0
	comisd	%xmm0, %xmm1
	ja	.L13
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	movl	48(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 48(%rsp)
	testl	%eax, %eax
	je	.L18
.L17:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm2, %xmm2
	imull	%eax, %eax
	movl	%eax, %edx
	movl	40(%rsp), %eax
	imull	%eax, %eax
	leal	(%rdx,%rax), %ecx
	cvtsi2sdl	%ecx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L27
	sqrtsd	%xmm0, %xmm0
.L6:
	mulsd	.LC3(%rip), %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	52(%rsp), %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L28
.L13:
	movq	%r12, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
.L27:
	.cfi_restore_state
	movl	%eax, 16(%rsp)
	movl	%edx, 8(%rsp)
	call	sqrt@PLT
	movl	16(%rsp), %eax
	movl	8(%rsp), %edx
	jmp	.L6
.L29:
	movl	%ecx, 28(%rsp)
	movl	%edx, 8(%rsp)
	movsd	%xmm1, 16(%rsp)
	call	sqrt@PLT
	movl	28(%rsp), %ecx
	movsd	16(%rsp), %xmm1
	movl	8(%rsp), %edx
	jmp	.L12
.L30:
	movsd	%xmm1, 8(%rsp)
	call	sqrt@PLT
	movsd	8(%rsp), %xmm1
	jmp	.L16
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.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:
```