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>
#include <stdlib.h>

#define BUF_SIZE 10

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

#define SET_MAX 1000000
#define INPUT_MAX 999999 // less than or equal
// 6000000**(1/3) = 181.7
// 180*181*182/6 < 181**3/6 < INPUT_MAX < 181*182*183/6
#define NUM_MAX 180
struct pair {
    int min;
    int odd_min;
};

#include <limits.h>
#define min(a,b) ((a) > (b) ? (b) : (a))

int main(void) {
    struct pair ans[SET_MAX] = {0};
    int idx = 0;
    int i;
    int tetra_area[NUM_MAX+1];
    // calc idx:1 ~ 99
    for(i = 1; i <= NUM_MAX; i++) {
        tetra_area[i] = i*(i+1)*(i+2)/6;
    }
    // answer to 1st question
    static int dp[INPUT_MAX+1];
    // answer to 2nd question
    static int odd_dp[INPUT_MAX+1];

    // In case of len = 1
    for(i = 0; i < INPUT_MAX+1; i++) {
        dp[i] = odd_dp[i] = i;
    }
    // calc len limit
    int len;
    for(len = 2; len <= NUM_MAX; len++) {
        int target = tetra_area[len];
        // update dp
        for(i = target; i <= INPUT_MAX; i++) {
            dp[i] = min(dp[i], dp[i-target]+1);
        }
    }
    for(len = 2; len <= NUM_MAX; len++) {
        int target = tetra_area[len];
        if(!(target%2)) continue; //require odd number
        for(i = target; i <= INPUT_MAX; i++) {
            odd_dp[i] = min(odd_dp[i], odd_dp[i-target]+1);
        }
    }
    // query
    while(1) {
        int sum = get_int();
        if(!sum) break;
        ans[idx].min = dp[sum]; ans[idx].odd_min = odd_dp[sum];
        idx++;
    }

    for(i = 0; i < idx; i++) {
        printf("%d %d\n", ans[i].min, ans[i].odd_min);
    }
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.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
	movq	stdin(%rip), %rdx
	leaq	-18(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$0, %eax
	jmp	.L4
.L2:
	leaq	-24(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-24(%rbp), %eax
.L4:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-7999488(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1296, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8000016(%rbp), %rax
	movl	$8000000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -8000776(%rbp)
	movl	$1, -8000772(%rbp)
	jmp	.L7
.L8:
	movl	-8000772(%rbp), %eax
	addl	$1, %eax
	imull	-8000772(%rbp), %eax
	movl	-8000772(%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	-8000772(%rbp), %eax
	cltq
	movl	%edx, -8000752(%rbp,%rax,4)
	addl	$1, -8000772(%rbp)
.L7:
	cmpl	$180, -8000772(%rbp)
	jle	.L8
	movl	$0, -8000772(%rbp)
	jmp	.L9
.L10:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	-8000772(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L9:
	cmpl	$999999, -8000772(%rbp)
	jle	.L10
	movl	$2, -8000768(%rbp)
	jmp	.L11
.L14:
	movl	-8000768(%rbp), %eax
	cltq
	movl	-8000752(%rbp,%rax,4), %eax
	movl	%eax, -8000756(%rbp)
	movl	-8000756(%rbp), %eax
	movl	%eax, -8000772(%rbp)
	jmp	.L12
.L13:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	subl	-8000756(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	addl	$1, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L12:
	cmpl	$999999, -8000772(%rbp)
	jle	.L13
	addl	$1, -8000768(%rbp)
.L11:
	cmpl	$180, -8000768(%rbp)
	jle	.L14
	movl	$2, -8000768(%rbp)
	jmp	.L15
.L20:
	movl	-8000768(%rbp), %eax
	cltq
	movl	-8000752(%rbp,%rax,4), %eax
	movl	%eax, -8000760(%rbp)
	movl	-8000760(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L29
	movl	-8000760(%rbp), %eax
	movl	%eax, -8000772(%rbp)
	jmp	.L18
.L19:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	subl	-8000760(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	addl	$1, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L18:
	cmpl	$999999, -8000772(%rbp)
	jle	.L19
	jmp	.L17
.L29:
	nop
.L17:
	addl	$1, -8000768(%rbp)
.L15:
	cmpl	$180, -8000768(%rbp)
	jle	.L20
.L23:
	call	get_int
	movl	%eax, -8000764(%rbp)
	cmpl	$0, -8000764(%rbp)
	je	.L30
	movl	-8000764(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8000776(%rbp), %eax
	cltq
	movl	%edx, -8000016(%rbp,%rax,8)
	movl	-8000764(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8000776(%rbp), %eax
	cltq
	movl	%edx, -8000012(%rbp,%rax,8)
	addl	$1, -8000776(%rbp)
	jmp	.L23
.L30:
	nop
	movl	$0, -8000772(%rbp)
	jmp	.L24
.L25:
	movl	-8000772(%rbp), %eax
	cltq
	movl	-8000012(%rbp,%rax,8), %edx
	movl	-8000772(%rbp), %eax
	cltq
	movl	-8000016(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8000772(%rbp)
.L24:
	movl	-8000772(%rbp), %eax
	cmpl	-8000776(%rbp), %eax
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	odd_dp.1
	.comm	odd_dp.1,4000000,32
	.local	dp.0
	.comm	dp.0,4000000,32
	.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"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$10, %esi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	14(%rsp), %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	%rax, %r8
	xorl	%eax, %eax
	testq	%r8, %r8
	je	.L1
	leaq	8(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rbp, %rdi
	call	__isoc99_sscanf@PLT
	movl	8(%rsp), %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L8
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.section	.rodata.str1.1
.LC7:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-7999488(%rsp), %r11
	.cfi_def_cfa 11, 7999544
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 8000864
	movl	$8000000, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 8000792(%rsp)
	xorl	%eax, %eax
	leaq	768(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	pxor	%xmm5, %xmm5
	movdqa	.LC6(%rip), %xmm2
	movdqa	.LC1(%rip), %xmm4
	movdqa	%xmm5, %xmm7
	leaq	36(%rsp), %rax
	movdqa	.LC3(%rip), %xmm6
	movdqa	.LC4(%rip), %xmm3
	pcmpgtd	%xmm2, %xmm7
	leaq	756(%rsp), %r9
	movdqa	.LC5(%rip), %xmm8
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm4, %xmm0
	addq	$16, %rax
	paddd	%xmm6, %xmm4
	movdqa	%xmm0, %xmm9
	movdqa	%xmm0, %xmm10
	paddd	%xmm3, %xmm9
	psrlq	$32, %xmm10
	movdqa	%xmm9, %xmm1
	psrlq	$32, %xmm9
	pmuludq	%xmm0, %xmm1
	pmuludq	%xmm10, %xmm9
	paddd	%xmm8, %xmm0
	movdqa	%xmm7, %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	%xmm5, %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	%xmm7, %xmm10
	psllq	$32, %xmm9
	pmuludq	%xmm0, %xmm10
	paddq	%xmm9, %xmm1
	movdqa	%xmm5, %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	%r9, %rax
	jne	.L10
	xorl	%eax, %eax
	movdqa	.LC2(%rip), %xmm0
	leaq	odd_dp.1(%rip), %rbp
	leaq	dp.0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm0, %xmm1
	paddd	%xmm6, %xmm0
	movaps	%xmm1, 0(%rbp,%rax)
	movaps	%xmm1, (%rbx,%rax)
	addq	$16, %rax
	cmpq	$4000000, %rax
	jne	.L11
	leaq	40(%rsp), %rdi
	movl	$999999, %r10d
	leaq	4+dp.0(%rip), %r12
	movl	$1000000, %r11d
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L18:
	movslq	(%r8), %r13
	cmpl	$999999, %r13d
	jg	.L12
	movl	%r10d, %edx
	leal	-1(%r13), %eax
	subl	%r13d, %edx
	cmpl	$2, %eax
	jbe	.L13
	cmpl	$2, %edx
	jbe	.L13
	movl	%r11d, %r14d
	movslq	%r13d, %rax
	subl	%r13d, %r14d
	leaq	(%rbx,%rax,4), %rdx
	xorl	%eax, %eax
	movl	%r14d, %esi
	shrl	$2, %esi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	movdqa	(%rbx,%rax), %xmm2
	movdqu	(%rdx,%rax), %xmm4
	paddd	%xmm3, %xmm2
	movdqa	%xmm4, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L14
	movl	%r14d, %eax
	andl	$-4, %eax
	leal	0(%r13,%rax), %edx
	cmpl	%eax, %r14d
	je	.L12
	cltq
	movslq	%edx, %rsi
	movl	(%rbx,%rax,4), %eax
	movl	(%rbx,%rsi,4), %r14d
	addl	$1, %eax
	cmpl	%r14d, %eax
	cmovg	%r14d, %eax
	movl	%eax, (%rbx,%rsi,4)
	leal	1(%rdx), %eax
	cmpl	$999999, %edx
	je	.L12
	movslq	%eax, %rsi
	subl	%r13d, %eax
	cltq
	movl	(%rbx,%rsi,4), %r14d
	movl	(%rbx,%rax,4), %eax
	addl	$1, %eax
	cmpl	%r14d, %eax
	cmovg	%r14d, %eax
	movl	%eax, (%rbx,%rsi,4)
	leal	2(%rdx), %eax
	cmpl	$999998, %edx
	je	.L12
	movslq	%eax, %rdx
	subl	%r13d, %eax
	cltq
	movl	(%rbx,%rdx,4), %esi
	movl	(%rbx,%rax,4), %eax
	addl	$1, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	movl	%eax, (%rbx,%rdx,4)
.L12:
	addq	$4, %r8
	cmpq	%r9, %r8
	jne	.L18
	movl	$999999, %r8d
	leaq	4+odd_dp.1(%rip), %r11
	movl	$1000000, %r10d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$4, %rdi
	cmpq	%r9, %rdi
	je	.L73
.L25:
	movslq	(%rdi), %rdx
	testb	$1, %dl
	je	.L19
	cmpl	$999999, %edx
	jg	.L19
	movl	%r8d, %esi
	leal	-1(%rdx), %eax
	subl	%edx, %esi
	cmpl	$2, %eax
	jbe	.L20
	cmpl	$2, %esi
	jbe	.L20
	movl	%r10d, %r13d
	movslq	%edx, %rax
	subl	%edx, %r13d
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
	movl	%r13d, %r12d
	shrl	$2, %r12d
	salq	$4, %r12
	.p2align 4,,10
	.p2align 3
.L21:
	movdqa	0(%rbp,%rax), %xmm2
	movdqu	(%rsi,%rax), %xmm6
	paddd	%xmm3, %xmm2
	movdqa	%xmm6, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm6, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%r12, %rax
	jne	.L21
	movl	%r13d, %eax
	andl	$-4, %eax
	leal	(%rdx,%rax), %esi
	cmpl	%r13d, %eax
	je	.L19
	cltq
	movslq	%esi, %r12
	movl	0(%rbp,%rax,4), %eax
	movl	0(%rbp,%r12,4), %r13d
	addl	$1, %eax
	cmpl	%r13d, %eax
	cmovg	%r13d, %eax
	movl	%eax, 0(%rbp,%r12,4)
	leal	1(%rsi), %eax
	cmpl	$999999, %esi
	je	.L19
	movslq	%eax, %r12
	subl	%edx, %eax
	cltq
	movl	0(%rbp,%r12,4), %r13d
	movl	0(%rbp,%rax,4), %eax
	addl	$1, %eax
	cmpl	%r13d, %eax
	cmovg	%r13d, %eax
	movl	%eax, 0(%rbp,%r12,4)
	leal	2(%rsi), %eax
	cmpl	$999998, %esi
	je	.L19
	movslq	%eax, %rsi
	subl	%edx, %eax
	cltq
	movl	0(%rbp,%rsi,4), %edx
	movl	0(%rbp,%rax,4), %eax
	addl	$1, %eax
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	addq	$4, %rdi
	movl	%eax, 0(%rbp,%rsi,4)
	cmpq	%r9, %rdi
	jne	.L25
.L73:
	xorl	%r15d, %r15d
	leaq	8000782(%rsp), %r12
	jmp	.L30
.L26:
	leaq	28(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movslq	28(%rsp), %rax
	testl	%eax, %eax
	je	.L29
	movd	(%rbx,%rax,4), %xmm0
	movd	0(%rbp,%rax,4), %xmm7
	movq	8(%rsp), %rax
	punpckldq	%xmm7, %xmm0
	movq	%xmm0, (%rax,%r15,8)
	addq	$1, %r15
.L30:
	movq	stdin(%rip), %rdx
	movq	%r12, %rdi
	movl	%r15d, %r13d
	movl	%r15d, %r14d
	movl	$10, %esi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L26
.L29:
	testl	%r14d, %r14d
	je	.L28
	leal	-1(%r13), %eax
	movq	8(%rsp), %rbp
	leaq	.LC7(%rip), %rbx
	leaq	776(%rsp,%rax,8), %r12
.L31:
	movl	4(%rbp), %ecx
	movl	0(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$8, %rbp
	call	__printf_chk@PLT
	cmpq	%r12, %rbp
	jne	.L31
.L28:
	movq	8000792(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
	addq	$8000808, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	leaq	0(,%r13,4), %rsi
	addq	%r13, %rdx
	leaq	(%rbx,%rsi), %rax
	negq	%rsi
	leaq	(%r12,%rdx,4), %r14
	movq	%rsi, %r13
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%rax,%r13), %edx
	movl	(%rax), %esi
	addl	$1, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%r14, %rax
	jne	.L16
	jmp	.L12
.L20:
	leaq	0(,%rdx,4), %r12
	addq	%rsi, %rdx
	leaq	0(%rbp,%r12), %rax
	leaq	(%r11,%rdx,4), %r13
	negq	%r12
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rax,%r12), %edx
	movl	(%rax), %esi
	addl	$1, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%r13, %rax
	jne	.L23
	jmp	.L19
.L74:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,4000000,32
	.local	odd_dp.1
	.comm	odd_dp.1,4000000,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC2:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC5:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC6:
	.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
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$10, %esi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	14(%rsp), %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	%rax, %r8
	xorl	%eax, %eax
	testq	%r8, %r8
	je	.L1
	leaq	8(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rbp, %rdi
	call	__isoc99_sscanf@PLT
	movl	8(%rsp), %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L8
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.section	.rodata.str1.1
.LC7:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-7999488(%rsp), %r11
	.cfi_def_cfa 11, 7999544
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 8000864
	movl	$8000000, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 8000792(%rsp)
	xorl	%eax, %eax
	leaq	768(%rsp), %rax
	movq	%rax, %rdi
	movq	%rax, 8(%rsp)
	call	memset@PLT
	pxor	%xmm5, %xmm5
	movdqa	.LC6(%rip), %xmm2
	movdqa	.LC1(%rip), %xmm4
	movdqa	%xmm5, %xmm7
	leaq	36(%rsp), %rax
	movdqa	.LC3(%rip), %xmm6
	movdqa	.LC4(%rip), %xmm3
	pcmpgtd	%xmm2, %xmm7
	leaq	756(%rsp), %r9
	movdqa	.LC5(%rip), %xmm8
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm4, %xmm0
	addq	$16, %rax
	paddd	%xmm6, %xmm4
	movdqa	%xmm0, %xmm9
	movdqa	%xmm0, %xmm10
	paddd	%xmm3, %xmm9
	psrlq	$32, %xmm10
	movdqa	%xmm9, %xmm1
	psrlq	$32, %xmm9
	pmuludq	%xmm0, %xmm1
	pmuludq	%xmm10, %xmm9
	paddd	%xmm8, %xmm0
	movdqa	%xmm7, %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	%xmm5, %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	%xmm7, %xmm10
	psllq	$32, %xmm9
	pmuludq	%xmm0, %xmm10
	paddq	%xmm9, %xmm1
	movdqa	%xmm5, %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	%r9, %rax
	jne	.L10
	xorl	%eax, %eax
	movdqa	.LC2(%rip), %xmm0
	leaq	odd_dp.1(%rip), %rbp
	leaq	dp.0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm0, %xmm1
	paddd	%xmm6, %xmm0
	movaps	%xmm1, 0(%rbp,%rax)
	movaps	%xmm1, (%rbx,%rax)
	addq	$16, %rax
	cmpq	$4000000, %rax
	jne	.L11
	leaq	40(%rsp), %rdi
	movl	$999999, %r10d
	leaq	4+dp.0(%rip), %r12
	movl	$1000000, %r11d
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L18:
	movslq	(%r8), %r13
	cmpl	$999999, %r13d
	jg	.L12
	movl	%r10d, %edx
	leal	-1(%r13), %eax
	subl	%r13d, %edx
	cmpl	$2, %eax
	jbe	.L13
	cmpl	$2, %edx
	jbe	.L13
	movl	%r11d, %r14d
	movslq	%r13d, %rax
	subl	%r13d, %r14d
	leaq	(%rbx,%rax,4), %rdx
	xorl	%eax, %eax
	movl	%r14d, %esi
	shrl	$2, %esi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	movdqa	(%rbx,%rax), %xmm2
	movdqu	(%rdx,%rax), %xmm4
	paddd	%xmm3, %xmm2
	movdqa	%xmm4, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L14
	movl	%r14d, %eax
	andl	$-4, %eax
	leal	0(%r13,%rax), %edx
	cmpl	%eax, %r14d
	je	.L12
	cltq
	movslq	%edx, %rsi
	movl	(%rbx,%rax,4), %eax
	movl	(%rbx,%rsi,4), %r14d
	addl	$1, %eax
	cmpl	%r14d, %eax
	cmovg	%r14d, %eax
	movl	%eax, (%rbx,%rsi,4)
	leal	1(%rdx), %eax
	cmpl	$999999, %edx
	je	.L12
	movslq	%eax, %rsi
	subl	%r13d, %eax
	cltq
	movl	(%rbx,%rsi,4), %r14d
	movl	(%rbx,%rax,4), %eax
	addl	$1, %eax
	cmpl	%r14d, %eax
	cmovg	%r14d, %eax
	movl	%eax, (%rbx,%rsi,4)
	leal	2(%rdx), %eax
	cmpl	$999998, %edx
	je	.L12
	movslq	%eax, %rdx
	subl	%r13d, %eax
	cltq
	movl	(%rbx,%rdx,4), %esi
	movl	(%rbx,%rax,4), %eax
	addl	$1, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	movl	%eax, (%rbx,%rdx,4)
.L12:
	addq	$4, %r8
	cmpq	%r9, %r8
	jne	.L18
	movl	$999999, %r8d
	leaq	4+odd_dp.1(%rip), %r11
	movl	$1000000, %r10d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$4, %rdi
	cmpq	%r9, %rdi
	je	.L73
.L25:
	movslq	(%rdi), %rdx
	testb	$1, %dl
	je	.L19
	cmpl	$999999, %edx
	jg	.L19
	movl	%r8d, %esi
	leal	-1(%rdx), %eax
	subl	%edx, %esi
	cmpl	$2, %eax
	jbe	.L20
	cmpl	$2, %esi
	jbe	.L20
	movl	%r10d, %r13d
	movslq	%edx, %rax
	subl	%edx, %r13d
	leaq	0(%rbp,%rax,4), %rsi
	xorl	%eax, %eax
	movl	%r13d, %r12d
	shrl	$2, %r12d
	salq	$4, %r12
	.p2align 4,,10
	.p2align 3
.L21:
	movdqa	0(%rbp,%rax), %xmm2
	movdqu	(%rsi,%rax), %xmm6
	paddd	%xmm3, %xmm2
	movdqa	%xmm6, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm6, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%r12, %rax
	jne	.L21
	movl	%r13d, %eax
	andl	$-4, %eax
	leal	(%rdx,%rax), %esi
	cmpl	%r13d, %eax
	je	.L19
	cltq
	movslq	%esi, %r12
	movl	0(%rbp,%rax,4), %eax
	movl	0(%rbp,%r12,4), %r13d
	addl	$1, %eax
	cmpl	%r13d, %eax
	cmovg	%r13d, %eax
	movl	%eax, 0(%rbp,%r12,4)
	leal	1(%rsi), %eax
	cmpl	$999999, %esi
	je	.L19
	movslq	%eax, %r12
	subl	%edx, %eax
	cltq
	movl	0(%rbp,%r12,4), %r13d
	movl	0(%rbp,%rax,4), %eax
	addl	$1, %eax
	cmpl	%r13d, %eax
	cmovg	%r13d, %eax
	movl	%eax, 0(%rbp,%r12,4)
	leal	2(%rsi), %eax
	cmpl	$999998, %esi
	je	.L19
	movslq	%eax, %rsi
	subl	%edx, %eax
	cltq
	movl	0(%rbp,%rsi,4), %edx
	movl	0(%rbp,%rax,4), %eax
	addl	$1, %eax
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	addq	$4, %rdi
	movl	%eax, 0(%rbp,%rsi,4)
	cmpq	%r9, %rdi
	jne	.L25
.L73:
	xorl	%r15d, %r15d
	leaq	8000782(%rsp), %r12
	jmp	.L30
.L26:
	leaq	28(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movslq	28(%rsp), %rax
	testl	%eax, %eax
	je	.L29
	movd	(%rbx,%rax,4), %xmm0
	movd	0(%rbp,%rax,4), %xmm7
	movq	8(%rsp), %rax
	punpckldq	%xmm7, %xmm0
	movq	%xmm0, (%rax,%r15,8)
	addq	$1, %r15
.L30:
	movq	stdin(%rip), %rdx
	movq	%r12, %rdi
	movl	%r15d, %r13d
	movl	%r15d, %r14d
	movl	$10, %esi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L26
.L29:
	testl	%r14d, %r14d
	je	.L28
	leal	-1(%r13), %eax
	movq	8(%rsp), %rbp
	leaq	.LC7(%rip), %rbx
	leaq	776(%rsp,%rax,8), %r12
.L31:
	movl	4(%rbp), %ecx
	movl	0(%rbp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$8, %rbp
	call	__printf_chk@PLT
	cmpq	%r12, %rbp
	jne	.L31
.L28:
	movq	8000792(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L74
	addq	$8000808, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	leaq	0(,%r13,4), %rsi
	addq	%r13, %rdx
	leaq	(%rbx,%rsi), %rax
	negq	%rsi
	leaq	(%r12,%rdx,4), %r14
	movq	%rsi, %r13
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%rax,%r13), %edx
	movl	(%rax), %esi
	addl	$1, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%r14, %rax
	jne	.L16
	jmp	.L12
.L20:
	leaq	0(,%rdx,4), %r12
	addq	%rsi, %rdx
	leaq	0(%rbp,%r12), %rax
	leaq	(%r11,%rdx,4), %r13
	negq	%r12
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rax,%r12), %edx
	movl	(%rax), %esi
	addl	$1, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%r13, %rax
	jne	.L23
	jmp	.L19
.L74:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,4000000,32
	.local	odd_dp.1
	.comm	odd_dp.1,4000000,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC2:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC5:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC6:
	.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>
#include <string.h>
#include <stdlib.h>

#define BUF_SIZE 10

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

#define SET_MAX 1000000
#define INPUT_MAX 999999 // less than or equal
// 6000000**(1/3) = 181.7
// 180*181*182/6 < 181**3/6 < INPUT_MAX < 181*182*183/6
#define NUM_MAX 180
struct pair {
    int min;
    int odd_min;
};

#include <limits.h>
#define min(a,b) ((a) > (b) ? (b) : (a))

int main(void) {
    struct pair ans[SET_MAX] = {0};
    int idx = 0;
    int i;
    int tetra_area[NUM_MAX+1];
    // calc idx:1 ~ 99
    for(i = 1; i <= NUM_MAX; i++) {
        tetra_area[i] = i*(i+1)*(i+2)/6;
    }
    // answer to 1st question
    static int dp[INPUT_MAX+1];
    // answer to 2nd question
    static int odd_dp[INPUT_MAX+1];

    // In case of len = 1
    for(i = 0; i < INPUT_MAX+1; i++) {
        dp[i] = odd_dp[i] = i;
    }
    // calc len limit
    int len;
    for(len = 2; len <= NUM_MAX; len++) {
        int target = tetra_area[len];
        // update dp
        for(i = target; i <= INPUT_MAX; i++) {
            dp[i] = min(dp[i], dp[i-target]+1);
        }
    }
    for(len = 2; len <= NUM_MAX; len++) {
        int target = tetra_area[len];
        if(!(target%2)) continue; //require odd number
        for(i = target; i <= INPUT_MAX; i++) {
            odd_dp[i] = min(odd_dp[i], odd_dp[i-target]+1);
        }
    }
    // query
    while(1) {
        int sum = get_int();
        if(!sum) break;
        ans[idx].min = dp[sum]; ans[idx].odd_min = odd_dp[sum];
        idx++;
    }

    for(i = 0; i < idx; i++) {
        printf("%d %d\n", ans[i].min, ans[i].odd_min);
    }
    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>
#include <stdlib.h>

#define BUF_SIZE 10

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

#define SET_MAX 1000000
#define INPUT_MAX 999999 // less than or equal
// 6000000**(1/3) = 181.7
// 180*181*182/6 < 181**3/6 < INPUT_MAX < 181*182*183/6
#define NUM_MAX 180
struct pair {
    int min;
    int odd_min;
};

#include <limits.h>
#define min(a,b) ((a) > (b) ? (b) : (a))

int main(void) {
    struct pair ans[SET_MAX] = {0};
    int idx = 0;
    int i;
    int tetra_area[NUM_MAX+1];
    // calc idx:1 ~ 99
    for(i = 1; i <= NUM_MAX; i++) {
        tetra_area[i] = i*(i+1)*(i+2)/6;
    }
    // answer to 1st question
    static int dp[INPUT_MAX+1];
    // answer to 2nd question
    static int odd_dp[INPUT_MAX+1];

    // In case of len = 1
    for(i = 0; i < INPUT_MAX+1; i++) {
        dp[i] = odd_dp[i] = i;
    }
    // calc len limit
    int len;
    for(len = 2; len <= NUM_MAX; len++) {
        int target = tetra_area[len];
        // update dp
        for(i = target; i <= INPUT_MAX; i++) {
            dp[i] = min(dp[i], dp[i-target]+1);
        }
    }
    for(len = 2; len <= NUM_MAX; len++) {
        int target = tetra_area[len];
        if(!(target%2)) continue; //require odd number
        for(i = target; i <= INPUT_MAX; i++) {
            odd_dp[i] = min(odd_dp[i], odd_dp[i-target]+1);
        }
    }
    // query
    while(1) {
        int sum = get_int();
        if(!sum) break;
        ans[idx].min = dp[sum]; ans[idx].odd_min = odd_dp[sum];
        idx++;
    }

    for(i = 0; i < idx; i++) {
        printf("%d %d\n", ans[i].min, ans[i].odd_min);
    }
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.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
	movq	stdin(%rip), %rdx
	leaq	-18(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$0, %eax
	jmp	.L4
.L2:
	leaq	-24(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-24(%rbp), %eax
.L4:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-7999488(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1296, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8000016(%rbp), %rax
	movl	$8000000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -8000776(%rbp)
	movl	$1, -8000772(%rbp)
	jmp	.L7
.L8:
	movl	-8000772(%rbp), %eax
	addl	$1, %eax
	imull	-8000772(%rbp), %eax
	movl	-8000772(%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	-8000772(%rbp), %eax
	cltq
	movl	%edx, -8000752(%rbp,%rax,4)
	addl	$1, -8000772(%rbp)
.L7:
	cmpl	$180, -8000772(%rbp)
	jle	.L8
	movl	$0, -8000772(%rbp)
	jmp	.L9
.L10:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	-8000772(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L9:
	cmpl	$999999, -8000772(%rbp)
	jle	.L10
	movl	$2, -8000768(%rbp)
	jmp	.L11
.L14:
	movl	-8000768(%rbp), %eax
	cltq
	movl	-8000752(%rbp,%rax,4), %eax
	movl	%eax, -8000756(%rbp)
	movl	-8000756(%rbp), %eax
	movl	%eax, -8000772(%rbp)
	jmp	.L12
.L13:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	subl	-8000756(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	addl	$1, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L12:
	cmpl	$999999, -8000772(%rbp)
	jle	.L13
	addl	$1, -8000768(%rbp)
.L11:
	cmpl	$180, -8000768(%rbp)
	jle	.L14
	movl	$2, -8000768(%rbp)
	jmp	.L15
.L20:
	movl	-8000768(%rbp), %eax
	cltq
	movl	-8000752(%rbp,%rax,4), %eax
	movl	%eax, -8000760(%rbp)
	movl	-8000760(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L29
	movl	-8000760(%rbp), %eax
	movl	%eax, -8000772(%rbp)
	jmp	.L18
.L19:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	subl	-8000760(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	addl	$1, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L18:
	cmpl	$999999, -8000772(%rbp)
	jle	.L19
	jmp	.L17
.L29:
	nop
.L17:
	addl	$1, -8000768(%rbp)
.L15:
	cmpl	$180, -8000768(%rbp)
	jle	.L20
.L23:
	call	get_int
	movl	%eax, -8000764(%rbp)
	cmpl	$0, -8000764(%rbp)
	je	.L30
	movl	-8000764(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8000776(%rbp), %eax
	cltq
	movl	%edx, -8000016(%rbp,%rax,8)
	movl	-8000764(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8000776(%rbp), %eax
	cltq
	movl	%edx, -8000012(%rbp,%rax,8)
	addl	$1, -8000776(%rbp)
	jmp	.L23
.L30:
	nop
	movl	$0, -8000772(%rbp)
	jmp	.L24
.L25:
	movl	-8000772(%rbp), %eax
	cltq
	movl	-8000012(%rbp,%rax,8), %edx
	movl	-8000772(%rbp), %eax
	cltq
	movl	-8000016(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8000772(%rbp)
.L24:
	movl	-8000772(%rbp), %eax
	cmpl	-8000776(%rbp), %eax
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	odd_dp.1
	.comm	odd_dp.1,4000000,32
	.local	dp.0
	.comm	dp.0,4000000,32
	.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"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.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
	movq	stdin(%rip), %rdx
	leaq	-18(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$0, %eax
	jmp	.L4
.L2:
	leaq	-24(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-24(%rbp), %eax
.L4:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-7999488(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1296, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8000016(%rbp), %rax
	movl	$8000000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -8000776(%rbp)
	movl	$1, -8000772(%rbp)
	jmp	.L7
.L8:
	movl	-8000772(%rbp), %eax
	addl	$1, %eax
	imull	-8000772(%rbp), %eax
	movl	-8000772(%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	-8000772(%rbp), %eax
	cltq
	movl	%edx, -8000752(%rbp,%rax,4)
	addl	$1, -8000772(%rbp)
.L7:
	cmpl	$180, -8000772(%rbp)
	jle	.L8
	movl	$0, -8000772(%rbp)
	jmp	.L9
.L10:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	-8000772(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L9:
	cmpl	$999999, -8000772(%rbp)
	jle	.L10
	movl	$2, -8000768(%rbp)
	jmp	.L11
.L14:
	movl	-8000768(%rbp), %eax
	cltq
	movl	-8000752(%rbp,%rax,4), %eax
	movl	%eax, -8000756(%rbp)
	movl	-8000756(%rbp), %eax
	movl	%eax, -8000772(%rbp)
	jmp	.L12
.L13:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	subl	-8000756(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	addl	$1, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp.0(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L12:
	cmpl	$999999, -8000772(%rbp)
	jle	.L13
	addl	$1, -8000768(%rbp)
.L11:
	cmpl	$180, -8000768(%rbp)
	jle	.L14
	movl	$2, -8000768(%rbp)
	jmp	.L15
.L20:
	movl	-8000768(%rbp), %eax
	cltq
	movl	-8000752(%rbp,%rax,4), %eax
	movl	%eax, -8000760(%rbp)
	movl	-8000760(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L29
	movl	-8000760(%rbp), %eax
	movl	%eax, -8000772(%rbp)
	jmp	.L18
.L19:
	movl	-8000772(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8000772(%rbp), %edx
	subl	-8000760(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	addl	$1, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	-8000772(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	odd_dp.1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8000772(%rbp)
.L18:
	cmpl	$999999, -8000772(%rbp)
	jle	.L19
	jmp	.L17
.L29:
	nop
.L17:
	addl	$1, -8000768(%rbp)
.L15:
	cmpl	$180, -8000768(%rbp)
	jle	.L20
.L23:
	call	get_int
	movl	%eax, -8000764(%rbp)
	cmpl	$0, -8000764(%rbp)
	je	.L30
	movl	-8000764(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp.0(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8000776(%rbp), %eax
	cltq
	movl	%edx, -8000016(%rbp,%rax,8)
	movl	-8000764(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	odd_dp.1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8000776(%rbp), %eax
	cltq
	movl	%edx, -8000012(%rbp,%rax,8)
	addl	$1, -8000776(%rbp)
	jmp	.L23
.L30:
	nop
	movl	$0, -8000772(%rbp)
	jmp	.L24
.L25:
	movl	-8000772(%rbp), %eax
	cltq
	movl	-8000012(%rbp,%rax,8), %edx
	movl	-8000772(%rbp), %eax
	cltq
	movl	-8000016(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8000772(%rbp)
.L24:
	movl	-8000772(%rbp), %eax
	cmpl	-8000776(%rbp), %eax
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	odd_dp.1
	.comm	odd_dp.1,4000000,32
	.local	dp.0
	.comm	dp.0,4000000,32
	.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:
