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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll n;
	while(scanf("%lld",&n),n){
		ll ans=1e9;
		rep(z,0,ans){
			if(z*z*z>n)break;
			rep(y,0,ans-z){
				if(z*z*z+y*y>n)break;
				ans=min(ans,z+y+n-z*z*z-y*y);
			}
		}
		printf("%lld\n",ans);
	}
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld\n"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %r9
	testq	%r9, %r9
	je	.L15
	movq	%r9, %r10
	xorl	%esi, %esi
	movl	$1000000000, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rsi, %rdi
	imulq	%rsi, %rdi
	imulq	%rsi, %rdi
	cmpq	%r9, %rdi
	jg	.L3
	movq	%r10, %r11
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	subq	%rdi, %r11
	cmpq	%rsi, %r8
	jg	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rax, %rcx
	imulq	%rax, %rcx
	leaq	(%rdi,%rcx), %rdx
	cmpq	%r9, %rdx
	jg	.L5
.L4:
	leaq	(%r11,%rax), %rdx
	subq	%rcx, %rdx
	cmpq	%rdx, %r8
	cmovg	%rdx, %r8
	addq	$1, %rax
	movq	%r8, %rdx
	subq	%rsi, %rdx
	cmpq	%rax, %rdx
	jg	.L6
.L5:
	addq	$1, %rsi
	addq	$1, %r10
	cmpq	%r8, %rsi
	jl	.L7
.L3:
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.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	"%lld\n"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %r9
	testq	%r9, %r9
	je	.L15
	movq	%r9, %r10
	xorl	%esi, %esi
	movl	$1000000000, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rsi, %rdi
	imulq	%rsi, %rdi
	imulq	%rsi, %rdi
	cmpq	%r9, %rdi
	jg	.L3
	movq	%r10, %r11
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	subq	%rdi, %r11
	cmpq	%rsi, %r8
	jg	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rax, %rcx
	imulq	%rax, %rcx
	leaq	(%rdi,%rcx), %rdx
	cmpq	%r9, %rdx
	jg	.L5
.L4:
	leaq	(%r11,%rax), %rdx
	subq	%rcx, %rdx
	cmpq	%rdx, %r8
	cmovg	%rdx, %r8
	addq	$1, %rax
	movq	%r8, %rdx
	subq	%rsi, %rdx
	cmpq	%rax, %rdx
	jg	.L6
.L5:
	addq	$1, %rsi
	addq	$1, %r10
	cmpq	%r8, %rsi
	jl	.L7
.L3:
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.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	"%lld\n"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %r9
	testq	%r9, %r9
	je	.L15
	movq	%r9, %r10
	xorl	%esi, %esi
	movl	$1000000000, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rsi, %rdi
	imulq	%rsi, %rdi
	imulq	%rsi, %rdi
	cmpq	%r9, %rdi
	jg	.L3
	movq	%r10, %r11
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	subq	%rdi, %r11
	cmpq	%rsi, %r8
	jg	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rax, %rcx
	imulq	%rax, %rcx
	leaq	(%rdi,%rcx), %rdx
	cmpq	%r9, %rdx
	jg	.L5
.L4:
	leaq	(%r11,%rax), %rdx
	subq	%rcx, %rdx
	cmpq	%rdx, %r8
	cmovg	%rdx, %r8
	addq	$1, %rax
	movq	%r8, %rdx
	subq	%rsi, %rdx
	cmpq	%rax, %rdx
	jg	.L6
.L5:
	addq	$1, %rsi
	addq	$1, %r10
	cmpq	%r8, %rsi
	jl	.L7
.L3:
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll n;
	while(scanf("%lld",&n),n){
		ll ans=1e9;
		rep(z,0,ans){
			if(z*z*z>n)break;
			rep(y,0,ans-z){
				if(z*z*z+y*y>n)break;
				ans=min(ans,z+y+n-z*z*z-y*y);
			}
		}
		printf("%lld\n",ans);
	}
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll n;
	while(scanf("%lld",&n),n){
		ll ans=1e9;
		rep(z,0,ans){
			if(z*z*z>n)break;
			rep(y,0,ans-z){
				if(z*z*z+y*y>n)break;
				ans=min(ans,z+y+n-z*z*z-y*y);
			}
		}
		printf("%lld\n",ans);
	}
}
```

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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll n;
	while(scanf("%lld",&n),n){
		ll ans=1e9;
		rep(z,0,ans){
			if(z*z*z>n)break;
			rep(y,0,ans-z){
				if(z*z*z+y*y>n)break;
				ans=min(ans,z+y+n-z*z*z-y*y);
			}
		}
		printf("%lld\n",ans);
	}
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld\n"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %r9
	testq	%r9, %r9
	je	.L15
	movq	%r9, %r10
	xorl	%esi, %esi
	movl	$1000000000, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rsi, %rdi
	imulq	%rsi, %rdi
	imulq	%rsi, %rdi
	cmpq	%r9, %rdi
	jg	.L3
	movq	%r10, %r11
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	subq	%rdi, %r11
	cmpq	%rsi, %r8
	jg	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rax, %rcx
	imulq	%rax, %rcx
	leaq	(%rdi,%rcx), %rdx
	cmpq	%r9, %rdx
	jg	.L5
.L4:
	leaq	(%r11,%rax), %rdx
	subq	%rcx, %rdx
	cmpq	%rdx, %r8
	cmovg	%rdx, %r8
	addq	$1, %rax
	movq	%r8, %rdx
	subq	%rsi, %rdx
	cmpq	%rax, %rdx
	jg	.L6
.L5:
	addq	$1, %rsi
	addq	$1, %r10
	cmpq	%r8, %rsi
	jl	.L7
.L3:
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.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	"%lld\n"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %r9
	testq	%r9, %r9
	je	.L15
	movq	%r9, %r10
	xorl	%esi, %esi
	movl	$1000000000, %r8d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rsi, %rdi
	imulq	%rsi, %rdi
	imulq	%rsi, %rdi
	cmpq	%r9, %rdi
	jg	.L3
	movq	%r10, %r11
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	subq	%rdi, %r11
	cmpq	%rsi, %r8
	jg	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rax, %rcx
	imulq	%rax, %rcx
	leaq	(%rdi,%rcx), %rdx
	cmpq	%r9, %rdx
	jg	.L5
.L4:
	leaq	(%r11,%rax), %rdx
	subq	%rcx, %rdx
	cmpq	%rdx, %r8
	cmovg	%rdx, %r8
	addq	$1, %rax
	movq	%r8, %rdx
	subq	%rsi, %rdx
	cmpq	%rax, %rdx
	jg	.L6
.L5:
	addq	$1, %rsi
	addq	$1, %r10
	cmpq	%r8, %rsi
	jl	.L7
.L3:
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L15:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.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:
```