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 M 1000010
int zMIN(int a,int b){
  if(a==0||a>b)return b;
  return a;
}
int d1[M],d2[M];
int main(){
  int n=200,t[200],i,j;
  for(i=1;i<200;i++)t[i]=i*(i+1)*(i+2)/6;
  for(i=0;i<M;i++){
    for(j=1;j<200;j++){
      if(i+t[j]>=M)continue;
                d1[i+t[j]]=zMIN(d1[i+t[j]],d1[i]+1);
      if(t[j]%2)d2[i+t[j]]=zMIN(d2[i+t[j]],d2[i]+1);
    }
  }
  while(scanf("%d",&n),n)printf("%d %d\n",d1[n],d2[n]);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	zMIN
	.type	zMIN, @function
zMIN:
.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)
	cmpl	$0, -4(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L3
.L2:
	movl	-8(%rbp), %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	zMIN, .-zMIN
	.globl	d1
	.bss
	.align 32
	.type	d1, @object
	.size	d1, 4000040
d1:
	.zero	4000040
	.globl	d2
	.align 32
	.type	d2, @object
	.size	d2, 4000040
d2:
	.zero	4000040
	.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	$840, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$200, -844(%rbp)
	movl	$1, -840(%rbp)
	jmp	.L6
.L7:
	movl	-840(%rbp), %eax
	addl	$1, %eax
	imull	-840(%rbp), %eax
	movl	-840(%rbp), %edx
	addl	$2, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-840(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	addl	$1, -840(%rbp)
.L6:
	cmpl	$199, -840(%rbp)
	jle	.L7
	movl	$0, -840(%rbp)
	jmp	.L8
.L13:
	movl	$1, -836(%rbp)
	jmp	.L9
.L12:
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-840(%rbp), %eax
	addl	%edx, %eax
	cmpl	$1000009, %eax
	jg	.L18
	movl	-840(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %ecx
	movl	-840(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-836(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	-832(%rbp,%rcx,4), %esi
	movl	-840(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	zMIN
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	-840(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %ecx
	movl	-840(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d2(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-836(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	-832(%rbp,%rcx,4), %esi
	movl	-840(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	zMIN
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -836(%rbp)
.L9:
	cmpl	$199, -836(%rbp)
	jle	.L12
	addl	$1, -840(%rbp)
.L8:
	cmpl	$1000009, -840(%rbp)
	jle	.L13
	jmp	.L14
.L15:
	movl	-844(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-844(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-844(%rbp), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	zMIN
	.type	zMIN, @function
zMIN:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	testl	%edi, %edi
	je	.L4
	cmpl	%esi, %edi
	jg	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	zMIN, .-zMIN
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC6:
	.string	"%d %d\n"
.LC7:
	.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
	pxor	%xmm4, %xmm4
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movdqa	%xmm4, %xmm5
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movdqa	.LC4(%rip), %xmm2
	movdqa	.LC0(%rip), %xmm3
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	movl	$200, 12(%rsp)
	leaq	20(%rsp), %r12
	movdqa	.LC1(%rip), %xmm8
	pcmpgtd	%xmm2, %xmm5
	movdqa	.LC2(%rip), %xmm7
	movq	%r12, %rax
	movdqa	.LC3(%rip), %xmm6
	leaq	16(%rsp), %rcx
	leaq	804(%rsp), %rdx
.L10:
	movdqa	%xmm3, %xmm0
	addq	$16, %rax
	paddd	%xmm8, %xmm3
	movdqa	%xmm0, %xmm9
	movdqa	%xmm0, %xmm10
	paddd	%xmm7, %xmm9
	psrlq	$32, %xmm10
	movdqa	%xmm9, %xmm1
	psrlq	$32, %xmm9
	pmuludq	%xmm0, %xmm1
	pmuludq	%xmm10, %xmm9
	paddd	%xmm6, %xmm0
	movdqa	%xmm5, %xmm10
	pshufd	$8, %xmm9, %xmm9
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm9, %xmm1
	movdqa	%xmm0, %xmm9
	movdqa	%xmm1, %xmm0
	psrlq	$32, %xmm1
	pmuludq	%xmm9, %xmm0
	psrlq	$32, %xmm9
	pmuludq	%xmm9, %xmm1
	movdqa	%xmm4, %xmm9
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	punpckldq	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm1, %xmm9
	pmuludq	%xmm1, %xmm10
	pmuludq	%xmm2, %xmm1
	pmuludq	%xmm2, %xmm9
	paddq	%xmm10, %xmm9
	movdqa	%xmm5, %xmm10
	psllq	$32, %xmm9
	pmuludq	%xmm0, %xmm10
	paddq	%xmm9, %xmm1
	movdqa	%xmm4, %xmm9
	pcmpgtd	%xmm0, %xmm9
	pmuludq	%xmm2, %xmm0
	pmuludq	%xmm2, %xmm9
	paddq	%xmm10, %xmm9
	psllq	$32, %xmm9
	paddq	%xmm9, %xmm0
	shufps	$221, %xmm0, %xmm1
	movups	%xmm1, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L10
	movq	.LC5(%rip), %rax
	leaq	d2(%rip), %rbp
	movl	$1333300, 812(%rsp)
	leaq	d1(%rip), %rbx
	movq	%rbp, %r11
	movq	%rbx, %r10
	leaq	800(%rcx), %r9
	xorl	%r8d, %r8d
	movq	%rax, 804(%rsp)
.L11:
	movq	%r12, %rdx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	cmpl	%ecx, %esi
	jl	.L23
.L14:
	andl	$1, %edi
	movl	%ecx, (%rbx,%rax,4)
	je	.L13
	movl	(%r11), %edi
	movl	0(%rbp,%rax,4), %ecx
	leal	1(%rdi), %esi
	testl	%ecx, %ecx
	je	.L24
	cmpl	%ecx, %esi
	jl	.L24
.L17:
	movl	%ecx, 0(%rbp,%rax,4)
.L13:
	addq	$4, %rdx
	cmpq	%r9, %rdx
	je	.L38
.L19:
	movl	(%rdx), %edi
	leal	(%rdi,%r8), %eax
	cmpl	$1000009, %eax
	jg	.L13
	cltq
	movl	(%r10), %esi
	movl	(%rbx,%rax,4), %ecx
	addl	$1, %esi
	testl	%ecx, %ecx
	jne	.L39
.L23:
	movl	%esi, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%esi, %ecx
	jmp	.L17
.L38:
	addl	$1, %r8d
	addq	$4, %r11
	addq	$4, %r10
	cmpl	$1000010, %r8d
	jne	.L11
	leaq	12(%rsp), %r14
	leaq	.LC7(%rip), %r13
	leaq	.LC6(%rip), %r12
	jmp	.L20
.L21:
	movl	0(%rbp,%rax,4), %ecx
	movl	(%rbx,%rax,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L20:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	testl	%eax, %eax
	jne	.L21
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$832, %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
.L40:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	d2
	.bss
	.align 32
	.type	d2, @object
	.size	d2, 4000040
d2:
	.zero	4000040
	.globl	d1
	.align 32
	.type	d1, @object
	.size	d1, 4000040
d1:
	.zero	4000040
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC3:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC4:
	.long	715827883
	.long	715827883
	.long	715827883
	.long	715827883
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	1293699
	.long	1313400
	.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	zMIN
	.type	zMIN, @function
zMIN:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	testl	%edi, %edi
	je	.L4
	cmpl	%esi, %edi
	jg	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	zMIN, .-zMIN
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC6:
	.string	"%d %d\n"
.LC7:
	.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
	pxor	%xmm4, %xmm4
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movdqa	%xmm4, %xmm5
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movdqa	.LC4(%rip), %xmm2
	movdqa	.LC0(%rip), %xmm3
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	movl	$200, 12(%rsp)
	leaq	20(%rsp), %r12
	movdqa	.LC1(%rip), %xmm8
	pcmpgtd	%xmm2, %xmm5
	movdqa	.LC2(%rip), %xmm7
	movq	%r12, %rax
	movdqa	.LC3(%rip), %xmm6
	leaq	16(%rsp), %rcx
	leaq	804(%rsp), %rdx
.L10:
	movdqa	%xmm3, %xmm0
	addq	$16, %rax
	paddd	%xmm8, %xmm3
	movdqa	%xmm0, %xmm9
	movdqa	%xmm0, %xmm10
	paddd	%xmm7, %xmm9
	psrlq	$32, %xmm10
	movdqa	%xmm9, %xmm1
	psrlq	$32, %xmm9
	pmuludq	%xmm0, %xmm1
	pmuludq	%xmm10, %xmm9
	paddd	%xmm6, %xmm0
	movdqa	%xmm5, %xmm10
	pshufd	$8, %xmm9, %xmm9
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm9, %xmm1
	movdqa	%xmm0, %xmm9
	movdqa	%xmm1, %xmm0
	psrlq	$32, %xmm1
	pmuludq	%xmm9, %xmm0
	psrlq	$32, %xmm9
	pmuludq	%xmm9, %xmm1
	movdqa	%xmm4, %xmm9
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	punpckldq	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm0
	pcmpgtd	%xmm1, %xmm9
	pmuludq	%xmm1, %xmm10
	pmuludq	%xmm2, %xmm1
	pmuludq	%xmm2, %xmm9
	paddq	%xmm10, %xmm9
	movdqa	%xmm5, %xmm10
	psllq	$32, %xmm9
	pmuludq	%xmm0, %xmm10
	paddq	%xmm9, %xmm1
	movdqa	%xmm4, %xmm9
	pcmpgtd	%xmm0, %xmm9
	pmuludq	%xmm2, %xmm0
	pmuludq	%xmm2, %xmm9
	paddq	%xmm10, %xmm9
	psllq	$32, %xmm9
	paddq	%xmm9, %xmm0
	shufps	$221, %xmm0, %xmm1
	movups	%xmm1, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L10
	movq	.LC5(%rip), %rax
	leaq	d2(%rip), %rbp
	movl	$1333300, 812(%rsp)
	leaq	d1(%rip), %rbx
	movq	%rbp, %r11
	movq	%rbx, %r10
	leaq	800(%rcx), %r9
	xorl	%r8d, %r8d
	movq	%rax, 804(%rsp)
.L11:
	movq	%r12, %rdx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	cmpl	%ecx, %esi
	jl	.L23
.L14:
	andl	$1, %edi
	movl	%ecx, (%rbx,%rax,4)
	je	.L13
	movl	(%r11), %edi
	movl	0(%rbp,%rax,4), %ecx
	leal	1(%rdi), %esi
	testl	%ecx, %ecx
	je	.L24
	cmpl	%ecx, %esi
	jl	.L24
.L17:
	movl	%ecx, 0(%rbp,%rax,4)
.L13:
	addq	$4, %rdx
	cmpq	%r9, %rdx
	je	.L38
.L19:
	movl	(%rdx), %edi
	leal	(%rdi,%r8), %eax
	cmpl	$1000009, %eax
	jg	.L13
	cltq
	movl	(%r10), %esi
	movl	(%rbx,%rax,4), %ecx
	addl	$1, %esi
	testl	%ecx, %ecx
	jne	.L39
.L23:
	movl	%esi, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%esi, %ecx
	jmp	.L17
.L38:
	addl	$1, %r8d
	addq	$4, %r11
	addq	$4, %r10
	cmpl	$1000010, %r8d
	jne	.L11
	leaq	12(%rsp), %r14
	leaq	.LC7(%rip), %r13
	leaq	.LC6(%rip), %r12
	jmp	.L20
.L21:
	movl	0(%rbp,%rax,4), %ecx
	movl	(%rbx,%rax,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L20:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	testl	%eax, %eax
	jne	.L21
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$832, %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
.L40:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	d2
	.bss
	.align 32
	.type	d2, @object
	.size	d2, 4000040
d2:
	.zero	4000040
	.globl	d1
	.align 32
	.type	d1, @object
	.size	d1, 4000040
d1:
	.zero	4000040
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC3:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC4:
	.long	715827883
	.long	715827883
	.long	715827883
	.long	715827883
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	1293699
	.long	1313400
	.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 M 1000010
int zMIN(int a,int b){
  if(a==0||a>b)return b;
  return a;
}
int d1[M],d2[M];
int main(){
  int n=200,t[200],i,j;
  for(i=1;i<200;i++)t[i]=i*(i+1)*(i+2)/6;
  for(i=0;i<M;i++){
    for(j=1;j<200;j++){
      if(i+t[j]>=M)continue;
                d1[i+t[j]]=zMIN(d1[i+t[j]],d1[i]+1);
      if(t[j]%2)d2[i+t[j]]=zMIN(d2[i+t[j]],d2[i]+1);
    }
  }
  while(scanf("%d",&n),n)printf("%d %d\n",d1[n],d2[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>
#define M 1000010
int zMIN(int a,int b){
  if(a==0||a>b)return b;
  return a;
}
int d1[M],d2[M];
int main(){
  int n=200,t[200],i,j;
  for(i=1;i<200;i++)t[i]=i*(i+1)*(i+2)/6;
  for(i=0;i<M;i++){
    for(j=1;j<200;j++){
      if(i+t[j]>=M)continue;
                d1[i+t[j]]=zMIN(d1[i+t[j]],d1[i]+1);
      if(t[j]%2)d2[i+t[j]]=zMIN(d2[i+t[j]],d2[i]+1);
    }
  }
  while(scanf("%d",&n),n)printf("%d %d\n",d1[n],d2[n]);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	zMIN
	.type	zMIN, @function
zMIN:
.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)
	cmpl	$0, -4(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L3
.L2:
	movl	-8(%rbp), %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	zMIN, .-zMIN
	.globl	d1
	.bss
	.align 32
	.type	d1, @object
	.size	d1, 4000040
d1:
	.zero	4000040
	.globl	d2
	.align 32
	.type	d2, @object
	.size	d2, 4000040
d2:
	.zero	4000040
	.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	$840, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$200, -844(%rbp)
	movl	$1, -840(%rbp)
	jmp	.L6
.L7:
	movl	-840(%rbp), %eax
	addl	$1, %eax
	imull	-840(%rbp), %eax
	movl	-840(%rbp), %edx
	addl	$2, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-840(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	addl	$1, -840(%rbp)
.L6:
	cmpl	$199, -840(%rbp)
	jle	.L7
	movl	$0, -840(%rbp)
	jmp	.L8
.L13:
	movl	$1, -836(%rbp)
	jmp	.L9
.L12:
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-840(%rbp), %eax
	addl	%edx, %eax
	cmpl	$1000009, %eax
	jg	.L18
	movl	-840(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %ecx
	movl	-840(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-836(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	-832(%rbp,%rcx,4), %esi
	movl	-840(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	zMIN
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	-840(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %ecx
	movl	-840(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d2(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-836(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	-832(%rbp,%rcx,4), %esi
	movl	-840(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	zMIN
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -836(%rbp)
.L9:
	cmpl	$199, -836(%rbp)
	jle	.L12
	addl	$1, -840(%rbp)
.L8:
	cmpl	$1000009, -840(%rbp)
	jle	.L13
	jmp	.L14
.L15:
	movl	-844(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-844(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-844(%rbp), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	zMIN
	.type	zMIN, @function
zMIN:
.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)
	cmpl	$0, -4(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L3
.L2:
	movl	-8(%rbp), %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	zMIN, .-zMIN
	.globl	d1
	.bss
	.align 32
	.type	d1, @object
	.size	d1, 4000040
d1:
	.zero	4000040
	.globl	d2
	.align 32
	.type	d2, @object
	.size	d2, 4000040
d2:
	.zero	4000040
	.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	$840, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$200, -844(%rbp)
	movl	$1, -840(%rbp)
	jmp	.L6
.L7:
	movl	-840(%rbp), %eax
	addl	$1, %eax
	imull	-840(%rbp), %eax
	movl	-840(%rbp), %edx
	addl	$2, %edx
	imull	%edx, %eax
	movslq	%eax, %rdx
	imulq	$715827883, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-840(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	addl	$1, -840(%rbp)
.L6:
	cmpl	$199, -840(%rbp)
	jle	.L7
	movl	$0, -840(%rbp)
	jmp	.L8
.L13:
	movl	$1, -836(%rbp)
	jmp	.L9
.L12:
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-840(%rbp), %eax
	addl	%edx, %eax
	cmpl	$1000009, %eax
	jg	.L18
	movl	-840(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %ecx
	movl	-840(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-836(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	-832(%rbp,%rcx,4), %esi
	movl	-840(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	zMIN
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L11
	movl	-840(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %ecx
	movl	-840(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d2(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	-836(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	-832(%rbp,%rcx,4), %esi
	movl	-840(%rbp), %ecx
	leal	(%rsi,%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	zMIN
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -836(%rbp)
.L9:
	cmpl	$199, -836(%rbp)
	jle	.L12
	addl	$1, -840(%rbp)
.L8:
	cmpl	$1000009, -840(%rbp)
	jle	.L13
	jmp	.L14
.L15:
	movl	-844(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-844(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d1(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-844(%rbp), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
