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>

int e;
int func(int y, int z)
{
    return e - (y * y) - (z * z * z) + y + z;
}

int main(void)
{
    while(1){
        int i, j;
        int min = 1000000;

        scanf("%d", &e);

        if(e == 0)
            break;

        for(i = 0; i <= e; i++){
            for(j = 0; j <= e; j++){
                if(i * i + j * j * j <= e){
                    int temp = func(i, j);
                    if(min > temp){
                        min = temp;
                    }
                }else{
                    break;
                }
            }
            if(i * i > e)
                break;
        }

        printf("%d\n", min);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	e
	.bss
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.zero	4
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	e(%rip), %edx
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	subl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	subl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
.L15:
	movl	$1000000, -8(%rbp)
	leaq	e(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	e(%rip), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -16(%rbp)
	jmp	.L6
.L14:
	movl	$0, -12(%rbp)
	jmp	.L7
.L11:
	movl	-16(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	imull	-12(%rbp), %eax
	addl	%eax, %edx
	movl	e(%rip), %eax
	cmpl	%eax, %edx
	jg	.L19
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	func
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L9
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L9:
	addl	$1, -12(%rbp)
.L7:
	movl	e(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L11
	jmp	.L10
.L19:
	nop
.L10:
	movl	-16(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	e(%rip), %eax
	cmpl	%eax, %edx
	jg	.L20
	addl	$1, -16(%rbp)
.L6:
	movl	e(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	jmp	.L13
.L20:
	nop
.L13:
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L18:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %edx
	movl	e(%rip), %eax
	imull	%edi, %edx
	subl	%edx, %eax
	movl	%esi, %edx
	imull	%esi, %edx
	imull	%esi, %edx
	subl	%edx, %eax
	addl	%edi, %eax
	addl	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	e(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	e(%rip), %esi
	testl	%esi, %esi
	je	.L12
	movl	$1000000, %r8d
	movl	$0, %edi
	js	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edi, %r9d
	imull	%edi, %r9d
	cmpl	%r9d, %esi
	jl	.L6
	movl	%esi, %r10d
	subl	%r9d, %r10d
	leal	(%r10,%rdi), %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %ecx
	imull	%eax, %ecx
	imull	%eax, %ecx
	leal	(%rcx,%r9), %edx
	cmpl	%edx, %esi
	jl	.L7
	movl	%r10d, %edx
	subl	%ecx, %edx
	addl	%edi, %edx
	addl	%eax, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	addl	$1, %eax
	cmpl	%eax, %esi
	jge	.L8
.L7:
	addl	$1, %edi
	cmpl	%edi, %esi
	jge	.L5
.L6:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L12:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	e
	.bss
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.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
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %edx
	movl	e(%rip), %eax
	imull	%edi, %edx
	subl	%edx, %eax
	movl	%esi, %edx
	imull	%esi, %edx
	imull	%esi, %edx
	subl	%edx, %eax
	addl	%edi, %eax
	addl	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	e(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	e(%rip), %esi
	testl	%esi, %esi
	je	.L12
	movl	$1000000, %r8d
	movl	$0, %edi
	js	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edi, %r9d
	imull	%edi, %r9d
	cmpl	%r9d, %esi
	jl	.L6
	movl	%esi, %r10d
	subl	%r9d, %r10d
	leal	(%r10,%rdi), %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %ecx
	imull	%eax, %ecx
	imull	%eax, %ecx
	leal	(%rcx,%r9), %edx
	cmpl	%edx, %esi
	jl	.L7
	movl	%r10d, %edx
	subl	%ecx, %edx
	addl	%edi, %edx
	addl	%eax, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	addl	$1, %eax
	cmpl	%eax, %esi
	jge	.L8
.L7:
	addl	$1, %edi
	cmpl	%edi, %esi
	jge	.L5
.L6:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L12:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	e
	.bss
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.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:

#include <stdio.h>

int e;
int func(int y, int z)
{
    return e - (y * y) - (z * z * z) + y + z;
}

int main(void)
{
    while(1){
        int i, j;
        int min = 1000000;

        scanf("%d", &e);

        if(e == 0)
            break;

        for(i = 0; i <= e; i++){
            for(j = 0; j <= e; j++){
                if(i * i + j * j * j <= e){
                    int temp = func(i, j);
                    if(min > temp){
                        min = temp;
                    }
                }else{
                    break;
                }
            }
            if(i * i > e)
                break;
        }

        printf("%d\n", min);
    }

    return 0;
}
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
#include <stdio.h>

int e;
int func(int y, int z)
{
    return e - (y * y) - (z * z * z) + y + z;
}

int main(void)
{
    while(1){
        int i, j;
        int min = 1000000;

        scanf("%d", &e);

        if(e == 0)
            break;

        for(i = 0; i <= e; i++){
            for(j = 0; j <= e; j++){
                if(i * i + j * j * j <= e){
                    int temp = func(i, j);
                    if(min > temp){
                        min = temp;
                    }
                }else{
                    break;
                }
            }
            if(i * i > e)
                break;
        }

        printf("%d\n", min);
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	e
	.bss
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.zero	4
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	e(%rip), %edx
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	subl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	subl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
.L15:
	movl	$1000000, -8(%rbp)
	leaq	e(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	e(%rip), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -16(%rbp)
	jmp	.L6
.L14:
	movl	$0, -12(%rbp)
	jmp	.L7
.L11:
	movl	-16(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	imull	-12(%rbp), %eax
	addl	%eax, %edx
	movl	e(%rip), %eax
	cmpl	%eax, %edx
	jg	.L19
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	func
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L9
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L9:
	addl	$1, -12(%rbp)
.L7:
	movl	e(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L11
	jmp	.L10
.L19:
	nop
.L10:
	movl	-16(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	e(%rip), %eax
	cmpl	%eax, %edx
	jg	.L20
	addl	$1, -16(%rbp)
.L6:
	movl	e(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	jmp	.L13
.L20:
	nop
.L13:
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L18:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	e
	.bss
	.align 4
	.type	e, @object
	.size	e, 4
e:
	.zero	4
	.text
	.globl	func
	.type	func, @function
func:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	e(%rip), %edx
	movl	-4(%rbp), %eax
	imull	%eax, %eax
	subl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	subl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	func, .-func
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
.L15:
	movl	$1000000, -8(%rbp)
	leaq	e(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	e(%rip), %eax
	testl	%eax, %eax
	je	.L18
	movl	$0, -16(%rbp)
	jmp	.L6
.L14:
	movl	$0, -12(%rbp)
	jmp	.L7
.L11:
	movl	-16(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	imull	-12(%rbp), %eax
	addl	%eax, %edx
	movl	e(%rip), %eax
	cmpl	%eax, %edx
	jg	.L19
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	func
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L9
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L9:
	addl	$1, -12(%rbp)
.L7:
	movl	e(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L11
	jmp	.L10
.L19:
	nop
.L10:
	movl	-16(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	e(%rip), %eax
	cmpl	%eax, %edx
	jg	.L20
	addl	$1, -16(%rbp)
.L6:
	movl	e(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L14
	jmp	.L13
.L20:
	nop
.L13:
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L18:
	nop
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
