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

```c
n;R(a,b,c){n--?R(b,c,a+b+c):printf("%d\n",~-c/3650+1);}main(){for(;~scanf("%d",&n);n&&R(0,0,1));}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	R
	.type	R, @function
R:
.LFB0:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	leal	-1(%rcx), %eax
	movl	%eax, n(%rip)
	testl	%ecx, %ecx
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %edx
.L3:
	addl	%esi, %edi
	subl	$1, %eax
	leal	(%rdi,%rdx), %ecx
	movl	%esi, %edi
	movl	%edx, %esi
	cmpl	$-1, %eax
	jne	.L5
	movl	$-1, n(%rip)
.L2:
	subl	$1, %ecx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movslq	%ecx, %rsi
	sarl	$31, %ecx
	imulq	$602472125, %rsi, %rsi
	sarq	$41, %rsi
	subl	%ecx, %esi
	addl	$1, %esi
	jmp	printf@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, %ecx
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	R, .-R
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	n(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L14
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L11
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edx
	xorl	%esi, %esi
	xorl	%edi, %edi
	xorl	%eax, %eax
	call	R
	jmp	.L10
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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\n"
	.text
	.p2align 4
	.globl	R
	.type	R, @function
R:
.LFB0:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	leal	-1(%rcx), %eax
	movl	%eax, n(%rip)
	testl	%ecx, %ecx
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %edx
.L3:
	addl	%esi, %edi
	subl	$1, %eax
	leal	(%rdi,%rdx), %ecx
	movl	%esi, %edi
	movl	%edx, %esi
	cmpl	$-1, %eax
	jne	.L5
	movl	$-1, n(%rip)
.L2:
	subl	$1, %ecx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movslq	%ecx, %rsi
	sarl	$31, %ecx
	imulq	$602472125, %rsi, %rsi
	sarq	$41, %rsi
	subl	%ecx, %esi
	addl	$1, %esi
	jmp	printf@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, %ecx
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	R, .-R
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	n(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L14
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L11
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edx
	xorl	%esi, %esi
	xorl	%edi, %edi
	xorl	%eax, %eax
	call	R
	jmp	.L10
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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\n"
	.text
	.p2align 4
	.globl	R
	.type	R, @function
R:
.LFB0:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	leal	-1(%rcx), %eax
	movl	%eax, n(%rip)
	testl	%ecx, %ecx
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %edx
.L3:
	addl	%esi, %edi
	subl	$1, %eax
	leal	(%rdi,%rdx), %ecx
	movl	%esi, %edi
	movl	%edx, %esi
	cmpl	$-1, %eax
	jne	.L5
	movl	$-1, n(%rip)
.L2:
	subl	$1, %ecx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movslq	%ecx, %rsi
	sarl	$31, %ecx
	imulq	$602472125, %rsi, %rsi
	sarq	$41, %rsi
	subl	%ecx, %esi
	addl	$1, %esi
	jmp	printf@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, %ecx
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	R, .-R
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	n(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L14
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L11
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edx
	xorl	%esi, %esi
	xorl	%edi, %edi
	xorl	%eax, %eax
	call	R
	jmp	.L10
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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
n;R(a,b,c){n--?R(b,c,a+b+c):printf("%d\n",~-c/3650+1);}main(){for(;~scanf("%d",&n);n&&R(0,0,1));}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
n;R(a,b,c){n--?R(b,c,a+b+c):printf("%d\n",~-c/3650+1);}main(){for(;~scanf("%d",&n);n&&R(0,0,1));}```

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
701
 1
19
1
1
 1
10
701
 1
10
1
701
 1
1
1

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

```c
n;R(a,b,c){n--?R(b,c,a+b+c):printf("%d\n",~-c/3650+1);}main(){for(;~scanf("%d",&n);n&&R(0,0,1));}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	R
	.type	R, @function
R:
.LFB0:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	leal	-1(%rcx), %eax
	movl	%eax, n(%rip)
	testl	%ecx, %ecx
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %edx
.L3:
	addl	%esi, %edi
	subl	$1, %eax
	leal	(%rdi,%rdx), %ecx
	movl	%esi, %edi
	movl	%edx, %esi
	cmpl	$-1, %eax
	jne	.L5
	movl	$-1, n(%rip)
.L2:
	subl	$1, %ecx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movslq	%ecx, %rsi
	sarl	$31, %ecx
	imulq	$602472125, %rsi, %rsi
	sarq	$41, %rsi
	subl	%ecx, %esi
	addl	$1, %esi
	jmp	printf@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, %ecx
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	R, .-R
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	n(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L14
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L11
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edx
	xorl	%esi, %esi
	xorl	%edi, %edi
	xorl	%eax, %eax
	call	R
	jmp	.L10
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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\n"
	.text
	.p2align 4
	.globl	R
	.type	R, @function
R:
.LFB0:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	leal	-1(%rcx), %eax
	movl	%eax, n(%rip)
	testl	%ecx, %ecx
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ecx, %edx
.L3:
	addl	%esi, %edi
	subl	$1, %eax
	leal	(%rdi,%rdx), %ecx
	movl	%esi, %edi
	movl	%edx, %esi
	cmpl	$-1, %eax
	jne	.L5
	movl	$-1, n(%rip)
.L2:
	subl	$1, %ecx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movslq	%ecx, %rsi
	sarl	$31, %ecx
	imulq	$602472125, %rsi, %rsi
	sarq	$41, %rsi
	subl	%ecx, %esi
	addl	$1, %esi
	jmp	printf@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, %ecx
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	R, .-R
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	n(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC1(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L14
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L11
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edx
	xorl	%esi, %esi
	xorl	%edi, %edi
	xorl	%eax, %eax
	call	R
	jmp	.L10
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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:
```