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

```c
z;main(e,m,y,t){for(;scanf("%d",&e)*e;z=!printf("%d\n",m))for(m=1e9;y=sqrt(t=e-z*z*z),t>=0;)m=fmin(m,t-y*y+y+z++);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	z
	.bss
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L2
.L5:
	movl	$1000000000, -8(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%eax, %ecx
	movl	z(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, z(%rip)
	addl	%ecx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-8(%rbp), %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -8(%rbp)
.L3:
	movl	-4(%rbp), %eax
	movl	z(%rip), %ecx
	movl	z(%rip), %edx
	imull	%edx, %ecx
	movl	z(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-16(%rbp), %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -16(%rbp)
	jns	.L4
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, z(%rip)
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L5
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	.LC1(%rip), %r14
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %ebp
	imull	%ebp, %eax
	testl	%eax, %eax
	je	.L7
	movl	z(%rip), %r15d
	movl	$1000000000, %esi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	movl	%r15d, z(%rip)
	imull	%eax, %ecx
	cvtsi2sdl	%esi, %xmm0
	subl	%ecx, %ebx
	addl	%eax, %ebx
	addl	%edx, %ebx
	cvtsi2sdl	%ebx, %xmm1
	call	fmin@PLT
	cvttsd2sil	%xmm0, %esi
.L8:
	movl	%r15d, %eax
	movl	%ebp, %ebx
	pxor	%xmm0, %xmm0
	movl	%r15d, %edx
	imull	%r15d, %eax
	pxor	%xmm2, %xmm2
	imull	%r15d, %eax
	subl	%eax, %ebx
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L10
	sqrtsd	%xmm0, %xmm0
	addl	$1, %r15d
	cvttsd2sil	%xmm0, %eax
	testl	%ebx, %ebx
	jns	.L5
.L6:
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, z(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$24, %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
.L10:
	.cfi_restore_state
	movl	%esi, 8(%rsp)
	movl	%r15d, 4(%rsp)
	addl	$1, %r15d
	call	sqrt@PLT
	testl	%ebx, %ebx
	movl	4(%rsp), %edx
	movl	8(%rsp), %esi
	cvttsd2sil	%xmm0, %eax
	jns	.L5
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	z
	.bss
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.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
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	.LC1(%rip), %r14
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %ebp
	imull	%ebp, %eax
	testl	%eax, %eax
	je	.L7
	movl	z(%rip), %r15d
	movl	$1000000000, %esi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	movl	%r15d, z(%rip)
	imull	%eax, %ecx
	cvtsi2sdl	%esi, %xmm0
	subl	%ecx, %ebx
	addl	%eax, %ebx
	addl	%edx, %ebx
	cvtsi2sdl	%ebx, %xmm1
	call	fmin@PLT
	cvttsd2sil	%xmm0, %esi
.L8:
	movl	%r15d, %eax
	movl	%ebp, %ebx
	pxor	%xmm0, %xmm0
	movl	%r15d, %edx
	imull	%r15d, %eax
	pxor	%xmm2, %xmm2
	imull	%r15d, %eax
	subl	%eax, %ebx
	cvtsi2sdl	%ebx, %xmm0
	ucomisd	%xmm0, %xmm2
	ja	.L10
	sqrtsd	%xmm0, %xmm0
	addl	$1, %r15d
	cvttsd2sil	%xmm0, %eax
	testl	%ebx, %ebx
	jns	.L5
.L6:
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, z(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$24, %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
.L10:
	.cfi_restore_state
	movl	%esi, 8(%rsp)
	movl	%r15d, 4(%rsp)
	addl	$1, %r15d
	call	sqrt@PLT
	testl	%ebx, %ebx
	movl	4(%rsp), %edx
	movl	8(%rsp), %esi
	cvttsd2sil	%xmm0, %eax
	jns	.L5
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	z
	.bss
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.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:

z;main(e,m,y,t){for(;scanf("%d",&e)*e;z=!printf("%d\n",m))for(m=1e9;y=sqrt(t=e-z*z*z),t>=0;)m=fmin(m,t-y*y+y+z++);}
1
2
4
6
300
1250
0
 1
2
4
2
300
1250
0
 1
2
4
3
300
1250
0
 1
2
4
3
76
1250
0
 1
2
4
27
557
1250
0
 1
2
4
6
300
1687
0
 1
1
4
2
300
1250
0
 1
2
5
3
300
1250
0
 1
2
3
3
76
1250
0
 1
2
4
27
266
1250
0

1
2
2
4
18
44
 1
2
2
2
18
44
 1
2
2
3
18
44
 1
2
2
3
10
44
 1
2
2
3
23
44
 1
2
2
4
18
47
 1
1
2
2
18
44
 1
2
3
3
18
44
 1
2
3
3
10
44
 1
2
2
3
14
44

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

```c
z;main(e,m,y,t){for(;scanf("%d",&e)*e;z=!printf("%d\n",m))for(m=1e9;y=sqrt(t=e-z*z*z),t>=0;)m=fmin(m,t-y*y+y+z++);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	z
	.bss
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L2
.L5:
	movl	$1000000000, -8(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%eax, %ecx
	movl	z(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, z(%rip)
	addl	%ecx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-8(%rbp), %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -8(%rbp)
.L3:
	movl	-4(%rbp), %eax
	movl	z(%rip), %ecx
	movl	z(%rip), %edx
	imull	%edx, %ecx
	movl	z(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-16(%rbp), %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -16(%rbp)
	jns	.L4
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, z(%rip)
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L5
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
train
	.file	"temp.c"
	.text
	.globl	z
	.bss
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	jmp	.L2
.L5:
	movl	$1000000000, -8(%rbp)
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	addl	%eax, %ecx
	movl	z(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, z(%rip)
	addl	%ecx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-8(%rbp), %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -8(%rbp)
.L3:
	movl	-4(%rbp), %eax
	movl	z(%rip), %ecx
	movl	z(%rip), %edx
	imull	%edx, %ecx
	movl	z(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-16(%rbp), %xmm3
	movq	%xmm3, %rax
	movq	%rax, %xmm0
	call	sqrt@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -16(%rbp)
	jns	.L4
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, z(%rip)
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L5
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
