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>

int num(int n)
{
	int cnt;
	
	if (n < 0){
		return (0);
	}
	if (n == 0){
		return (1);
	}
	
	cnt = (num(n - 3) + num(n - 2) + num(n - 1));
	
	return (cnt);
}

int main(void)
{
	int n, m;
	
	while (scanf("%d", &n), n != 0){
		m = num(n);
		m = m / 3650 + (m % 3650 > 0);
		
		printf("%d\n", m);
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	num
	.type	num, @function
num:
.LFB0:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jns	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	cmpl	$0, -36(%rbp)
	jne	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	-36(%rbp), %eax
	subl	$3, %eax
	movl	%eax, %edi
	call	num
	movl	%eax, %ebx
	movl	-36(%rbp), %eax
	subl	$2, %eax
	movl	%eax, %edi
	call	num
	addl	%eax, %ebx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	num
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	num, .-num
	.section	.rodata
.LC0:
	.string	"%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
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	num
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$602472125, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$9, %edx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$602472125, %rax, %rax
	shrq	$32, %rax
	sarl	$9, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$3650, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	setg	%al
	movzbl	%al, %eax
	addl	%esi, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	num
	.type	num, @function
num:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	js	.L142
	je	.L143
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edi, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subl	$3, %eax
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	%eax, 48(%rsp)
	movl	$0, 56(%rsp)
.L138:
	movl	48(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 44(%rsp)
	testl	%eax, %eax
	js	.L3
	je	.L144
	subl	$3, %eax
	movl	$0, 32(%rsp)
	movl	%eax, 28(%rsp)
.L62:
	movl	28(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 36(%rsp)
	testl	%eax, %eax
	js	.L5
	je	.L145
	subl	$3, %eax
	movl	$0, 24(%rsp)
	movl	%eax, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L32:
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 16(%rsp)
	testl	%eax, %eax
	js	.L7
	je	.L146
	leal	-3(%rax), %r15d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L9
	je	.L147
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L11:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r13d
	call	num
	addl	%eax, %r13d
	addl	%r13d, %r14d
	subl	$1, %ebp
	jne	.L11
	leal	1(%r14), %r13d
	cmpl	$-1, %ebx
	je	.L209
	testl	%ebx, %ebx
	je	.L210
.L10:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L16:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r14d
	subl	$1, %ebx
	jne	.L16
	leal	1(%r14,%r13), %eax
.L14:
	subl	$1, %r15d
	addl	%eax, %r12d
	cmpl	$-3, %r15d
	jne	.L18
	leal	1(%r12), %eax
	cmpl	$-1, 16(%rsp)
	movl	%eax, 20(%rsp)
	je	.L211
	movl	16(%rsp), %esi
	testl	%esi, %esi
	je	.L212
.L8:
	movl	12(%rsp), %eax
	xorl	%r13d, %r13d
	leal	-2(%rax), %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L150
	.p2align 4,,10
	.p2align 3
.L215:
	je	.L151
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L25:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebp
	jne	.L25
	leal	1(%r14), %ebp
	cmpl	$-1, %ebx
	je	.L26
.L216:
	testl	%ebx, %ebx
	je	.L213
.L24:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L28:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebx
	jne	.L28
	leal	1(%r14,%rbp), %eax
	addl	%eax, %r13d
	cmpl	$-2, %r15d
	je	.L214
.L29:
	subl	$1, %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	jns	.L215
.L150:
	xorl	%ebp, %ebp
	cmpl	$-1, %ebx
	jne	.L216
.L26:
	leal	1(%r13,%rbp), %eax
	addl	20(%rsp), %eax
.L21:
	addl	%eax, 24(%rsp)
	subl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	$-3, %eax
	jne	.L32
	movl	24(%rsp), %eax
	addl	$1, %eax
	cmpl	$-1, 36(%rsp)
	movl	%eax, 40(%rsp)
	je	.L217
	movl	36(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L218
.L6:
	movl	28(%rsp), %eax
	movl	$0, 24(%rsp)
	subl	$2, %eax
	movl	%eax, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	js	.L153
	.p2align 4,,10
	.p2align 3
.L226:
	je	.L154
	leal	-3(%rax), %r15d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L39
	je	.L155
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L41:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r13d
	call	num
	addl	%eax, %r13d
	addl	%r13d, %r14d
	subl	$1, %ebp
	jne	.L41
	leal	1(%r14), %r13d
	cmpl	$-1, %ebx
	je	.L219
	testl	%ebx, %ebx
	je	.L220
.L40:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L46:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r14d
	subl	$1, %ebx
	jne	.L46
	leal	1(%r14,%r13), %eax
.L44:
	subl	$1, %r15d
	addl	%eax, %r12d
	cmpl	$-3, %r15d
	jne	.L48
	leal	1(%r12), %eax
	movl	%eax, 20(%rsp)
	movl	16(%rsp), %eax
	cmpl	$-1, %eax
	je	.L49
.L227:
	testl	%eax, %eax
	je	.L221
.L38:
	movl	12(%rsp), %eax
	xorl	%r13d, %r13d
	leal	-2(%rax), %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L157
	.p2align 4,,10
	.p2align 3
.L223:
	je	.L158
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L53:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebp
	jne	.L53
	leal	1(%r14), %ebp
	cmpl	$-1, %ebx
	je	.L54
.L224:
	testl	%ebx, %ebx
	je	.L222
.L52:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L56:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebx
	jne	.L56
	leal	1(%r14,%rbp), %eax
	addl	%eax, %r13d
	cmpl	$-2, %r15d
	je	.L57
.L141:
	subl	$1, %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	jns	.L223
.L157:
	xorl	%ebp, %ebp
	cmpl	$-1, %ebx
	jne	.L224
.L54:
	addl	%ebp, %r13d
.L57:
	movl	20(%rsp), %eax
	leal	1(%r13,%rax), %eax
	addl	%eax, 24(%rsp)
	cmpl	$-2, 12(%rsp)
	je	.L225
.L59:
	subl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jns	.L226
.L153:
	movl	16(%rsp), %eax
	movl	$0, 20(%rsp)
	cmpl	$-1, %eax
	jne	.L227
.L49:
	movl	24(%rsp), %eax
	movl	20(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	addl	40(%rsp), %eax
.L35:
	addl	%eax, 32(%rsp)
	subl	$1, 28(%rsp)
	movl	28(%rsp), %eax
	cmpl	$-3, %eax
	jne	.L62
	movl	32(%rsp), %eax
	addl	$1, %eax
	cmpl	$-1, 44(%rsp)
	movl	%eax, 52(%rsp)
	je	.L228
	movl	44(%rsp), %edx
	testl	%edx, %edx
	je	.L229
.L4:
	movl	48(%rsp), %eax
	movl	$0, 44(%rsp)
	subl	$2, %eax
	movl	%eax, 40(%rsp)
	movl	40(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 60(%rsp)
	testl	%eax, %eax
	js	.L160
.L251:
	je	.L161
	subl	$3, %eax
	movl	$0, 36(%rsp)
	movl	%eax, 28(%rsp)
	.p2align 4,,10
	.p2align 3
.L108:
	movl	28(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	testl	%eax, %eax
	js	.L69
	je	.L162
	leal	-3(%rax), %r15d
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L80:
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L71
	je	.L163
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L73:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebp
	jne	.L73
	leal	1(%r14), %r12d
	cmpl	$-1, %ebx
	je	.L230
	testl	%ebx, %ebx
	je	.L231
.L72:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L78:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r14d
	subl	$1, %ebx
	jne	.L78
	leal	1(%r14,%r12), %eax
.L76:
	subl	$1, %r15d
	addl	%eax, %r13d
	cmpl	$-3, %r15d
	jne	.L80
	leal	1(%r13), %eax
	cmpl	$-1, 12(%rsp)
	movl	%eax, 32(%rsp)
	je	.L232
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L233
.L70:
	movl	28(%rsp), %eax
	movl	$0, 24(%rsp)
	subl	$2, %eax
	movl	%eax, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 16(%rsp)
	testl	%eax, %eax
	js	.L166
	.p2align 4,,10
	.p2align 3
.L239:
	je	.L167
	leal	-3(%rax), %r12d
	xorl	%r13d, %r13d
.L96:
	movl	%r12d, %r14d
	leal	1(%r12), %ebx
	testl	%r12d, %r12d
	js	.L87
	je	.L168
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L89:
	leal	-3(%r14), %edi
	call	num
	leal	-2(%r14), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r15d
	subl	$1, %r14d
	jne	.L89
	leal	1(%r15), %r14d
	cmpl	$-1, %ebx
	je	.L234
.L91:
	testl	%ebx, %ebx
	je	.L235
.L88:
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L94:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r15d
	subl	$1, %ebx
	jne	.L94
	leal	1(%r15,%r14), %eax
.L92:
	subl	$1, %r12d
	addl	%eax, %r13d
	cmpl	$-3, %r12d
	jne	.L96
	leal	1(%r13), %eax
	movl	%eax, 20(%rsp)
	movl	16(%rsp), %eax
	cmpl	$-1, %eax
	je	.L97
.L240:
	testl	%eax, %eax
	je	.L236
.L86:
	movl	12(%rsp), %eax
	xorl	%r13d, %r13d
	leal	-2(%rax), %r14d
	movl	%r14d, %ebp
	leal	1(%r14), %r15d
	testl	%r14d, %r14d
	js	.L99
	.p2align 4,,10
	.p2align 3
.L237:
	je	.L100
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L101:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %ebx
	call	num
	addl	%eax, %ebx
	addl	%ebx, %r12d
	subl	$1, %ebp
	jne	.L101
	movl	%r15d, %edi
	call	num
	leal	1(%r12,%rax), %eax
	addl	%eax, %r13d
.L102:
	subl	$1, %r14d
	movl	%r14d, %ebp
	leal	1(%r14), %r15d
	testl	%r14d, %r14d
	jns	.L237
.L99:
	movl	%r15d, %edi
	call	num
	addl	%eax, %r13d
	cmpl	$-2, %r14d
	jne	.L102
	movl	20(%rsp), %eax
	leal	1(%r13,%rax), %eax
	addl	%eax, 24(%rsp)
	cmpl	$-2, 12(%rsp)
	je	.L238
.L105:
	subl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 16(%rsp)
	testl	%eax, %eax
	jns	.L239
.L166:
	movl	16(%rsp), %eax
	movl	$0, 20(%rsp)
	cmpl	$-1, %eax
	jne	.L240
.L97:
	movl	24(%rsp), %eax
	movl	20(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	addl	32(%rsp), %eax
.L83:
	addl	%eax, 36(%rsp)
	subl	$1, 28(%rsp)
	movl	28(%rsp), %eax
	cmpl	$-3, %eax
	jne	.L108
	movl	36(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 28(%rsp)
	movl	60(%rsp), %eax
	cmpl	$-1, %eax
	je	.L109
.L252:
	testl	%eax, %eax
	je	.L241
.L68:
	movl	40(%rsp), %eax
	movl	$0, 24(%rsp)
	subl	$2, %eax
	movl	%eax, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 16(%rsp)
	testl	%eax, %eax
	js	.L170
	.p2align 4,,10
	.p2align 3
.L248:
	je	.L171
	leal	-3(%rax), %r15d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L122:
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L113
	je	.L172
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L115:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r13d
	call	num
	addl	%eax, %r13d
	addl	%r13d, %r14d
	subl	$1, %ebp
	jne	.L115
	leal	1(%r14), %r13d
	cmpl	$-1, %ebx
	je	.L242
	testl	%ebx, %ebx
	je	.L243
.L114:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L120:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r14d
	subl	$1, %ebx
	jne	.L120
	leal	1(%r14,%r13), %eax
.L118:
	subl	$1, %r15d
	addl	%eax, %r12d
	cmpl	$-3, %r15d
	jne	.L122
	leal	1(%r12), %eax
	movl	%eax, 20(%rsp)
	movl	16(%rsp), %eax
	cmpl	$-1, %eax
	je	.L123
.L249:
	testl	%eax, %eax
	je	.L244
.L112:
	movl	12(%rsp), %eax
	xorl	%r13d, %r13d
	leal	-2(%rax), %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L174
	.p2align 4,,10
	.p2align 3
.L246:
	je	.L175
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L127:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebp
	jne	.L127
	leal	1(%r14), %ebp
	cmpl	$-1, %ebx
	je	.L128
.L247:
	testl	%ebx, %ebx
	je	.L245
.L126:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L130:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebx
	jne	.L130
	leal	1(%r14,%rbp), %eax
	addl	%eax, %r13d
	cmpl	$-2, %r15d
	je	.L131
.L140:
	subl	$1, %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	jns	.L246
.L174:
	xorl	%ebp, %ebp
	cmpl	$-1, %ebx
	jne	.L247
.L128:
	addl	%ebp, %r13d
.L131:
	movl	20(%rsp), %eax
	leal	1(%r13,%rax), %eax
	addl	%eax, 24(%rsp)
	cmpl	$-2, 12(%rsp)
	je	.L133
.L139:
	subl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 16(%rsp)
	testl	%eax, %eax
	jns	.L248
.L170:
	movl	16(%rsp), %eax
	movl	$0, 20(%rsp)
	cmpl	$-1, %eax
	jne	.L249
.L123:
	movl	20(%rsp), %ecx
	addl	%ecx, 24(%rsp)
.L133:
	movl	24(%rsp), %eax
	movl	28(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	addl	%eax, 44(%rsp)
	cmpl	$-2, 40(%rsp)
	je	.L250
.L135:
	subl	$1, 40(%rsp)
	movl	40(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 60(%rsp)
	testl	%eax, %eax
	jns	.L251
.L160:
	movl	60(%rsp), %eax
	movl	$0, 28(%rsp)
	cmpl	$-1, %eax
	jne	.L252
.L109:
	movl	44(%rsp), %eax
	movl	28(%rsp), %esi
	leal	1(%rax,%rsi), %eax
	addl	52(%rsp), %eax
.L65:
	addl	%eax, 56(%rsp)
	subl	$1, 48(%rsp)
	movl	48(%rsp), %eax
	cmpl	$-3, %eax
	jne	.L138
	movl	56(%rsp), %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	addl	$1, %eax
	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
.L9:
	.cfi_restore_state
	cmpl	$-1, %ebx
	je	.L148
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	.L10
.L210:
	leal	1(%r12,%r13), %r12d
	subl	$1, %r15d
	jmp	.L18
.L7:
	cmpl	$-1, 16(%rsp)
	je	.L149
	movl	16(%rsp), %esi
	movl	$0, 20(%rsp)
	testl	%esi, %esi
	jne	.L8
.L212:
	movl	24(%rsp), %eax
	movl	20(%rsp), %ecx
	subl	$1, 12(%rsp)
	leal	1(%rax,%rcx), %eax
	movl	%eax, 24(%rsp)
	jmp	.L32
.L39:
	cmpl	$-1, %ebx
	je	.L156
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	.L40
.L220:
	leal	1(%r12,%r13), %r12d
	subl	$1, %r15d
	jmp	.L48
.L155:
	movl	$1, %r13d
	jmp	.L40
.L222:
	leal	1(%r13,%rbp), %r13d
	jmp	.L141
.L158:
	movl	$1, %ebp
	jmp	.L52
.L151:
	movl	$1, %ebp
	jmp	.L24
.L213:
	leal	1(%r13,%rbp), %r13d
	jmp	.L29
.L147:
	movl	$1, %r13d
	jmp	.L10
.L148:
	xorl	%eax, %eax
	jmp	.L14
.L156:
	xorl	%eax, %eax
	jmp	.L44
.L219:
	addl	%r13d, %r12d
	subl	$1, %r15d
	jmp	.L48
.L209:
	addl	%r13d, %r12d
	subl	$1, %r15d
	jmp	.L18
.L5:
	cmpl	$-1, 36(%rsp)
	je	.L152
	movl	36(%rsp), %ecx
	movl	$0, 40(%rsp)
	testl	%ecx, %ecx
	jne	.L6
.L218:
	movl	32(%rsp), %eax
	movl	40(%rsp), %esi
	subl	$1, 28(%rsp)
	leal	1(%rax,%rsi), %eax
	movl	%eax, 32(%rsp)
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L87:
	cmpl	$-1, %ebx
	jne	.L253
	xorl	%eax, %eax
	jmp	.L92
.L71:
	cmpl	$-1, %ebx
	je	.L164
	xorl	%r12d, %r12d
	testl	%ebx, %ebx
	jne	.L72
.L231:
	leal	1(%r13,%r12), %r13d
	subl	$1, %r15d
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L235:
	leal	1(%r13,%r14), %r13d
	subl	$1, %r12d
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L100:
	movl	%r15d, %edi
	call	num
	leal	1(%r13,%rax), %r13d
	jmp	.L102
	.p2align 4,,10
	.p2align 3
.L168:
	movl	$1, %r14d
	jmp	.L88
.L69:
	cmpl	$-1, 12(%rsp)
	je	.L165
	movl	12(%rsp), %eax
	movl	$0, 32(%rsp)
	testl	%eax, %eax
	jne	.L70
.L233:
	movl	36(%rsp), %eax
	movl	32(%rsp), %esi
	subl	$1, 28(%rsp)
	leal	1(%rax,%rsi), %eax
	movl	%eax, 36(%rsp)
	jmp	.L108
.L113:
	cmpl	$-1, %ebx
	je	.L173
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	.L114
.L243:
	leal	1(%r12,%r13), %r12d
	subl	$1, %r15d
	jmp	.L122
.L245:
	leal	1(%r13,%rbp), %r13d
	jmp	.L140
.L175:
	movl	$1, %ebp
	jmp	.L126
.L167:
	movl	$1, 20(%rsp)
	jmp	.L86
.L236:
	movl	24(%rsp), %eax
	movl	20(%rsp), %ecx
	leal	1(%rax,%rcx), %eax
	movl	%eax, 24(%rsp)
	jmp	.L105
.L172:
	movl	$1, %r13d
	jmp	.L114
.L163:
	movl	$1, %r12d
	jmp	.L72
.L234:
	addl	%r14d, %r13d
	subl	$1, %r12d
	jmp	.L96
.L164:
	xorl	%eax, %eax
	jmp	.L76
.L173:
	xorl	%eax, %eax
	jmp	.L118
.L242:
	addl	%r13d, %r12d
	subl	$1, %r15d
	jmp	.L122
.L230:
	addl	%r12d, %r13d
	subl	$1, %r15d
	jmp	.L80
.L154:
	movl	$1, 20(%rsp)
	jmp	.L38
.L244:
	movl	24(%rsp), %eax
	movl	20(%rsp), %esi
	leal	1(%rax,%rsi), %eax
	movl	%eax, 24(%rsp)
	jmp	.L139
.L171:
	movl	$1, 20(%rsp)
	jmp	.L112
.L146:
	movl	$1, 20(%rsp)
	jmp	.L8
.L162:
	movl	$1, 32(%rsp)
	jmp	.L70
.L221:
	movl	24(%rsp), %eax
	movl	20(%rsp), %ecx
	leal	1(%rax,%rcx), %eax
	movl	%eax, 24(%rsp)
	jmp	.L59
.L165:
	xorl	%eax, %eax
	jmp	.L83
.L149:
	xorl	%eax, %eax
	jmp	.L21
.L232:
	addl	%eax, 36(%rsp)
	subl	$1, 28(%rsp)
	jmp	.L108
.L211:
	addl	%eax, 24(%rsp)
	subl	$1, 12(%rsp)
	jmp	.L32
.L3:
	cmpl	$-1, 44(%rsp)
	je	.L159
	movl	44(%rsp), %edx
	movl	$0, 52(%rsp)
	testl	%edx, %edx
	jne	.L4
.L229:
	movl	56(%rsp), %eax
	movl	52(%rsp), %ecx
	subl	$1, 48(%rsp)
	leal	1(%rax,%rcx), %eax
	movl	%eax, 56(%rsp)
	jmp	.L138
.L145:
	movl	$1, 40(%rsp)
	jmp	.L6
.L161:
	movl	$1, 28(%rsp)
	jmp	.L68
.L241:
	movl	44(%rsp), %eax
	movl	28(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	movl	%eax, 44(%rsp)
	jmp	.L135
.L152:
	xorl	%eax, %eax
	jmp	.L35
.L217:
	addl	%eax, 32(%rsp)
	subl	$1, 28(%rsp)
	jmp	.L62
.L159:
	xorl	%eax, %eax
	jmp	.L65
.L144:
	movl	$1, 52(%rsp)
	jmp	.L4
.L228:
	addl	%eax, 56(%rsp)
	subl	$1, 48(%rsp)
	jmp	.L138
.L142:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%eax, %eax
	ret
.L143:
	movl	$1, %eax
	ret
.L238:
	.cfi_def_cfa_offset 128
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	24(%rsp), %eax
	movl	32(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	jmp	.L83
.L214:
	movl	20(%rsp), %eax
	leal	1(%r13,%rax), %eax
	jmp	.L21
.L253:
	xorl	%r14d, %r14d
	jmp	.L91
.L225:
	movl	24(%rsp), %eax
	movl	40(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	jmp	.L35
.L250:
	movl	44(%rsp), %eax
	movl	52(%rsp), %ecx
	leal	1(%rax,%rcx), %eax
	jmp	.L65
	.cfi_endproc
.LFE23:
	.size	num, .-num
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L255:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L263
	js	.L260
	subl	$3, %r8d
	xorl	%r10d, %r10d
.L257:
	movl	%r8d, %edi
	call	num
	leal	1(%r8), %edi
	subl	$1, %r8d
	movl	%eax, %r9d
	call	num
	addl	%eax, %r9d
	addl	%r9d, %r10d
	cmpl	$-3, %r8d
	jne	.L257
	addl	$1, %r10d
	movslq	%r10d, %rax
	movl	%r10d, %edx
	imulq	$602472125, %rax, %rax
	sarl	$31, %edx
	sarq	$41, %rax
	subl	%edx, %eax
	imull	$3650, %eax, %edx
	subl	%edx, %r10d
	xorl	%edx, %edx
	testl	%r10d, %r10d
	setg	%dl
	addl	%eax, %edx
.L256:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L255
	.p2align 4,,10
	.p2align 3
.L263:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L264
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L260:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L256
.L264:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	num
	.type	num, @function
num:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	js	.L142
	je	.L143
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%edi, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subl	$3, %eax
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movl	%eax, 48(%rsp)
	movl	$0, 56(%rsp)
.L138:
	movl	48(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 44(%rsp)
	testl	%eax, %eax
	js	.L3
	je	.L144
	subl	$3, %eax
	movl	$0, 32(%rsp)
	movl	%eax, 28(%rsp)
.L62:
	movl	28(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 36(%rsp)
	testl	%eax, %eax
	js	.L5
	je	.L145
	subl	$3, %eax
	movl	$0, 24(%rsp)
	movl	%eax, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L32:
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 16(%rsp)
	testl	%eax, %eax
	js	.L7
	je	.L146
	leal	-3(%rax), %r15d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L9
	je	.L147
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L11:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r13d
	call	num
	addl	%eax, %r13d
	addl	%r13d, %r14d
	subl	$1, %ebp
	jne	.L11
	leal	1(%r14), %r13d
	cmpl	$-1, %ebx
	je	.L209
	testl	%ebx, %ebx
	je	.L210
.L10:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L16:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r14d
	subl	$1, %ebx
	jne	.L16
	leal	1(%r14,%r13), %eax
.L14:
	subl	$1, %r15d
	addl	%eax, %r12d
	cmpl	$-3, %r15d
	jne	.L18
	leal	1(%r12), %eax
	cmpl	$-1, 16(%rsp)
	movl	%eax, 20(%rsp)
	je	.L211
	movl	16(%rsp), %esi
	testl	%esi, %esi
	je	.L212
.L8:
	movl	12(%rsp), %eax
	xorl	%r13d, %r13d
	leal	-2(%rax), %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L150
	.p2align 4,,10
	.p2align 3
.L215:
	je	.L151
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L25:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebp
	jne	.L25
	leal	1(%r14), %ebp
	cmpl	$-1, %ebx
	je	.L26
.L216:
	testl	%ebx, %ebx
	je	.L213
.L24:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L28:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebx
	jne	.L28
	leal	1(%r14,%rbp), %eax
	addl	%eax, %r13d
	cmpl	$-2, %r15d
	je	.L214
.L29:
	subl	$1, %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	jns	.L215
.L150:
	xorl	%ebp, %ebp
	cmpl	$-1, %ebx
	jne	.L216
.L26:
	leal	1(%r13,%rbp), %eax
	addl	20(%rsp), %eax
.L21:
	addl	%eax, 24(%rsp)
	subl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	cmpl	$-3, %eax
	jne	.L32
	movl	24(%rsp), %eax
	addl	$1, %eax
	cmpl	$-1, 36(%rsp)
	movl	%eax, 40(%rsp)
	je	.L217
	movl	36(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L218
.L6:
	movl	28(%rsp), %eax
	movl	$0, 24(%rsp)
	subl	$2, %eax
	movl	%eax, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	js	.L153
	.p2align 4,,10
	.p2align 3
.L226:
	je	.L154
	leal	-3(%rax), %r15d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L39
	je	.L155
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L41:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r13d
	call	num
	addl	%eax, %r13d
	addl	%r13d, %r14d
	subl	$1, %ebp
	jne	.L41
	leal	1(%r14), %r13d
	cmpl	$-1, %ebx
	je	.L219
	testl	%ebx, %ebx
	je	.L220
.L40:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L46:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r14d
	subl	$1, %ebx
	jne	.L46
	leal	1(%r14,%r13), %eax
.L44:
	subl	$1, %r15d
	addl	%eax, %r12d
	cmpl	$-3, %r15d
	jne	.L48
	leal	1(%r12), %eax
	movl	%eax, 20(%rsp)
	movl	16(%rsp), %eax
	cmpl	$-1, %eax
	je	.L49
.L227:
	testl	%eax, %eax
	je	.L221
.L38:
	movl	12(%rsp), %eax
	xorl	%r13d, %r13d
	leal	-2(%rax), %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L157
	.p2align 4,,10
	.p2align 3
.L223:
	je	.L158
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L53:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebp
	jne	.L53
	leal	1(%r14), %ebp
	cmpl	$-1, %ebx
	je	.L54
.L224:
	testl	%ebx, %ebx
	je	.L222
.L52:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L56:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebx
	jne	.L56
	leal	1(%r14,%rbp), %eax
	addl	%eax, %r13d
	cmpl	$-2, %r15d
	je	.L57
.L141:
	subl	$1, %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	jns	.L223
.L157:
	xorl	%ebp, %ebp
	cmpl	$-1, %ebx
	jne	.L224
.L54:
	addl	%ebp, %r13d
.L57:
	movl	20(%rsp), %eax
	leal	1(%r13,%rax), %eax
	addl	%eax, 24(%rsp)
	cmpl	$-2, 12(%rsp)
	je	.L225
.L59:
	subl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	jns	.L226
.L153:
	movl	16(%rsp), %eax
	movl	$0, 20(%rsp)
	cmpl	$-1, %eax
	jne	.L227
.L49:
	movl	24(%rsp), %eax
	movl	20(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	addl	40(%rsp), %eax
.L35:
	addl	%eax, 32(%rsp)
	subl	$1, 28(%rsp)
	movl	28(%rsp), %eax
	cmpl	$-3, %eax
	jne	.L62
	movl	32(%rsp), %eax
	addl	$1, %eax
	cmpl	$-1, 44(%rsp)
	movl	%eax, 52(%rsp)
	je	.L228
	movl	44(%rsp), %edx
	testl	%edx, %edx
	je	.L229
.L4:
	movl	48(%rsp), %eax
	movl	$0, 44(%rsp)
	subl	$2, %eax
	movl	%eax, 40(%rsp)
	movl	40(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 60(%rsp)
	testl	%eax, %eax
	js	.L160
.L251:
	je	.L161
	subl	$3, %eax
	movl	$0, 36(%rsp)
	movl	%eax, 28(%rsp)
	.p2align 4,,10
	.p2align 3
.L108:
	movl	28(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	testl	%eax, %eax
	js	.L69
	je	.L162
	leal	-3(%rax), %r15d
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L80:
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L71
	je	.L163
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L73:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebp
	jne	.L73
	leal	1(%r14), %r12d
	cmpl	$-1, %ebx
	je	.L230
	testl	%ebx, %ebx
	je	.L231
.L72:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L78:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r14d
	subl	$1, %ebx
	jne	.L78
	leal	1(%r14,%r12), %eax
.L76:
	subl	$1, %r15d
	addl	%eax, %r13d
	cmpl	$-3, %r15d
	jne	.L80
	leal	1(%r13), %eax
	cmpl	$-1, 12(%rsp)
	movl	%eax, 32(%rsp)
	je	.L232
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L233
.L70:
	movl	28(%rsp), %eax
	movl	$0, 24(%rsp)
	subl	$2, %eax
	movl	%eax, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 16(%rsp)
	testl	%eax, %eax
	js	.L166
	.p2align 4,,10
	.p2align 3
.L239:
	je	.L167
	leal	-3(%rax), %r12d
	xorl	%r13d, %r13d
.L96:
	movl	%r12d, %r14d
	leal	1(%r12), %ebx
	testl	%r12d, %r12d
	js	.L87
	je	.L168
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L89:
	leal	-3(%r14), %edi
	call	num
	leal	-2(%r14), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r15d
	subl	$1, %r14d
	jne	.L89
	leal	1(%r15), %r14d
	cmpl	$-1, %ebx
	je	.L234
.L91:
	testl	%ebx, %ebx
	je	.L235
.L88:
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L94:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r15d
	subl	$1, %ebx
	jne	.L94
	leal	1(%r15,%r14), %eax
.L92:
	subl	$1, %r12d
	addl	%eax, %r13d
	cmpl	$-3, %r12d
	jne	.L96
	leal	1(%r13), %eax
	movl	%eax, 20(%rsp)
	movl	16(%rsp), %eax
	cmpl	$-1, %eax
	je	.L97
.L240:
	testl	%eax, %eax
	je	.L236
.L86:
	movl	12(%rsp), %eax
	xorl	%r13d, %r13d
	leal	-2(%rax), %r14d
	movl	%r14d, %ebp
	leal	1(%r14), %r15d
	testl	%r14d, %r14d
	js	.L99
	.p2align 4,,10
	.p2align 3
.L237:
	je	.L100
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L101:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %ebx
	call	num
	addl	%eax, %ebx
	addl	%ebx, %r12d
	subl	$1, %ebp
	jne	.L101
	movl	%r15d, %edi
	call	num
	leal	1(%r12,%rax), %eax
	addl	%eax, %r13d
.L102:
	subl	$1, %r14d
	movl	%r14d, %ebp
	leal	1(%r14), %r15d
	testl	%r14d, %r14d
	jns	.L237
.L99:
	movl	%r15d, %edi
	call	num
	addl	%eax, %r13d
	cmpl	$-2, %r14d
	jne	.L102
	movl	20(%rsp), %eax
	leal	1(%r13,%rax), %eax
	addl	%eax, 24(%rsp)
	cmpl	$-2, 12(%rsp)
	je	.L238
.L105:
	subl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 16(%rsp)
	testl	%eax, %eax
	jns	.L239
.L166:
	movl	16(%rsp), %eax
	movl	$0, 20(%rsp)
	cmpl	$-1, %eax
	jne	.L240
.L97:
	movl	24(%rsp), %eax
	movl	20(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	addl	32(%rsp), %eax
.L83:
	addl	%eax, 36(%rsp)
	subl	$1, 28(%rsp)
	movl	28(%rsp), %eax
	cmpl	$-3, %eax
	jne	.L108
	movl	36(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 28(%rsp)
	movl	60(%rsp), %eax
	cmpl	$-1, %eax
	je	.L109
.L252:
	testl	%eax, %eax
	je	.L241
.L68:
	movl	40(%rsp), %eax
	movl	$0, 24(%rsp)
	subl	$2, %eax
	movl	%eax, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 16(%rsp)
	testl	%eax, %eax
	js	.L170
	.p2align 4,,10
	.p2align 3
.L248:
	je	.L171
	leal	-3(%rax), %r15d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L122:
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L113
	je	.L172
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L115:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r13d
	call	num
	addl	%eax, %r13d
	addl	%r13d, %r14d
	subl	$1, %ebp
	jne	.L115
	leal	1(%r14), %r13d
	cmpl	$-1, %ebx
	je	.L242
	testl	%ebx, %ebx
	je	.L243
.L114:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L120:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %ebp
	call	num
	addl	%eax, %ebp
	addl	%ebp, %r14d
	subl	$1, %ebx
	jne	.L120
	leal	1(%r14,%r13), %eax
.L118:
	subl	$1, %r15d
	addl	%eax, %r12d
	cmpl	$-3, %r15d
	jne	.L122
	leal	1(%r12), %eax
	movl	%eax, 20(%rsp)
	movl	16(%rsp), %eax
	cmpl	$-1, %eax
	je	.L123
.L249:
	testl	%eax, %eax
	je	.L244
.L112:
	movl	12(%rsp), %eax
	xorl	%r13d, %r13d
	leal	-2(%rax), %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	js	.L174
	.p2align 4,,10
	.p2align 3
.L246:
	je	.L175
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L127:
	leal	-3(%rbp), %edi
	call	num
	leal	-2(%rbp), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebp
	jne	.L127
	leal	1(%r14), %ebp
	cmpl	$-1, %ebx
	je	.L128
.L247:
	testl	%ebx, %ebx
	je	.L245
.L126:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L130:
	leal	-3(%rbx), %edi
	call	num
	leal	-2(%rbx), %edi
	movl	%eax, %r12d
	call	num
	addl	%eax, %r12d
	addl	%r12d, %r14d
	subl	$1, %ebx
	jne	.L130
	leal	1(%r14,%rbp), %eax
	addl	%eax, %r13d
	cmpl	$-2, %r15d
	je	.L131
.L140:
	subl	$1, %r15d
	movl	%r15d, %ebp
	leal	1(%r15), %ebx
	testl	%r15d, %r15d
	jns	.L246
.L174:
	xorl	%ebp, %ebp
	cmpl	$-1, %ebx
	jne	.L247
.L128:
	addl	%ebp, %r13d
.L131:
	movl	20(%rsp), %eax
	leal	1(%r13,%rax), %eax
	addl	%eax, 24(%rsp)
	cmpl	$-2, 12(%rsp)
	je	.L133
.L139:
	subl	$1, 12(%rsp)
	movl	12(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 16(%rsp)
	testl	%eax, %eax
	jns	.L248
.L170:
	movl	16(%rsp), %eax
	movl	$0, 20(%rsp)
	cmpl	$-1, %eax
	jne	.L249
.L123:
	movl	20(%rsp), %ecx
	addl	%ecx, 24(%rsp)
.L133:
	movl	24(%rsp), %eax
	movl	28(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	addl	%eax, 44(%rsp)
	cmpl	$-2, 40(%rsp)
	je	.L250
.L135:
	subl	$1, 40(%rsp)
	movl	40(%rsp), %eax
	leal	1(%rax), %esi
	movl	%esi, 60(%rsp)
	testl	%eax, %eax
	jns	.L251
.L160:
	movl	60(%rsp), %eax
	movl	$0, 28(%rsp)
	cmpl	$-1, %eax
	jne	.L252
.L109:
	movl	44(%rsp), %eax
	movl	28(%rsp), %esi
	leal	1(%rax,%rsi), %eax
	addl	52(%rsp), %eax
.L65:
	addl	%eax, 56(%rsp)
	subl	$1, 48(%rsp)
	movl	48(%rsp), %eax
	cmpl	$-3, %eax
	jne	.L138
	movl	56(%rsp), %eax
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	addl	$1, %eax
	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
.L9:
	.cfi_restore_state
	cmpl	$-1, %ebx
	je	.L148
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	.L10
.L210:
	leal	1(%r12,%r13), %r12d
	subl	$1, %r15d
	jmp	.L18
.L7:
	cmpl	$-1, 16(%rsp)
	je	.L149
	movl	16(%rsp), %esi
	movl	$0, 20(%rsp)
	testl	%esi, %esi
	jne	.L8
.L212:
	movl	24(%rsp), %eax
	movl	20(%rsp), %ecx
	subl	$1, 12(%rsp)
	leal	1(%rax,%rcx), %eax
	movl	%eax, 24(%rsp)
	jmp	.L32
.L39:
	cmpl	$-1, %ebx
	je	.L156
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	.L40
.L220:
	leal	1(%r12,%r13), %r12d
	subl	$1, %r15d
	jmp	.L48
.L155:
	movl	$1, %r13d
	jmp	.L40
.L222:
	leal	1(%r13,%rbp), %r13d
	jmp	.L141
.L158:
	movl	$1, %ebp
	jmp	.L52
.L151:
	movl	$1, %ebp
	jmp	.L24
.L213:
	leal	1(%r13,%rbp), %r13d
	jmp	.L29
.L147:
	movl	$1, %r13d
	jmp	.L10
.L148:
	xorl	%eax, %eax
	jmp	.L14
.L156:
	xorl	%eax, %eax
	jmp	.L44
.L219:
	addl	%r13d, %r12d
	subl	$1, %r15d
	jmp	.L48
.L209:
	addl	%r13d, %r12d
	subl	$1, %r15d
	jmp	.L18
.L5:
	cmpl	$-1, 36(%rsp)
	je	.L152
	movl	36(%rsp), %ecx
	movl	$0, 40(%rsp)
	testl	%ecx, %ecx
	jne	.L6
.L218:
	movl	32(%rsp), %eax
	movl	40(%rsp), %esi
	subl	$1, 28(%rsp)
	leal	1(%rax,%rsi), %eax
	movl	%eax, 32(%rsp)
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L87:
	cmpl	$-1, %ebx
	jne	.L253
	xorl	%eax, %eax
	jmp	.L92
.L71:
	cmpl	$-1, %ebx
	je	.L164
	xorl	%r12d, %r12d
	testl	%ebx, %ebx
	jne	.L72
.L231:
	leal	1(%r13,%r12), %r13d
	subl	$1, %r15d
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L235:
	leal	1(%r13,%r14), %r13d
	subl	$1, %r12d
	jmp	.L96
	.p2align 4,,10
	.p2align 3
.L100:
	movl	%r15d, %edi
	call	num
	leal	1(%r13,%rax), %r13d
	jmp	.L102
	.p2align 4,,10
	.p2align 3
.L168:
	movl	$1, %r14d
	jmp	.L88
.L69:
	cmpl	$-1, 12(%rsp)
	je	.L165
	movl	12(%rsp), %eax
	movl	$0, 32(%rsp)
	testl	%eax, %eax
	jne	.L70
.L233:
	movl	36(%rsp), %eax
	movl	32(%rsp), %esi
	subl	$1, 28(%rsp)
	leal	1(%rax,%rsi), %eax
	movl	%eax, 36(%rsp)
	jmp	.L108
.L113:
	cmpl	$-1, %ebx
	je	.L173
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	.L114
.L243:
	leal	1(%r12,%r13), %r12d
	subl	$1, %r15d
	jmp	.L122
.L245:
	leal	1(%r13,%rbp), %r13d
	jmp	.L140
.L175:
	movl	$1, %ebp
	jmp	.L126
.L167:
	movl	$1, 20(%rsp)
	jmp	.L86
.L236:
	movl	24(%rsp), %eax
	movl	20(%rsp), %ecx
	leal	1(%rax,%rcx), %eax
	movl	%eax, 24(%rsp)
	jmp	.L105
.L172:
	movl	$1, %r13d
	jmp	.L114
.L163:
	movl	$1, %r12d
	jmp	.L72
.L234:
	addl	%r14d, %r13d
	subl	$1, %r12d
	jmp	.L96
.L164:
	xorl	%eax, %eax
	jmp	.L76
.L173:
	xorl	%eax, %eax
	jmp	.L118
.L242:
	addl	%r13d, %r12d
	subl	$1, %r15d
	jmp	.L122
.L230:
	addl	%r12d, %r13d
	subl	$1, %r15d
	jmp	.L80
.L154:
	movl	$1, 20(%rsp)
	jmp	.L38
.L244:
	movl	24(%rsp), %eax
	movl	20(%rsp), %esi
	leal	1(%rax,%rsi), %eax
	movl	%eax, 24(%rsp)
	jmp	.L139
.L171:
	movl	$1, 20(%rsp)
	jmp	.L112
.L146:
	movl	$1, 20(%rsp)
	jmp	.L8
.L162:
	movl	$1, 32(%rsp)
	jmp	.L70
.L221:
	movl	24(%rsp), %eax
	movl	20(%rsp), %ecx
	leal	1(%rax,%rcx), %eax
	movl	%eax, 24(%rsp)
	jmp	.L59
.L165:
	xorl	%eax, %eax
	jmp	.L83
.L149:
	xorl	%eax, %eax
	jmp	.L21
.L232:
	addl	%eax, 36(%rsp)
	subl	$1, 28(%rsp)
	jmp	.L108
.L211:
	addl	%eax, 24(%rsp)
	subl	$1, 12(%rsp)
	jmp	.L32
.L3:
	cmpl	$-1, 44(%rsp)
	je	.L159
	movl	44(%rsp), %edx
	movl	$0, 52(%rsp)
	testl	%edx, %edx
	jne	.L4
.L229:
	movl	56(%rsp), %eax
	movl	52(%rsp), %ecx
	subl	$1, 48(%rsp)
	leal	1(%rax,%rcx), %eax
	movl	%eax, 56(%rsp)
	jmp	.L138
.L145:
	movl	$1, 40(%rsp)
	jmp	.L6
.L161:
	movl	$1, 28(%rsp)
	jmp	.L68
.L241:
	movl	44(%rsp), %eax
	movl	28(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	movl	%eax, 44(%rsp)
	jmp	.L135
.L152:
	xorl	%eax, %eax
	jmp	.L35
.L217:
	addl	%eax, 32(%rsp)
	subl	$1, 28(%rsp)
	jmp	.L62
.L159:
	xorl	%eax, %eax
	jmp	.L65
.L144:
	movl	$1, 52(%rsp)
	jmp	.L4
.L228:
	addl	%eax, 56(%rsp)
	subl	$1, 48(%rsp)
	jmp	.L138
.L142:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%eax, %eax
	ret
.L143:
	movl	$1, %eax
	ret
.L238:
	.cfi_def_cfa_offset 128
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	24(%rsp), %eax
	movl	32(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	jmp	.L83
.L214:
	movl	20(%rsp), %eax
	leal	1(%r13,%rax), %eax
	jmp	.L21
.L253:
	xorl	%r14d, %r14d
	jmp	.L91
.L225:
	movl	24(%rsp), %eax
	movl	40(%rsp), %edx
	leal	1(%rax,%rdx), %eax
	jmp	.L35
.L250:
	movl	44(%rsp), %eax
	movl	52(%rsp), %ecx
	leal	1(%rax,%rcx), %eax
	jmp	.L65
	.cfi_endproc
.LFE23:
	.size	num, .-num
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L255:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L263
	js	.L260
	subl	$3, %r8d
	xorl	%r10d, %r10d
.L257:
	movl	%r8d, %edi
	call	num
	leal	1(%r8), %edi
	subl	$1, %r8d
	movl	%eax, %r9d
	call	num
	addl	%eax, %r9d
	addl	%r9d, %r10d
	cmpl	$-3, %r8d
	jne	.L257
	addl	$1, %r10d
	movslq	%r10d, %rax
	movl	%r10d, %edx
	imulq	$602472125, %rax, %rax
	sarl	$31, %edx
	sarq	$41, %rax
	subl	%edx, %eax
	imull	$3650, %eax, %edx
	subl	%edx, %r10d
	xorl	%edx, %edx
	testl	%r10d, %r10d
	setg	%dl
	addl	%eax, %edx
.L256:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L255
	.p2align 4,,10
	.p2align 3
.L263:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L264
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L260:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L256
.L264:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

#include <stdio.h>

int num(int n)
{
	int cnt;
	
	if (n < 0){
		return (0);
	}
	if (n == 0){
		return (1);
	}
	
	cnt = (num(n - 3) + num(n - 2) + num(n - 1));
	
	return (cnt);
}

int main(void)
{
	int n, m;
	
	while (scanf("%d", &n), n != 0){
		m = num(n);
		m = m / 3650 + (m % 3650 > 0);
		
		printf("%d\n", m);
	}
	
	return (0);
}
1
10
14
25
0
 1
10
14
23
0
 1
10
14
6
0
 1
1
20
25
0
 1
10
14
24
0
 1
10
0
25
0
 1
19
14
5
0
 1
18
0
25
0
 1
18
1
25
0
 1
0
14
6
0

1
1
1
701
 1
1
1
207
 1
1
1
1
 1
1
34
701
 1
1
1
381
 1
1
 1
19
1
1
 1
10
 1
10
1
701
 1

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>

int num(int n)
{
	int cnt;
	
	if (n < 0){
		return (0);
	}
	if (n == 0){
		return (1);
	}
	
	cnt = (num(n - 3) + num(n - 2) + num(n - 1));
	
	return (cnt);
}

int main(void)
{
	int n, m;
	
	while (scanf("%d", &n), n != 0){
		m = num(n);
		m = m / 3650 + (m % 3650 > 0);
		
		printf("%d\n", m);
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	num
	.type	num, @function
num:
.LFB0:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jns	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	cmpl	$0, -36(%rbp)
	jne	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	-36(%rbp), %eax
	subl	$3, %eax
	movl	%eax, %edi
	call	num
	movl	%eax, %ebx
	movl	-36(%rbp), %eax
	subl	$2, %eax
	movl	%eax, %edi
	call	num
	addl	%eax, %ebx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	num
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	num, .-num
	.section	.rodata
.LC0:
	.string	"%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
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	num
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$602472125, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$9, %edx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$602472125, %rax, %rax
	shrq	$32, %rax
	sarl	$9, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$3650, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	setg	%al
	movzbl	%al, %eax
	addl	%esi, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	num
	.type	num, @function
num:
.LFB0:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jns	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	cmpl	$0, -36(%rbp)
	jne	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	-36(%rbp), %eax
	subl	$3, %eax
	movl	%eax, %edi
	call	num
	movl	%eax, %ebx
	movl	-36(%rbp), %eax
	subl	$2, %eax
	movl	%eax, %edi
	call	num
	addl	%eax, %ebx
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	num
	addl	%ebx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
.L3:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	num, .-num
	.section	.rodata
.LC0:
	.string	"%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
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	num
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$602472125, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$9, %edx
	sarl	$31, %eax
	movl	%edx, %esi
	subl	%eax, %esi
	movl	-12(%rbp), %edx
	movslq	%edx, %rax
	imulq	$602472125, %rax, %rax
	shrq	$32, %rax
	sarl	$9, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$3650, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	setg	%al
	movzbl	%al, %eax
	addl	%esi, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
