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>
#include<string.h>
#define min(a,b)a<b?a:b
#define N 1000010
int o[200],s[200],dp1[N],dp2[N],n,i,j,k,x;;

void f(int t[200],int dp[N])
{
	int i,j;
	dp[0]=0;
	for(i=0;t[i];i++)
		for(j=0;j<=N;j++)
			if(j>=t[i])
				dp[j]=min(dp[j],dp[j-t[i]]+1);
}

int main()
{
	for(i=1,j=k=0;i*(i+1)*(i+2)/6<=N;i++)
	{
		x=i*(i+1)*(i+2)/6;
		if(x%2)
			o[j++]=x;
		s[k++]=x;
	}
	memset(dp1,0x7f,sizeof(dp1));
	memset(dp2,0x7f,sizeof(dp2));
	f(s,dp1);
	f(o,dp2);
	for(;scanf("%d",&n),n;)
		printf("%d %d\n",dp1[n],dp2[n]);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	o
	.bss
	.align 32
	.type	o, @object
	.size	o, 800
o:
	.zero	800
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 800
s:
	.zero	800
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4000040
dp1:
	.zero	4000040
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4000040
dp2:
	.zero	4000040
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -8(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	jmp	.L6
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	$1, %eax
.L6:
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$1000010, -4(%rbp)
	jle	.L7
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.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
	movl	$1, i(%rip)
	movl	$0, k(%rip)
	movl	k(%rip), %eax
	movl	%eax, j(%rip)
	jmp	.L10
.L12:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	imull	%edx, %eax
	movl	i(%rip), %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, x(%rip)
	movl	x(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	x(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	o(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L11:
	movl	k(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, k(%rip)
	movl	x(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	s(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	imull	%edx, %eax
	movl	i(%rip), %edx
	addl	$2, %edx
	imull	%edx, %eax
	cmpl	$6000065, %eax
	jle	.L12
	movl	$4000040, %edx
	movl	$127, %esi
	leaq	dp1(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$4000040, %edx
	movl	$127, %esi
	leaq	dp2(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	leaq	dp1(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	f
	leaq	dp2(%rip), %rax
	movq	%rax, %rsi
	leaq	o(%rip), %rax
	movq	%rax, %rdi
	call	f
	jmp	.L13
.L14:
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	popq	%rbp
	.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	f
	.type	f, @function
f:
.LFB35:
	.cfi_startproc
	endbr64
	movl	$0, (%rsi)
	movl	(%rdi), %edx
	testl	%edx, %edx
	je	.L1
.L2:
	xorl	%eax, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rdi), %edx
.L6:
	cmpl	%eax, %edx
	jg	.L3
	movl	%eax, %ecx
	subl	%edx, %ecx
	movslq	%ecx, %rdx
	movl	(%rsi,%rdx,4), %ecx
	movl	(%rsi,%rax,4), %edx
	leal	1(%rcx), %r8d
	cmpl	%edx, %ecx
	cmovl	%r8d, %edx
	movl	%edx, (%rsi,%rax,4)
.L3:
	addq	$1, %rax
	cmpq	$1000011, %rax
	jne	.L11
	movl	4(%rdi), %edx
	addq	$4, %rdi
	testl	%edx, %edx
	jne	.L2
.L1:
	ret
	.cfi_endproc
.LFE35:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1, %edx
	xorl	%edi, %edi
	movl	$6, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	$2, %esi
	leaq	-4+s(%rip), %r10
	movl	$2863311531, %r9d
	movl	$0, j(%rip)
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	o(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
.L17:
	imulq	%r9, %rax
	shrq	$34, %rax
	movq	%rax, %rcx
	testb	$1, %al
	je	.L13
.L30:
	leal	1(%rsi), %r8d
	movl	%eax, (%r12,%rdi,4)
	leal	1(%rdi), %r11d
	movl	%edx, %ebx
	movl	%eax, (%r10,%rdx,4)
	movl	%r8d, %eax
	leal	3(%rdx), %edi
	addq	$1, %rdx
	imull	%esi, %eax
	imull	%edi, %eax
	cmpl	$6000065, %eax
	jg	.L29
	imulq	%r9, %rax
	movslq	%r11d, %rdi
	movl	%r8d, %esi
	movl	$1, %ebx
	shrq	$34, %rax
	movq	%rax, %rcx
	testb	$1, %al
	jne	.L30
.L13:
	leal	1(%rsi), %r8d
	movl	%eax, (%r10,%rdx,4)
	leal	3(%rdx), %r11d
	movl	%edx, %ebp
	movl	%r8d, %eax
	addq	$1, %rdx
	imull	%esi, %eax
	imull	%r11d, %eax
	cmpl	$6000065, %eax
	jg	.L16
	movl	%r8d, %esi
	jmp	.L17
.L16:
	movl	%ebp, k(%rip)
	movl	%esi, i(%rip)
	movl	%ecx, x(%rip)
	testb	%bl, %bl
	jne	.L21
.L18:
	leaq	dp1(%rip), %rbp
	movl	$4000040, %edx
	movl	$127, %esi
	movq	%rbp, %rdi
	leaq	dp2(%rip), %rbx
	leaq	n(%rip), %r13
	call	memset@PLT
	movl	$4000040, %edx
	movq	%rbx, %rdi
	movl	$127, %esi
	call	memset@PLT
	movq	%rbp, %rsi
	leaq	s(%rip), %rdi
	leaq	.LC0(%rip), %r14
	call	f
	movq	%r12, %rdi
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %r12
	call	f
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%rbx,%rax,4), %ecx
	movl	0(%rbp,%rax,4), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L19:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rax
	testl	%eax, %eax
	jne	.L20
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L29:
	.cfi_restore_state
	movl	%ebx, k(%rip)
	movl	%r11d, %edi
	movl	%esi, i(%rip)
	movl	%ecx, x(%rip)
.L21:
	movl	%edi, j(%rip)
	jmp	.L18
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	x
	.bss
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4000040
dp2:
	.zero	4000040
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4000040
dp1:
	.zero	4000040
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 800
s:
	.zero	800
	.globl	o
	.align 32
	.type	o, @object
	.size	o, 800
o:
	.zero	800
	.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	f
	.type	f, @function
f:
.LFB35:
	.cfi_startproc
	endbr64
	movl	$0, (%rsi)
	movl	(%rdi), %edx
	testl	%edx, %edx
	je	.L1
.L2:
	xorl	%eax, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rdi), %edx
.L6:
	cmpl	%eax, %edx
	jg	.L3
	movl	%eax, %ecx
	subl	%edx, %ecx
	movslq	%ecx, %rdx
	movl	(%rsi,%rdx,4), %ecx
	movl	(%rsi,%rax,4), %edx
	leal	1(%rcx), %r8d
	cmpl	%edx, %ecx
	cmovl	%r8d, %edx
	movl	%edx, (%rsi,%rax,4)
.L3:
	addq	$1, %rax
	cmpq	$1000011, %rax
	jne	.L11
	movl	4(%rdi), %edx
	addq	$4, %rdi
	testl	%edx, %edx
	jne	.L2
.L1:
	ret
	.cfi_endproc
.LFE35:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1, %edx
	xorl	%edi, %edi
	movl	$6, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	$2, %esi
	leaq	-4+s(%rip), %r10
	movl	$2863311531, %r9d
	movl	$0, j(%rip)
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	o(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
.L17:
	imulq	%r9, %rax
	shrq	$34, %rax
	movq	%rax, %rcx
	testb	$1, %al
	je	.L13
.L30:
	leal	1(%rsi), %r8d
	movl	%eax, (%r12,%rdi,4)
	leal	1(%rdi), %r11d
	movl	%edx, %ebx
	movl	%eax, (%r10,%rdx,4)
	movl	%r8d, %eax
	leal	3(%rdx), %edi
	addq	$1, %rdx
	imull	%esi, %eax
	imull	%edi, %eax
	cmpl	$6000065, %eax
	jg	.L29
	imulq	%r9, %rax
	movslq	%r11d, %rdi
	movl	%r8d, %esi
	movl	$1, %ebx
	shrq	$34, %rax
	movq	%rax, %rcx
	testb	$1, %al
	jne	.L30
.L13:
	leal	1(%rsi), %r8d
	movl	%eax, (%r10,%rdx,4)
	leal	3(%rdx), %r11d
	movl	%edx, %ebp
	movl	%r8d, %eax
	addq	$1, %rdx
	imull	%esi, %eax
	imull	%r11d, %eax
	cmpl	$6000065, %eax
	jg	.L16
	movl	%r8d, %esi
	jmp	.L17
.L16:
	movl	%ebp, k(%rip)
	movl	%esi, i(%rip)
	movl	%ecx, x(%rip)
	testb	%bl, %bl
	jne	.L21
.L18:
	leaq	dp1(%rip), %rbp
	movl	$4000040, %edx
	movl	$127, %esi
	movq	%rbp, %rdi
	leaq	dp2(%rip), %rbx
	leaq	n(%rip), %r13
	call	memset@PLT
	movl	$4000040, %edx
	movq	%rbx, %rdi
	movl	$127, %esi
	call	memset@PLT
	movq	%rbp, %rsi
	leaq	s(%rip), %rdi
	leaq	.LC0(%rip), %r14
	call	f
	movq	%r12, %rdi
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %r12
	call	f
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%rbx,%rax,4), %ecx
	movl	0(%rbp,%rax,4), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L19:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rax
	testl	%eax, %eax
	jne	.L20
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L29:
	.cfi_restore_state
	movl	%ebx, k(%rip)
	movl	%r11d, %edi
	movl	%esi, i(%rip)
	movl	%ecx, x(%rip)
.L21:
	movl	%edi, j(%rip)
	jmp	.L18
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	x
	.bss
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4000040
dp2:
	.zero	4000040
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4000040
dp1:
	.zero	4000040
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 800
s:
	.zero	800
	.globl	o
	.align 32
	.type	o, @object
	.size	o, 800
o:
	.zero	800
	.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>
#include<string.h>
#define min(a,b)a<b?a:b
#define N 1000010
int o[200],s[200],dp1[N],dp2[N],n,i,j,k,x;;

void f(int t[200],int dp[N])
{
	int i,j;
	dp[0]=0;
	for(i=0;t[i];i++)
		for(j=0;j<=N;j++)
			if(j>=t[i])
				dp[j]=min(dp[j],dp[j-t[i]]+1);
}

int main()
{
	for(i=1,j=k=0;i*(i+1)*(i+2)/6<=N;i++)
	{
		x=i*(i+1)*(i+2)/6;
		if(x%2)
			o[j++]=x;
		s[k++]=x;
	}
	memset(dp1,0x7f,sizeof(dp1));
	memset(dp2,0x7f,sizeof(dp2));
	f(s,dp1);
	f(o,dp2);
	for(;scanf("%d",&n),n;)
		printf("%d %d\n",dp1[n],dp2[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>
#include<string.h>
#define min(a,b)a<b?a:b
#define N 1000010
int o[200],s[200],dp1[N],dp2[N],n,i,j,k,x;;

void f(int t[200],int dp[N])
{
	int i,j;
	dp[0]=0;
	for(i=0;t[i];i++)
		for(j=0;j<=N;j++)
			if(j>=t[i])
				dp[j]=min(dp[j],dp[j-t[i]]+1);
}

int main()
{
	for(i=1,j=k=0;i*(i+1)*(i+2)/6<=N;i++)
	{
		x=i*(i+1)*(i+2)/6;
		if(x%2)
			o[j++]=x;
		s[k++]=x;
	}
	memset(dp1,0x7f,sizeof(dp1));
	memset(dp2,0x7f,sizeof(dp2));
	f(s,dp1);
	f(o,dp2);
	for(;scanf("%d",&n),n;)
		printf("%d %d\n",dp1[n],dp2[n]);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	o
	.bss
	.align 32
	.type	o, @object
	.size	o, 800
o:
	.zero	800
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 800
s:
	.zero	800
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4000040
dp1:
	.zero	4000040
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4000040
dp2:
	.zero	4000040
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -8(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	jmp	.L6
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	$1, %eax
.L6:
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$1000010, -4(%rbp)
	jle	.L7
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.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
	movl	$1, i(%rip)
	movl	$0, k(%rip)
	movl	k(%rip), %eax
	movl	%eax, j(%rip)
	jmp	.L10
.L12:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	imull	%edx, %eax
	movl	i(%rip), %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, x(%rip)
	movl	x(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	x(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	o(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L11:
	movl	k(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, k(%rip)
	movl	x(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	s(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	imull	%edx, %eax
	movl	i(%rip), %edx
	addl	$2, %edx
	imull	%edx, %eax
	cmpl	$6000065, %eax
	jle	.L12
	movl	$4000040, %edx
	movl	$127, %esi
	leaq	dp1(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$4000040, %edx
	movl	$127, %esi
	leaq	dp2(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	leaq	dp1(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	f
	leaq	dp2(%rip), %rax
	movq	%rax, %rsi
	leaq	o(%rip), %rax
	movq	%rax, %rdi
	call	f
	jmp	.L13
.L14:
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	popq	%rbp
	.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	o
	.bss
	.align 32
	.type	o, @object
	.size	o, 800
o:
	.zero	800
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 800
s:
	.zero	800
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4000040
dp1:
	.zero	4000040
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4000040
dp2:
	.zero	4000040
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -8(%rbp)
	jmp	.L2
.L8:
	movl	$0, -4(%rbp)
	jmp	.L3
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	jmp	.L6
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	$1, %eax
.L6:
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
.L4:
	addl	$1, -4(%rbp)
.L3:
	cmpl	$1000010, -4(%rbp)
	jle	.L7
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L8
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.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
	movl	$1, i(%rip)
	movl	$0, k(%rip)
	movl	k(%rip), %eax
	movl	%eax, j(%rip)
	jmp	.L10
.L12:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	imull	%edx, %eax
	movl	i(%rip), %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, x(%rip)
	movl	x(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	j(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, j(%rip)
	movl	x(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	o(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L11:
	movl	k(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, k(%rip)
	movl	x(%rip), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	s(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L10:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	i(%rip), %eax
	imull	%edx, %eax
	movl	i(%rip), %edx
	addl	$2, %edx
	imull	%edx, %eax
	cmpl	$6000065, %eax
	jle	.L12
	movl	$4000040, %edx
	movl	$127, %esi
	leaq	dp1(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$4000040, %edx
	movl	$127, %esi
	leaq	dp2(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	leaq	dp1(%rip), %rax
	movq	%rax, %rsi
	leaq	s(%rip), %rax
	movq	%rax, %rdi
	call	f
	leaq	dp2(%rip), %rax
	movq	%rax, %rsi
	leaq	o(%rip), %rax
	movq	%rax, %rdi
	call	f
	jmp	.L13
.L14:
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	popq	%rbp
	.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:
