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 a,i,x,y,z=0;
int num[100000];
int min = 1000006;
int result[100000];


int main(void) {
  while(scanf("%d",&a) && a!=0){
  num[i]=a;
  i++;
}

for(int k=0;k<i;k++){
  //printf("y\n");
  for(int y=0;y*y<=num[k];y++){
    //printf("y\n");
    for(int z=0;z*z*z <= num[k];z++){
      //printf("y\n");
      x = num[k]-y*y-z*z*z;
      //printf("%d\n",x);
      if(x>=0){
        if(x+y+z<=min) min=x+y+z;
        else;
      }
      else;
    }
  }
  result[k]=min;
  min=1000006;
}

//printf("%d\n",result[3]);
//  printf("%d\n",i);
for(int k=0;k<i;k++){
  printf("%d\n",result[k]);
}

  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	z
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.globl	num
	.align 32
	.type	num, @object
	.size	num, 400000
num:
	.zero	400000
	.globl	min
	.data
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.long	1000006
	.globl	result
	.bss
	.align 32
	.type	result, @object
	.size	result, 400000
result:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	jmp	.L2
.L4:
	movl	i(%rip), %edx
	movl	a(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	num(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L4
.L3:
	movl	$0, -16(%rbp)
	jmp	.L5
.L11:
	movl	$0, -12(%rbp)
	jmp	.L6
.L10:
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	subl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, x(%rip)
	movl	x(%rip), %eax
	testl	%eax, %eax
	js	.L8
	movl	x(%rip), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	min(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	x(%rip), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, min(%rip)
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L9
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	min(%rip), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	result(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$1000006, min(%rip)
	addl	$1, -16(%rbp)
.L5:
	movl	i(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	movl	$0, -4(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	result(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L12:
	movl	i(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	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
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	num(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	a(%rip), %edx
	movl	i(%rip), %eax
	testl	%edx, %edx
	je	.L7
	movslq	%eax, %rcx
	addl	$1, %eax
	movl	%edx, 0(%r13,%rcx,4)
	movl	%eax, i(%rip)
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L3
	movl	i(%rip), %eax
.L7:
	testl	%eax, %eax
	jle	.L24
	movl	min(%rip), %esi
	movslq	%eax, %r9
	xorl	%r10d, %r10d
	xorl	%edx, %edx
	leaq	num(%rip), %r11
	leaq	result(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r11,%r10,4), %edi
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	testl	%edi, %edi
	js	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%edi, %ecx
	xorl	%edx, %edx
	subl	%eax, %ecx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%ecx, %ebx
	subl	%eax, %ebx
	js	.L8
	leal	(%r8,%rbx), %eax
	addl	%edx, %eax
	cmpl	%eax, %esi
	cmovg	%eax, %esi
.L8:
	addl	$1, %edx
	movl	%edx, %eax
	imull	%edx, %eax
	imull	%edx, %eax
	cmpl	%eax, %edi
	jge	.L9
	addl	$1, %r8d
	movl	%r8d, %eax
	imull	%r8d, %eax
	cmpl	%eax, %edi
	jge	.L10
	movl	$1, %edx
.L12:
	movl	%esi, 0(%rbp,%r10,4)
	addq	$1, %r10
	movl	$1000006, %esi
	cmpq	%r9, %r10
	jne	.L5
	movl	$1000006, min(%rip)
	testb	%dl, %dl
	je	.L13
	movl	%ebx, x(%rip)
.L13:
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L14:
	movl	0(%rbp,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, i(%rip)
	jg	.L14
.L24:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	result
	.bss
	.align 32
	.type	result, @object
	.size	result, 400000
result:
	.zero	400000
	.globl	min
	.data
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.long	1000006
	.globl	num
	.bss
	.align 32
	.type	num, @object
	.size	num, 400000
num:
	.zero	400000
	.globl	z
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.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
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	num(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	a(%rip), %edx
	movl	i(%rip), %eax
	testl	%edx, %edx
	je	.L7
	movslq	%eax, %rcx
	addl	$1, %eax
	movl	%edx, 0(%r13,%rcx,4)
	movl	%eax, i(%rip)
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L3
	movl	i(%rip), %eax
.L7:
	testl	%eax, %eax
	jle	.L24
	movl	min(%rip), %esi
	movslq	%eax, %r9
	xorl	%r10d, %r10d
	xorl	%edx, %edx
	leaq	num(%rip), %r11
	leaq	result(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r11,%r10,4), %edi
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	testl	%edi, %edi
	js	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%edi, %ecx
	xorl	%edx, %edx
	subl	%eax, %ecx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%ecx, %ebx
	subl	%eax, %ebx
	js	.L8
	leal	(%r8,%rbx), %eax
	addl	%edx, %eax
	cmpl	%eax, %esi
	cmovg	%eax, %esi
.L8:
	addl	$1, %edx
	movl	%edx, %eax
	imull	%edx, %eax
	imull	%edx, %eax
	cmpl	%eax, %edi
	jge	.L9
	addl	$1, %r8d
	movl	%r8d, %eax
	imull	%r8d, %eax
	cmpl	%eax, %edi
	jge	.L10
	movl	$1, %edx
.L12:
	movl	%esi, 0(%rbp,%r10,4)
	addq	$1, %r10
	movl	$1000006, %esi
	cmpq	%r9, %r10
	jne	.L5
	movl	$1000006, min(%rip)
	testb	%dl, %dl
	je	.L13
	movl	%ebx, x(%rip)
.L13:
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L14:
	movl	0(%rbp,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, i(%rip)
	jg	.L14
.L24:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	result
	.bss
	.align 32
	.type	result, @object
	.size	result, 400000
result:
	.zero	400000
	.globl	min
	.data
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.long	1000006
	.globl	num
	.bss
	.align 32
	.type	num, @object
	.size	num, 400000
num:
	.zero	400000
	.globl	z
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.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 a,i,x,y,z=0;
int num[100000];
int min = 1000006;
int result[100000];


int main(void) {
  while(scanf("%d",&a) && a!=0){
  num[i]=a;
  i++;
}

for(int k=0;k<i;k++){
  //printf("y\n");
  for(int y=0;y*y<=num[k];y++){
    //printf("y\n");
    for(int z=0;z*z*z <= num[k];z++){
      //printf("y\n");
      x = num[k]-y*y-z*z*z;
      //printf("%d\n",x);
      if(x>=0){
        if(x+y+z<=min) min=x+y+z;
        else;
      }
      else;
    }
  }
  result[k]=min;
  min=1000006;
}

//printf("%d\n",result[3]);
//  printf("%d\n",i);
for(int k=0;k<i;k++){
  printf("%d\n",result[k]);
}

  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 a,i,x,y,z=0;
int num[100000];
int min = 1000006;
int result[100000];


int main(void) {
  while(scanf("%d",&a) && a!=0){
  num[i]=a;
  i++;
}

for(int k=0;k<i;k++){
  //printf("y\n");
  for(int y=0;y*y<=num[k];y++){
    //printf("y\n");
    for(int z=0;z*z*z <= num[k];z++){
      //printf("y\n");
      x = num[k]-y*y-z*z*z;
      //printf("%d\n",x);
      if(x>=0){
        if(x+y+z<=min) min=x+y+z;
        else;
      }
      else;
    }
  }
  result[k]=min;
  min=1000006;
}

//printf("%d\n",result[3]);
//  printf("%d\n",i);
for(int k=0;k<i;k++){
  printf("%d\n",result[k]);
}

  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	z
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.globl	num
	.align 32
	.type	num, @object
	.size	num, 400000
num:
	.zero	400000
	.globl	min
	.data
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.long	1000006
	.globl	result
	.bss
	.align 32
	.type	result, @object
	.size	result, 400000
result:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	jmp	.L2
.L4:
	movl	i(%rip), %edx
	movl	a(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	num(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L4
.L3:
	movl	$0, -16(%rbp)
	jmp	.L5
.L11:
	movl	$0, -12(%rbp)
	jmp	.L6
.L10:
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	subl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, x(%rip)
	movl	x(%rip), %eax
	testl	%eax, %eax
	js	.L8
	movl	x(%rip), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	min(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	x(%rip), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, min(%rip)
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L9
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	min(%rip), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	result(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$1000006, min(%rip)
	addl	$1, -16(%rbp)
.L5:
	movl	i(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	movl	$0, -4(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	result(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L12:
	movl	i(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	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	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	z
	.align 4
	.type	z, @object
	.size	z, 4
z:
	.zero	4
	.globl	num
	.align 32
	.type	num, @object
	.size	num, 400000
num:
	.zero	400000
	.globl	min
	.data
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.long	1000006
	.globl	result
	.bss
	.align 32
	.type	result, @object
	.size	result, 400000
result:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	jmp	.L2
.L4:
	movl	i(%rip), %edx
	movl	a(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	num(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L4
.L3:
	movl	$0, -16(%rbp)
	jmp	.L5
.L11:
	movl	$0, -12(%rbp)
	jmp	.L6
.L10:
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	num(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	subl	%eax, %edx
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, x(%rip)
	movl	x(%rip), %eax
	testl	%eax, %eax
	js	.L8
	movl	x(%rip), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	min(%rip), %eax
	cmpl	%eax, %edx
	jg	.L8
	movl	x(%rip), %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, min(%rip)
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	imull	%eax, %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L9
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	num(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	min(%rip), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	result(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$1000006, min(%rip)
	addl	$1, -16(%rbp)
.L5:
	movl	i(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	movl	$0, -4(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	result(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L12:
	movl	i(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L13
	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:
