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>
#define min(X, Y) ((X) < (Y) ? (X) : (Y))

int ch_string(char str[], char ch);

int n;
char str[55];
int ch[30];

int main()
{
	for (int i = 0; i < 30; i++) {
		ch[i] = 100000;
	}

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s", str);

		for (int j = 'a'; j <= 'z'; j++) {
			ch[j - 'a'] = min(ch[j - 'a'], ch_string(str, j));
		}
	}

	for (int i = 'a'; i <= 'z'; i++) {

		if (ch[i - 'a'] < 100000) {
			for (int j = 0; j < ch[i - 'a']; j++) {
				putchar(i);
			}
		}
	}

	return 0;
}

int ch_string(char str[], char ch)
{
	int res = 0;

	while (*str != '\0') {
		if (*str == ch) {
			res++;
		}
		str++;
	}

	return res;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 55
str:
	.zero	55
	.globl	ch
	.align 32
	.type	ch, @object
	.size	ch, 120
ch:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	$100000, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$29, -36(%rbp)
	jle	.L3
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	jmp	.L4
.L9:
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$97, -28(%rbp)
	jmp	.L5
.L8:
	movl	-28(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	ch_string
	cmpl	%eax, %ebx
	jge	.L6
	movl	-28(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L6:
	movl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	ch_string
.L7:
	movl	-28(%rbp), %edx
	subl	$97, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ch(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L5:
	cmpl	$122, -28(%rbp)
	jle	.L8
	addl	$1, -32(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L9
	movl	$97, -24(%rbp)
	jmp	.L10
.L14:
	movl	-24(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$99999, %eax
	jg	.L11
	movl	$0, -20(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -20(%rbp)
.L12:
	movl	-24(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L13
.L11:
	addl	$1, -24(%rbp)
.L10:
	cmpl	$122, -24(%rbp)
	jle	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	ch_string
	.type	ch_string, @function
ch_string:
.LFB1:
	.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)
	movl	%esi, %eax
	movb	%al, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L19:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L18
	addl	$1, -4(%rbp)
.L18:
	addq	$1, -24(%rbp)
.L17:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L19
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ch_string, .-ch_string
	.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
.LC2:
	.string	"%d"
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	str(%rip), %r13
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	-388+ch(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC3(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movq	.LC1(%rip), %rax
	movdqa	.LC0(%rip), %xmm0
	movq	%rax, 112+ch(%rip)
	xorl	%eax, %eax
	movaps	%xmm0, ch(%rip)
	movaps	%xmm0, 16+ch(%rip)
	movaps	%xmm0, 32+ch(%rip)
	movaps	%xmm0, 48+ch(%rip)
	movaps	%xmm0, 64+ch(%rip)
	movaps	%xmm0, 80+ch(%rip)
	movaps	%xmm0, 96+ch(%rip)
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L12
.L2:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	0(%r13), %r9d
	movl	$97, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	0(%rbp,%rsi,4), %edi
	testb	%r9b, %r9b
	je	.L4
	movl	%r9d, %edx
	leaq	str(%rip), %rax
	xorl	%ecx, %ecx
	movl	%esi, %r8d
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	%sil, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %ecx
	movzbl	(%rax), %edx
	testb	%dl, %dl
	jne	.L6
	cmpl	%ecx, %edi
	jge	.L31
.L8:
	movl	%edi, 0(%rbp,%rsi,4)
	addq	$1, %rsi
	cmpq	$123, %rsi
	jne	.L11
	addl	$1, %r12d
	cmpl	%r12d, n(%rip)
	jg	.L2
.L12:
	leaq	ch(%rip), %r12
	movl	$97, %ebp
	.p2align 4,,10
	.p2align 3
.L3:
	movl	(%r12), %eax
	xorl	%ebx, %ebx
	subl	$1, %eax
	cmpl	$99998, %eax
	ja	.L15
.L13:
	movq	stdout(%rip), %rsi
	movl	%ebp, %edi
	addl	$1, %ebx
	call	putc@PLT
	cmpl	%ebx, (%r12)
	jg	.L13
.L15:
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	$123, %ebp
	jne	.L3
	addq	$8, %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
	.p2align 4,,10
	.p2align 3
.L31:
	.cfi_restore_state
	movl	%r9d, %edx
	leaq	str(%rip), %rax
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	%r8b, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %edi
	movzbl	(%rax), %edx
	testb	%dl, %dl
	jne	.L10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	testl	%edi, %edi
	cmovg	%eax, %edi
	jmp	.L8
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.text
	.p2align 4
	.globl	ch_string
	.type	ch_string, @function
ch_string:
.LFB36:
	.cfi_startproc
	endbr64
	movzbl	(%rdi), %eax
	xorl	%r8d, %r8d
	testb	%al, %al
	je	.L32
	.p2align 4,,10
	.p2align 3
.L35:
	cmpb	%sil, %al
	sete	%al
	addq	$1, %rdi
	movzbl	%al, %eax
	addl	%eax, %r8d
	movzbl	(%rdi), %eax
	testb	%al, %al
	jne	.L35
.L32:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	ch_string, .-ch_string
	.globl	ch
	.bss
	.align 32
	.type	ch, @object
	.size	ch, 120
ch:
	.zero	120
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 55
str:
	.zero	55
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	100000
	.long	100000
	.long	100000
	.long	100000
	.set	.LC1,.LC0
	.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
.LC2:
	.string	"%d"
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	str(%rip), %r13
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	-388+ch(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC3(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movq	.LC1(%rip), %rax
	movdqa	.LC0(%rip), %xmm0
	movq	%rax, 112+ch(%rip)
	xorl	%eax, %eax
	movaps	%xmm0, ch(%rip)
	movaps	%xmm0, 16+ch(%rip)
	movaps	%xmm0, 32+ch(%rip)
	movaps	%xmm0, 48+ch(%rip)
	movaps	%xmm0, 64+ch(%rip)
	movaps	%xmm0, 80+ch(%rip)
	movaps	%xmm0, 96+ch(%rip)
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L12
.L2:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	0(%r13), %r9d
	movl	$97, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	0(%rbp,%rsi,4), %edi
	testb	%r9b, %r9b
	je	.L4
	movl	%r9d, %edx
	leaq	str(%rip), %rax
	xorl	%ecx, %ecx
	movl	%esi, %r8d
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	%sil, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %ecx
	movzbl	(%rax), %edx
	testb	%dl, %dl
	jne	.L6
	cmpl	%ecx, %edi
	jge	.L31
.L8:
	movl	%edi, 0(%rbp,%rsi,4)
	addq	$1, %rsi
	cmpq	$123, %rsi
	jne	.L11
	addl	$1, %r12d
	cmpl	%r12d, n(%rip)
	jg	.L2
.L12:
	leaq	ch(%rip), %r12
	movl	$97, %ebp
	.p2align 4,,10
	.p2align 3
.L3:
	movl	(%r12), %eax
	xorl	%ebx, %ebx
	subl	$1, %eax
	cmpl	$99998, %eax
	ja	.L15
.L13:
	movq	stdout(%rip), %rsi
	movl	%ebp, %edi
	addl	$1, %ebx
	call	putc@PLT
	cmpl	%ebx, (%r12)
	jg	.L13
.L15:
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	$123, %ebp
	jne	.L3
	addq	$8, %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
	.p2align 4,,10
	.p2align 3
.L31:
	.cfi_restore_state
	movl	%r9d, %edx
	leaq	str(%rip), %rax
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	%r8b, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %edi
	movzbl	(%rax), %edx
	testb	%dl, %dl
	jne	.L10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	testl	%edi, %edi
	cmovg	%eax, %edi
	jmp	.L8
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.text
	.p2align 4
	.globl	ch_string
	.type	ch_string, @function
ch_string:
.LFB36:
	.cfi_startproc
	endbr64
	movzbl	(%rdi), %eax
	xorl	%r8d, %r8d
	testb	%al, %al
	je	.L32
	.p2align 4,,10
	.p2align 3
.L35:
	cmpb	%sil, %al
	sete	%al
	addq	$1, %rdi
	movzbl	%al, %eax
	addl	%eax, %r8d
	movzbl	(%rdi), %eax
	testb	%al, %al
	jne	.L35
.L32:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	ch_string, .-ch_string
	.globl	ch
	.bss
	.align 32
	.type	ch, @object
	.size	ch, 120
ch:
	.zero	120
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 55
str:
	.zero	55
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	100000
	.long	100000
	.long	100000
	.long	100000
	.set	.LC1,.LC0
	.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>
#define min(X, Y) ((X) < (Y) ? (X) : (Y))

int ch_string(char str[], char ch);

int n;
char str[55];
int ch[30];

int main()
{
	for (int i = 0; i < 30; i++) {
		ch[i] = 100000;
	}

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s", str);

		for (int j = 'a'; j <= 'z'; j++) {
			ch[j - 'a'] = min(ch[j - 'a'], ch_string(str, j));
		}
	}

	for (int i = 'a'; i <= 'z'; i++) {

		if (ch[i - 'a'] < 100000) {
			for (int j = 0; j < ch[i - 'a']; j++) {
				putchar(i);
			}
		}
	}

	return 0;
}

int ch_string(char str[], char ch)
{
	int res = 0;

	while (*str != '\0') {
		if (*str == ch) {
			res++;
		}
		str++;
	}

	return res;
}

3
cbaa
daacc
acacac

aac
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>
#define min(X, Y) ((X) < (Y) ? (X) : (Y))

int ch_string(char str[], char ch);

int n;
char str[55];
int ch[30];

int main()
{
	for (int i = 0; i < 30; i++) {
		ch[i] = 100000;
	}

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s", str);

		for (int j = 'a'; j <= 'z'; j++) {
			ch[j - 'a'] = min(ch[j - 'a'], ch_string(str, j));
		}
	}

	for (int i = 'a'; i <= 'z'; i++) {

		if (ch[i - 'a'] < 100000) {
			for (int j = 0; j < ch[i - 'a']; j++) {
				putchar(i);
			}
		}
	}

	return 0;
}

int ch_string(char str[], char ch)
{
	int res = 0;

	while (*str != '\0') {
		if (*str == ch) {
			res++;
		}
		str++;
	}

	return res;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 55
str:
	.zero	55
	.globl	ch
	.align 32
	.type	ch, @object
	.size	ch, 120
ch:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	$100000, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$29, -36(%rbp)
	jle	.L3
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	jmp	.L4
.L9:
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$97, -28(%rbp)
	jmp	.L5
.L8:
	movl	-28(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	ch_string
	cmpl	%eax, %ebx
	jge	.L6
	movl	-28(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L6:
	movl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	ch_string
.L7:
	movl	-28(%rbp), %edx
	subl	$97, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ch(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L5:
	cmpl	$122, -28(%rbp)
	jle	.L8
	addl	$1, -32(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L9
	movl	$97, -24(%rbp)
	jmp	.L10
.L14:
	movl	-24(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$99999, %eax
	jg	.L11
	movl	$0, -20(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -20(%rbp)
.L12:
	movl	-24(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L13
.L11:
	addl	$1, -24(%rbp)
.L10:
	cmpl	$122, -24(%rbp)
	jle	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	ch_string
	.type	ch_string, @function
ch_string:
.LFB1:
	.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)
	movl	%esi, %eax
	movb	%al, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L19:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L18
	addl	$1, -4(%rbp)
.L18:
	addq	$1, -24(%rbp)
.L17:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L19
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ch_string, .-ch_string
	.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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 55
str:
	.zero	55
	.globl	ch
	.align 32
	.type	ch, @object
	.size	ch, 120
ch:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	$100000, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$29, -36(%rbp)
	jle	.L3
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	jmp	.L4
.L9:
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$97, -28(%rbp)
	jmp	.L5
.L8:
	movl	-28(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %ebx
	movl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	ch_string
	cmpl	%eax, %ebx
	jge	.L6
	movl	-28(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L6:
	movl	-28(%rbp), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	ch_string
.L7:
	movl	-28(%rbp), %edx
	subl	$97, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ch(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L5:
	cmpl	$122, -28(%rbp)
	jle	.L8
	addl	$1, -32(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L9
	movl	$97, -24(%rbp)
	jmp	.L10
.L14:
	movl	-24(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$99999, %eax
	jg	.L11
	movl	$0, -20(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -20(%rbp)
.L12:
	movl	-24(%rbp), %eax
	subl	$97, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ch(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L13
.L11:
	addl	$1, -24(%rbp)
.L10:
	cmpl	$122, -24(%rbp)
	jle	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	ch_string
	.type	ch_string, @function
ch_string:
.LFB1:
	.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)
	movl	%esi, %eax
	movb	%al, -28(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L17
.L19:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, -28(%rbp)
	jne	.L18
	addl	$1, -4(%rbp)
.L18:
	addq	$1, -24(%rbp)
.L17:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L19
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	ch_string, .-ch_string
	.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:
