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

#define NOANSWER "UNRESTORABLE"

int             check_hint(char *key, char *hint)
{
        int i = 0;

        while (hint[i])
        {
                if (key[i] != '?' && key[i] != hint[i])
                        return (0);
                i++;
        }
        return (1);
}

void    print_answer(char *key, char *hint, int first)
{
        int i;

        for (i = 0; i < first; i++)
        {
                if (key[i] == '?')
                        write(1, "a", 1);
                else
                        write(1, &key[i], 1);
        }
        while (*hint)
        {
                write(1, hint, 1);
                hint++;
                i++;
        }
        while (key[i])
        {
                if (key[i] == '?')
                        write(1, "a", 1);
                else
                        write(1, &key[i], 1);
                i++;
        }
        write(1, "\n", 1);
}



int             main(void)
{
        char    key[51];
        char    hint[51];
        int             first = -1;
        int             max;
        int             i;

        scanf("%s%s", key, hint);
        max = strlen(key) - strlen(hint);
        for (i = 0; i <= max; i++)
        {
                if (check_hint(&key[i], hint))
                        first = i;
        }
        if (first == -1)
        {
                printf("%s\n", NOANSWER);
                return (0);
        }
        print_answer(key, hint, first);
        return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	check_hint
	.type	check_hint, @function
check_hint:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	je	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	check_hint, .-check_hint
	.section	.rodata
.LC0:
	.string	"a"
.LC1:
	.string	"\n"
	.text
	.globl	print_answer
	.type	print_answer, @function
print_answer:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L7
.L10:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	jne	.L8
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L9:
	addl	$1, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L10
	jmp	.L11
.L12:
	movq	-32(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	addq	$1, -32(%rbp)
	addl	$1, -4(%rbp)
.L11:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L12
	jmp	.L13
.L16:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	jne	.L14
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L15
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L15:
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L16
	movl	$1, %edx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	print_answer, .-print_answer
	.section	.rodata
.LC2:
	.string	"%s%s"
.LC3:
	.string	"UNRESTORABLE"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$152, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$-1, -156(%rbp)
	leaq	-80(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-144(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %ebx
	leaq	-80(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -148(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L18
.L20:
	leaq	-144(%rbp), %rdx
	movl	-152(%rbp), %eax
	cltq
	addq	%rax, %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	check_hint
	testl	%eax, %eax
	je	.L19
	movl	-152(%rbp), %eax
	movl	%eax, -156(%rbp)
.L19:
	addl	$1, -152(%rbp)
.L18:
	movl	-152(%rbp), %eax
	cmpl	-148(%rbp), %eax
	jle	.L20
	cmpl	$-1, -156(%rbp)
	jne	.L21
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L23
.L21:
	movl	-156(%rbp), %edx
	leaq	-80(%rbp), %rcx
	leaq	-144(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	print_answer
	movl	$0, %eax
.L23:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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
	.p2align 4
	.globl	check_hint
	.type	check_hint, @function
check_hint:
.LFB63:
	.cfi_startproc
	endbr64
	movzbl	(%rsi), %edx
	testb	%dl, %dl
	je	.L5
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	(%rdi,%rax), %ecx
	cmpb	%dl, %cl
	je	.L7
	cmpb	$63, %cl
	jne	.L6
.L7:
	addq	$1, %rax
	movzbl	(%rsi,%rax), %edx
	testb	%dl, %dl
	jne	.L4
.L5:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE63:
	.size	check_hint, .-check_hint
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"a"
.LC1:
	.string	"\n"
	.text
	.p2align 4
	.globl	print_answer
	.type	print_answer, @function
print_answer:
.LFB64:
	.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
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	testl	%edx, %edx
	jle	.L24
	leal	-1(%rdx), %eax
	movl	%edx, %r13d
	leaq	.LC0(%rip), %r15
	movq	%rdi, %rbp
	leaq	1(%rdi,%rax), %r14
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbp
	call	write@PLT
	cmpq	%r14, %rbp
	je	.L14
.L17:
	cmpb	$63, 0(%rbp)
	movl	$1, %edx
	jne	.L15
	movq	%r15, %rsi
	movl	$1, %edi
	addq	$1, %rbp
	call	write@PLT
	cmpq	%r14, %rbp
	jne	.L17
.L14:
	cmpb	$0, (%rbx)
	je	.L25
.L36:
	subl	%ebx, %r13d
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rbx, %rsi
	movl	$1, %edx
	addq	$1, %rbx
	movl	$1, %edi
	call	write@PLT
	cmpb	$0, (%rbx)
	leal	0(%r13,%rbx), %eax
	jne	.L19
.L18:
	movslq	%eax, %rdx
	leaq	(%r12,%rdx), %rbx
	movzbl	(%rbx), %eax
	testb	%al, %al
	je	.L20
	leaq	1(%r12,%rdx), %rbp
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L23:
	movl	$1, %edx
	movq	%r12, %rsi
	cmpb	$63, %al
	je	.L35
	movq	%rbx, %rsi
.L35:
	movl	$1, %edi
	addq	$1, %rbp
	addq	$1, %rbx
	call	write@PLT
	movzbl	-1(%rbp), %eax
	testb	%al, %al
	jne	.L23
.L20:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %edx
	movl	$1, %edi
	popq	%rbx
	.cfi_def_cfa_offset 48
	leaq	.LC1(%rip), %rsi
	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
	jmp	write@PLT
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	xorl	%r13d, %r13d
	cmpb	$0, (%rbx)
	jne	.L36
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%r13d, %eax
	jmp	.L18
	.cfi_endproc
.LFE64:
	.size	print_answer, .-print_answer
	.section	.rodata.str1.1
.LC2:
	.string	"%s%s"
.LC3:
	.string	"UNRESTORABLE"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB65:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	addq	$-128, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rbp
	movq	%rsp, %r12
	movq	%rbp, %rdx
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	subl	%eax, %ebx
	js	.L38
	movzbl	64(%rsp), %r8d
	movq	%r12, %rsi
	leal	1(%rbx), %r9d
	xorl	%edi, %edi
	movl	$-1, %r10d
	.p2align 4,,10
	.p2align 3
.L42:
	testb	%r8b, %r8b
	je	.L46
	movl	%r8d, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L41:
	movzbl	(%rsi,%rax), %ecx
	cmpb	%dl, %cl
	je	.L47
	cmpb	$63, %cl
	jne	.L39
.L47:
	addq	$1, %rax
	movzbl	0(%rbp,%rax), %edx
	testb	%dl, %dl
	jne	.L41
.L46:
	movl	%edi, %r10d
.L39:
	addl	$1, %edi
	addq	$1, %rsi
	cmpl	%r9d, %edi
	jne	.L42
	cmpl	$-1, %r10d
	je	.L38
	movl	%r10d, %edx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	print_answer
.L44:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	subq	$-128, %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
.L38:
	.cfi_restore_state
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L44
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE65:
	.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
	.p2align 4
	.globl	check_hint
	.type	check_hint, @function
check_hint:
.LFB63:
	.cfi_startproc
	endbr64
	movzbl	(%rsi), %edx
	testb	%dl, %dl
	je	.L5
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	(%rdi,%rax), %ecx
	cmpb	%dl, %cl
	je	.L7
	cmpb	$63, %cl
	jne	.L6
.L7:
	addq	$1, %rax
	movzbl	(%rsi,%rax), %edx
	testb	%dl, %dl
	jne	.L4
.L5:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE63:
	.size	check_hint, .-check_hint
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"a"
.LC1:
	.string	"\n"
	.text
	.p2align 4
	.globl	print_answer
	.type	print_answer, @function
print_answer:
.LFB64:
	.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
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	testl	%edx, %edx
	jle	.L24
	leal	-1(%rdx), %eax
	movl	%edx, %r13d
	leaq	.LC0(%rip), %r15
	movq	%rdi, %rbp
	leaq	1(%rdi,%rax), %r14
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbp
	call	write@PLT
	cmpq	%r14, %rbp
	je	.L14
.L17:
	cmpb	$63, 0(%rbp)
	movl	$1, %edx
	jne	.L15
	movq	%r15, %rsi
	movl	$1, %edi
	addq	$1, %rbp
	call	write@PLT
	cmpq	%r14, %rbp
	jne	.L17
.L14:
	cmpb	$0, (%rbx)
	je	.L25
.L36:
	subl	%ebx, %r13d
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rbx, %rsi
	movl	$1, %edx
	addq	$1, %rbx
	movl	$1, %edi
	call	write@PLT
	cmpb	$0, (%rbx)
	leal	0(%r13,%rbx), %eax
	jne	.L19
.L18:
	movslq	%eax, %rdx
	leaq	(%r12,%rdx), %rbx
	movzbl	(%rbx), %eax
	testb	%al, %al
	je	.L20
	leaq	1(%r12,%rdx), %rbp
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L23:
	movl	$1, %edx
	movq	%r12, %rsi
	cmpb	$63, %al
	je	.L35
	movq	%rbx, %rsi
.L35:
	movl	$1, %edi
	addq	$1, %rbp
	addq	$1, %rbx
	call	write@PLT
	movzbl	-1(%rbp), %eax
	testb	%al, %al
	jne	.L23
.L20:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	$1, %edx
	movl	$1, %edi
	popq	%rbx
	.cfi_def_cfa_offset 48
	leaq	.LC1(%rip), %rsi
	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
	jmp	write@PLT
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	xorl	%r13d, %r13d
	cmpb	$0, (%rbx)
	jne	.L36
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%r13d, %eax
	jmp	.L18
	.cfi_endproc
.LFE64:
	.size	print_answer, .-print_answer
	.section	.rodata.str1.1
.LC2:
	.string	"%s%s"
.LC3:
	.string	"UNRESTORABLE"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB65:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	addq	$-128, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rbp
	movq	%rsp, %r12
	movq	%rbp, %rdx
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movq	%r12, %rdi
	call	strlen@PLT
	movq	%rbp, %rdi
	movq	%rax, %rbx
	call	strlen@PLT
	subl	%eax, %ebx
	js	.L38
	movzbl	64(%rsp), %r8d
	movq	%r12, %rsi
	leal	1(%rbx), %r9d
	xorl	%edi, %edi
	movl	$-1, %r10d
	.p2align 4,,10
	.p2align 3
.L42:
	testb	%r8b, %r8b
	je	.L46
	movl	%r8d, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L41:
	movzbl	(%rsi,%rax), %ecx
	cmpb	%dl, %cl
	je	.L47
	cmpb	$63, %cl
	jne	.L39
.L47:
	addq	$1, %rax
	movzbl	0(%rbp,%rax), %edx
	testb	%dl, %dl
	jne	.L41
.L46:
	movl	%edi, %r10d
.L39:
	addl	$1, %edi
	addq	$1, %rsi
	cmpl	%r9d, %edi
	jne	.L42
	cmpl	$-1, %r10d
	je	.L38
	movl	%r10d, %edx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	print_answer
.L44:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	subq	$-128, %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
.L38:
	.cfi_restore_state
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L44
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE65:
	.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 <stdlib.h>
#include <string.h>
#include <unistd.h>

#define NOANSWER "UNRESTORABLE"

int             check_hint(char *key, char *hint)
{
        int i = 0;

        while (hint[i])
        {
                if (key[i] != '?' && key[i] != hint[i])
                        return (0);
                i++;
        }
        return (1);
}

void    print_answer(char *key, char *hint, int first)
{
        int i;

        for (i = 0; i < first; i++)
        {
                if (key[i] == '?')
                        write(1, "a", 1);
                else
                        write(1, &key[i], 1);
        }
        while (*hint)
        {
                write(1, hint, 1);
                hint++;
                i++;
        }
        while (key[i])
        {
                if (key[i] == '?')
                        write(1, "a", 1);
                else
                        write(1, &key[i], 1);
                i++;
        }
        write(1, "\n", 1);
}



int             main(void)
{
        char    key[51];
        char    hint[51];
        int             first = -1;
        int             max;
        int             i;

        scanf("%s%s", key, hint);
        max = strlen(key) - strlen(hint);
        for (i = 0; i <= max; i++)
        {
                if (check_hint(&key[i], hint))
                        first = i;
        }
        if (first == -1)
        {
                printf("%s\n", NOANSWER);
                return (0);
        }
        print_answer(key, hint, first);
        return (0);
}
?tc??@?
coder
 >q???d?>
_ba
 d>>>???q
a`a
 d>>>???q
aaa
 ??p??d??
abb
 ?tc??@?
cnder
 ??p??d??
`bb
 ?tc??@?
endcr
 ??p??d??
`ab
 @tc??@?
endcr

UNRESTORABLE
 >q_bada>
 d>>>a`aq
 d>>>aaaq
 UNRESTORABLE
 UNRESTORABLE
 UNRESTORABLE
 UNRESTORABLE
 UNRESTORABLE
 UNRESTORABLE

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

#define NOANSWER "UNRESTORABLE"

int             check_hint(char *key, char *hint)
{
        int i = 0;

        while (hint[i])
        {
                if (key[i] != '?' && key[i] != hint[i])
                        return (0);
                i++;
        }
        return (1);
}

void    print_answer(char *key, char *hint, int first)
{
        int i;

        for (i = 0; i < first; i++)
        {
                if (key[i] == '?')
                        write(1, "a", 1);
                else
                        write(1, &key[i], 1);
        }
        while (*hint)
        {
                write(1, hint, 1);
                hint++;
                i++;
        }
        while (key[i])
        {
                if (key[i] == '?')
                        write(1, "a", 1);
                else
                        write(1, &key[i], 1);
                i++;
        }
        write(1, "\n", 1);
}



int             main(void)
{
        char    key[51];
        char    hint[51];
        int             first = -1;
        int             max;
        int             i;

        scanf("%s%s", key, hint);
        max = strlen(key) - strlen(hint);
        for (i = 0; i <= max; i++)
        {
                if (check_hint(&key[i], hint))
                        first = i;
        }
        if (first == -1)
        {
                printf("%s\n", NOANSWER);
                return (0);
        }
        print_answer(key, hint, first);
        return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	check_hint
	.type	check_hint, @function
check_hint:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	je	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	check_hint, .-check_hint
	.section	.rodata
.LC0:
	.string	"a"
.LC1:
	.string	"\n"
	.text
	.globl	print_answer
	.type	print_answer, @function
print_answer:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L7
.L10:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	jne	.L8
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L9:
	addl	$1, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L10
	jmp	.L11
.L12:
	movq	-32(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	addq	$1, -32(%rbp)
	addl	$1, -4(%rbp)
.L11:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L12
	jmp	.L13
.L16:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	jne	.L14
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L15
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L15:
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L16
	movl	$1, %edx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	print_answer, .-print_answer
	.section	.rodata
.LC2:
	.string	"%s%s"
.LC3:
	.string	"UNRESTORABLE"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$152, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$-1, -156(%rbp)
	leaq	-80(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-144(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %ebx
	leaq	-80(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -148(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L18
.L20:
	leaq	-144(%rbp), %rdx
	movl	-152(%rbp), %eax
	cltq
	addq	%rax, %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	check_hint
	testl	%eax, %eax
	je	.L19
	movl	-152(%rbp), %eax
	movl	%eax, -156(%rbp)
.L19:
	addl	$1, -152(%rbp)
.L18:
	movl	-152(%rbp), %eax
	cmpl	-148(%rbp), %eax
	jle	.L20
	cmpl	$-1, -156(%rbp)
	jne	.L21
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L23
.L21:
	movl	-156(%rbp), %edx
	leaq	-80(%rbp), %rcx
	leaq	-144(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	print_answer
	movl	$0, %eax
.L23:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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
	.globl	check_hint
	.type	check_hint, @function
check_hint:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	je	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L3
	movl	$0, %eax
	jmp	.L4
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	check_hint, .-check_hint
	.section	.rodata
.LC0:
	.string	"a"
.LC1:
	.string	"\n"
	.text
	.globl	print_answer
	.type	print_answer, @function
print_answer:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L7
.L10:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	jne	.L8
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L9:
	addl	$1, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L10
	jmp	.L11
.L12:
	movq	-32(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	addq	$1, -32(%rbp)
	addl	$1, -4(%rbp)
.L11:
	movq	-32(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L12
	jmp	.L13
.L16:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$63, %al
	jne	.L14
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L15
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L15:
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L16
	movl	$1, %edx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	print_answer, .-print_answer
	.section	.rodata
.LC2:
	.string	"%s%s"
.LC3:
	.string	"UNRESTORABLE"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$152, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$-1, -156(%rbp)
	leaq	-80(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-144(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %ebx
	leaq	-80(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	movl	%ebx, %eax
	subl	%edx, %eax
	movl	%eax, -148(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L18
.L20:
	leaq	-144(%rbp), %rdx
	movl	-152(%rbp), %eax
	cltq
	addq	%rax, %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	check_hint
	testl	%eax, %eax
	je	.L19
	movl	-152(%rbp), %eax
	movl	%eax, -156(%rbp)
.L19:
	addl	$1, -152(%rbp)
.L18:
	movl	-152(%rbp), %eax
	cmpl	-148(%rbp), %eax
	jle	.L20
	cmpl	$-1, -156(%rbp)
	jne	.L21
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L23
.L21:
	movl	-156(%rbp), %edx
	leaq	-80(%rbp), %rcx
	leaq	-144(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	print_answer
	movl	$0, %eax
.L23:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
