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>
#include <string.h>

int main() {
    int y,m,d;
    char g[10];
    
    while(1){
        scanf("%s%d%d%d",g,&y,&m,&d);
        if(strcmp(g, "#")==0) break;
        if((y==31 && m>4) || y>31)
            printf("? %d %d %d\n",y-30,m,d);
        else
            printf("%s %d %d %d\n",g,y,m,d);
    }
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%d%d%d"
.LC1:
	.string	"#"
.LC2:
	.string	"? %d %d %d\n"
.LC3:
	.string	"%s %d %d %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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L8:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-18(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-18(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L12
	movl	-32(%rbp), %eax
	cmpl	$31, %eax
	jne	.L4
	movl	-28(%rbp), %eax
	cmpl	$4, %eax
	jg	.L5
.L4:
	movl	-32(%rbp), %eax
	cmpl	$31, %eax
	jle	.L6
.L5:
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %ecx
	leal	-30(%rcx), %esi
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	leaq	-18(%rbp), %rax
	movl	%esi, %r8d
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	jmp	.L8
.L12:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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
.LC0:
	.string	"%s%d%d%d"
.LC1:
	.string	"#"
.LC2:
	.string	"? %d %d %d\n"
.LC3:
	.string	"%s %d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %r15
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	leaq	4(%rsp), %r13
	movq	%rsp, %r12
	leaq	14(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %r8
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpw	$35, (%rbx)
	je	.L14
	movl	(%rsp), %r10d
	movl	4(%rsp), %ecx
	cmpl	$31, %r10d
	je	.L15
	jle	.L8
.L7:
	movl	8(%rsp), %r8d
	leal	-30(%r10), %edx
	movq	%r15, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	cmpl	$4, %ecx
	jg	.L7
.L8:
	movl	8(%rsp), %r9d
	movl	%ecx, %r8d
	movq	%rbx, %rdx
	movl	%r10d, %ecx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s%d%d%d"
.LC1:
	.string	"#"
.LC2:
	.string	"? %d %d %d\n"
.LC3:
	.string	"%s %d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %r15
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	leaq	4(%rsp), %r13
	movq	%rsp, %r12
	leaq	14(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %r8
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpw	$35, (%rbx)
	je	.L14
	movl	(%rsp), %r10d
	movl	4(%rsp), %ecx
	cmpl	$31, %r10d
	je	.L15
	jle	.L8
.L7:
	movl	8(%rsp), %r8d
	leal	-30(%r10), %edx
	movq	%r15, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	cmpl	$4, %ecx
	jg	.L7
.L8:
	movl	8(%rsp), %r9d
	movl	%ecx, %r8d
	movq	%rbx, %rdx
	movl	%r10d, %ecx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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>
#include <string.h>

int main() {
    int y,m,d;
    char g[10];
    
    while(1){
        scanf("%s%d%d%d",g,&y,&m,&d);
        if(strcmp(g, "#")==0) break;
        if((y==31 && m>4) || y>31)
            printf("? %d %d %d\n",y-30,m,d);
        else
            printf("%s %d %d %d\n",g,y,m,d);
    }
    return 0;
}

HEISEI 1 1 8
HEISEI 31 4 30
IESIEH 31 5 1
HEISEI 99 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 2 3 26
HEISEI 28 4 23
#
 HEISEI 1 1 8
HEISEI 31 4 30
IESIEH 31 5 1
HEISEI 99 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 3 3 26
HEISEI 28 4 23
#
 HEISEI 1 1 8
HEISEI 31 4 30
IESIEH 31 5 1
HEISEI 99 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 5 3 26
HEISEI 28 4 23
#
 HEISEI 1 1 8
HEISEI 31 4 30
IESIEH 31 5 2
HEISEI 99 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 2 3 26
HEISEI 28 4 23
#
 HEISEI 1 1 8
HEISEI 31 4 30
IESIEH 31 5 2
HEISEI 142 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 2 3 26
HEISEI 28 4 23
#
 HEISEI 1 1 8
HEISEI 31 4 10
IESIEH 31 5 2
HEISEI 142 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 2 3 26
HEISEI 28 4 23
#
 HEISEI 1 0 8
HEISEI 31 4 10
IESIEH 31 5 2
HEISEI 142 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 2 3 26
HEISEI 28 4 23
#
 HEISEI 1 0 8
HEISEI 31 4 10
IESEIH 31 5 2
HEISEI 142 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 4 3 26
HEISEI 28 4 23
#
 HEISEI 1 0 8
HEISEI 31 4 10
IESEIH 31 5 2
HEISEI 142 12 31
HEISEI 38 8 30
HEISEI 98 2 22
HEISEI 3 3 26
HEISEI 28 4 23
#
 HEISEI 1 0 0
HEISEI 31 4 10
IESEIH 31 5 2
IEISEH 142 12 31
HEISEI 38 8 30
HEJSEI 98 2 22
HEISEI 3 3 26
HEISEI 28 4 23
#

HEISEI 1 1 8
HEISEI 31 4 30
? 1 5 1
? 69 12 31
? 8 8 30
? 68 2 22
HEISEI 2 3 26
HEISEI 28 4 23
 HEISEI 1 1 8
HEISEI 31 4 30
? 1 5 1
? 69 12 31
? 8 8 30
? 68 2 22
HEISEI 3 3 26
HEISEI 28 4 23
 HEISEI 1 1 8
HEISEI 31 4 30
? 1 5 1
? 69 12 31
? 8 8 30
? 68 2 22
HEISEI 5 3 26
HEISEI 28 4 23
 HEISEI 1 1 8
HEISEI 31 4 30
? 1 5 2
? 69 12 31
? 8 8 30
? 68 2 22
HEISEI 2 3 26
HEISEI 28 4 23
 HEISEI 1 1 8
HEISEI 31 4 30
? 1 5 2
? 112 12 31
? 8 8 30
? 68 2 22
HEISEI 2 3 26
HEISEI 28 4 23
 HEISEI 1 1 8
HEISEI 31 4 10
? 1 5 2
? 112 12 31
? 8 8 30
? 68 2 22
HEISEI 2 3 26
HEISEI 28 4 23
 HEISEI 1 0 8
HEISEI 31 4 10
? 1 5 2
? 112 12 31
? 8 8 30
? 68 2 22
HEISEI 2 3 26
HEISEI 28 4 23
 HEISEI 1 0 8
HEISEI 31 4 10
? 1 5 2
? 112 12 31
? 8 8 30
? 68 2 22
HEISEI 4 3 26
HEISEI 28 4 23
 HEISEI 1 0 8
HEISEI 31 4 10
? 1 5 2
? 112 12 31
? 8 8 30
? 68 2 22
HEISEI 3 3 26
HEISEI 28 4 23
 HEISEI 1 0 0
HEISEI 31 4 10
? 1 5 2
? 112 12 31
? 8 8 30
? 68 2 22
HEISEI 3 3 26
HEISEI 28 4 23

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>
#include <string.h>

int main() {
    int y,m,d;
    char g[10];
    
    while(1){
        scanf("%s%d%d%d",g,&y,&m,&d);
        if(strcmp(g, "#")==0) break;
        if((y==31 && m>4) || y>31)
            printf("? %d %d %d\n",y-30,m,d);
        else
            printf("%s %d %d %d\n",g,y,m,d);
    }
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s%d%d%d"
.LC1:
	.string	"#"
.LC2:
	.string	"? %d %d %d\n"
.LC3:
	.string	"%s %d %d %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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L8:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-18(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-18(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L12
	movl	-32(%rbp), %eax
	cmpl	$31, %eax
	jne	.L4
	movl	-28(%rbp), %eax
	cmpl	$4, %eax
	jg	.L5
.L4:
	movl	-32(%rbp), %eax
	cmpl	$31, %eax
	jle	.L6
.L5:
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %ecx
	leal	-30(%rcx), %esi
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	leaq	-18(%rbp), %rax
	movl	%esi, %r8d
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	jmp	.L8
.L12:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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	"%s%d%d%d"
.LC1:
	.string	"#"
.LC2:
	.string	"? %d %d %d\n"
.LC3:
	.string	"%s %d %d %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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L8:
	leaq	-24(%rbp), %rsi
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-18(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-18(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L12
	movl	-32(%rbp), %eax
	cmpl	$31, %eax
	jne	.L4
	movl	-28(%rbp), %eax
	cmpl	$4, %eax
	jg	.L5
.L4:
	movl	-32(%rbp), %eax
	cmpl	$31, %eax
	jle	.L6
.L5:
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	-32(%rbp), %ecx
	leal	-30(%rcx), %esi
	movl	%edx, %ecx
	movl	%eax, %edx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	leaq	-18(%rbp), %rax
	movl	%esi, %r8d
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	jmp	.L8
.L12:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
