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 main(void) {
	int patern[30] = {1,2,4};
	int i,n,p=0,year = 0;

	for (i = 3; i < 30; i++) 
		patern[i] = patern[i - 1] + patern[i - 2] + patern[i - 3];

	while (1) {
		scanf("%d", &n);
		if (n == 0)break;
		if (patern[n - 1] % 10 == 0)
			p = patern[n - 1] / 10;
		else
			p = (patern[n - 1] / 10) + 1;
		year = p / 365;
		if (p%365==0) 
			printf("%d\n",year);
		else
			printf("%d\n", year+1);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-128(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -128(%rbp)
	movl	$2, -124(%rbp)
	movl	$4, -120(%rbp)
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$3, -140(%rbp)
	jmp	.L2
.L3:
	movl	-140(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-140(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-140(%rbp), %eax
	subl	$3, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-140(%rbp), %eax
	cltq
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -140(%rbp)
.L2:
	cmpl	$29, -140(%rbp)
	jle	.L3
.L10:
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	testl	%eax, %eax
	je	.L14
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L6
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -136(%rbp)
	jmp	.L7
.L6:
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	$1, %eax
	movl	%eax, -136(%rbp)
.L7:
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1282606671, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$8, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -132(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1282606671, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$8, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$365, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L8
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L8:
	movl	-132(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC8:
	.string	"%d"
.LC9:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC9(%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	.LC8(%rip), %rbx
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	.LC7(%rip), %rax
	leaq	12(%rsp), %rbp
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movq	%rax, 128(%rsp)
	movaps	%xmm0, 32(%rsp)
	movdqa	.LC2(%rip), %xmm0
	movaps	%xmm0, 48(%rsp)
	movdqa	.LC3(%rip), %xmm0
	movaps	%xmm0, 64(%rsp)
	movdqa	.LC4(%rip), %xmm0
	movaps	%xmm0, 80(%rsp)
	movdqa	.LC5(%rip), %xmm0
	movaps	%xmm0, 96(%rsp)
	movdqa	.LC6(%rip), %xmm0
	movaps	%xmm0, 112(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	subl	$1, %eax
	cltq
	movslq	16(%rsp,%rax,4), %rax
	movq	%rax, %rdx
	imulq	$1717986919, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	cmpl	$1, %edx
	sbbl	$-1, %eax
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$-1282606671, %rdx, %rdx
	sarl	$31, %ecx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$8, %edx
	subl	%ecx, %edx
	imull	$365, %edx, %ecx
	cmpl	%ecx, %eax
	je	.L11
	addl	$1, %edx
.L11:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jne	.L13
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$144, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	4
	.long	7
	.align 16
.LC1:
	.long	13
	.long	24
	.long	44
	.long	81
	.align 16
.LC2:
	.long	149
	.long	274
	.long	504
	.long	927
	.align 16
.LC3:
	.long	1705
	.long	3136
	.long	5768
	.long	10609
	.align 16
.LC4:
	.long	19513
	.long	35890
	.long	66012
	.long	121415
	.align 16
.LC5:
	.long	223317
	.long	410744
	.long	755476
	.long	1389537
	.align 16
.LC6:
	.long	2555757
	.long	4700770
	.long	8646064
	.long	15902591
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC7:
	.long	29249425
	.long	53798080
	.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
.LC8:
	.string	"%d"
.LC9:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC9(%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	.LC8(%rip), %rbx
	subq	$144, %rsp
	.cfi_def_cfa_offset 176
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	movq	.LC7(%rip), %rax
	leaq	12(%rsp), %rbp
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movq	%rax, 128(%rsp)
	movaps	%xmm0, 32(%rsp)
	movdqa	.LC2(%rip), %xmm0
	movaps	%xmm0, 48(%rsp)
	movdqa	.LC3(%rip), %xmm0
	movaps	%xmm0, 64(%rsp)
	movdqa	.LC4(%rip), %xmm0
	movaps	%xmm0, 80(%rsp)
	movdqa	.LC5(%rip), %xmm0
	movaps	%xmm0, 96(%rsp)
	movdqa	.LC6(%rip), %xmm0
	movaps	%xmm0, 112(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	subl	$1, %eax
	cltq
	movslq	16(%rsp,%rax,4), %rax
	movq	%rax, %rdx
	imulq	$1717986919, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	cmpl	$1, %edx
	sbbl	$-1, %eax
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$-1282606671, %rdx, %rdx
	sarl	$31, %ecx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$8, %edx
	subl	%ecx, %edx
	imull	$365, %edx, %ecx
	cmpl	%ecx, %eax
	je	.L11
	addl	$1, %edx
.L11:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jne	.L13
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$144, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	4
	.long	7
	.align 16
.LC1:
	.long	13
	.long	24
	.long	44
	.long	81
	.align 16
.LC2:
	.long	149
	.long	274
	.long	504
	.long	927
	.align 16
.LC3:
	.long	1705
	.long	3136
	.long	5768
	.long	10609
	.align 16
.LC4:
	.long	19513
	.long	35890
	.long	66012
	.long	121415
	.align 16
.LC5:
	.long	223317
	.long	410744
	.long	755476
	.long	1389537
	.align 16
.LC6:
	.long	2555757
	.long	4700770
	.long	8646064
	.long	15902591
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC7:
	.long	29249425
	.long	53798080
	.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 main(void) {
	int patern[30] = {1,2,4};
	int i,n,p=0,year = 0;

	for (i = 3; i < 30; i++) 
		patern[i] = patern[i - 1] + patern[i - 2] + patern[i - 3];

	while (1) {
		scanf("%d", &n);
		if (n == 0)break;
		if (patern[n - 1] % 10 == 0)
			p = patern[n - 1] / 10;
		else
			p = (patern[n - 1] / 10) + 1;
		year = p / 365;
		if (p%365==0) 
			printf("%d\n",year);
		else
			printf("%d\n", year+1);
	}
	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 main(void) {
	int patern[30] = {1,2,4};
	int i,n,p=0,year = 0;

	for (i = 3; i < 30; i++) 
		patern[i] = patern[i - 1] + patern[i - 2] + patern[i - 3];

	while (1) {
		scanf("%d", &n);
		if (n == 0)break;
		if (patern[n - 1] % 10 == 0)
			p = patern[n - 1] / 10;
		else
			p = (patern[n - 1] / 10) + 1;
		year = p / 365;
		if (p%365==0) 
			printf("%d\n",year);
		else
			printf("%d\n", year+1);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-128(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -128(%rbp)
	movl	$2, -124(%rbp)
	movl	$4, -120(%rbp)
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$3, -140(%rbp)
	jmp	.L2
.L3:
	movl	-140(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-140(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-140(%rbp), %eax
	subl	$3, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-140(%rbp), %eax
	cltq
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -140(%rbp)
.L2:
	cmpl	$29, -140(%rbp)
	jle	.L3
.L10:
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	testl	%eax, %eax
	je	.L14
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L6
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -136(%rbp)
	jmp	.L7
.L6:
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	$1, %eax
	movl	%eax, -136(%rbp)
.L7:
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1282606671, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$8, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -132(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1282606671, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$8, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$365, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L8
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L8:
	movl	-132(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-128(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -128(%rbp)
	movl	$2, -124(%rbp)
	movl	$4, -120(%rbp)
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$3, -140(%rbp)
	jmp	.L2
.L3:
	movl	-140(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %edx
	movl	-140(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-140(%rbp), %eax
	subl	$3, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-140(%rbp), %eax
	cltq
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -140(%rbp)
.L2:
	cmpl	$29, -140(%rbp)
	jle	.L3
.L10:
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	testl	%eax, %eax
	je	.L14
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L6
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -136(%rbp)
	jmp	.L7
.L6:
	movl	-144(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	$1, %eax
	movl	%eax, -136(%rbp)
.L7:
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1282606671, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$8, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -132(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$-1282606671, %rdx, %rdx
	shrq	$32, %rdx
	addl	%eax, %edx
	sarl	$8, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$365, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	testl	%edx, %edx
	jne	.L8
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L8:
	movl	-132(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
