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>

int main(void)
{
    char bu[10][6] = {
        "",
        ".,!? ",
        "abc",
        "def",
        "ghi",
        "jkl",
        "mno",
        "pqrs",
        "tuv",
        "wxyz"
    };

    int n;
    scanf("%d", &n);
    int i;
    for(i = 0; i < n; i++){
        char line[1025];
        scanf("%s", line);
        int num, p = 0;
        while(line[p] != '\0'){
            num = 0;
            while(line[p] != '0'){
                num++;
                p++;
            }
            if(p > 0 && line[p - 1] != '0'){
                int but_no = line[p - 1] - '0';
                int but_index = num % strlen(bu[but_no]);
                if(but_index > 0)
                    but_index--;
                else
                    but_index += (strlen(bu[but_no]) - 1);
                printf("%c", bu[but_no][but_index]);
            }
            p++;
        }
        printf("\n");
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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	$1144, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -1120(%rbp)
	movw	$0, -1116(%rbp)
	movl	$1059138606, -1114(%rbp)
	movw	$32, -1110(%rbp)
	movl	$6513249, -1108(%rbp)
	movw	$0, -1104(%rbp)
	movl	$6710628, -1102(%rbp)
	movw	$0, -1098(%rbp)
	movl	$6908007, -1096(%rbp)
	movw	$0, -1092(%rbp)
	movl	$7105386, -1090(%rbp)
	movw	$0, -1086(%rbp)
	movl	$7302765, -1084(%rbp)
	movw	$0, -1080(%rbp)
	movl	$1936879984, -1078(%rbp)
	movw	$0, -1074(%rbp)
	movl	$7763316, -1072(%rbp)
	movw	$0, -1068(%rbp)
	movl	$2054781047, -1066(%rbp)
	movw	$0, -1062(%rbp)
	leaq	-1144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1140(%rbp)
	jmp	.L2
.L10:
	leaq	-1056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1132(%rbp)
	jmp	.L3
.L9:
	movl	$0, -1136(%rbp)
	jmp	.L4
.L5:
	addl	$1, -1136(%rbp)
	addl	$1, -1132(%rbp)
.L4:
	movl	-1132(%rbp), %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L5
	cmpl	$0, -1132(%rbp)
	jle	.L6
	movl	-1132(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	cmpb	$48, %al
	je	.L6
	movl	-1132(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1124(%rbp)
	movl	-1136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1120(%rbp), %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rsi
	movq	%rbx, %rax
	movl	$0, %edx
	divq	%rsi
	movq	%rdx, %rcx
	movq	%rcx, %rax
	movl	%eax, -1128(%rbp)
	cmpl	$0, -1128(%rbp)
	jle	.L7
	subl	$1, -1128(%rbp)
	jmp	.L8
.L7:
	leaq	-1120(%rbp), %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	movl	-1128(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -1128(%rbp)
.L8:
	movl	-1128(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$1104, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
.L6:
	addl	$1, -1132(%rbp)
.L3:
	movl	-1132(%rbp), %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -1140(%rbp)
.L2:
	movl	-1144(%rbp), %eax
	cmpl	%eax, -1140(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1128, %rsp
	.cfi_def_cfa_offset 1184
	movdqa	.LC2(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 1112(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	80(%rsp), %r13
	movabsq	$8680406806787683700, %rax
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC3(%rip), %xmm0
	leaq	16(%rsp), %rbx
	movq	%rax, 64(%rsp)
	xorl	%eax, %eax
	movaps	%xmm0, 32(%rsp)
	movdqa	.LC4(%rip), %xmm0
	movl	$31353, 72(%rsp)
	movaps	%xmm0, 48(%rsp)
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	call	__isoc99_scanf@PLT
	movzbl	80(%rsp), %ecx
	testb	%cl, %cl
	je	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$48, %cl
	je	.L36
	leal	1(%r12), %edx
	xorl	%r14d, %r14d
	leaq	79(%rsp), %rdi
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r12d
	addq	$1, %rdx
	movl	%ecx, %eax
	addl	$1, %r14d
	movzbl	(%rdi,%rdx), %ecx
	cmpb	$48, %cl
	jne	.L5
	movsbl	%al, %r15d
	subl	$48, %r15d
	movslq	%r15d, %r15
	leaq	(%r15,%r15,2), %rax
	leaq	(%rbx,%rax,2), %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	movq	%rax, %rcx
	movslq	%r14d, %rax
	divq	%rcx
	testq	%rdx, %rdx
	je	.L9
	leal	-1(%rdx), %ecx
.L10:
	leaq	(%r15,%r15,2), %rax
	movslq	%ecx, %rcx
	leaq	1120(%rsp,%rax,2), %rax
	movsbl	-1104(%rcx,%rax), %edi
	call	putchar@PLT
.L7:
	addl	$1, %r12d
	movslq	%r12d, %rax
	movzbl	80(%rsp,%rax), %ecx
	testb	%cl, %cl
	jne	.L3
.L4:
	movl	$10, %edi
	addl	$1, %ebp
	call	putchar@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L2
.L13:
	movq	1112(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$1128, %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
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	testl	%r12d, %r12d
	je	.L7
	leal	-1(%r12), %eax
	cltq
	movzbl	80(%rsp,%rax), %eax
	cmpb	$48, %al
	je	.L7
	movsbl	%al, %r15d
	subl	$48, %r15d
	movslq	%r15d, %r15
	imulq	$6, %r15, %rdi
	addq	%rbx, %rdi
	call	strlen@PLT
	movq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$1, %ecx
	jmp	.L10
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	3183481986597519360
	.quad	27974191447818017
	.align 16
.LC3:
	.quad	439787716608
	.quad	7739998909596526695
	.align 16
.LC4:
	.quad	31365136845373548
	.quad	126935366631424
	.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
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$1128, %rsp
	.cfi_def_cfa_offset 1184
	movdqa	.LC2(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 1112(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	80(%rsp), %r13
	movabsq	$8680406806787683700, %rax
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC3(%rip), %xmm0
	leaq	16(%rsp), %rbx
	movq	%rax, 64(%rsp)
	xorl	%eax, %eax
	movaps	%xmm0, 32(%rsp)
	movdqa	.LC4(%rip), %xmm0
	movl	$31353, 72(%rsp)
	movaps	%xmm0, 48(%rsp)
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	call	__isoc99_scanf@PLT
	movzbl	80(%rsp), %ecx
	testb	%cl, %cl
	je	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$48, %cl
	je	.L36
	leal	1(%r12), %edx
	xorl	%r14d, %r14d
	leaq	79(%rsp), %rdi
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r12d
	addq	$1, %rdx
	movl	%ecx, %eax
	addl	$1, %r14d
	movzbl	(%rdi,%rdx), %ecx
	cmpb	$48, %cl
	jne	.L5
	movsbl	%al, %r15d
	subl	$48, %r15d
	movslq	%r15d, %r15
	leaq	(%r15,%r15,2), %rax
	leaq	(%rbx,%rax,2), %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	movq	%rax, %rcx
	movslq	%r14d, %rax
	divq	%rcx
	testq	%rdx, %rdx
	je	.L9
	leal	-1(%rdx), %ecx
.L10:
	leaq	(%r15,%r15,2), %rax
	movslq	%ecx, %rcx
	leaq	1120(%rsp,%rax,2), %rax
	movsbl	-1104(%rcx,%rax), %edi
	call	putchar@PLT
.L7:
	addl	$1, %r12d
	movslq	%r12d, %rax
	movzbl	80(%rsp,%rax), %ecx
	testb	%cl, %cl
	jne	.L3
.L4:
	movl	$10, %edi
	addl	$1, %ebp
	call	putchar@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L2
.L13:
	movq	1112(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$1128, %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
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	testl	%r12d, %r12d
	je	.L7
	leal	-1(%r12), %eax
	cltq
	movzbl	80(%rsp,%rax), %eax
	cmpb	$48, %al
	je	.L7
	movsbl	%al, %r15d
	subl	$48, %r15d
	movslq	%r15d, %r15
	imulq	$6, %r15, %rdi
	addq	%rbx, %rdi
	call	strlen@PLT
	movq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$1, %ecx
	jmp	.L10
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	3183481986597519360
	.quad	27974191447818017
	.align 16
.LC3:
	.quad	439787716608
	.quad	7739998909596526695
	.align 16
.LC4:
	.quad	31365136845373548
	.quad	126935366631424
	.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>

int main(void)
{
    char bu[10][6] = {
        "",
        ".,!? ",
        "abc",
        "def",
        "ghi",
        "jkl",
        "mno",
        "pqrs",
        "tuv",
        "wxyz"
    };

    int n;
    scanf("%d", &n);
    int i;
    for(i = 0; i < n; i++){
        char line[1025];
        scanf("%s", line);
        int num, p = 0;
        while(line[p] != '\0'){
            num = 0;
            while(line[p] != '0'){
                num++;
                p++;
            }
            if(p > 0 && line[p - 1] != '0'){
                int but_no = line[p - 1] - '0';
                int but_index = num % strlen(bu[but_no]);
                if(but_index > 0)
                    but_index--;
                else
                    but_index += (strlen(bu[but_no]) - 1);
                printf("%c", bu[but_no][but_index]);
            }
            p++;
        }
        printf("\n");
    }

    return 0;
}
5
40
220
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
40
30
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
10
220
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
40
40
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
20
40
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
40
50
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
0
220
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
20
300
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
20
10
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000
 5
0
300
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000

g
b
b
hello, world!
keitai
 g
d
b
hello, world!
keitai
 .
b
b
hello, world!
keitai
 g
g
b
hello, world!
keitai
 a
g
b
hello, world!
keitai
 g
j
b
hello, world!
keitai
 
b
b
hello, world!
keitai
 a
d
b
hello, world!
keitai
 a
.
b
hello, world!
keitai
 
d
b
hello, world!
keitai

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>

int main(void)
{
    char bu[10][6] = {
        "",
        ".,!? ",
        "abc",
        "def",
        "ghi",
        "jkl",
        "mno",
        "pqrs",
        "tuv",
        "wxyz"
    };

    int n;
    scanf("%d", &n);
    int i;
    for(i = 0; i < n; i++){
        char line[1025];
        scanf("%s", line);
        int num, p = 0;
        while(line[p] != '\0'){
            num = 0;
            while(line[p] != '0'){
                num++;
                p++;
            }
            if(p > 0 && line[p - 1] != '0'){
                int but_no = line[p - 1] - '0';
                int but_index = num % strlen(bu[but_no]);
                if(but_index > 0)
                    but_index--;
                else
                    but_index += (strlen(bu[but_no]) - 1);
                printf("%c", bu[but_no][but_index]);
            }
            p++;
        }
        printf("\n");
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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	$1144, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -1120(%rbp)
	movw	$0, -1116(%rbp)
	movl	$1059138606, -1114(%rbp)
	movw	$32, -1110(%rbp)
	movl	$6513249, -1108(%rbp)
	movw	$0, -1104(%rbp)
	movl	$6710628, -1102(%rbp)
	movw	$0, -1098(%rbp)
	movl	$6908007, -1096(%rbp)
	movw	$0, -1092(%rbp)
	movl	$7105386, -1090(%rbp)
	movw	$0, -1086(%rbp)
	movl	$7302765, -1084(%rbp)
	movw	$0, -1080(%rbp)
	movl	$1936879984, -1078(%rbp)
	movw	$0, -1074(%rbp)
	movl	$7763316, -1072(%rbp)
	movw	$0, -1068(%rbp)
	movl	$2054781047, -1066(%rbp)
	movw	$0, -1062(%rbp)
	leaq	-1144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1140(%rbp)
	jmp	.L2
.L10:
	leaq	-1056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1132(%rbp)
	jmp	.L3
.L9:
	movl	$0, -1136(%rbp)
	jmp	.L4
.L5:
	addl	$1, -1136(%rbp)
	addl	$1, -1132(%rbp)
.L4:
	movl	-1132(%rbp), %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L5
	cmpl	$0, -1132(%rbp)
	jle	.L6
	movl	-1132(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	cmpb	$48, %al
	je	.L6
	movl	-1132(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1124(%rbp)
	movl	-1136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1120(%rbp), %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rsi
	movq	%rbx, %rax
	movl	$0, %edx
	divq	%rsi
	movq	%rdx, %rcx
	movq	%rcx, %rax
	movl	%eax, -1128(%rbp)
	cmpl	$0, -1128(%rbp)
	jle	.L7
	subl	$1, -1128(%rbp)
	jmp	.L8
.L7:
	leaq	-1120(%rbp), %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	movl	-1128(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -1128(%rbp)
.L8:
	movl	-1128(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$1104, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
.L6:
	addl	$1, -1132(%rbp)
.L3:
	movl	-1132(%rbp), %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -1140(%rbp)
.L2:
	movl	-1144(%rbp), %eax
	cmpl	%eax, -1140(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.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	$1144, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -1120(%rbp)
	movw	$0, -1116(%rbp)
	movl	$1059138606, -1114(%rbp)
	movw	$32, -1110(%rbp)
	movl	$6513249, -1108(%rbp)
	movw	$0, -1104(%rbp)
	movl	$6710628, -1102(%rbp)
	movw	$0, -1098(%rbp)
	movl	$6908007, -1096(%rbp)
	movw	$0, -1092(%rbp)
	movl	$7105386, -1090(%rbp)
	movw	$0, -1086(%rbp)
	movl	$7302765, -1084(%rbp)
	movw	$0, -1080(%rbp)
	movl	$1936879984, -1078(%rbp)
	movw	$0, -1074(%rbp)
	movl	$7763316, -1072(%rbp)
	movw	$0, -1068(%rbp)
	movl	$2054781047, -1066(%rbp)
	movw	$0, -1062(%rbp)
	leaq	-1144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1140(%rbp)
	jmp	.L2
.L10:
	leaq	-1056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1132(%rbp)
	jmp	.L3
.L9:
	movl	$0, -1136(%rbp)
	jmp	.L4
.L5:
	addl	$1, -1136(%rbp)
	addl	$1, -1132(%rbp)
.L4:
	movl	-1132(%rbp), %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L5
	cmpl	$0, -1132(%rbp)
	jle	.L6
	movl	-1132(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	cmpb	$48, %al
	je	.L6
	movl	-1132(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -1124(%rbp)
	movl	-1136(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-1120(%rbp), %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, %rsi
	movq	%rbx, %rax
	movl	$0, %edx
	divq	%rsi
	movq	%rdx, %rcx
	movq	%rcx, %rax
	movl	%eax, -1128(%rbp)
	cmpl	$0, -1128(%rbp)
	jle	.L7
	subl	$1, -1128(%rbp)
	jmp	.L8
.L7:
	leaq	-1120(%rbp), %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	movl	-1128(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -1128(%rbp)
.L8:
	movl	-1128(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$1104, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
.L6:
	addl	$1, -1132(%rbp)
.L3:
	movl	-1132(%rbp), %eax
	cltq
	movzbl	-1056(%rbp,%rax), %eax
	testb	%al, %al
	jne	.L9
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -1140(%rbp)
.L2:
	movl	-1144(%rbp), %eax
	cmpl	%eax, -1140(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
