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>

#define EPS 1e-7

int main(void) {
	double d;
	double answer = 0;
	int i;
	if (scanf("%lf", &d) != 1) return 1;
	answer = d * sqrt(2);
	for (i = 1; i < d + EPS; i++) {
		double y = sqrt(d * d - i * i);
		double candidate;
		if (y < 1) candidate = i + y + (1.0 - y) /* / 2 * 2 */;
		else candidate = i + y;
		if (candidate > answer) answer = candidate;
	}
	printf("%.15f\n", answer);
	return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%lf"
.LC5:
	.string	"%.15f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$1, %r8d
	cmpl	$1, %eax
	jne	.L1
	movsd	48(%rsp), %xmm5
	movsd	.LC3(%rip), %xmm6
	movsd	.LC0(%rip), %xmm4
	movsd	.LC2(%rip), %xmm2
	addsd	%xmm5, %xmm6
	mulsd	%xmm5, %xmm2
	comisd	%xmm4, %xmm6
	jbe	.L3
	mulsd	%xmm5, %xmm5
	movapd	%xmm4, %xmm1
	pxor	%xmm7, %xmm7
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %edx
	pxor	%xmm3, %xmm3
	movapd	%xmm5, %xmm0
	imull	%eax, %edx
	cvtsi2sdl	%edx, %xmm3
	subsd	%xmm3, %xmm0
	ucomisd	%xmm0, %xmm7
	ja	.L20
	sqrtsd	%xmm0, %xmm0
.L7:
	comisd	%xmm0, %xmm4
	addsd	%xmm0, %xmm1
	jbe	.L8
	movapd	%xmm4, %xmm3
	subsd	%xmm0, %xmm3
	addsd	%xmm3, %xmm1
.L8:
	maxsd	%xmm2, %xmm1
	addl	$1, %eax
	movapd	%xmm1, %xmm2
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm1, %xmm6
	ja	.L12
.L3:
	movapd	%xmm2, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	movl	%r8d, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	movl	%eax, 36(%rsp)
	movsd	%xmm6, 40(%rsp)
	movsd	%xmm2, 24(%rsp)
	movsd	%xmm1, 16(%rsp)
	movsd	%xmm5, 8(%rsp)
	call	sqrt@PLT
	movq	.LC0(%rip), %rax
	pxor	%xmm7, %xmm7
	movsd	40(%rsp), %xmm6
	movsd	24(%rsp), %xmm2
	movsd	16(%rsp), %xmm1
	movq	%rax, %xmm4
	movsd	8(%rsp), %xmm5
	movl	36(%rsp), %eax
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	1719614413
	.long	1073127582
	.align 8
.LC3:
	.long	-1698910392
	.long	1048238066
	.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	"%lf"
.LC5:
	.string	"%.15f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$1, %r8d
	cmpl	$1, %eax
	jne	.L1
	movsd	48(%rsp), %xmm5
	movsd	.LC3(%rip), %xmm6
	movsd	.LC0(%rip), %xmm4
	movsd	.LC2(%rip), %xmm2
	addsd	%xmm5, %xmm6
	mulsd	%xmm5, %xmm2
	comisd	%xmm4, %xmm6
	jbe	.L3
	mulsd	%xmm5, %xmm5
	movapd	%xmm4, %xmm1
	pxor	%xmm7, %xmm7
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %edx
	pxor	%xmm3, %xmm3
	movapd	%xmm5, %xmm0
	imull	%eax, %edx
	cvtsi2sdl	%edx, %xmm3
	subsd	%xmm3, %xmm0
	ucomisd	%xmm0, %xmm7
	ja	.L20
	sqrtsd	%xmm0, %xmm0
.L7:
	comisd	%xmm0, %xmm4
	addsd	%xmm0, %xmm1
	jbe	.L8
	movapd	%xmm4, %xmm3
	subsd	%xmm0, %xmm3
	addsd	%xmm3, %xmm1
.L8:
	maxsd	%xmm2, %xmm1
	addl	$1, %eax
	movapd	%xmm1, %xmm2
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm1, %xmm6
	ja	.L12
.L3:
	movapd	%xmm2, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	movl	%r8d, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	movl	%eax, 36(%rsp)
	movsd	%xmm6, 40(%rsp)
	movsd	%xmm2, 24(%rsp)
	movsd	%xmm1, 16(%rsp)
	movsd	%xmm5, 8(%rsp)
	call	sqrt@PLT
	movq	.LC0(%rip), %rax
	pxor	%xmm7, %xmm7
	movsd	40(%rsp), %xmm6
	movsd	24(%rsp), %xmm2
	movsd	16(%rsp), %xmm1
	movq	%rax, %xmm4
	movsd	8(%rsp), %xmm5
	movl	36(%rsp), %eax
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	1719614413
	.long	1073127582
	.align 8
.LC3:
	.long	-1698910392
	.long	1048238066
	.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	"%lf"
.LC5:
	.string	"%.15f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$1, %r8d
	cmpl	$1, %eax
	jne	.L1
	movsd	48(%rsp), %xmm5
	movsd	.LC3(%rip), %xmm6
	movsd	.LC0(%rip), %xmm4
	movsd	.LC2(%rip), %xmm2
	addsd	%xmm5, %xmm6
	mulsd	%xmm5, %xmm2
	comisd	%xmm4, %xmm6
	jbe	.L3
	mulsd	%xmm5, %xmm5
	movapd	%xmm4, %xmm1
	pxor	%xmm7, %xmm7
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %edx
	pxor	%xmm3, %xmm3
	movapd	%xmm5, %xmm0
	imull	%eax, %edx
	cvtsi2sdl	%edx, %xmm3
	subsd	%xmm3, %xmm0
	ucomisd	%xmm0, %xmm7
	ja	.L20
	sqrtsd	%xmm0, %xmm0
.L7:
	comisd	%xmm0, %xmm4
	addsd	%xmm0, %xmm1
	jbe	.L8
	movapd	%xmm4, %xmm3
	subsd	%xmm0, %xmm3
	addsd	%xmm3, %xmm1
.L8:
	maxsd	%xmm2, %xmm1
	addl	$1, %eax
	movapd	%xmm1, %xmm2
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm1, %xmm6
	ja	.L12
.L3:
	movapd	%xmm2, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	movl	%r8d, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	movl	%eax, 36(%rsp)
	movsd	%xmm6, 40(%rsp)
	movsd	%xmm2, 24(%rsp)
	movsd	%xmm1, 16(%rsp)
	movsd	%xmm5, 8(%rsp)
	call	sqrt@PLT
	movq	.LC0(%rip), %rax
	pxor	%xmm7, %xmm7
	movsd	40(%rsp), %xmm6
	movsd	24(%rsp), %xmm2
	movsd	16(%rsp), %xmm1
	movq	%rax, %xmm4
	movsd	8(%rsp), %xmm5
	movl	36(%rsp), %eax
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	1719614413
	.long	1073127582
	.align 8
.LC3:
	.long	-1698910392
	.long	1048238066
	.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>

#define EPS 1e-7

int main(void) {
	double d;
	double answer = 0;
	int i;
	if (scanf("%lf", &d) != 1) return 1;
	answer = d * sqrt(2);
	for (i = 1; i < d + EPS; i++) {
		double y = sqrt(d * d - i * i);
		double candidate;
		if (y < 1) candidate = i + y + (1.0 - y) /* / 2 * 2 */;
		else candidate = i + y;
		if (candidate > answer) answer = candidate;
	}
	printf("%.15f\n", answer);
	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>

#define EPS 1e-7

int main(void) {
	double d;
	double answer = 0;
	int i;
	if (scanf("%lf", &d) != 1) return 1;
	answer = d * sqrt(2);
	for (i = 1; i < d + EPS; i++) {
		double y = sqrt(d * d - i * i);
		double candidate;
		if (y < 1) candidate = i + y + (1.0 - y) /* / 2 * 2 */;
		else candidate = i + y;
		if (candidate > answer) answer = candidate;
	}
	printf("%.15f\n", answer);
	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:

1.6623460269048462
 3.25937378137542
 2.618243582076879
 4.191829833885925
 2.6469616558038407
 4.247442548717362
 2.711344148850446
 4.7522412032328525
 2.895597134917855
 5.55775493898071

2.350912296605864
 4.609450606464399
 3.702755583369436
 5.928142602241634
 3.743369072719336
 6.006790857796639
 3.834419667565237
 6.720683961280137
 4.094992739369507
 7.859852411052574

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>

#define EPS 1e-7

int main(void) {
	double d;
	double answer = 0;
	int i;
	if (scanf("%lf", &d) != 1) return 1;
	answer = d * sqrt(2);
	for (i = 1; i < d + EPS; i++) {
		double y = sqrt(d * d - i * i);
		double candidate;
		if (y < 1) candidate = i + y + (1.0 - y) /* / 2 * 2 */;
		else candidate = i + y;
		if (candidate > answer) answer = candidate;
	}
	printf("%.15f\n", answer);
	return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%lf"
.LC5:
	.string	"%.15f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$1, %r8d
	cmpl	$1, %eax
	jne	.L1
	movsd	48(%rsp), %xmm5
	movsd	.LC3(%rip), %xmm6
	movsd	.LC0(%rip), %xmm4
	movsd	.LC2(%rip), %xmm2
	addsd	%xmm5, %xmm6
	mulsd	%xmm5, %xmm2
	comisd	%xmm4, %xmm6
	jbe	.L3
	mulsd	%xmm5, %xmm5
	movapd	%xmm4, %xmm1
	pxor	%xmm7, %xmm7
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %edx
	pxor	%xmm3, %xmm3
	movapd	%xmm5, %xmm0
	imull	%eax, %edx
	cvtsi2sdl	%edx, %xmm3
	subsd	%xmm3, %xmm0
	ucomisd	%xmm0, %xmm7
	ja	.L20
	sqrtsd	%xmm0, %xmm0
.L7:
	comisd	%xmm0, %xmm4
	addsd	%xmm0, %xmm1
	jbe	.L8
	movapd	%xmm4, %xmm3
	subsd	%xmm0, %xmm3
	addsd	%xmm3, %xmm1
.L8:
	maxsd	%xmm2, %xmm1
	addl	$1, %eax
	movapd	%xmm1, %xmm2
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm1, %xmm6
	ja	.L12
.L3:
	movapd	%xmm2, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	movl	%r8d, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	movl	%eax, 36(%rsp)
	movsd	%xmm6, 40(%rsp)
	movsd	%xmm2, 24(%rsp)
	movsd	%xmm1, 16(%rsp)
	movsd	%xmm5, 8(%rsp)
	call	sqrt@PLT
	movq	.LC0(%rip), %rax
	pxor	%xmm7, %xmm7
	movsd	40(%rsp), %xmm6
	movsd	24(%rsp), %xmm2
	movsd	16(%rsp), %xmm1
	movq	%rax, %xmm4
	movsd	8(%rsp), %xmm5
	movl	36(%rsp), %eax
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	1719614413
	.long	1073127582
	.align 8
.LC3:
	.long	-1698910392
	.long	1048238066
	.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	"%lf"
.LC5:
	.string	"%.15f\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	$1, %r8d
	cmpl	$1, %eax
	jne	.L1
	movsd	48(%rsp), %xmm5
	movsd	.LC3(%rip), %xmm6
	movsd	.LC0(%rip), %xmm4
	movsd	.LC2(%rip), %xmm2
	addsd	%xmm5, %xmm6
	mulsd	%xmm5, %xmm2
	comisd	%xmm4, %xmm6
	jbe	.L3
	mulsd	%xmm5, %xmm5
	movapd	%xmm4, %xmm1
	pxor	%xmm7, %xmm7
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %edx
	pxor	%xmm3, %xmm3
	movapd	%xmm5, %xmm0
	imull	%eax, %edx
	cvtsi2sdl	%edx, %xmm3
	subsd	%xmm3, %xmm0
	ucomisd	%xmm0, %xmm7
	ja	.L20
	sqrtsd	%xmm0, %xmm0
.L7:
	comisd	%xmm0, %xmm4
	addsd	%xmm0, %xmm1
	jbe	.L8
	movapd	%xmm4, %xmm3
	subsd	%xmm0, %xmm3
	addsd	%xmm3, %xmm1
.L8:
	maxsd	%xmm2, %xmm1
	addl	$1, %eax
	movapd	%xmm1, %xmm2
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm1, %xmm6
	ja	.L12
.L3:
	movapd	%xmm2, %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	movl	%r8d, %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	movl	%eax, 36(%rsp)
	movsd	%xmm6, 40(%rsp)
	movsd	%xmm2, 24(%rsp)
	movsd	%xmm1, 16(%rsp)
	movsd	%xmm5, 8(%rsp)
	call	sqrt@PLT
	movq	.LC0(%rip), %rax
	pxor	%xmm7, %xmm7
	movsd	40(%rsp), %xmm6
	movsd	24(%rsp), %xmm2
	movsd	16(%rsp), %xmm1
	movq	%rax, %xmm4
	movsd	8(%rsp), %xmm5
	movl	36(%rsp), %eax
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1072693248
	.align 8
.LC2:
	.long	1719614413
	.long	1073127582
	.align 8
.LC3:
	.long	-1698910392
	.long	1048238066
	.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:
```