Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void)
{
	int n;
	int i,j;
	int dan[31],s;
	
	scanf("%d",&n);
	while(n!=0){
		for(i=0;i<31;i++){
			dan[i]=0;
		}
		dan[0]=1;
		dan[1]=2;
		dan[2]=4;
		for(i=3;i<n;i++){
			dan[i]=dan[i-3]+dan[i-2]+dan[i-1];
		//	printf("dan[%d]=%d\n",i,dan[i]);
		}
		s=dan[n-1]/10;
		s=s/365;
		printf("%d\n",s+1);
		scanf("%d",&n);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC11:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	movq	.LC1(%rip), %r14
	movq	.LC2(%rip), %r15
	leaq	24(%rsp), %rbx
	leaq	.LC11(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$14, %ecx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	movq	%r14, 16(%rsp)
	rep stosq
	movl	$4, 24(%rsp)
	movl	$0, (%rdi)
	cmpl	$3, %esi
	jle	.L3
	leal	-2(%rsi), %eax
	cmpl	$6, %esi
	jle	.L8
	movq	%r15, 28(%rsp)
	movl	$24, 36(%rsp)
	cmpl	$7, %eax
	jle	.L9
	movq	.LC3(%rip), %rdi
	movl	$149, 48(%rsp)
	movq	%rdi, 40(%rsp)
	cmpl	$10, %eax
	jle	.L10
	movq	.LC4(%rip), %rdi
	movl	$927, 60(%rsp)
	movq	%rdi, 52(%rsp)
	cmpl	$13, %eax
	jle	.L11
	movq	.LC5(%rip), %rdi
	movl	$5768, 72(%rsp)
	movq	%rdi, 64(%rsp)
	cmpl	$16, %eax
	jle	.L12
	movq	.LC6(%rip), %rdx
	movl	$35890, 84(%rsp)
	movq	%rdx, 76(%rsp)
	cmpl	$19, %eax
	jle	.L13
	movq	.LC7(%rip), %rdx
	movl	$223317, 96(%rsp)
	movq	%rdx, 88(%rsp)
	cmpl	$22, %eax
	jle	.L14
	movq	.LC8(%rip), %rdx
	movl	$1389537, 108(%rsp)
	movq	%rdx, 100(%rsp)
	cmpl	$25, %eax
	jle	.L15
	movq	.LC9(%rip), %rdx
	movl	$8646064, 120(%rsp)
	movq	%rdx, 112(%rsp)
	cmpl	$28, %eax
	jle	.L16
	movq	.LC10(%rip), %rax
	movl	$30, %ecx
	movl	$53798080, 132(%rsp)
	movq	%rax, 124(%rsp)
.L4:
	movslq	%ecx, %rax
	leaq	16(%rsp,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	-8(%rax), %edx
	addl	$1, %ecx
	addl	-12(%rax), %edx
	addq	$4, %rax
	addl	-8(%rax), %edx
	movl	%edx, -4(%rax)
	cmpl	%ecx, %esi
	jg	.L5
.L3:
	subl	$1, %esi
	movl	$1, %edi
	movslq	%esi, %rsi
	movslq	16(%rsp,%rsi,4), %rdx
	movq	%r13, %rsi
	movq	%rdx, %rax
	imulq	$602472125, %rdx, %rdx
	sarl	$31, %eax
	sarq	$41, %rdx
	subl	%eax, %edx
	xorl	%eax, %eax
	addl	$1, %edx
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jne	.L6
.L2:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$168, %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
.L9:
	.cfi_restore_state
	movl	$6, %ecx
	jmp	.L4
.L10:
	movl	$9, %ecx
	jmp	.L4
.L11:
	movl	$12, %ecx
	jmp	.L4
.L8:
	movl	$3, %ecx
	jmp	.L4
.L12:
	movl	$15, %ecx
	jmp	.L4
.L13:
	movl	$18, %ecx
	jmp	.L4
.L14:
	movl	$21, %ecx
	jmp	.L4
.L15:
	movl	$24, %ecx
	jmp	.L4
.L16:
	movl	$27, %ecx
	jmp	.L4
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	1
	.long	2
	.align 8
.LC2:
	.long	7
	.long	13
	.align 8
.LC3:
	.long	44
	.long	81
	.align 8
.LC4:
	.long	274
	.long	504
	.align 8
.LC5:
	.long	1705
	.long	3136
	.align 8
.LC6:
	.long	10609
	.long	19513
	.align 8
.LC7:
	.long	66012
	.long	121415
	.align 8
.LC8:
	.long	410744
	.long	755476
	.align 8
.LC9:
	.long	2555757
	.long	4700770
	.align 8
.LC10:
	.long	15902591
	.long	29249425
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC11:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	movq	.LC1(%rip), %r14
	movq	.LC2(%rip), %r15
	leaq	24(%rsp), %rbx
	leaq	.LC11(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$14, %ecx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	movq	%r14, 16(%rsp)
	rep stosq
	movl	$4, 24(%rsp)
	movl	$0, (%rdi)
	cmpl	$3, %esi
	jle	.L3
	leal	-2(%rsi), %eax
	cmpl	$6, %esi
	jle	.L8
	movq	%r15, 28(%rsp)
	movl	$24, 36(%rsp)
	cmpl	$7, %eax
	jle	.L9
	movq	.LC3(%rip), %rdi
	movl	$149, 48(%rsp)
	movq	%rdi, 40(%rsp)
	cmpl	$10, %eax
	jle	.L10
	movq	.LC4(%rip), %rdi
	movl	$927, 60(%rsp)
	movq	%rdi, 52(%rsp)
	cmpl	$13, %eax
	jle	.L11
	movq	.LC5(%rip), %rdi
	movl	$5768, 72(%rsp)
	movq	%rdi, 64(%rsp)
	cmpl	$16, %eax
	jle	.L12
	movq	.LC6(%rip), %rdx
	movl	$35890, 84(%rsp)
	movq	%rdx, 76(%rsp)
	cmpl	$19, %eax
	jle	.L13
	movq	.LC7(%rip), %rdx
	movl	$223317, 96(%rsp)
	movq	%rdx, 88(%rsp)
	cmpl	$22, %eax
	jle	.L14
	movq	.LC8(%rip), %rdx
	movl	$1389537, 108(%rsp)
	movq	%rdx, 100(%rsp)
	cmpl	$25, %eax
	jle	.L15
	movq	.LC9(%rip), %rdx
	movl	$8646064, 120(%rsp)
	movq	%rdx, 112(%rsp)
	cmpl	$28, %eax
	jle	.L16
	movq	.LC10(%rip), %rax
	movl	$30, %ecx
	movl	$53798080, 132(%rsp)
	movq	%rax, 124(%rsp)
.L4:
	movslq	%ecx, %rax
	leaq	16(%rsp,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	-8(%rax), %edx
	addl	$1, %ecx
	addl	-12(%rax), %edx
	addq	$4, %rax
	addl	-8(%rax), %edx
	movl	%edx, -4(%rax)
	cmpl	%ecx, %esi
	jg	.L5
.L3:
	subl	$1, %esi
	movl	$1, %edi
	movslq	%esi, %rsi
	movslq	16(%rsp,%rsi,4), %rdx
	movq	%r13, %rsi
	movq	%rdx, %rax
	imulq	$602472125, %rdx, %rdx
	sarl	$31, %eax
	sarq	$41, %rdx
	subl	%eax, %edx
	xorl	%eax, %eax
	addl	$1, %edx
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jne	.L6
.L2:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$168, %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
.L9:
	.cfi_restore_state
	movl	$6, %ecx
	jmp	.L4
.L10:
	movl	$9, %ecx
	jmp	.L4
.L11:
	movl	$12, %ecx
	jmp	.L4
.L8:
	movl	$3, %ecx
	jmp	.L4
.L12:
	movl	$15, %ecx
	jmp	.L4
.L13:
	movl	$18, %ecx
	jmp	.L4
.L14:
	movl	$21, %ecx
	jmp	.L4
.L15:
	movl	$24, %ecx
	jmp	.L4
.L16:
	movl	$27, %ecx
	jmp	.L4
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	1
	.long	2
	.align 8
.LC2:
	.long	7
	.long	13
	.align 8
.LC3:
	.long	44
	.long	81
	.align 8
.LC4:
	.long	274
	.long	504
	.align 8
.LC5:
	.long	1705
	.long	3136
	.align 8
.LC6:
	.long	10609
	.long	19513
	.align 8
.LC7:
	.long	66012
	.long	121415
	.align 8
.LC8:
	.long	410744
	.long	755476
	.align 8
.LC9:
	.long	2555757
	.long	4700770
	.align 8
.LC10:
	.long	15902591
	.long	29249425
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC11:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	movq	.LC1(%rip), %r14
	movq	.LC2(%rip), %r15
	leaq	24(%rsp), %rbx
	leaq	.LC11(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$14, %ecx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	movq	%r14, 16(%rsp)
	rep stosq
	movl	$4, 24(%rsp)
	movl	$0, (%rdi)
	cmpl	$3, %esi
	jle	.L3
	leal	-2(%rsi), %eax
	cmpl	$6, %esi
	jle	.L8
	movq	%r15, 28(%rsp)
	movl	$24, 36(%rsp)
	cmpl	$7, %eax
	jle	.L9
	movq	.LC3(%rip), %rdi
	movl	$149, 48(%rsp)
	movq	%rdi, 40(%rsp)
	cmpl	$10, %eax
	jle	.L10
	movq	.LC4(%rip), %rdi
	movl	$927, 60(%rsp)
	movq	%rdi, 52(%rsp)
	cmpl	$13, %eax
	jle	.L11
	movq	.LC5(%rip), %rdi
	movl	$5768, 72(%rsp)
	movq	%rdi, 64(%rsp)
	cmpl	$16, %eax
	jle	.L12
	movq	.LC6(%rip), %rdx
	movl	$35890, 84(%rsp)
	movq	%rdx, 76(%rsp)
	cmpl	$19, %eax
	jle	.L13
	movq	.LC7(%rip), %rdx
	movl	$223317, 96(%rsp)
	movq	%rdx, 88(%rsp)
	cmpl	$22, %eax
	jle	.L14
	movq	.LC8(%rip), %rdx
	movl	$1389537, 108(%rsp)
	movq	%rdx, 100(%rsp)
	cmpl	$25, %eax
	jle	.L15
	movq	.LC9(%rip), %rdx
	movl	$8646064, 120(%rsp)
	movq	%rdx, 112(%rsp)
	cmpl	$28, %eax
	jle	.L16
	movq	.LC10(%rip), %rax
	movl	$30, %ecx
	movl	$53798080, 132(%rsp)
	movq	%rax, 124(%rsp)
.L4:
	movslq	%ecx, %rax
	leaq	16(%rsp,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	-8(%rax), %edx
	addl	$1, %ecx
	addl	-12(%rax), %edx
	addq	$4, %rax
	addl	-8(%rax), %edx
	movl	%edx, -4(%rax)
	cmpl	%ecx, %esi
	jg	.L5
.L3:
	subl	$1, %esi
	movl	$1, %edi
	movslq	%esi, %rsi
	movslq	16(%rsp,%rsi,4), %rdx
	movq	%r13, %rsi
	movq	%rdx, %rax
	imulq	$602472125, %rdx, %rdx
	sarl	$31, %eax
	sarq	$41, %rdx
	subl	%eax, %edx
	xorl	%eax, %eax
	addl	$1, %edx
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jne	.L6
.L2:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$168, %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
.L9:
	.cfi_restore_state
	movl	$6, %ecx
	jmp	.L4
.L10:
	movl	$9, %ecx
	jmp	.L4
.L11:
	movl	$12, %ecx
	jmp	.L4
.L8:
	movl	$3, %ecx
	jmp	.L4
.L12:
	movl	$15, %ecx
	jmp	.L4
.L13:
	movl	$18, %ecx
	jmp	.L4
.L14:
	movl	$21, %ecx
	jmp	.L4
.L15:
	movl	$24, %ecx
	jmp	.L4
.L16:
	movl	$27, %ecx
	jmp	.L4
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	1
	.long	2
	.align 8
.LC2:
	.long	7
	.long	13
	.align 8
.LC3:
	.long	44
	.long	81
	.align 8
.LC4:
	.long	274
	.long	504
	.align 8
.LC5:
	.long	1705
	.long	3136
	.align 8
.LC6:
	.long	10609
	.long	19513
	.align 8
.LC7:
	.long	66012
	.long	121415
	.align 8
.LC8:
	.long	410744
	.long	755476
	.align 8
.LC9:
	.long	2555757
	.long	4700770
	.align 8
.LC10:
	.long	15902591
	.long	29249425
	.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:
```
```c
#include<stdio.h>
int main(void)
{
	int n;
	int i,j;
	int dan[31],s;
	
	scanf("%d",&n);
	while(n!=0){
		for(i=0;i<31;i++){
			dan[i]=0;
		}
		dan[0]=1;
		dan[1]=2;
		dan[2]=4;
		for(i=3;i<n;i++){
			dan[i]=dan[i-3]+dan[i-2]+dan[i-1];
		//	printf("dan[%d]=%d\n",i,dan[i]);
		}
		s=dan[n-1]/10;
		s=s/365;
		printf("%d\n",s+1);
		scanf("%d",&n);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void)
{
	int n;
	int i,j;
	int dan[31],s;
	
	scanf("%d",&n);
	while(n!=0){
		for(i=0;i<31;i++){
			dan[i]=0;
		}
		dan[0]=1;
		dan[1]=2;
		dan[2]=4;
		for(i=3;i<n;i++){
			dan[i]=dan[i-3]+dan[i-2]+dan[i-1];
		//	printf("dan[%d]=%d\n",i,dan[i]);
		}
		s=dan[n-1]/10;
		s=s/365;
		printf("%d\n",s+1);
		scanf("%d",&n);
	}
	return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void)
{
	int n;
	int i,j;
	int dan[31],s;
	
	scanf("%d",&n);
	while(n!=0){
		for(i=0;i<31;i++){
			dan[i]=0;
		}
		dan[0]=1;
		dan[1]=2;
		dan[2]=4;
		for(i=3;i<n;i++){
			dan[i]=dan[i-3]+dan[i-2]+dan[i-1];
		//	printf("dan[%d]=%d\n",i,dan[i]);
		}
		s=dan[n-1]/10;
		s=s/365;
		printf("%d\n",s+1);
		scanf("%d",&n);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC11:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	movq	.LC1(%rip), %r14
	movq	.LC2(%rip), %r15
	leaq	24(%rsp), %rbx
	leaq	.LC11(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$14, %ecx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	movq	%r14, 16(%rsp)
	rep stosq
	movl	$4, 24(%rsp)
	movl	$0, (%rdi)
	cmpl	$3, %esi
	jle	.L3
	leal	-2(%rsi), %eax
	cmpl	$6, %esi
	jle	.L8
	movq	%r15, 28(%rsp)
	movl	$24, 36(%rsp)
	cmpl	$7, %eax
	jle	.L9
	movq	.LC3(%rip), %rdi
	movl	$149, 48(%rsp)
	movq	%rdi, 40(%rsp)
	cmpl	$10, %eax
	jle	.L10
	movq	.LC4(%rip), %rdi
	movl	$927, 60(%rsp)
	movq	%rdi, 52(%rsp)
	cmpl	$13, %eax
	jle	.L11
	movq	.LC5(%rip), %rdi
	movl	$5768, 72(%rsp)
	movq	%rdi, 64(%rsp)
	cmpl	$16, %eax
	jle	.L12
	movq	.LC6(%rip), %rdx
	movl	$35890, 84(%rsp)
	movq	%rdx, 76(%rsp)
	cmpl	$19, %eax
	jle	.L13
	movq	.LC7(%rip), %rdx
	movl	$223317, 96(%rsp)
	movq	%rdx, 88(%rsp)
	cmpl	$22, %eax
	jle	.L14
	movq	.LC8(%rip), %rdx
	movl	$1389537, 108(%rsp)
	movq	%rdx, 100(%rsp)
	cmpl	$25, %eax
	jle	.L15
	movq	.LC9(%rip), %rdx
	movl	$8646064, 120(%rsp)
	movq	%rdx, 112(%rsp)
	cmpl	$28, %eax
	jle	.L16
	movq	.LC10(%rip), %rax
	movl	$30, %ecx
	movl	$53798080, 132(%rsp)
	movq	%rax, 124(%rsp)
.L4:
	movslq	%ecx, %rax
	leaq	16(%rsp,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	-8(%rax), %edx
	addl	$1, %ecx
	addl	-12(%rax), %edx
	addq	$4, %rax
	addl	-8(%rax), %edx
	movl	%edx, -4(%rax)
	cmpl	%ecx, %esi
	jg	.L5
.L3:
	subl	$1, %esi
	movl	$1, %edi
	movslq	%esi, %rsi
	movslq	16(%rsp,%rsi,4), %rdx
	movq	%r13, %rsi
	movq	%rdx, %rax
	imulq	$602472125, %rdx, %rdx
	sarl	$31, %eax
	sarq	$41, %rdx
	subl	%eax, %edx
	xorl	%eax, %eax
	addl	$1, %edx
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jne	.L6
.L2:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$168, %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
.L9:
	.cfi_restore_state
	movl	$6, %ecx
	jmp	.L4
.L10:
	movl	$9, %ecx
	jmp	.L4
.L11:
	movl	$12, %ecx
	jmp	.L4
.L8:
	movl	$3, %ecx
	jmp	.L4
.L12:
	movl	$15, %ecx
	jmp	.L4
.L13:
	movl	$18, %ecx
	jmp	.L4
.L14:
	movl	$21, %ecx
	jmp	.L4
.L15:
	movl	$24, %ecx
	jmp	.L4
.L16:
	movl	$27, %ecx
	jmp	.L4
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	1
	.long	2
	.align 8
.LC2:
	.long	7
	.long	13
	.align 8
.LC3:
	.long	44
	.long	81
	.align 8
.LC4:
	.long	274
	.long	504
	.align 8
.LC5:
	.long	1705
	.long	3136
	.align 8
.LC6:
	.long	10609
	.long	19513
	.align 8
.LC7:
	.long	66012
	.long	121415
	.align 8
.LC8:
	.long	410744
	.long	755476
	.align 8
.LC9:
	.long	2555757
	.long	4700770
	.align 8
.LC10:
	.long	15902591
	.long	29249425
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC11:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	movq	.LC1(%rip), %r14
	movq	.LC2(%rip), %r15
	leaq	24(%rsp), %rbx
	leaq	.LC11(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$14, %ecx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	movq	%r14, 16(%rsp)
	rep stosq
	movl	$4, 24(%rsp)
	movl	$0, (%rdi)
	cmpl	$3, %esi
	jle	.L3
	leal	-2(%rsi), %eax
	cmpl	$6, %esi
	jle	.L8
	movq	%r15, 28(%rsp)
	movl	$24, 36(%rsp)
	cmpl	$7, %eax
	jle	.L9
	movq	.LC3(%rip), %rdi
	movl	$149, 48(%rsp)
	movq	%rdi, 40(%rsp)
	cmpl	$10, %eax
	jle	.L10
	movq	.LC4(%rip), %rdi
	movl	$927, 60(%rsp)
	movq	%rdi, 52(%rsp)
	cmpl	$13, %eax
	jle	.L11
	movq	.LC5(%rip), %rdi
	movl	$5768, 72(%rsp)
	movq	%rdi, 64(%rsp)
	cmpl	$16, %eax
	jle	.L12
	movq	.LC6(%rip), %rdx
	movl	$35890, 84(%rsp)
	movq	%rdx, 76(%rsp)
	cmpl	$19, %eax
	jle	.L13
	movq	.LC7(%rip), %rdx
	movl	$223317, 96(%rsp)
	movq	%rdx, 88(%rsp)
	cmpl	$22, %eax
	jle	.L14
	movq	.LC8(%rip), %rdx
	movl	$1389537, 108(%rsp)
	movq	%rdx, 100(%rsp)
	cmpl	$25, %eax
	jle	.L15
	movq	.LC9(%rip), %rdx
	movl	$8646064, 120(%rsp)
	movq	%rdx, 112(%rsp)
	cmpl	$28, %eax
	jle	.L16
	movq	.LC10(%rip), %rax
	movl	$30, %ecx
	movl	$53798080, 132(%rsp)
	movq	%rax, 124(%rsp)
.L4:
	movslq	%ecx, %rax
	leaq	16(%rsp,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	-8(%rax), %edx
	addl	$1, %ecx
	addl	-12(%rax), %edx
	addq	$4, %rax
	addl	-8(%rax), %edx
	movl	%edx, -4(%rax)
	cmpl	%ecx, %esi
	jg	.L5
.L3:
	subl	$1, %esi
	movl	$1, %edi
	movslq	%esi, %rsi
	movslq	16(%rsp,%rsi,4), %rdx
	movq	%r13, %rsi
	movq	%rdx, %rax
	imulq	$602472125, %rdx, %rdx
	sarl	$31, %eax
	sarq	$41, %rdx
	subl	%eax, %edx
	xorl	%eax, %eax
	addl	$1, %edx
	call	__printf_chk@PLT
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jne	.L6
.L2:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$168, %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
.L9:
	.cfi_restore_state
	movl	$6, %ecx
	jmp	.L4
.L10:
	movl	$9, %ecx
	jmp	.L4
.L11:
	movl	$12, %ecx
	jmp	.L4
.L8:
	movl	$3, %ecx
	jmp	.L4
.L12:
	movl	$15, %ecx
	jmp	.L4
.L13:
	movl	$18, %ecx
	jmp	.L4
.L14:
	movl	$21, %ecx
	jmp	.L4
.L15:
	movl	$24, %ecx
	jmp	.L4
.L16:
	movl	$27, %ecx
	jmp	.L4
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	1
	.long	2
	.align 8
.LC2:
	.long	7
	.long	13
	.align 8
.LC3:
	.long	44
	.long	81
	.align 8
.LC4:
	.long	274
	.long	504
	.align 8
.LC5:
	.long	1705
	.long	3136
	.align 8
.LC6:
	.long	10609
	.long	19513
	.align 8
.LC7:
	.long	66012
	.long	121415
	.align 8
.LC8:
	.long	410744
	.long	755476
	.align 8
.LC9:
	.long	2555757
	.long	4700770
	.align 8
.LC10:
	.long	15902591
	.long	29249425
	.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:
```