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>
typedef long long ll;
int main(void)
{
    int e;
    while (scanf("%d", &e), e) {
        int res=(1<<29), x, y, z, m;
        ll tz, ty;
        for(z=0;(tz=(ll)z*z*z)<=e;++z) for(y=0;tz+(ty=(ll)y*y)<=e;++y) {
            x=e-ty-tz;
            m=x+y+z;
            if (m<res) res=m;
        }
        printf("%d\n", res);
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L7
	movslq	%r10d, %rsi
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	movl	$536870912, %r8d
	testq	%rsi, %rsi
	js	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%r11d, %r9d
	movl	%ecx, %edi
	movl	$1, %eax
	xorl	%r13d, %r13d
	cmpq	%rcx, %rsi
	jl	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r10d, %edx
	subl	%r13d, %edx
	movq	%rax, %r13
	subl	%edi, %edx
	leal	-1(%rdx,%rax), %edx
	addl	%r9d, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	imulq	%rax, %r13
	addq	$1, %rax
	leaq	0(%r13,%rcx), %rdx
	cmpq	%rsi, %rdx
	jle	.L3
.L6:
	addq	$1, %r11
	movq	%r11, %rcx
	imulq	%r11, %rcx
	imulq	%r11, %rcx
	cmpq	%rsi, %rcx
	jle	.L8
.L4:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L7
	movslq	%r10d, %rsi
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	movl	$536870912, %r8d
	testq	%rsi, %rsi
	js	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%r11d, %r9d
	movl	%ecx, %edi
	movl	$1, %eax
	xorl	%r13d, %r13d
	cmpq	%rcx, %rsi
	jl	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r10d, %edx
	subl	%r13d, %edx
	movq	%rax, %r13
	subl	%edi, %edx
	leal	-1(%rdx,%rax), %edx
	addl	%r9d, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	imulq	%rax, %r13
	addq	$1, %rax
	leaq	0(%r13,%rcx), %rdx
	cmpq	%rsi, %rdx
	jle	.L3
.L6:
	addq	$1, %r11
	movq	%r11, %rcx
	imulq	%r11, %rcx
	imulq	%r11, %rcx
	cmpq	%rsi, %rcx
	jle	.L8
.L4:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L7
	movslq	%r10d, %rsi
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	movl	$536870912, %r8d
	testq	%rsi, %rsi
	js	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%r11d, %r9d
	movl	%ecx, %edi
	movl	$1, %eax
	xorl	%r13d, %r13d
	cmpq	%rcx, %rsi
	jl	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r10d, %edx
	subl	%r13d, %edx
	movq	%rax, %r13
	subl	%edi, %edx
	leal	-1(%rdx,%rax), %edx
	addl	%r9d, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	imulq	%rax, %r13
	addq	$1, %rax
	leaq	0(%r13,%rcx), %rdx
	cmpq	%rsi, %rdx
	jle	.L3
.L6:
	addq	$1, %r11
	movq	%r11, %rcx
	imulq	%r11, %rcx
	imulq	%r11, %rcx
	cmpq	%rsi, %rcx
	jle	.L8
.L4:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include <stdio.h>
typedef long long ll;
int main(void)
{
    int e;
    while (scanf("%d", &e), e) {
        int res=(1<<29), x, y, z, m;
        ll tz, ty;
        for(z=0;(tz=(ll)z*z*z)<=e;++z) for(y=0;tz+(ty=(ll)y*y)<=e;++y) {
            x=e-ty-tz;
            m=x+y+z;
            if (m<res) res=m;
        }
        printf("%d\n", res);
    }
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
typedef long long ll;
int main(void)
{
    int e;
    while (scanf("%d", &e), e) {
        int res=(1<<29), x, y, z, m;
        ll tz, ty;
        for(z=0;(tz=(ll)z*z*z)<=e;++z) for(y=0;tz+(ty=(ll)y*y)<=e;++y) {
            x=e-ty-tz;
            m=x+y+z;
            if (m<res) res=m;
        }
        printf("%d\n", res);
    }
    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
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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
typedef long long ll;
int main(void)
{
    int e;
    while (scanf("%d", &e), e) {
        int res=(1<<29), x, y, z, m;
        ll tz, ty;
        for(z=0;(tz=(ll)z*z*z)<=e;++z) for(y=0;tz+(ty=(ll)y*y)<=e;++y) {
            x=e-ty-tz;
            m=x+y+z;
            if (m<res) res=m;
        }
        printf("%d\n", res);
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L7
	movslq	%r10d, %rsi
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	movl	$536870912, %r8d
	testq	%rsi, %rsi
	js	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%r11d, %r9d
	movl	%ecx, %edi
	movl	$1, %eax
	xorl	%r13d, %r13d
	cmpq	%rcx, %rsi
	jl	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r10d, %edx
	subl	%r13d, %edx
	movq	%rax, %r13
	subl	%edi, %edx
	leal	-1(%rdx,%rax), %edx
	addl	%r9d, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	imulq	%rax, %r13
	addq	$1, %rax
	leaq	0(%r13,%rcx), %rdx
	cmpq	%rsi, %rdx
	jle	.L3
.L6:
	addq	$1, %r11
	movq	%r11, %rcx
	imulq	%r11, %rcx
	imulq	%r11, %rcx
	cmpq	%rsi, %rcx
	jle	.L8
.L4:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L7
	movslq	%r10d, %rsi
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	movl	$536870912, %r8d
	testq	%rsi, %rsi
	js	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%r11d, %r9d
	movl	%ecx, %edi
	movl	$1, %eax
	xorl	%r13d, %r13d
	cmpq	%rcx, %rsi
	jl	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r10d, %edx
	subl	%r13d, %edx
	movq	%rax, %r13
	subl	%edi, %edx
	leal	-1(%rdx,%rax), %edx
	addl	%r9d, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
	imulq	%rax, %r13
	addq	$1, %rax
	leaq	0(%r13,%rcx), %rdx
	cmpq	%rsi, %rdx
	jle	.L3
.L6:
	addq	$1, %r11
	movq	%r11, %rcx
	imulq	%r11, %rcx
	imulq	%r11, %rcx
	cmpq	%rsi, %rcx
	jle	.L8
.L4:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```