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>
#define MAX (1000000-1)

int tcomp[MAX+1];	// 各自然数を構成するために必要な正四面体数の数
int otcomp[MAX+1];	// 各自然数を構成するために必要な奇数の正四面体数の数

int min(int a,int b){
	return a<b?a:b;
}
int main(){
	int i,n,m;
	int in;
	for(i=0;i<=MAX;i++){
		tcomp[i]=otcomp[i]=MAX;
	}
	tcomp[0]=otcomp[0]=0;
	for(i=0;i<=MAX;i++){
		for(n=1;;n++){
			m = n*(n+1)*(n+2)/6;
			if(MAX < i+m)break;
			tcomp[i+m] = min(tcomp[i+m],tcomp[i]+1);
			if(m&1)
				otcomp[i+m] = min(otcomp[i+m],otcomp[i]+1);
		}
	}
	while(scanf("%d",&in)==1&&in){
		printf("%d %d\n",tcomp[in],otcomp[in]);
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tcomp
	.bss
	.align 32
	.type	tcomp, @object
	.size	tcomp, 4000000
tcomp:
	.zero	4000000
	.globl	otcomp
	.align 32
	.type	otcomp, @object
	.size	otcomp, 4000000
otcomp:
	.zero	4000000
	.text
	.globl	min
	.type	min, @function
min:
.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	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -36(%rbp)
	jmp	.L4
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	$999999, (%rdx,%rax)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L4:
	cmpl	$999999, -36(%rbp)
	jle	.L5
	movl	$0, otcomp(%rip)
	movl	otcomp(%rip), %eax
	movl	%eax, tcomp(%rip)
	movl	$0, -36(%rbp)
	jmp	.L6
.L11:
	movl	$1, -32(%rbp)
.L10:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	imull	-32(%rbp), %eax
	movl	-32(%rbp), %edx
	addl	$2, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jg	.L18
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	tcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-36(%rbp), %esi
	movl	-28(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L9
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	otcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-36(%rbp), %esi
	movl	-28(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	otcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	addl	$1, -32(%rbp)
	jmp	.L10
.L18:
	nop
	addl	$1, -36(%rbp)
.L6:
	cmpl	$999999, -36(%rbp)
	jle	.L11
	jmp	.L12
.L14:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	tcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L13
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
.L13:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	movq	-8(%rbp), %rbx
	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	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	otcomp(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	tcomp(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	movaps	%xmm0, 0(%rbp,%rax)
	movaps	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	$4000000, %rax
	jne	.L4
	xorl	%esi, %esi
	leaq	tcomp(%rip), %rdi
	movl	$0, otcomp(%rip)
	leaq	otcomp(%rip), %r9
	leal	1(%rsi), %r10d
	movl	$2863311531, %r8d
	movl	$0, tcomp(%rip)
	cmpl	$999999, %r10d
	jg	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%r10d, %edx
	movl	$1, %eax
	movl	$2, %r11d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ecx, %r11d
.L10:
	movl	(%rdi), %ecx
	movslq	%edx, %rdx
	movl	(%rbx,%rdx,4), %r12d
	addl	$1, %ecx
	cmpl	%r12d, %ecx
	cmovg	%r12d, %ecx
	movl	%ecx, (%rbx,%rdx,4)
	testb	$1, %al
	je	.L7
	movl	(%r9), %eax
	movl	0(%rbp,%rdx,4), %ecx
	addl	$1, %eax
	cmpl	%ecx, %eax
	cmovg	%ecx, %eax
	movl	%eax, 0(%rbp,%rdx,4)
.L7:
	leal	1(%r11), %ecx
	movl	%ecx, %eax
	imull	%r11d, %eax
	addl	$2, %r11d
	imull	%r11d, %eax
	imulq	%r8, %rax
	shrq	$34, %rax
	leal	(%rax,%rsi), %edx
	cmpl	$999999, %edx
	jle	.L20
.L6:
	movl	%r10d, %esi
	addq	$4, %rdi
	addq	$4, %r9
	leal	1(%rsi), %r10d
	cmpl	$999999, %r10d
	jle	.L21
.L9:
	cmpl	$1000000, %r10d
	jne	.L6
	leaq	4(%rsp), %r13
	leaq	.LC2(%rip), %r12
	leaq	.LC1(%rip), %r14
	jmp	.L8
.L22:
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	je	.L11
	movl	0(%rbp,%rax,4), %ecx
	movl	(%rbx,%rax,4), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L22
.L11:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	otcomp
	.bss
	.align 32
	.type	otcomp, @object
	.size	otcomp, 4000000
otcomp:
	.zero	4000000
	.globl	tcomp
	.align 32
	.type	tcomp, @object
	.size	tcomp, 4000000
tcomp:
	.zero	4000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	999999
	.long	999999
	.long	999999
	.long	999999
	.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	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	otcomp(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	tcomp(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	movaps	%xmm0, 0(%rbp,%rax)
	movaps	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	$4000000, %rax
	jne	.L4
	xorl	%esi, %esi
	leaq	tcomp(%rip), %rdi
	movl	$0, otcomp(%rip)
	leaq	otcomp(%rip), %r9
	leal	1(%rsi), %r10d
	movl	$2863311531, %r8d
	movl	$0, tcomp(%rip)
	cmpl	$999999, %r10d
	jg	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%r10d, %edx
	movl	$1, %eax
	movl	$2, %r11d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ecx, %r11d
.L10:
	movl	(%rdi), %ecx
	movslq	%edx, %rdx
	movl	(%rbx,%rdx,4), %r12d
	addl	$1, %ecx
	cmpl	%r12d, %ecx
	cmovg	%r12d, %ecx
	movl	%ecx, (%rbx,%rdx,4)
	testb	$1, %al
	je	.L7
	movl	(%r9), %eax
	movl	0(%rbp,%rdx,4), %ecx
	addl	$1, %eax
	cmpl	%ecx, %eax
	cmovg	%ecx, %eax
	movl	%eax, 0(%rbp,%rdx,4)
.L7:
	leal	1(%r11), %ecx
	movl	%ecx, %eax
	imull	%r11d, %eax
	addl	$2, %r11d
	imull	%r11d, %eax
	imulq	%r8, %rax
	shrq	$34, %rax
	leal	(%rax,%rsi), %edx
	cmpl	$999999, %edx
	jle	.L20
.L6:
	movl	%r10d, %esi
	addq	$4, %rdi
	addq	$4, %r9
	leal	1(%rsi), %r10d
	cmpl	$999999, %r10d
	jle	.L21
.L9:
	cmpl	$1000000, %r10d
	jne	.L6
	leaq	4(%rsp), %r13
	leaq	.LC2(%rip), %r12
	leaq	.LC1(%rip), %r14
	jmp	.L8
.L22:
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	je	.L11
	movl	0(%rbp,%rax,4), %ecx
	movl	(%rbx,%rax,4), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L22
.L11:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	otcomp
	.bss
	.align 32
	.type	otcomp, @object
	.size	otcomp, 4000000
otcomp:
	.zero	4000000
	.globl	tcomp
	.align 32
	.type	tcomp, @object
	.size	tcomp, 4000000
tcomp:
	.zero	4000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	999999
	.long	999999
	.long	999999
	.long	999999
	.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>
#define MAX (1000000-1)

int tcomp[MAX+1];	// 各自然数を構成するために必要な正四面体数の数
int otcomp[MAX+1];	// 各自然数を構成するために必要な奇数の正四面体数の数

int min(int a,int b){
	return a<b?a:b;
}
int main(){
	int i,n,m;
	int in;
	for(i=0;i<=MAX;i++){
		tcomp[i]=otcomp[i]=MAX;
	}
	tcomp[0]=otcomp[0]=0;
	for(i=0;i<=MAX;i++){
		for(n=1;;n++){
			m = n*(n+1)*(n+2)/6;
			if(MAX < i+m)break;
			tcomp[i+m] = min(tcomp[i+m],tcomp[i]+1);
			if(m&1)
				otcomp[i+m] = min(otcomp[i+m],otcomp[i]+1);
		}
	}
	while(scanf("%d",&in)==1&&in){
		printf("%d %d\n",tcomp[in],otcomp[in]);
	}
}
40
14
5
165
120
133
106
139
0
 40
14
5
98
120
133
106
139
0
 40
14
5
98
120
133
106
150
0
 40
14
5
70
120
133
106
150
0
 40
14
9
70
120
133
106
150
0
 40
14
9
70
72
133
106
150
0
 40
14
9
29
72
133
106
150
0
 40
14
9
29
79
133
106
150
0
 40
14
9
29
79
133
106
241
0
 40
14
9
20
79
133
106
241
0

2 6
2 14
2 5
1 1
1 18
4 31
4 4
3 37
 2 6
2 14
2 5
3 30
1 18
4 31
4 4
3 37
 2 6
2 14
2 5
3 30
1 18
4 31
4 4
3 14
 2 6
2 14
2 5
2 2
1 18
4 31
4 4
3 14
 2 6
2 14
3 9
2 2
1 18
4 31
4 4
3 14
 2 6
2 14
3 9
2 2
4 4
4 31
4 4
3 14
 2 6
2 14
3 9
4 29
4 4
4 31
4 4
3 14
 2 6
2 14
3 9
4 29
4 11
4 31
4 4
3 14
 2 6
2 14
3 9
4 29
4 11
4 31
4 4
3 9
 2 6
2 14
3 9
1 20
4 11
4 31
4 4
3 9

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>
#define MAX (1000000-1)

int tcomp[MAX+1];	// 各自然数を構成するために必要な正四面体数の数
int otcomp[MAX+1];	// 各自然数を構成するために必要な奇数の正四面体数の数

int min(int a,int b){
	return a<b?a:b;
}
int main(){
	int i,n,m;
	int in;
	for(i=0;i<=MAX;i++){
		tcomp[i]=otcomp[i]=MAX;
	}
	tcomp[0]=otcomp[0]=0;
	for(i=0;i<=MAX;i++){
		for(n=1;;n++){
			m = n*(n+1)*(n+2)/6;
			if(MAX < i+m)break;
			tcomp[i+m] = min(tcomp[i+m],tcomp[i]+1);
			if(m&1)
				otcomp[i+m] = min(otcomp[i+m],otcomp[i]+1);
		}
	}
	while(scanf("%d",&in)==1&&in){
		printf("%d %d\n",tcomp[in],otcomp[in]);
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tcomp
	.bss
	.align 32
	.type	tcomp, @object
	.size	tcomp, 4000000
tcomp:
	.zero	4000000
	.globl	otcomp
	.align 32
	.type	otcomp, @object
	.size	otcomp, 4000000
otcomp:
	.zero	4000000
	.text
	.globl	min
	.type	min, @function
min:
.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	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -36(%rbp)
	jmp	.L4
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	$999999, (%rdx,%rax)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L4:
	cmpl	$999999, -36(%rbp)
	jle	.L5
	movl	$0, otcomp(%rip)
	movl	otcomp(%rip), %eax
	movl	%eax, tcomp(%rip)
	movl	$0, -36(%rbp)
	jmp	.L6
.L11:
	movl	$1, -32(%rbp)
.L10:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	imull	-32(%rbp), %eax
	movl	-32(%rbp), %edx
	addl	$2, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jg	.L18
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	tcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-36(%rbp), %esi
	movl	-28(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L9
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	otcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-36(%rbp), %esi
	movl	-28(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	otcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	addl	$1, -32(%rbp)
	jmp	.L10
.L18:
	nop
	addl	$1, -36(%rbp)
.L6:
	cmpl	$999999, -36(%rbp)
	jle	.L11
	jmp	.L12
.L14:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	tcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L13
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
.L13:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	movq	-8(%rbp), %rbx
	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	tcomp
	.bss
	.align 32
	.type	tcomp, @object
	.size	tcomp, 4000000
tcomp:
	.zero	4000000
	.globl	otcomp
	.align 32
	.type	otcomp, @object
	.size	otcomp, 4000000
otcomp:
	.zero	4000000
	.text
	.globl	min
	.type	min, @function
min:
.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	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -36(%rbp)
	jmp	.L4
.L5:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	$999999, (%rdx,%rax)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L4:
	cmpl	$999999, -36(%rbp)
	jle	.L5
	movl	$0, otcomp(%rip)
	movl	otcomp(%rip), %eax
	movl	%eax, tcomp(%rip)
	movl	$0, -36(%rbp)
	jmp	.L6
.L11:
	movl	$1, -32(%rbp)
.L10:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	imull	-32(%rbp), %eax
	movl	-32(%rbp), %edx
	addl	$2, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jg	.L18
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	tcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-36(%rbp), %esi
	movl	-28(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	tcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L9
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-36(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	otcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-36(%rbp), %esi
	movl	-28(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	otcomp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	addl	$1, -32(%rbp)
	jmp	.L10
.L18:
	nop
	addl	$1, -36(%rbp)
.L6:
	cmpl	$999999, -36(%rbp)
	jle	.L11
	jmp	.L12
.L14:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	otcomp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	tcomp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L12:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L13
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
.L13:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	movq	-8(%rbp), %rbx
	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:
