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

```c
// Aizu Vol-3 0337: Japanese Calendar
// 2017.8.25

#include <stdio.h>

int greg[] = { 1989, 1926, 1912, 1868, 0 };
char jan[] = { 'H', 'S', 'T', 'M', 0 };

int main()
{
	int E, Y, i;
	scanf("%d%d", &E, &Y);
	if (E == 0) {
		for (i = 0; greg[i] > 0; i++) {
			if (Y >= greg[i]) { printf("%c%d\n", jan[i], Y - greg[i] + 1); break; }
		}
	} else printf("%d\n", Y + greg[(4-E) & 3] - 1);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%c%d\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %rdx
	testl	%edx, %edx
	jne	.L2
	movl	greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	4(%rsp), %ecx
	cmpl	%eax, %ecx
	jge	.L4
	movl	4+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L6
	movl	8+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L7
	movl	12+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L8
	movl	16+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	$4, %edx
.L4:
	subl	%eax, %ecx
	leaq	jan(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movsbl	(%rax,%rdx), %edx
	addl	$1, %ecx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	negl	%edx
	movl	4(%rsp), %eax
	leaq	greg(%rip), %rcx
	leaq	.LC2(%rip), %rsi
	andl	$3, %edx
	movl	$1, %edi
	addl	(%rcx,%rdx,4), %eax
	movl	%eax, %edx
	xorl	%eax, %eax
	subl	$1, %edx
	call	__printf_chk@PLT
	jmp	.L3
.L7:
	movl	$2, %edx
	jmp	.L4
.L6:
	movl	$1, %edx
	jmp	.L4
.L8:
	movl	$3, %edx
	jmp	.L4
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	jan
	.data
	.type	jan, @object
	.size	jan, 5
jan:
	.string	"HSTM"
	.globl	greg
	.align 16
	.type	greg, @object
	.size	greg, 20
greg:
	.long	1989
	.long	1926
	.long	1912
	.long	1868
	.long	0
	.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%d"
.LC1:
	.string	"%c%d\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %rdx
	testl	%edx, %edx
	jne	.L2
	movl	greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	4(%rsp), %ecx
	cmpl	%eax, %ecx
	jge	.L4
	movl	4+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L6
	movl	8+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L7
	movl	12+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L8
	movl	16+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	$4, %edx
.L4:
	subl	%eax, %ecx
	leaq	jan(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movsbl	(%rax,%rdx), %edx
	addl	$1, %ecx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	negl	%edx
	movl	4(%rsp), %eax
	leaq	greg(%rip), %rcx
	leaq	.LC2(%rip), %rsi
	andl	$3, %edx
	movl	$1, %edi
	addl	(%rcx,%rdx,4), %eax
	movl	%eax, %edx
	xorl	%eax, %eax
	subl	$1, %edx
	call	__printf_chk@PLT
	jmp	.L3
.L7:
	movl	$2, %edx
	jmp	.L4
.L6:
	movl	$1, %edx
	jmp	.L4
.L8:
	movl	$3, %edx
	jmp	.L4
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	jan
	.data
	.type	jan, @object
	.size	jan, 5
jan:
	.string	"HSTM"
	.globl	greg
	.align 16
	.type	greg, @object
	.size	greg, 20
greg:
	.long	1989
	.long	1926
	.long	1912
	.long	1868
	.long	0
	.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%d"
.LC1:
	.string	"%c%d\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %rdx
	testl	%edx, %edx
	jne	.L2
	movl	greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	4(%rsp), %ecx
	cmpl	%eax, %ecx
	jge	.L4
	movl	4+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L6
	movl	8+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L7
	movl	12+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L8
	movl	16+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	$4, %edx
.L4:
	subl	%eax, %ecx
	leaq	jan(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movsbl	(%rax,%rdx), %edx
	addl	$1, %ecx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	negl	%edx
	movl	4(%rsp), %eax
	leaq	greg(%rip), %rcx
	leaq	.LC2(%rip), %rsi
	andl	$3, %edx
	movl	$1, %edi
	addl	(%rcx,%rdx,4), %eax
	movl	%eax, %edx
	xorl	%eax, %eax
	subl	$1, %edx
	call	__printf_chk@PLT
	jmp	.L3
.L7:
	movl	$2, %edx
	jmp	.L4
.L6:
	movl	$1, %edx
	jmp	.L4
.L8:
	movl	$3, %edx
	jmp	.L4
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	jan
	.data
	.type	jan, @object
	.size	jan, 5
jan:
	.string	"HSTM"
	.globl	greg
	.align 16
	.type	greg, @object
	.size	greg, 20
greg:
	.long	1989
	.long	1926
	.long	1912
	.long	1868
	.long	0
	.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
// Aizu Vol-3 0337: Japanese Calendar
// 2017.8.25

#include <stdio.h>

int greg[] = { 1989, 1926, 1912, 1868, 0 };
char jan[] = { 'H', 'S', 'T', 'M', 0 };

int main()
{
	int E, Y, i;
	scanf("%d%d", &E, &Y);
	if (E == 0) {
		for (i = 0; greg[i] > 0; i++) {
			if (Y >= greg[i]) { printf("%c%d\n", jan[i], Y - greg[i] + 1); break; }
		}
	} else printf("%d\n", Y + greg[(4-E) & 3] - 1);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// Aizu Vol-3 0337: Japanese Calendar
// 2017.8.25

#include <stdio.h>

int greg[] = { 1989, 1926, 1912, 1868, 0 };
char jan[] = { 'H', 'S', 'T', 'M', 0 };

int main()
{
	int E, Y, i;
	scanf("%d%d", &E, &Y);
	if (E == 0) {
		for (i = 0; greg[i] > 0; i++) {
			if (Y >= greg[i]) { printf("%c%d\n", jan[i], Y - greg[i] + 1); break; }
		}
	} else printf("%d\n", Y + greg[(4-E) & 3] - 1);
	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:

4 2
 3 1
 1 28
 2 0
 3 2
 4 1
 1 42
 1 0
 3 0
 4 0

1990
 1926
 1895
 1911
 1927
 1989
 1909
 1867
 1925
 1988

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

```c
// Aizu Vol-3 0337: Japanese Calendar
// 2017.8.25

#include <stdio.h>

int greg[] = { 1989, 1926, 1912, 1868, 0 };
char jan[] = { 'H', 'S', 'T', 'M', 0 };

int main()
{
	int E, Y, i;
	scanf("%d%d", &E, &Y);
	if (E == 0) {
		for (i = 0; greg[i] > 0; i++) {
			if (Y >= greg[i]) { printf("%c%d\n", jan[i], Y - greg[i] + 1); break; }
		}
	} else printf("%d\n", Y + greg[(4-E) & 3] - 1);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%c%d\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %rdx
	testl	%edx, %edx
	jne	.L2
	movl	greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	4(%rsp), %ecx
	cmpl	%eax, %ecx
	jge	.L4
	movl	4+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L6
	movl	8+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L7
	movl	12+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L8
	movl	16+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	$4, %edx
.L4:
	subl	%eax, %ecx
	leaq	jan(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movsbl	(%rax,%rdx), %edx
	addl	$1, %ecx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	negl	%edx
	movl	4(%rsp), %eax
	leaq	greg(%rip), %rcx
	leaq	.LC2(%rip), %rsi
	andl	$3, %edx
	movl	$1, %edi
	addl	(%rcx,%rdx,4), %eax
	movl	%eax, %edx
	xorl	%eax, %eax
	subl	$1, %edx
	call	__printf_chk@PLT
	jmp	.L3
.L7:
	movl	$2, %edx
	jmp	.L4
.L6:
	movl	$1, %edx
	jmp	.L4
.L8:
	movl	$3, %edx
	jmp	.L4
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	jan
	.data
	.type	jan, @object
	.size	jan, 5
jan:
	.string	"HSTM"
	.globl	greg
	.align 16
	.type	greg, @object
	.size	greg, 20
greg:
	.long	1989
	.long	1926
	.long	1912
	.long	1868
	.long	0
	.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%d"
.LC1:
	.string	"%c%d\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	(%rsp), %rdx
	testl	%edx, %edx
	jne	.L2
	movl	greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	4(%rsp), %ecx
	cmpl	%eax, %ecx
	jge	.L4
	movl	4+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L6
	movl	8+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L7
	movl	12+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	cmpl	%eax, %ecx
	jge	.L8
	movl	16+greg(%rip), %eax
	testl	%eax, %eax
	jle	.L3
	movl	$4, %edx
.L4:
	subl	%eax, %ecx
	leaq	jan(%rip), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movsbl	(%rax,%rdx), %edx
	addl	$1, %ecx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L11
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	negl	%edx
	movl	4(%rsp), %eax
	leaq	greg(%rip), %rcx
	leaq	.LC2(%rip), %rsi
	andl	$3, %edx
	movl	$1, %edi
	addl	(%rcx,%rdx,4), %eax
	movl	%eax, %edx
	xorl	%eax, %eax
	subl	$1, %edx
	call	__printf_chk@PLT
	jmp	.L3
.L7:
	movl	$2, %edx
	jmp	.L4
.L6:
	movl	$1, %edx
	jmp	.L4
.L8:
	movl	$3, %edx
	jmp	.L4
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	jan
	.data
	.type	jan, @object
	.size	jan, 5
jan:
	.string	"HSTM"
	.globl	greg
	.align 16
	.type	greg, @object
	.size	greg, 20
greg:
	.long	1989
	.long	1926
	.long	1912
	.long	1868
	.long	0
	.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:
```