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>

main(){
  int data[1000], i, min2, j, k, n, min, ans[1000000], ans2[1000000];

  for(i=0;i<1000;i++){
    data[i]=(i+1)*(i+2)*(i+3)/6;
  }

  ans[0]=0;
  ans2[0]=0;
  for(i=1;i<1000000;i++){
    min=1000000;
    min2=1000000;
    for(j=0;data[j]<=i;j++){
      if(min>ans[i-data[j]]) min=ans[i-data[j]]+1;
      if(data[j]%2!=0){
	if(min2>ans2[i-data[j]]) min2=ans2[i-data[j]]+1;
      }
    }
    ans[i]=min;
    ans2[i]=min2;
  }
  while(1){
    scanf("%d", &n);
    if(n==0) break;
    printf("%d %d\n", ans[n], ans2[n]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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
	leaq	-8003584(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -8004032(%rbp)
	jmp	.L2
.L3:
	movl	-8004032(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8004032(%rbp), %eax
	addl	$2, %eax
	imull	%edx, %eax
	movl	-8004032(%rbp), %edx
	addl	$3, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-8004032(%rbp), %eax
	cltq
	movl	%edx, -8004016(%rbp,%rax,4)
	addl	$1, -8004032(%rbp)
.L2:
	cmpl	$999, -8004032(%rbp)
	jle	.L3
	movl	$0, -8000016(%rbp)
	movl	$0, -4000016(%rbp)
	movl	$1, -8004032(%rbp)
	jmp	.L4
.L9:
	movl	$1000000, -8004020(%rbp)
	movl	$1000000, -8004028(%rbp)
	movl	$0, -8004024(%rbp)
	jmp	.L5
.L8:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004020(%rbp)
	jle	.L6
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, -8004020(%rbp)
.L6:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004028(%rbp)
	jle	.L7
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, -8004028(%rbp)
.L7:
	addl	$1, -8004024(%rbp)
.L5:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004032(%rbp)
	jge	.L8
	movl	-8004032(%rbp), %eax
	cltq
	movl	-8004020(%rbp), %edx
	movl	%edx, -8000016(%rbp,%rax,4)
	movl	-8004032(%rbp), %eax
	cltq
	movl	-8004028(%rbp), %edx
	movl	%edx, -4000016(%rbp,%rax,4)
	addl	$1, -8004032(%rbp)
.L4:
	cmpl	$999999, -8004032(%rbp)
	jle	.L9
.L12:
	leaq	-8004036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8004036(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	-8004036(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %edx
	movl	-8004036(%rbp), %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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
.LC6:
	.string	"%d"
.LC7:
	.string	"%d %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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-8003584(%rsp), %r11
	.cfi_def_cfa 11, 8003624
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$456, %rsp
	.cfi_def_cfa_offset 8004080
	movdqa	.LC5(%rip), %xmm2
	pxor	%xmm4, %xmm4
	movdqa	.LC0(%rip), %xmm3
	movdqa	%xmm4, %xmm5
	movdqa	.LC3(%rip), %xmm7
	movdqa	.LC1(%rip), %xmm9
	pcmpgtd	%xmm2, %xmm5
	movdqa	.LC4(%rip), %xmm6
	movdqa	.LC2(%rip), %xmm8
	movq	%fs:40, %rax
	movq	%rax, 8004024(%rsp)
	xorl	%eax, %eax
	leaq	4016(%rsp), %r12
	leaq	16(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movdqa	%xmm3, %xmm0
	addq	$16, %rax
	paddd	%xmm9, %xmm3
	movdqa	%xmm0, %xmm10
	movdqa	%xmm0, %xmm11
	paddd	%xmm6, %xmm0
	paddd	%xmm8, %xmm10
	paddd	%xmm7, %xmm11
	movdqa	%xmm10, %xmm1
	psrlq	$32, %xmm10
	pmuludq	%xmm11, %xmm1
	psrlq	$32, %xmm11
	pmuludq	%xmm11, %xmm10
	movdqa	%xmm5, %xmm11
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm10, %xmm10
	punpckldq	%xmm10, %xmm1
	movdqa	%xmm0, %xmm10
	movdqa	%xmm1, %xmm0
	psrlq	$32, %xmm1
	pmuludq	%xmm10, %xmm0
	psrlq	$32, %xmm10
	pmuludq	%xmm10, %xmm1
	movdqa	%xmm4, %xmm10
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	punpckldq	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm1, %xmm10
	pmuludq	%xmm1, %xmm11
	pmuludq	%xmm2, %xmm1
	pmuludq	%xmm2, %xmm10
	paddq	%xmm11, %xmm10
	movdqa	%xmm5, %xmm11
	psllq	$32, %xmm10
	pmuludq	%xmm0, %xmm11
	paddq	%xmm10, %xmm1
	movdqa	%xmm4, %xmm10
	pcmpgtd	%xmm0, %xmm10
	pmuludq	%xmm2, %xmm0
	pmuludq	%xmm2, %xmm10
	paddq	%xmm11, %xmm10
	psllq	$32, %xmm10
	paddq	%xmm10, %xmm0
	shufps	$221, %xmm0, %xmm1
	movaps	%xmm1, -16(%rax)
	cmpq	%r12, %rax
	jne	.L2
	movl	$0, 4016(%rsp)
	movl	16(%rsp), %ebp
	movl	$1, %ebx
	leaq	4004016(%rsp), %r13
	movl	$0, 4004016(%rsp)
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%ebx, %r11d
	movl	%ebx, %r10d
	movl	$1000000, %ecx
	movl	$1000000, %r9d
	cmpl	%ebp, %ebx
	jl	.L9
	leaq	20(%rsp), %rsi
	movl	%ebp, %edx
	movl	$1000000, %ecx
	movl	$1000000, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r11d, %eax
	subl	%edx, %eax
	cltq
	movl	4016(%rsp,%rax,4), %edi
	cmpl	%ecx, %edi
	leal	1(%rdi), %r8d
	cmovl	%r8d, %ecx
	andl	$1, %edx
	je	.L5
	movl	4004016(%rsp,%rax,4), %eax
	leal	1(%rax), %edx
	cmpl	%r9d, %eax
	cmovl	%edx, %r9d
.L5:
	movl	(%rsi), %edx
	addq	$4, %rsi
	cmpl	%edx, %r10d
	jge	.L6
.L9:
	movl	%ecx, (%r12,%rbx,4)
	movl	%r9d, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpq	$1000000, %rbx
	jne	.L3
	leaq	12(%rsp), %rbp
	leaq	.LC6(%rip), %rbx
	leaq	.LC7(%rip), %r12
	jmp	.L7
.L20:
	movl	4004016(%rsp,%rax,4), %ecx
	movl	4016(%rsp,%rax,4), %edx
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
.L7:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	testl	%eax, %eax
	jne	.L20
	movq	8004024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$8004040, %rsp
	.cfi_remember_state
	.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
.L21:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC2:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC4:
	.long	3
	.long	3
	.long	3
	.long	3
	.align 16
.LC5:
	.long	715827883
	.long	715827883
	.long	715827883
	.long	715827883
	.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
.LC6:
	.string	"%d"
.LC7:
	.string	"%d %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
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-8003584(%rsp), %r11
	.cfi_def_cfa 11, 8003624
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$456, %rsp
	.cfi_def_cfa_offset 8004080
	movdqa	.LC5(%rip), %xmm2
	pxor	%xmm4, %xmm4
	movdqa	.LC0(%rip), %xmm3
	movdqa	%xmm4, %xmm5
	movdqa	.LC3(%rip), %xmm7
	movdqa	.LC1(%rip), %xmm9
	pcmpgtd	%xmm2, %xmm5
	movdqa	.LC4(%rip), %xmm6
	movdqa	.LC2(%rip), %xmm8
	movq	%fs:40, %rax
	movq	%rax, 8004024(%rsp)
	xorl	%eax, %eax
	leaq	4016(%rsp), %r12
	leaq	16(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movdqa	%xmm3, %xmm0
	addq	$16, %rax
	paddd	%xmm9, %xmm3
	movdqa	%xmm0, %xmm10
	movdqa	%xmm0, %xmm11
	paddd	%xmm6, %xmm0
	paddd	%xmm8, %xmm10
	paddd	%xmm7, %xmm11
	movdqa	%xmm10, %xmm1
	psrlq	$32, %xmm10
	pmuludq	%xmm11, %xmm1
	psrlq	$32, %xmm11
	pmuludq	%xmm11, %xmm10
	movdqa	%xmm5, %xmm11
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm10, %xmm10
	punpckldq	%xmm10, %xmm1
	movdqa	%xmm0, %xmm10
	movdqa	%xmm1, %xmm0
	psrlq	$32, %xmm1
	pmuludq	%xmm10, %xmm0
	psrlq	$32, %xmm10
	pmuludq	%xmm10, %xmm1
	movdqa	%xmm4, %xmm10
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	punpckldq	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm1, %xmm10
	pmuludq	%xmm1, %xmm11
	pmuludq	%xmm2, %xmm1
	pmuludq	%xmm2, %xmm10
	paddq	%xmm11, %xmm10
	movdqa	%xmm5, %xmm11
	psllq	$32, %xmm10
	pmuludq	%xmm0, %xmm11
	paddq	%xmm10, %xmm1
	movdqa	%xmm4, %xmm10
	pcmpgtd	%xmm0, %xmm10
	pmuludq	%xmm2, %xmm0
	pmuludq	%xmm2, %xmm10
	paddq	%xmm11, %xmm10
	psllq	$32, %xmm10
	paddq	%xmm10, %xmm0
	shufps	$221, %xmm0, %xmm1
	movaps	%xmm1, -16(%rax)
	cmpq	%r12, %rax
	jne	.L2
	movl	$0, 4016(%rsp)
	movl	16(%rsp), %ebp
	movl	$1, %ebx
	leaq	4004016(%rsp), %r13
	movl	$0, 4004016(%rsp)
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%ebx, %r11d
	movl	%ebx, %r10d
	movl	$1000000, %ecx
	movl	$1000000, %r9d
	cmpl	%ebp, %ebx
	jl	.L9
	leaq	20(%rsp), %rsi
	movl	%ebp, %edx
	movl	$1000000, %ecx
	movl	$1000000, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r11d, %eax
	subl	%edx, %eax
	cltq
	movl	4016(%rsp,%rax,4), %edi
	cmpl	%ecx, %edi
	leal	1(%rdi), %r8d
	cmovl	%r8d, %ecx
	andl	$1, %edx
	je	.L5
	movl	4004016(%rsp,%rax,4), %eax
	leal	1(%rax), %edx
	cmpl	%r9d, %eax
	cmovl	%edx, %r9d
.L5:
	movl	(%rsi), %edx
	addq	$4, %rsi
	cmpl	%edx, %r10d
	jge	.L6
.L9:
	movl	%ecx, (%r12,%rbx,4)
	movl	%r9d, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpq	$1000000, %rbx
	jne	.L3
	leaq	12(%rsp), %rbp
	leaq	.LC6(%rip), %rbx
	leaq	.LC7(%rip), %r12
	jmp	.L7
.L20:
	movl	4004016(%rsp,%rax,4), %ecx
	movl	4016(%rsp,%rax,4), %edx
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
.L7:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	testl	%eax, %eax
	jne	.L20
	movq	8004024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$8004040, %rsp
	.cfi_remember_state
	.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
.L21:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC2:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC4:
	.long	3
	.long	3
	.long	3
	.long	3
	.align 16
.LC5:
	.long	715827883
	.long	715827883
	.long	715827883
	.long	715827883
	.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>

main(){
  int data[1000], i, min2, j, k, n, min, ans[1000000], ans2[1000000];

  for(i=0;i<1000;i++){
    data[i]=(i+1)*(i+2)*(i+3)/6;
  }

  ans[0]=0;
  ans2[0]=0;
  for(i=1;i<1000000;i++){
    min=1000000;
    min2=1000000;
    for(j=0;data[j]<=i;j++){
      if(min>ans[i-data[j]]) min=ans[i-data[j]]+1;
      if(data[j]%2!=0){
	if(min2>ans2[i-data[j]]) min2=ans2[i-data[j]]+1;
      }
    }
    ans[i]=min;
    ans2[i]=min2;
  }
  while(1){
    scanf("%d", &n);
    if(n==0) break;
    printf("%d %d\n", ans[n], ans2[n]);
  }
  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>

main(){
  int data[1000], i, min2, j, k, n, min, ans[1000000], ans2[1000000];

  for(i=0;i<1000;i++){
    data[i]=(i+1)*(i+2)*(i+3)/6;
  }

  ans[0]=0;
  ans2[0]=0;
  for(i=1;i<1000000;i++){
    min=1000000;
    min2=1000000;
    for(j=0;data[j]<=i;j++){
      if(min>ans[i-data[j]]) min=ans[i-data[j]]+1;
      if(data[j]%2!=0){
	if(min2>ans2[i-data[j]]) min2=ans2[i-data[j]]+1;
      }
    }
    ans[i]=min;
    ans2[i]=min2;
  }
  while(1){
    scanf("%d", &n);
    if(n==0) break;
    printf("%d %d\n", ans[n], ans2[n]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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
	leaq	-8003584(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -8004032(%rbp)
	jmp	.L2
.L3:
	movl	-8004032(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8004032(%rbp), %eax
	addl	$2, %eax
	imull	%edx, %eax
	movl	-8004032(%rbp), %edx
	addl	$3, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-8004032(%rbp), %eax
	cltq
	movl	%edx, -8004016(%rbp,%rax,4)
	addl	$1, -8004032(%rbp)
.L2:
	cmpl	$999, -8004032(%rbp)
	jle	.L3
	movl	$0, -8000016(%rbp)
	movl	$0, -4000016(%rbp)
	movl	$1, -8004032(%rbp)
	jmp	.L4
.L9:
	movl	$1000000, -8004020(%rbp)
	movl	$1000000, -8004028(%rbp)
	movl	$0, -8004024(%rbp)
	jmp	.L5
.L8:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004020(%rbp)
	jle	.L6
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, -8004020(%rbp)
.L6:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004028(%rbp)
	jle	.L7
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, -8004028(%rbp)
.L7:
	addl	$1, -8004024(%rbp)
.L5:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004032(%rbp)
	jge	.L8
	movl	-8004032(%rbp), %eax
	cltq
	movl	-8004020(%rbp), %edx
	movl	%edx, -8000016(%rbp,%rax,4)
	movl	-8004032(%rbp), %eax
	cltq
	movl	-8004028(%rbp), %edx
	movl	%edx, -4000016(%rbp,%rax,4)
	addl	$1, -8004032(%rbp)
.L4:
	cmpl	$999999, -8004032(%rbp)
	jle	.L9
.L12:
	leaq	-8004036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8004036(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	-8004036(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %edx
	movl	-8004036(%rbp), %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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
	.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
	leaq	-8003584(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -8004032(%rbp)
	jmp	.L2
.L3:
	movl	-8004032(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8004032(%rbp), %eax
	addl	$2, %eax
	imull	%edx, %eax
	movl	-8004032(%rbp), %edx
	addl	$3, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-8004032(%rbp), %eax
	cltq
	movl	%edx, -8004016(%rbp,%rax,4)
	addl	$1, -8004032(%rbp)
.L2:
	cmpl	$999, -8004032(%rbp)
	jle	.L3
	movl	$0, -8000016(%rbp)
	movl	$0, -4000016(%rbp)
	movl	$1, -8004032(%rbp)
	jmp	.L4
.L9:
	movl	$1000000, -8004020(%rbp)
	movl	$1000000, -8004028(%rbp)
	movl	$0, -8004024(%rbp)
	jmp	.L5
.L8:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004020(%rbp)
	jle	.L6
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, -8004020(%rbp)
.L6:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004028(%rbp)
	jle	.L7
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %edx
	movl	-8004032(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	addl	$1, %eax
	movl	%eax, -8004028(%rbp)
.L7:
	addl	$1, -8004024(%rbp)
.L5:
	movl	-8004024(%rbp), %eax
	cltq
	movl	-8004016(%rbp,%rax,4), %eax
	cmpl	%eax, -8004032(%rbp)
	jge	.L8
	movl	-8004032(%rbp), %eax
	cltq
	movl	-8004020(%rbp), %edx
	movl	%edx, -8000016(%rbp,%rax,4)
	movl	-8004032(%rbp), %eax
	cltq
	movl	-8004028(%rbp), %edx
	movl	%edx, -4000016(%rbp,%rax,4)
	addl	$1, -8004032(%rbp)
.L4:
	cmpl	$999999, -8004032(%rbp)
	jle	.L9
.L12:
	leaq	-8004036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8004036(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	-8004036(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %edx
	movl	-8004036(%rbp), %eax
	cltq
	movl	-8000016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L16:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
