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>

char ans[100000005];
int main()
{
	int n;
	int m, i;
	char c[10005];
	char a, data;

	while(1){
		for(i=0; i<10005; i++){
			c[i] = 0;
		}
		scanf("%d", &n);
		if(n==0)
			break;

		for(i=0; i<n; i++){
			scanf(" %c", &a);
			scanf("	%c", &c[a]);
		}
		scanf("%ld", &m);
		for(i=0; i<m; i++){
			scanf(" %c", &data);
			if(c[data] != 0)
				ans[i] = c[data];
			else
				ans[i] = data;
		}
		ans[i] = '\0';
		printf("%s\n", ans);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c"
.LC2:
	.string	"\t%c"
.LC3:
	.string	"%ld"
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$1864, %rsp
	.cfi_def_cfa_offset 10112
	leaq	.LC1(%rip), %rbx
	leaq	.LC2(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 10040(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
.L9:
	movl	$10005, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	jle	.L3
	xorl	%r14d, %r14d
	leaq	22(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movsbq	22(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L3:
	leaq	28(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	ans(%rip), %r14
	xorl	%r15d, %r15d
	leaq	23(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbq	23(%rsp), %rsi
	movq	%rsi, %rax
	movzbl	32(%rsp,%rsi), %esi
	testb	%sil, %sil
	je	.L6
	movb	%sil, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
.L5:
	movslq	%r15d, %rdx
	leaq	ans(%rip), %rax
	movb	$0, (%rax,%rdx)
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	movb	%al, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
	jmp	.L5
.L2:
	movq	10040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$10056, %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
.L11:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L5
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 100000005
ans:
	.zero	100000005
	.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	"\t%c"
.LC3:
	.string	"%ld"
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$1864, %rsp
	.cfi_def_cfa_offset 10112
	leaq	.LC1(%rip), %rbx
	leaq	.LC2(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 10040(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
.L9:
	movl	$10005, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	jle	.L3
	xorl	%r14d, %r14d
	leaq	22(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movsbq	22(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L3:
	leaq	28(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	ans(%rip), %r14
	xorl	%r15d, %r15d
	leaq	23(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbq	23(%rsp), %rsi
	movq	%rsi, %rax
	movzbl	32(%rsp,%rsi), %esi
	testb	%sil, %sil
	je	.L6
	movb	%sil, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
.L5:
	movslq	%r15d, %rdx
	leaq	ans(%rip), %rax
	movb	$0, (%rax,%rdx)
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	movb	%al, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
	jmp	.L5
.L2:
	movq	10040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$10056, %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
.L11:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L5
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 100000005
ans:
	.zero	100000005
	.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	"\t%c"
.LC3:
	.string	"%ld"
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$1864, %rsp
	.cfi_def_cfa_offset 10112
	leaq	.LC1(%rip), %rbx
	leaq	.LC2(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 10040(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
.L9:
	movl	$10005, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	jle	.L3
	xorl	%r14d, %r14d
	leaq	22(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movsbq	22(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L3:
	leaq	28(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	ans(%rip), %r14
	xorl	%r15d, %r15d
	leaq	23(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbq	23(%rsp), %rsi
	movq	%rsi, %rax
	movzbl	32(%rsp,%rsi), %esi
	testb	%sil, %sil
	je	.L6
	movb	%sil, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
.L5:
	movslq	%r15d, %rdx
	leaq	ans(%rip), %rax
	movb	$0, (%rax,%rdx)
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	movb	%al, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
	jmp	.L5
.L2:
	movq	10040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$10056, %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
.L11:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L5
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 100000005
ans:
	.zero	100000005
	.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>

char ans[100000005];
int main()
{
	int n;
	int m, i;
	char c[10005];
	char a, data;

	while(1){
		for(i=0; i<10005; i++){
			c[i] = 0;
		}
		scanf("%d", &n);
		if(n==0)
			break;

		for(i=0; i<n; i++){
			scanf(" %c", &a);
			scanf("	%c", &c[a]);
		}
		scanf("%ld", &m);
		for(i=0; i<m; i++){
			scanf(" %c", &data);
			if(c[data] != 0)
				ans[i] = c[data];
			else
				ans[i] = data;
		}
		ans[i] = '\0';
		printf("%s\n", ans);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

char ans[100000005];
int main()
{
	int n;
	int m, i;
	char c[10005];
	char a, data;

	while(1){
		for(i=0; i<10005; i++){
			c[i] = 0;
		}
		scanf("%d", &n);
		if(n==0)
			break;

		for(i=0; i<n; i++){
			scanf(" %c", &a);
			scanf("	%c", &c[a]);
		}
		scanf("%ld", &m);
		for(i=0; i<m; i++){
			scanf(" %c", &data);
			if(c[data] != 0)
				ans[i] = c[data];
			else
				ans[i] = data;
		}
		ans[i] = '\0';
		printf("%s\n", ans);
	}
	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>

char ans[100000005];
int main()
{
	int n;
	int m, i;
	char c[10005];
	char a, data;

	while(1){
		for(i=0; i<10005; i++){
			c[i] = 0;
		}
		scanf("%d", &n);
		if(n==0)
			break;

		for(i=0; i<n; i++){
			scanf(" %c", &a);
			scanf("	%c", &c[a]);
		}
		scanf("%ld", &m);
		for(i=0; i<m; i++){
			scanf(" %c", &data);
			if(c[data] != 0)
				ans[i] = c[data];
			else
				ans[i] = data;
		}
		ans[i] = '\0';
		printf("%s\n", ans);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c"
.LC2:
	.string	"\t%c"
.LC3:
	.string	"%ld"
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$1864, %rsp
	.cfi_def_cfa_offset 10112
	leaq	.LC1(%rip), %rbx
	leaq	.LC2(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 10040(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
.L9:
	movl	$10005, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	jle	.L3
	xorl	%r14d, %r14d
	leaq	22(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movsbq	22(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L3:
	leaq	28(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	ans(%rip), %r14
	xorl	%r15d, %r15d
	leaq	23(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbq	23(%rsp), %rsi
	movq	%rsi, %rax
	movzbl	32(%rsp,%rsi), %esi
	testb	%sil, %sil
	je	.L6
	movb	%sil, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
.L5:
	movslq	%r15d, %rdx
	leaq	ans(%rip), %rax
	movb	$0, (%rax,%rdx)
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	movb	%al, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
	jmp	.L5
.L2:
	movq	10040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$10056, %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
.L11:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L5
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 100000005
ans:
	.zero	100000005
	.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	"\t%c"
.LC3:
	.string	"%ld"
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$1864, %rsp
	.cfi_def_cfa_offset 10112
	leaq	.LC1(%rip), %rbx
	leaq	.LC2(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 10040(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
.L9:
	movl	$10005, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	jle	.L3
	xorl	%r14d, %r14d
	leaq	22(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movsbq	22(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L3:
	leaq	28(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	ans(%rip), %r14
	xorl	%r15d, %r15d
	leaq	23(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movsbq	23(%rsp), %rsi
	movq	%rsi, %rax
	movzbl	32(%rsp,%rsi), %esi
	testb	%sil, %sil
	je	.L6
	movb	%sil, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
.L5:
	movslq	%r15d, %rdx
	leaq	ans(%rip), %rax
	movb	$0, (%rax,%rdx)
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	movb	%al, (%r14)
	addl	$1, %r15d
	addq	$1, %r14
	cmpl	%r15d, 28(%rsp)
	jg	.L8
	jmp	.L5
.L2:
	movq	10040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$10056, %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
.L11:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L5
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 100000005
ans:
	.zero	100000005
	.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:
```