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

```c
#include<stdio.h>
int main(void){
	int n,m;
	int i,j;
	char str1[20000];
	char str2[100000];
	while(scanf(" %d",&n)){
		if(n == 0){
			break;
		}
	for(i = 0;i < n * 2;i++){
		scanf(" %c",&str1[i]);
	}
	scanf("%d",&m);
	for(i = 0;i < m;i++){
		scanf(" %c",&str2[i]);
	}
	i = 0;
	while(str2[i] != '\0'){
		for(j = 0;j < n * 2;j = j + 2){
			if(str2[i] == str1[j]){
				str2[i] = str1[j+1];
				break;
			}
		}
		i++;
	}
	str2[i] = '\0';
	for(i = 0;i < m;i++){
		printf("%c",str2[i]);
	}
	printf("\n");
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c"
.LC2:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-118784(%rsp), %r11
	.cfi_def_cfa 11, 118840
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1272, %rsp
	.cfi_def_cfa_offset 120112
	leaq	.LC2(%rip), %r12
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 120040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L3
	movl	$0, %ebx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%r14,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addl	%eax, %eax
	cmpl	%ebx, %eax
	jg	.L4
.L7:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	leaq	20032(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L43
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rbx,%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	cmpl	%r15d, %r8d
	jg	.L5
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	je	.L21
.L16:
	movl	24(%rsp), %eax
	movl	$1, %r9d
	movq	%rbx, %rdi
	subl	%ebx, %r9d
	leal	(%rax,%rax), %esi
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	testl	%esi, %esi
	jg	.L12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$2, %rax
	cmpl	%eax, %esi
	jle	.L11
.L12:
	movl	%eax, %edx
	cmpb	%r10b, (%r14,%rax)
	jne	.L10
	addl	$1, %edx
	movslq	%edx, %rdx
	movzbl	32(%rsp,%rdx), %eax
	movb	%al, (%rdi)
.L11:
	leal	(%r9,%rdi), %eax
	movzbl	1(%rdi), %r10d
	addq	$1, %rdi
	testb	%r10b, %r10b
	jne	.L9
.L8:
	cltq
	xorl	%r15d, %r15d
	movb	$0, 20032(%rsp,%rax)
	testl	%r8d, %r8d
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movsbl	(%rbx,%r15), %edi
	addq	$1, %r15
	call	putchar@PLT
	cmpl	%r15d, 28(%rsp)
	jg	.L13
.L14:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
.L3:
	movq	120040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$120056, %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
.L43:
	.cfi_restore_state
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	jne	.L16
	jmp	.L14
.L21:
	xorl	%eax, %eax
	jmp	.L8
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c"
.LC2:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-118784(%rsp), %r11
	.cfi_def_cfa 11, 118840
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1272, %rsp
	.cfi_def_cfa_offset 120112
	leaq	.LC2(%rip), %r12
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 120040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L3
	movl	$0, %ebx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%r14,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addl	%eax, %eax
	cmpl	%ebx, %eax
	jg	.L4
.L7:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	leaq	20032(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L43
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rbx,%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	cmpl	%r15d, %r8d
	jg	.L5
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	je	.L21
.L16:
	movl	24(%rsp), %eax
	movl	$1, %r9d
	movq	%rbx, %rdi
	subl	%ebx, %r9d
	leal	(%rax,%rax), %esi
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	testl	%esi, %esi
	jg	.L12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$2, %rax
	cmpl	%eax, %esi
	jle	.L11
.L12:
	movl	%eax, %edx
	cmpb	%r10b, (%r14,%rax)
	jne	.L10
	addl	$1, %edx
	movslq	%edx, %rdx
	movzbl	32(%rsp,%rdx), %eax
	movb	%al, (%rdi)
.L11:
	leal	(%r9,%rdi), %eax
	movzbl	1(%rdi), %r10d
	addq	$1, %rdi
	testb	%r10b, %r10b
	jne	.L9
.L8:
	cltq
	xorl	%r15d, %r15d
	movb	$0, 20032(%rsp,%rax)
	testl	%r8d, %r8d
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movsbl	(%rbx,%r15), %edi
	addq	$1, %r15
	call	putchar@PLT
	cmpl	%r15d, 28(%rsp)
	jg	.L13
.L14:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
.L3:
	movq	120040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$120056, %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
.L43:
	.cfi_restore_state
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	jne	.L16
	jmp	.L14
.L21:
	xorl	%eax, %eax
	jmp	.L8
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c"
.LC2:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-118784(%rsp), %r11
	.cfi_def_cfa 11, 118840
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1272, %rsp
	.cfi_def_cfa_offset 120112
	leaq	.LC2(%rip), %r12
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 120040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L3
	movl	$0, %ebx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%r14,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addl	%eax, %eax
	cmpl	%ebx, %eax
	jg	.L4
.L7:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	leaq	20032(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L43
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rbx,%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	cmpl	%r15d, %r8d
	jg	.L5
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	je	.L21
.L16:
	movl	24(%rsp), %eax
	movl	$1, %r9d
	movq	%rbx, %rdi
	subl	%ebx, %r9d
	leal	(%rax,%rax), %esi
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	testl	%esi, %esi
	jg	.L12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$2, %rax
	cmpl	%eax, %esi
	jle	.L11
.L12:
	movl	%eax, %edx
	cmpb	%r10b, (%r14,%rax)
	jne	.L10
	addl	$1, %edx
	movslq	%edx, %rdx
	movzbl	32(%rsp,%rdx), %eax
	movb	%al, (%rdi)
.L11:
	leal	(%r9,%rdi), %eax
	movzbl	1(%rdi), %r10d
	addq	$1, %rdi
	testb	%r10b, %r10b
	jne	.L9
.L8:
	cltq
	xorl	%r15d, %r15d
	movb	$0, 20032(%rsp,%rax)
	testl	%r8d, %r8d
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movsbl	(%rbx,%r15), %edi
	addq	$1, %r15
	call	putchar@PLT
	cmpl	%r15d, 28(%rsp)
	jg	.L13
.L14:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
.L3:
	movq	120040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$120056, %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
.L43:
	.cfi_restore_state
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	jne	.L16
	jmp	.L14
.L21:
	xorl	%eax, %eax
	jmp	.L8
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include<stdio.h>
int main(void){
	int n,m;
	int i,j;
	char str1[20000];
	char str2[100000];
	while(scanf(" %d",&n)){
		if(n == 0){
			break;
		}
	for(i = 0;i < n * 2;i++){
		scanf(" %c",&str1[i]);
	}
	scanf("%d",&m);
	for(i = 0;i < m;i++){
		scanf(" %c",&str2[i]);
	}
	i = 0;
	while(str2[i] != '\0'){
		for(j = 0;j < n * 2;j = j + 2){
			if(str2[i] == str1[j]){
				str2[i] = str1[j+1];
				break;
			}
		}
		i++;
	}
	str2[i] = '\0';
	for(i = 0;i < m;i++){
		printf("%c",str2[i]);
	}
	printf("\n");
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void){
	int n,m;
	int i,j;
	char str1[20000];
	char str2[100000];
	while(scanf(" %d",&n)){
		if(n == 0){
			break;
		}
	for(i = 0;i < n * 2;i++){
		scanf(" %c",&str1[i]);
	}
	scanf("%d",&m);
	for(i = 0;i < m;i++){
		scanf(" %c",&str2[i]);
	}
	i = 0;
	while(str2[i] != '\0'){
		for(j = 0;j < n * 2;j = j + 2){
			if(str2[i] == str1[j]){
				str2[i] = str1[j+1];
				break;
			}
		}
		i++;
	}
	str2[i] = '\0';
	for(i = 0;i < m;i++){
		printf("%c",str2[i]);
	}
	printf("\n");
	}
	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
#include<stdio.h>
int main(void){
	int n,m;
	int i,j;
	char str1[20000];
	char str2[100000];
	while(scanf(" %d",&n)){
		if(n == 0){
			break;
		}
	for(i = 0;i < n * 2;i++){
		scanf(" %c",&str1[i]);
	}
	scanf("%d",&m);
	for(i = 0;i < m;i++){
		scanf(" %c",&str2[i]);
	}
	i = 0;
	while(str2[i] != '\0'){
		for(j = 0;j < n * 2;j = j + 2){
			if(str2[i] == str1[j]){
				str2[i] = str1[j+1];
				break;
			}
		}
		i++;
	}
	str2[i] = '\0';
	for(i = 0;i < m;i++){
		printf("%c",str2[i]);
	}
	printf("\n");
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c"
.LC2:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-118784(%rsp), %r11
	.cfi_def_cfa 11, 118840
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1272, %rsp
	.cfi_def_cfa_offset 120112
	leaq	.LC2(%rip), %r12
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 120040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L3
	movl	$0, %ebx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%r14,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addl	%eax, %eax
	cmpl	%ebx, %eax
	jg	.L4
.L7:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	leaq	20032(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L43
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rbx,%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	cmpl	%r15d, %r8d
	jg	.L5
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	je	.L21
.L16:
	movl	24(%rsp), %eax
	movl	$1, %r9d
	movq	%rbx, %rdi
	subl	%ebx, %r9d
	leal	(%rax,%rax), %esi
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	testl	%esi, %esi
	jg	.L12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$2, %rax
	cmpl	%eax, %esi
	jle	.L11
.L12:
	movl	%eax, %edx
	cmpb	%r10b, (%r14,%rax)
	jne	.L10
	addl	$1, %edx
	movslq	%edx, %rdx
	movzbl	32(%rsp,%rdx), %eax
	movb	%al, (%rdi)
.L11:
	leal	(%r9,%rdi), %eax
	movzbl	1(%rdi), %r10d
	addq	$1, %rdi
	testb	%r10b, %r10b
	jne	.L9
.L8:
	cltq
	xorl	%r15d, %r15d
	movb	$0, 20032(%rsp,%rax)
	testl	%r8d, %r8d
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movsbl	(%rbx,%r15), %edi
	addq	$1, %r15
	call	putchar@PLT
	cmpl	%r15d, 28(%rsp)
	jg	.L13
.L14:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
.L3:
	movq	120040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$120056, %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
.L43:
	.cfi_restore_state
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	jne	.L16
	jmp	.L14
.L21:
	xorl	%eax, %eax
	jmp	.L8
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c"
.LC2:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-118784(%rsp), %r11
	.cfi_def_cfa 11, 118840
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1272, %rsp
	.cfi_def_cfa_offset 120112
	leaq	.LC2(%rip), %r12
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 120040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %r13
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L3
	movl	$0, %ebx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%r14,%rbx), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addl	%eax, %eax
	cmpl	%ebx, %eax
	jg	.L4
.L7:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	leaq	20032(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L43
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	(%rbx,%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	cmpl	%r15d, %r8d
	jg	.L5
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	je	.L21
.L16:
	movl	24(%rsp), %eax
	movl	$1, %r9d
	movq	%rbx, %rdi
	subl	%ebx, %r9d
	leal	(%rax,%rax), %esi
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	testl	%esi, %esi
	jg	.L12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$2, %rax
	cmpl	%eax, %esi
	jle	.L11
.L12:
	movl	%eax, %edx
	cmpb	%r10b, (%r14,%rax)
	jne	.L10
	addl	$1, %edx
	movslq	%edx, %rdx
	movzbl	32(%rsp,%rdx), %eax
	movb	%al, (%rdi)
.L11:
	leal	(%r9,%rdi), %eax
	movzbl	1(%rdi), %r10d
	addq	$1, %rdi
	testb	%r10b, %r10b
	jne	.L9
.L8:
	cltq
	xorl	%r15d, %r15d
	movb	$0, 20032(%rsp,%rax)
	testl	%r8d, %r8d
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movsbl	(%rbx,%r15), %edi
	addq	$1, %r15
	call	putchar@PLT
	cmpl	%r15d, 28(%rsp)
	jg	.L13
.L14:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
.L3:
	movq	120040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$120056, %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
.L43:
	.cfi_restore_state
	movzbl	20032(%rsp), %r10d
	testb	%r10b, %r10b
	jne	.L16
	jmp	.L14
.L21:
	xorl	%eax, %eax
	jmp	.L8
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```