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

```c
// AOJ 0501: Data Conversion
// 2017.10.25 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

char t['z'+1];
char s[100005], *p;

int main()
{
	int n, m, i;
	char b[33];

	while (fgets(b, 32, stdin) && *b != '0') {
		for (i = '0'; i <= 'z'; i++) t[i] = i;
		n = atoi(b);
		while (n-- > 0) {
			fgets(b, 32, stdin);
			t[*b] = *(b+2);
		}
		fgets(b, 32, stdin);
		m = atoi(b); p = s;
		while (m-- > 0) {
			fgets(b, 32, stdin);
			*p++ = t[*b];
		}
		*p = 0;
		puts(s);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L7
	cmpb	$48, (%rsp)
	je	.L7
	movq	.LC4(%rip), %rax
	movdqa	.LC0(%rip), %xmm0
	movl	$10, %edx
	xorl	%esi, %esi
	movdqa	.LC1(%rip), %xmm1
	movdqa	.LC2(%rip), %xmm2
	movq	%rbp, %rdi
	movb	$122, 122+t(%rip)
	movdqa	.LC3(%rip), %xmm3
	movq	%rax, 112+t(%rip)
	movl	$31096, %eax
	leaq	t(%rip), %r12
	movw	%ax, 120+t(%rip)
	movaps	%xmm0, 48+t(%rip)
	movaps	%xmm1, 64+t(%rip)
	movaps	%xmm2, 80+t(%rip)
	movaps	%xmm3, 96+t(%rip)
	call	strtol@PLT
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movsbq	(%rsp), %rax
	movzbl	2(%rsp), %edx
	movb	%dl, (%r12,%rax)
	subl	$1, %ebx
	jnb	.L3
.L6:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	leaq	s(%rip), %r13
	leaq	t(%rip), %r12
	call	fgets@PLT
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%r13, p(%rip)
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movsbq	(%rsp), %rdx
	movzbl	(%r12,%rdx), %edx
	movb	%dl, (%rax)
	subl	$1, %ebx
	jnb	.L4
	movq	p(%rip), %rax
.L5:
	movb	$0, (%rax)
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movq	%r13, %rax
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 123
t:
	.zero	123
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.byte	48
	.byte	49
	.byte	50
	.byte	51
	.byte	52
	.byte	53
	.byte	54
	.byte	55
	.byte	56
	.byte	57
	.byte	58
	.byte	59
	.byte	60
	.byte	61
	.byte	62
	.byte	63
	.align 16
.LC1:
	.byte	64
	.byte	65
	.byte	66
	.byte	67
	.byte	68
	.byte	69
	.byte	70
	.byte	71
	.byte	72
	.byte	73
	.byte	74
	.byte	75
	.byte	76
	.byte	77
	.byte	78
	.byte	79
	.align 16
.LC2:
	.byte	80
	.byte	81
	.byte	82
	.byte	83
	.byte	84
	.byte	85
	.byte	86
	.byte	87
	.byte	88
	.byte	89
	.byte	90
	.byte	91
	.byte	92
	.byte	93
	.byte	94
	.byte	95
	.align 16
.LC3:
	.byte	96
	.byte	97
	.byte	98
	.byte	99
	.byte	100
	.byte	101
	.byte	102
	.byte	103
	.byte	104
	.byte	105
	.byte	106
	.byte	107
	.byte	108
	.byte	109
	.byte	110
	.byte	111
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.byte	112
	.byte	113
	.byte	114
	.byte	115
	.byte	116
	.byte	117
	.byte	118
	.byte	119
	.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	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L7
	cmpb	$48, (%rsp)
	je	.L7
	movq	.LC4(%rip), %rax
	movdqa	.LC0(%rip), %xmm0
	movl	$10, %edx
	xorl	%esi, %esi
	movdqa	.LC1(%rip), %xmm1
	movdqa	.LC2(%rip), %xmm2
	movq	%rbp, %rdi
	movb	$122, 122+t(%rip)
	movdqa	.LC3(%rip), %xmm3
	movq	%rax, 112+t(%rip)
	movl	$31096, %eax
	leaq	t(%rip), %r12
	movw	%ax, 120+t(%rip)
	movaps	%xmm0, 48+t(%rip)
	movaps	%xmm1, 64+t(%rip)
	movaps	%xmm2, 80+t(%rip)
	movaps	%xmm3, 96+t(%rip)
	call	strtol@PLT
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movsbq	(%rsp), %rax
	movzbl	2(%rsp), %edx
	movb	%dl, (%r12,%rax)
	subl	$1, %ebx
	jnb	.L3
.L6:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	leaq	s(%rip), %r13
	leaq	t(%rip), %r12
	call	fgets@PLT
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%r13, p(%rip)
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movsbq	(%rsp), %rdx
	movzbl	(%r12,%rdx), %edx
	movb	%dl, (%rax)
	subl	$1, %ebx
	jnb	.L4
	movq	p(%rip), %rax
.L5:
	movb	$0, (%rax)
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movq	%r13, %rax
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 123
t:
	.zero	123
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.byte	48
	.byte	49
	.byte	50
	.byte	51
	.byte	52
	.byte	53
	.byte	54
	.byte	55
	.byte	56
	.byte	57
	.byte	58
	.byte	59
	.byte	60
	.byte	61
	.byte	62
	.byte	63
	.align 16
.LC1:
	.byte	64
	.byte	65
	.byte	66
	.byte	67
	.byte	68
	.byte	69
	.byte	70
	.byte	71
	.byte	72
	.byte	73
	.byte	74
	.byte	75
	.byte	76
	.byte	77
	.byte	78
	.byte	79
	.align 16
.LC2:
	.byte	80
	.byte	81
	.byte	82
	.byte	83
	.byte	84
	.byte	85
	.byte	86
	.byte	87
	.byte	88
	.byte	89
	.byte	90
	.byte	91
	.byte	92
	.byte	93
	.byte	94
	.byte	95
	.align 16
.LC3:
	.byte	96
	.byte	97
	.byte	98
	.byte	99
	.byte	100
	.byte	101
	.byte	102
	.byte	103
	.byte	104
	.byte	105
	.byte	106
	.byte	107
	.byte	108
	.byte	109
	.byte	110
	.byte	111
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.byte	112
	.byte	113
	.byte	114
	.byte	115
	.byte	116
	.byte	117
	.byte	118
	.byte	119
	.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	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L7
	cmpb	$48, (%rsp)
	je	.L7
	movq	.LC4(%rip), %rax
	movdqa	.LC0(%rip), %xmm0
	movl	$10, %edx
	xorl	%esi, %esi
	movdqa	.LC1(%rip), %xmm1
	movdqa	.LC2(%rip), %xmm2
	movq	%rbp, %rdi
	movb	$122, 122+t(%rip)
	movdqa	.LC3(%rip), %xmm3
	movq	%rax, 112+t(%rip)
	movl	$31096, %eax
	leaq	t(%rip), %r12
	movw	%ax, 120+t(%rip)
	movaps	%xmm0, 48+t(%rip)
	movaps	%xmm1, 64+t(%rip)
	movaps	%xmm2, 80+t(%rip)
	movaps	%xmm3, 96+t(%rip)
	call	strtol@PLT
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movsbq	(%rsp), %rax
	movzbl	2(%rsp), %edx
	movb	%dl, (%r12,%rax)
	subl	$1, %ebx
	jnb	.L3
.L6:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	leaq	s(%rip), %r13
	leaq	t(%rip), %r12
	call	fgets@PLT
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%r13, p(%rip)
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movsbq	(%rsp), %rdx
	movzbl	(%r12,%rdx), %edx
	movb	%dl, (%rax)
	subl	$1, %ebx
	jnb	.L4
	movq	p(%rip), %rax
.L5:
	movb	$0, (%rax)
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movq	%r13, %rax
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 123
t:
	.zero	123
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.byte	48
	.byte	49
	.byte	50
	.byte	51
	.byte	52
	.byte	53
	.byte	54
	.byte	55
	.byte	56
	.byte	57
	.byte	58
	.byte	59
	.byte	60
	.byte	61
	.byte	62
	.byte	63
	.align 16
.LC1:
	.byte	64
	.byte	65
	.byte	66
	.byte	67
	.byte	68
	.byte	69
	.byte	70
	.byte	71
	.byte	72
	.byte	73
	.byte	74
	.byte	75
	.byte	76
	.byte	77
	.byte	78
	.byte	79
	.align 16
.LC2:
	.byte	80
	.byte	81
	.byte	82
	.byte	83
	.byte	84
	.byte	85
	.byte	86
	.byte	87
	.byte	88
	.byte	89
	.byte	90
	.byte	91
	.byte	92
	.byte	93
	.byte	94
	.byte	95
	.align 16
.LC3:
	.byte	96
	.byte	97
	.byte	98
	.byte	99
	.byte	100
	.byte	101
	.byte	102
	.byte	103
	.byte	104
	.byte	105
	.byte	106
	.byte	107
	.byte	108
	.byte	109
	.byte	110
	.byte	111
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.byte	112
	.byte	113
	.byte	114
	.byte	115
	.byte	116
	.byte	117
	.byte	118
	.byte	119
	.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
// AOJ 0501: Data Conversion
// 2017.10.25 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

char t['z'+1];
char s[100005], *p;

int main()
{
	int n, m, i;
	char b[33];

	while (fgets(b, 32, stdin) && *b != '0') {
		for (i = '0'; i <= 'z'; i++) t[i] = i;
		n = atoi(b);
		while (n-- > 0) {
			fgets(b, 32, stdin);
			t[*b] = *(b+2);
		}
		fgets(b, 32, stdin);
		m = atoi(b); p = s;
		while (m-- > 0) {
			fgets(b, 32, stdin);
			*p++ = t[*b];
		}
		*p = 0;
		puts(s);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 0501: Data Conversion
// 2017.10.25 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

char t['z'+1];
char s[100005], *p;

int main()
{
	int n, m, i;
	char b[33];

	while (fgets(b, 32, stdin) && *b != '0') {
		for (i = '0'; i <= 'z'; i++) t[i] = i;
		n = atoi(b);
		while (n-- > 0) {
			fgets(b, 32, stdin);
			t[*b] = *(b+2);
		}
		fgets(b, 32, stdin);
		m = atoi(b); p = s;
		while (m-- > 0) {
			fgets(b, 32, stdin);
			*p++ = t[*b];
		}
		*p = 0;
		puts(s);
	}
	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:

3
A a
0 5
5 4
10
B
B
C
0
1
4
5
a
b
A
3
A a
0 5
5 4
10
A
B
C
0
1
4
5
a
b
A
0
 3
A a
0 0
5 4
10
B
B
C
0
1
4
5
a
b
A
3
A a
0 5
5 4
10
A
B
C
0
1
4
5
a
b
A
0
 3
A a
0 0
5 4
10
B
B
C
0
1
4
5
a
b
A
3
@ a
0 5
5 4
10
A
B
C
0
1
4
5
a
b
A
0
 3
A a
0 0
5 4
10
B
B
C
0
1
4
5
a
b
A
3
@ a
0 5
5 4
10
A
B
C
0
1
4
5
a
b
@
0
 3
A a
0 0
5 4
10
B
B
C
0
1
4
5
a
b
A
3
@ a
0 5
5 5
10
A
B
C
0
1
4
5
a
b
@
0
 3
A a
0 0
5 4
10
B
B
C
0
1
0
5
a
b
A
3
@ a
0 5
5 5
10
A
B
C
0
1
4
5
a
b
@
0
 3
A a
0 0
5 4
10
B
B
C
0
1
0
5
a
c
A
3
@ a
0 5
5 5
10
A
B
C
0
1
4
5
a
b
@
0
 3
A a
0 5
5 4
10
A
B
C
0
1
4
5
a
b
A
3
A a
0 5
5 4
10
@
B
C
0
1
4
5
a
b
A
0
 3
A a
0 5
5 4
10
B
B
C
0
1
4
5
a
b
A
3
A a
0 5
5 4
10
A
C
C
0
1
4
5
a
b
A
0
 3
A a
0 0
5 4
10
A
B
C
0
1
4
5
a
b
A
3
A a
0 5
5 4
10
A
B
C
0
1
4
5
a
b
A
0

BBC5144aba
aBC5144aba
 BBC0144aba
aBC5144aba
 BBC0144aba
ABC5144abA
 BBC0144aba
ABC5144aba
 BBC0144aba
ABC5145aba
 BBC0104aba
ABC5145aba
 BBC0104aca
ABC5145aba
 aBC5144aba
@BC5144aba
 BBC5144aba
aCC5144aba
 aBC0144aba
aBC5144aba

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

```c
// AOJ 0501: Data Conversion
// 2017.10.25 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

char t['z'+1];
char s[100005], *p;

int main()
{
	int n, m, i;
	char b[33];

	while (fgets(b, 32, stdin) && *b != '0') {
		for (i = '0'; i <= 'z'; i++) t[i] = i;
		n = atoi(b);
		while (n-- > 0) {
			fgets(b, 32, stdin);
			t[*b] = *(b+2);
		}
		fgets(b, 32, stdin);
		m = atoi(b); p = s;
		while (m-- > 0) {
			fgets(b, 32, stdin);
			*p++ = t[*b];
		}
		*p = 0;
		puts(s);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L7
	cmpb	$48, (%rsp)
	je	.L7
	movq	.LC4(%rip), %rax
	movdqa	.LC0(%rip), %xmm0
	movl	$10, %edx
	xorl	%esi, %esi
	movdqa	.LC1(%rip), %xmm1
	movdqa	.LC2(%rip), %xmm2
	movq	%rbp, %rdi
	movb	$122, 122+t(%rip)
	movdqa	.LC3(%rip), %xmm3
	movq	%rax, 112+t(%rip)
	movl	$31096, %eax
	leaq	t(%rip), %r12
	movw	%ax, 120+t(%rip)
	movaps	%xmm0, 48+t(%rip)
	movaps	%xmm1, 64+t(%rip)
	movaps	%xmm2, 80+t(%rip)
	movaps	%xmm3, 96+t(%rip)
	call	strtol@PLT
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movsbq	(%rsp), %rax
	movzbl	2(%rsp), %edx
	movb	%dl, (%r12,%rax)
	subl	$1, %ebx
	jnb	.L3
.L6:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	leaq	s(%rip), %r13
	leaq	t(%rip), %r12
	call	fgets@PLT
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%r13, p(%rip)
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movsbq	(%rsp), %rdx
	movzbl	(%r12,%rdx), %edx
	movb	%dl, (%rax)
	subl	$1, %ebx
	jnb	.L4
	movq	p(%rip), %rax
.L5:
	movb	$0, (%rax)
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movq	%r13, %rax
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 123
t:
	.zero	123
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.byte	48
	.byte	49
	.byte	50
	.byte	51
	.byte	52
	.byte	53
	.byte	54
	.byte	55
	.byte	56
	.byte	57
	.byte	58
	.byte	59
	.byte	60
	.byte	61
	.byte	62
	.byte	63
	.align 16
.LC1:
	.byte	64
	.byte	65
	.byte	66
	.byte	67
	.byte	68
	.byte	69
	.byte	70
	.byte	71
	.byte	72
	.byte	73
	.byte	74
	.byte	75
	.byte	76
	.byte	77
	.byte	78
	.byte	79
	.align 16
.LC2:
	.byte	80
	.byte	81
	.byte	82
	.byte	83
	.byte	84
	.byte	85
	.byte	86
	.byte	87
	.byte	88
	.byte	89
	.byte	90
	.byte	91
	.byte	92
	.byte	93
	.byte	94
	.byte	95
	.align 16
.LC3:
	.byte	96
	.byte	97
	.byte	98
	.byte	99
	.byte	100
	.byte	101
	.byte	102
	.byte	103
	.byte	104
	.byte	105
	.byte	106
	.byte	107
	.byte	108
	.byte	109
	.byte	110
	.byte	111
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.byte	112
	.byte	113
	.byte	114
	.byte	115
	.byte	116
	.byte	117
	.byte	118
	.byte	119
	.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	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L7
	cmpb	$48, (%rsp)
	je	.L7
	movq	.LC4(%rip), %rax
	movdqa	.LC0(%rip), %xmm0
	movl	$10, %edx
	xorl	%esi, %esi
	movdqa	.LC1(%rip), %xmm1
	movdqa	.LC2(%rip), %xmm2
	movq	%rbp, %rdi
	movb	$122, 122+t(%rip)
	movdqa	.LC3(%rip), %xmm3
	movq	%rax, 112+t(%rip)
	movl	$31096, %eax
	leaq	t(%rip), %r12
	movw	%ax, 120+t(%rip)
	movaps	%xmm0, 48+t(%rip)
	movaps	%xmm1, 64+t(%rip)
	movaps	%xmm2, 80+t(%rip)
	movaps	%xmm3, 96+t(%rip)
	call	strtol@PLT
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movsbq	(%rsp), %rax
	movzbl	2(%rsp), %edx
	movb	%dl, (%r12,%rax)
	subl	$1, %ebx
	jnb	.L3
.L6:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	leaq	s(%rip), %r13
	leaq	t(%rip), %r12
	call	fgets@PLT
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	%r13, p(%rip)
	leal	-1(%rax), %ebx
	testl	%eax, %eax
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L4:
	movq	stdin(%rip), %rdx
	movl	$32, %esi
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movsbq	(%rsp), %rdx
	movzbl	(%r12,%rdx), %edx
	movb	%dl, (%rax)
	subl	$1, %ebx
	jnb	.L4
	movq	p(%rip), %rax
.L5:
	movb	$0, (%rax)
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movq	%r13, %rax
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100005
s:
	.zero	100005
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 123
t:
	.zero	123
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.byte	48
	.byte	49
	.byte	50
	.byte	51
	.byte	52
	.byte	53
	.byte	54
	.byte	55
	.byte	56
	.byte	57
	.byte	58
	.byte	59
	.byte	60
	.byte	61
	.byte	62
	.byte	63
	.align 16
.LC1:
	.byte	64
	.byte	65
	.byte	66
	.byte	67
	.byte	68
	.byte	69
	.byte	70
	.byte	71
	.byte	72
	.byte	73
	.byte	74
	.byte	75
	.byte	76
	.byte	77
	.byte	78
	.byte	79
	.align 16
.LC2:
	.byte	80
	.byte	81
	.byte	82
	.byte	83
	.byte	84
	.byte	85
	.byte	86
	.byte	87
	.byte	88
	.byte	89
	.byte	90
	.byte	91
	.byte	92
	.byte	93
	.byte	94
	.byte	95
	.align 16
.LC3:
	.byte	96
	.byte	97
	.byte	98
	.byte	99
	.byte	100
	.byte	101
	.byte	102
	.byte	103
	.byte	104
	.byte	105
	.byte	106
	.byte	107
	.byte	108
	.byte	109
	.byte	110
	.byte	111
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.byte	112
	.byte	113
	.byte	114
	.byte	115
	.byte	116
	.byte	117
	.byte	118
	.byte	119
	.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:
```