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 min(a, b)   (((a) < (b))?(a):(b))

int n1[1000000];
int n2[1000000];

int main(void)
{
    int a;
    int i, j, k;
    int n;
    
    for (i = 0; i < 1000000; i++){
        j = 1;
        while (1){
            n = j * (j + 1) * (j + 2) / 6;
            if ((i + n) >= 1000000){
                break;
            }
            if (n1[i + n] == 0){
                n1[i + n] =  n1[i] + 1;
            }
            else {
                n1[i + n] = min(n1[i + n], n1[i] + 1);
            }
            if (n % 2 == 1){
                if (n2[i + n] == 0){
                    n2[i + n] =  n2[i] + 1;
                }
                else {
                    n2[i + n] = min(n2[i + n], n2[i] + 1);
                }
            }
            j++;
        }
    }

    
    while (1){
        scanf("%d", &a);
        if (a == 0){
            break;
        }
        printf("%d %d\n", n1[a], n2[a]);
    }
    
    return (0);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n1
	.bss
	.align 32
	.type	n1, @object
	.size	n1, 4000000
n1:
	.zero	4000000
	.globl	n2
	.align 32
	.type	n2, @object
	.size	n2, 4000000
n2:
	.zero	4000000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	jmp	.L2
.L14:
	movl	$1, -16(%rbp)
.L13:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	-16(%rbp), %eax
	movl	-16(%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, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jg	.L22
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L8
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
.L8:
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	n1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-12(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n2(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L12
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
.L12:
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	n2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	addl	$1, -16(%rbp)
	jmp	.L13
.L22:
	nop
	addl	$1, -20(%rbp)
.L2:
	cmpl	$999999, -20(%rbp)
	jle	.L14
.L17:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	je	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L23:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	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 %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%edi, %edi
	movl	$2863311531, %r9d
	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	n2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	n1(%rip), %rbx
	movq	%rbp, %r10
	movq	%rbx, %r8
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L2:
	leal	1(%rdi), %r11d
	cmpl	$999999, %r11d
	jg	.L12
	movl	%r11d, %edx
	movl	$1, %eax
	movl	$2, %ecx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	leal	1(%r12), %esi
	movl	%esi, (%rbx,%rdx,4)
	testb	$1, %al
	jne	.L21
.L7:
	leal	1(%rcx), %esi
	movl	%esi, %eax
	imull	%ecx, %eax
	addl	$2, %ecx
	imull	%ecx, %eax
	imulq	%r9, %rax
	shrq	$34, %rax
	leal	(%rax,%rdi), %edx
	cmpl	$999999, %edx
	jg	.L10
	movl	%esi, %ecx
.L3:
	movslq	%edx, %rdx
	movl	(%r8), %r12d
	movl	(%rbx,%rdx,4), %esi
	testl	%esi, %esi
	je	.L22
	leal	1(%r12), %r13d
	cmpl	%r12d, %esi
	cmovg	%r13d, %esi
	movl	%esi, (%rbx,%rdx,4)
	testb	$1, %al
	je	.L7
.L21:
	movl	0(%rbp,%rdx,4), %eax
	movl	(%r10), %esi
	testl	%eax, %eax
	jne	.L8
	addl	$1, %esi
	movl	%esi, 0(%rbp,%rdx,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	leal	1(%rsi), %r12d
	cmpl	%esi, %eax
	cmovg	%r12d, %eax
	movl	%eax, 0(%rbp,%rdx,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	$1000000, %r11d
	je	.L23
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$4, %r10
	addq	$4, %r8
	movl	%r11d, %edi
	jmp	.L2
.L23:
	leaq	4(%rsp), %r13
	leaq	.LC0(%rip), %r12
	leaq	.LC1(%rip), %r14
	jmp	.L11
.L24:
	movl	0(%rbp,%rax,4), %ecx
	movl	(%rbx,%rax,4), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L11:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L24
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	n2
	.bss
	.align 32
	.type	n2, @object
	.size	n2, 4000000
n2:
	.zero	4000000
	.globl	n1
	.align 32
	.type	n1, @object
	.size	n1, 4000000
n1:
	.zero	4000000
	.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 %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%edi, %edi
	movl	$2863311531, %r9d
	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	n2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	n1(%rip), %rbx
	movq	%rbp, %r10
	movq	%rbx, %r8
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L2:
	leal	1(%rdi), %r11d
	cmpl	$999999, %r11d
	jg	.L12
	movl	%r11d, %edx
	movl	$1, %eax
	movl	$2, %ecx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	leal	1(%r12), %esi
	movl	%esi, (%rbx,%rdx,4)
	testb	$1, %al
	jne	.L21
.L7:
	leal	1(%rcx), %esi
	movl	%esi, %eax
	imull	%ecx, %eax
	addl	$2, %ecx
	imull	%ecx, %eax
	imulq	%r9, %rax
	shrq	$34, %rax
	leal	(%rax,%rdi), %edx
	cmpl	$999999, %edx
	jg	.L10
	movl	%esi, %ecx
.L3:
	movslq	%edx, %rdx
	movl	(%r8), %r12d
	movl	(%rbx,%rdx,4), %esi
	testl	%esi, %esi
	je	.L22
	leal	1(%r12), %r13d
	cmpl	%r12d, %esi
	cmovg	%r13d, %esi
	movl	%esi, (%rbx,%rdx,4)
	testb	$1, %al
	je	.L7
.L21:
	movl	0(%rbp,%rdx,4), %eax
	movl	(%r10), %esi
	testl	%eax, %eax
	jne	.L8
	addl	$1, %esi
	movl	%esi, 0(%rbp,%rdx,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	leal	1(%rsi), %r12d
	cmpl	%esi, %eax
	cmovg	%r12d, %eax
	movl	%eax, 0(%rbp,%rdx,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	$1000000, %r11d
	je	.L23
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$4, %r10
	addq	$4, %r8
	movl	%r11d, %edi
	jmp	.L2
.L23:
	leaq	4(%rsp), %r13
	leaq	.LC0(%rip), %r12
	leaq	.LC1(%rip), %r14
	jmp	.L11
.L24:
	movl	0(%rbp,%rax,4), %ecx
	movl	(%rbx,%rax,4), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L11:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L24
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	n2
	.bss
	.align 32
	.type	n2, @object
	.size	n2, 4000000
n2:
	.zero	4000000
	.globl	n1
	.align 32
	.type	n1, @object
	.size	n1, 4000000
n1:
	.zero	4000000
	.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 min(a, b)   (((a) < (b))?(a):(b))

int n1[1000000];
int n2[1000000];

int main(void)
{
    int a;
    int i, j, k;
    int n;
    
    for (i = 0; i < 1000000; i++){
        j = 1;
        while (1){
            n = j * (j + 1) * (j + 2) / 6;
            if ((i + n) >= 1000000){
                break;
            }
            if (n1[i + n] == 0){
                n1[i + n] =  n1[i] + 1;
            }
            else {
                n1[i + n] = min(n1[i + n], n1[i] + 1);
            }
            if (n % 2 == 1){
                if (n2[i + n] == 0){
                    n2[i + n] =  n2[i] + 1;
                }
                else {
                    n2[i + n] = min(n2[i + n], n2[i] + 1);
                }
            }
            j++;
        }
    }

    
    while (1){
        scanf("%d", &a);
        if (a == 0){
            break;
        }
        printf("%d %d\n", n1[a], n2[a]);
    }
    
    return (0);
}


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 min(a, b)   (((a) < (b))?(a):(b))

int n1[1000000];
int n2[1000000];

int main(void)
{
    int a;
    int i, j, k;
    int n;
    
    for (i = 0; i < 1000000; i++){
        j = 1;
        while (1){
            n = j * (j + 1) * (j + 2) / 6;
            if ((i + n) >= 1000000){
                break;
            }
            if (n1[i + n] == 0){
                n1[i + n] =  n1[i] + 1;
            }
            else {
                n1[i + n] = min(n1[i + n], n1[i] + 1);
            }
            if (n % 2 == 1){
                if (n2[i + n] == 0){
                    n2[i + n] =  n2[i] + 1;
                }
                else {
                    n2[i + n] = min(n2[i + n], n2[i] + 1);
                }
            }
            j++;
        }
    }

    
    while (1){
        scanf("%d", &a);
        if (a == 0){
            break;
        }
        printf("%d %d\n", n1[a], n2[a]);
    }
    
    return (0);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n1
	.bss
	.align 32
	.type	n1, @object
	.size	n1, 4000000
n1:
	.zero	4000000
	.globl	n2
	.align 32
	.type	n2, @object
	.size	n2, 4000000
n2:
	.zero	4000000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	jmp	.L2
.L14:
	movl	$1, -16(%rbp)
.L13:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	-16(%rbp), %eax
	movl	-16(%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, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jg	.L22
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L8
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
.L8:
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	n1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-12(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n2(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L12
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
.L12:
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	n2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	addl	$1, -16(%rbp)
	jmp	.L13
.L22:
	nop
	addl	$1, -20(%rbp)
.L2:
	cmpl	$999999, -20(%rbp)
	jle	.L14
.L17:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	je	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L23:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	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	n1
	.bss
	.align 32
	.type	n1, @object
	.size	n1, 4000000
n1:
	.zero	4000000
	.globl	n2
	.align 32
	.type	n2, @object
	.size	n2, 4000000
n2:
	.zero	4000000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	jmp	.L2
.L14:
	movl	$1, -16(%rbp)
.L13:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	-16(%rbp), %eax
	movl	-16(%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, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cmpl	$999999, %eax
	jg	.L22
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L8
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n1(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
.L8:
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	n1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-12(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n2(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L12
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %eax
.L12:
	movl	-20(%rbp), %ecx
	movl	-12(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	n2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L9:
	addl	$1, -16(%rbp)
	jmp	.L13
.L22:
	nop
	addl	$1, -20(%rbp)
.L2:
	cmpl	$999999, -20(%rbp)
	jle	.L14
.L17:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	je	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	n2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	n1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L23:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	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:
