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>
#include <math.h>
int line[101],line1[1001];
int main(void){
    int sum,min,i,o;
    for(;min=1000000,scanf("%d",&sum),sum;){
        for(i=0;i<101;i++){
            if(!line[i])
                line[i]=(int)pow(i,3);
            if(line[i]>sum)
                break;
            for(o=0;o<1001;o++){
                if(!line1[o])
                    line1[o]=(int)pow(o,2);
                if(line[i]+line1[o] > sum)
                    break;
                if(sum-line[i]-line1[o]+i+o < min)
                    min=(sum-line[i]-line1[o]+i+o);
            }
        }
        printf("%d\n",min);
    }
    return 0;
}```

Assembly Code:

```assembly
	.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:
.LFB23:
	.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	line(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	line1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r15d
	testl	%r15d, %r15d
	je	.L15
	xorl	%ebx, %ebx
	movl	$1000000, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r14,%rbx,4), %esi
	movl	%ebx, %ebp
	testl	%esi, %esi
	je	.L16
.L3:
	cmpl	%esi, %r15d
	jl	.L4
	movl	%r15d, %r8d
	xorl	%edx, %edx
	subl	%esi, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rsi,%rcx), %eax
	cmpl	%r15d, %eax
	jg	.L6
.L17:
	movl	%r8d, %eax
	subl	%ecx, %eax
	addl	%ebp, %eax
	addl	%r10d, %eax
	cmpl	%eax, %r12d
	cmovg	%eax, %r12d
	addq	$1, %rdx
	cmpq	$1001, %rdx
	je	.L6
.L7:
	movl	0(%r13,%rdx,4), %ecx
	movl	%edx, %r10d
	testl	%ecx, %ecx
	jne	.L5
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	mulsd	%xmm0, %xmm0
	cvttsd2sil	%xmm0, %ecx
	leal	(%rsi,%rcx), %eax
	movl	%ecx, 0(%r13,%rdx,4)
	cmpl	%r15d, %eax
	jle	.L17
.L6:
	addq	$1, %rbx
	cmpq	$101, %rbx
	jne	.L8
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	pxor	%xmm0, %xmm0
	movq	.LC0(%rip), %rax
	cvtsi2sdl	%ebx, %xmm0
	movq	%rax, %xmm1
	call	pow@PLT
	cvttsd2sil	%xmm0, %esi
	movl	%esi, (%r14,%rbx,4)
	jmp	.L3
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	line1
	.bss
	.align 32
	.type	line1, @object
	.size	line1, 4004
line1:
	.zero	4004
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 404
line:
	.zero	404
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1074266112
	.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
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	line(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	line1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r15d
	testl	%r15d, %r15d
	je	.L15
	xorl	%ebx, %ebx
	movl	$1000000, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r14,%rbx,4), %esi
	movl	%ebx, %ebp
	testl	%esi, %esi
	je	.L16
.L3:
	cmpl	%esi, %r15d
	jl	.L4
	movl	%r15d, %r8d
	xorl	%edx, %edx
	subl	%esi, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rsi,%rcx), %eax
	cmpl	%r15d, %eax
	jg	.L6
.L17:
	movl	%r8d, %eax
	subl	%ecx, %eax
	addl	%ebp, %eax
	addl	%r10d, %eax
	cmpl	%eax, %r12d
	cmovg	%eax, %r12d
	addq	$1, %rdx
	cmpq	$1001, %rdx
	je	.L6
.L7:
	movl	0(%r13,%rdx,4), %ecx
	movl	%edx, %r10d
	testl	%ecx, %ecx
	jne	.L5
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	mulsd	%xmm0, %xmm0
	cvttsd2sil	%xmm0, %ecx
	leal	(%rsi,%rcx), %eax
	movl	%ecx, 0(%r13,%rdx,4)
	cmpl	%r15d, %eax
	jle	.L17
.L6:
	addq	$1, %rbx
	cmpq	$101, %rbx
	jne	.L8
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	pxor	%xmm0, %xmm0
	movq	.LC0(%rip), %rax
	cvtsi2sdl	%ebx, %xmm0
	movq	%rax, %xmm1
	call	pow@PLT
	cvttsd2sil	%xmm0, %esi
	movl	%esi, (%r14,%rbx,4)
	jmp	.L3
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	line1
	.bss
	.align 32
	.type	line1, @object
	.size	line1, 4004
line1:
	.zero	4004
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 404
line:
	.zero	404
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1074266112
	.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
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	line(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	line1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r15d
	testl	%r15d, %r15d
	je	.L15
	xorl	%ebx, %ebx
	movl	$1000000, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r14,%rbx,4), %esi
	movl	%ebx, %ebp
	testl	%esi, %esi
	je	.L16
.L3:
	cmpl	%esi, %r15d
	jl	.L4
	movl	%r15d, %r8d
	xorl	%edx, %edx
	subl	%esi, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rsi,%rcx), %eax
	cmpl	%r15d, %eax
	jg	.L6
.L17:
	movl	%r8d, %eax
	subl	%ecx, %eax
	addl	%ebp, %eax
	addl	%r10d, %eax
	cmpl	%eax, %r12d
	cmovg	%eax, %r12d
	addq	$1, %rdx
	cmpq	$1001, %rdx
	je	.L6
.L7:
	movl	0(%r13,%rdx,4), %ecx
	movl	%edx, %r10d
	testl	%ecx, %ecx
	jne	.L5
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	mulsd	%xmm0, %xmm0
	cvttsd2sil	%xmm0, %ecx
	leal	(%rsi,%rcx), %eax
	movl	%ecx, 0(%r13,%rdx,4)
	cmpl	%r15d, %eax
	jle	.L17
.L6:
	addq	$1, %rbx
	cmpq	$101, %rbx
	jne	.L8
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	pxor	%xmm0, %xmm0
	movq	.LC0(%rip), %rax
	cvtsi2sdl	%ebx, %xmm0
	movq	%rax, %xmm1
	call	pow@PLT
	cvttsd2sil	%xmm0, %esi
	movl	%esi, (%r14,%rbx,4)
	jmp	.L3
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	line1
	.bss
	.align 32
	.type	line1, @object
	.size	line1, 4004
line1:
	.zero	4004
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 404
line:
	.zero	404
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1074266112
	.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>
#include <math.h>
int line[101],line1[1001];
int main(void){
    int sum,min,i,o;
    for(;min=1000000,scanf("%d",&sum),sum;){
        for(i=0;i<101;i++){
            if(!line[i])
                line[i]=(int)pow(i,3);
            if(line[i]>sum)
                break;
            for(o=0;o<1001;o++){
                if(!line1[o])
                    line1[o]=(int)pow(o,2);
                if(line[i]+line1[o] > sum)
                    break;
                if(sum-line[i]-line1[o]+i+o < min)
                    min=(sum-line[i]-line1[o]+i+o);
            }
        }
        printf("%d\n",min);
    }
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <math.h>
int line[101],line1[1001];
int main(void){
    int sum,min,i,o;
    for(;min=1000000,scanf("%d",&sum),sum;){
        for(i=0;i<101;i++){
            if(!line[i])
                line[i]=(int)pow(i,3);
            if(line[i]>sum)
                break;
            for(o=0;o<1001;o++){
                if(!line1[o])
                    line1[o]=(int)pow(o,2);
                if(line[i]+line1[o] > sum)
                    break;
                if(sum-line[i]-line1[o]+i+o < min)
                    min=(sum-line[i]-line1[o]+i+o);
            }
        }
        printf("%d\n",min);
    }
    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>
#include <math.h>
int line[101],line1[1001];
int main(void){
    int sum,min,i,o;
    for(;min=1000000,scanf("%d",&sum),sum;){
        for(i=0;i<101;i++){
            if(!line[i])
                line[i]=(int)pow(i,3);
            if(line[i]>sum)
                break;
            for(o=0;o<1001;o++){
                if(!line1[o])
                    line1[o]=(int)pow(o,2);
                if(line[i]+line1[o] > sum)
                    break;
                if(sum-line[i]-line1[o]+i+o < min)
                    min=(sum-line[i]-line1[o]+i+o);
            }
        }
        printf("%d\n",min);
    }
    return 0;
}```

Assembly Code:

```assembly
	.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:
.LFB23:
	.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	line(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	line1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r15d
	testl	%r15d, %r15d
	je	.L15
	xorl	%ebx, %ebx
	movl	$1000000, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r14,%rbx,4), %esi
	movl	%ebx, %ebp
	testl	%esi, %esi
	je	.L16
.L3:
	cmpl	%esi, %r15d
	jl	.L4
	movl	%r15d, %r8d
	xorl	%edx, %edx
	subl	%esi, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rsi,%rcx), %eax
	cmpl	%r15d, %eax
	jg	.L6
.L17:
	movl	%r8d, %eax
	subl	%ecx, %eax
	addl	%ebp, %eax
	addl	%r10d, %eax
	cmpl	%eax, %r12d
	cmovg	%eax, %r12d
	addq	$1, %rdx
	cmpq	$1001, %rdx
	je	.L6
.L7:
	movl	0(%r13,%rdx,4), %ecx
	movl	%edx, %r10d
	testl	%ecx, %ecx
	jne	.L5
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	mulsd	%xmm0, %xmm0
	cvttsd2sil	%xmm0, %ecx
	leal	(%rsi,%rcx), %eax
	movl	%ecx, 0(%r13,%rdx,4)
	cmpl	%r15d, %eax
	jle	.L17
.L6:
	addq	$1, %rbx
	cmpq	$101, %rbx
	jne	.L8
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	pxor	%xmm0, %xmm0
	movq	.LC0(%rip), %rax
	cvtsi2sdl	%ebx, %xmm0
	movq	%rax, %xmm1
	call	pow@PLT
	cvttsd2sil	%xmm0, %esi
	movl	%esi, (%r14,%rbx,4)
	jmp	.L3
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	line1
	.bss
	.align 32
	.type	line1, @object
	.size	line1, 4004
line1:
	.zero	4004
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 404
line:
	.zero	404
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1074266112
	.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
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	line(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	line1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r15d
	testl	%r15d, %r15d
	je	.L15
	xorl	%ebx, %ebx
	movl	$1000000, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r14,%rbx,4), %esi
	movl	%ebx, %ebp
	testl	%esi, %esi
	je	.L16
.L3:
	cmpl	%esi, %r15d
	jl	.L4
	movl	%r15d, %r8d
	xorl	%edx, %edx
	subl	%esi, %r8d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rsi,%rcx), %eax
	cmpl	%r15d, %eax
	jg	.L6
.L17:
	movl	%r8d, %eax
	subl	%ecx, %eax
	addl	%ebp, %eax
	addl	%r10d, %eax
	cmpl	%eax, %r12d
	cmovg	%eax, %r12d
	addq	$1, %rdx
	cmpq	$1001, %rdx
	je	.L6
.L7:
	movl	0(%r13,%rdx,4), %ecx
	movl	%edx, %r10d
	testl	%ecx, %ecx
	jne	.L5
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edx, %xmm0
	mulsd	%xmm0, %xmm0
	cvttsd2sil	%xmm0, %ecx
	leal	(%rsi,%rcx), %eax
	movl	%ecx, 0(%r13,%rdx,4)
	cmpl	%r15d, %eax
	jle	.L17
.L6:
	addq	$1, %rbx
	cmpq	$101, %rbx
	jne	.L8
.L4:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	pxor	%xmm0, %xmm0
	movq	.LC0(%rip), %rax
	cvtsi2sdl	%ebx, %xmm0
	movq	%rax, %xmm1
	call	pow@PLT
	cvttsd2sil	%xmm0, %esi
	movl	%esi, (%r14,%rbx,4)
	jmp	.L3
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$40, %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
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	line1
	.bss
	.align 32
	.type	line1, @object
	.size	line1, 4004
line1:
	.zero	4004
	.globl	line
	.align 32
	.type	line, @object
	.size	line, 404
line:
	.zero	404
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1074266112
	.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:
```