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 <unistd.h>

void get_nums(int *array, int count)
{
    char c;
    int num;

    c = 0;
    while (c != 10)
    {
        if (read(0, &c, 1) == -1)
            return ;
        if (c != 32)
        {
            num = 0;
            while ('0' <= c && c <= '9')
            {
                num = num * 10 + c - '0';
                if (read(0, &c, 1) == 0)
                {
                    array[count++] = num;
                    return ;                    
                }
            }
            array[count++] = num;
        }
    }  
}

void get_stirngs(char *s, int i)
{
    char c;

    c = 0;
    while (c != 10)
    {
        if (read(0, &c, 1) == -1)
            return ;
        while (31 < c && c < 127)
        {
            s[i++] = c;
            if (read(0, &c, 1) == 0)
            {
                s[i] = 0;
                return ;                    
            }
        }
        s[i] = 0;
    }  
}

void get_ans(int x, int y, int i, int j)
{
    char s[x + 1];
    
    while (++j < y + 2)
    {
        if (0 < j  && j <= y)
            get_stirngs(s, 0);
        i = -1;
        while (++i < x + 2)
        {
            if (0 < j  && j <= y && 0 < i && i <= x)
                write(1, &s[i - 1], 1);
            else
                write(1, "#", 1);
        }
        write(1, "\n", 1);
    }
}

int main(void){
    int num[2];
    
    get_nums(num, 0);
    get_ans(num[1],num[0], -1, -1);
    return (0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	get_nums
	.type	get_nums, @function
get_nums:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$0, -13(%rbp)
	jmp	.L2
.L8:
	leaq	-13(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L11
	movzbl	-13(%rbp), %eax
	cmpb	$32, %al
	je	.L2
	movl	$0, -12(%rbp)
	jmp	.L5
.L7:
	movl	-12(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movzbl	-13(%rbp), %eax
	movsbl	%al, %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -12(%rbp)
	leaq	-13(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	testq	%rax, %rax
	jne	.L5
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L1
.L5:
	movzbl	-13(%rbp), %eax
	cmpb	$47, %al
	jle	.L6
	movzbl	-13(%rbp), %eax
	cmpb	$57, %al
	jle	.L7
.L6:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
.L2:
	movzbl	-13(%rbp), %eax
	cmpb	$10, %al
	jne	.L8
	jmp	.L1
.L11:
	nop
.L1:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	get_nums, .-get_nums
	.globl	get_stirngs
	.type	get_stirngs, @function
get_stirngs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$0, -9(%rbp)
	jmp	.L13
.L19:
	leaq	-9(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L22
	jmp	.L16
.L18:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-9(%rbp), %eax
	movb	%al, (%rdx)
	leaq	-9(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	testq	%rax, %rax
	jne	.L16
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	jmp	.L12
.L16:
	movzbl	-9(%rbp), %eax
	cmpb	$31, %al
	jle	.L17
	movzbl	-9(%rbp), %eax
	cmpb	$127, %al
	jne	.L18
.L17:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
.L13:
	movzbl	-9(%rbp), %eax
	cmpb	$10, %al
	jne	.L19
	jmp	.L12
.L22:
	nop
.L12:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	get_stirngs, .-get_stirngs
	.section	.rodata
.LC0:
	.string	"#"
.LC1:
	.string	"\n"
	.text
	.globl	get_ans
	.type	get_ans, @function
get_ans:
.LFB2:
	.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	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, -52(%rbp)
	movl	%esi, -56(%rbp)
	movl	%edx, -60(%rbp)
	movl	%ecx, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -40(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r10
	movl	$0, %r11d
	movslq	%eax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L24:
	cmpq	%rdx, %rsp
	je	.L25
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L24
.L25:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L26
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L26:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -32(%rbp)
	jmp	.L27
.L32:
	cmpl	$0, -64(%rbp)
	jle	.L28
	movl	-64(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jg	.L28
	movq	-32(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	get_stirngs
.L28:
	movl	$-1, -60(%rbp)
	jmp	.L29
.L31:
	cmpl	$0, -64(%rbp)
	jle	.L30
	movl	-64(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jg	.L30
	cmpl	$0, -60(%rbp)
	jle	.L30
	movl	-60(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jg	.L30
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L29
.L30:
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L29:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	addl	$1, -60(%rbp)
	cmpl	%eax, -60(%rbp)
	jle	.L31
	movl	$1, %edx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L27:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	addl	$1, -64(%rbp)
	cmpl	%eax, -64(%rbp)
	jle	.L32
	movq	%rbx, %rsp
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	get_ans, .-get_ans
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	get_nums
	movl	-16(%rbp), %esi
	movl	-12(%rbp), %eax
	movl	$-1, %ecx
	movl	$-1, %edx
	movl	%eax, %edi
	call	get_ans
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.p2align 4
	.globl	get_nums
	.type	get_nums, @function
get_nums:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movb	$0, 7(%rsp)
	leaq	7(%rsp), %rbx
.L2:
	movslq	%ebp, %r13
	cmpb	$10, %al
	jne	.L5
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	movsbl	7(%rsp), %eax
	cmpb	$32, %al
	jne	.L16
.L5:
	xorl	%edi, %edi
	movl	$1, %edx
	movq	%rbx, %rsi
	call	read@PLT
	cmpq	$-1, %rax
	jne	.L17
.L1:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xorl	%r14d, %r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	leal	(%r14,%r14,4), %edx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	leal	-48(%rax,%rdx,2), %r14d
	movl	$1, %edx
	call	read@PLT
	testq	%rax, %rax
	je	.L6
	movsbl	7(%rsp), %eax
.L4:
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	jbe	.L7
	movl	%r14d, (%r12,%rbp,4)
	addq	$1, %rbp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r14d, (%r12,%r13,4)
	jmp	.L1
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	get_nums, .-get_nums
	.p2align 4
	.globl	get_stirngs
	.type	get_stirngs, @function
get_stirngs:
.LFB36:
	.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
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movb	$0, 7(%rsp)
	leaq	7(%rsp), %r13
.L24:
	xorl	%edi, %edi
	movl	$1, %edx
	movq	%r13, %rsi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L19
	movslq	%ebp, %rbx
	addq	%r12, %rbx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L23:
	movb	%al, (%rbx)
	movl	$1, %edx
	movq	%r13, %rsi
	xorl	%edi, %edi
	addl	$1, %ebp
	addq	$1, %rbx
	call	read@PLT
	testq	%rax, %rax
	je	.L33
.L22:
	movzbl	7(%rsp), %eax
	leal	-32(%rax), %edx
	cmpb	$94, %dl
	jbe	.L23
	movb	$0, (%rbx)
	cmpb	$10, %al
	jne	.L24
	.p2align 4,,10
	.p2align 3
.L19:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L33:
	.cfi_restore_state
	movslq	%ebp, %rbp
	movb	$0, (%r12,%rbp)
	jmp	.L19
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	get_stirngs, .-get_stirngs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\n"
.LC1:
	.string	"#"
	.text
	.p2align 4
	.globl	get_ans
	.type	get_ans, @function
get_ans:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$40, %rsp
	movl	%esi, -72(%rbp)
	movq	%rsp, %rsi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leal	1(%rdi), %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L37
.L83:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L83
.L37:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L84
.L38:
	leal	1(%rcx), %eax
	movq	%rsp, -80(%rbp)
	leaq	.LC1(%rip), %r13
	movl	%eax, -68(%rbp)
	cmpl	-72(%rbp), %ecx
	jg	.L35
	testl	%eax, %eax
	jle	.L40
	.p2align 4,,10
	.p2align 3
.L87:
	cmpl	%eax, -72(%rbp)
	jl	.L40
	movb	$0, -57(%rbp)
	xorl	%r12d, %r12d
	leaq	-57(%rbp), %r14
.L45:
	xorl	%edi, %edi
	movl	$1, %edx
	movq	%r14, %rsi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L41
	movq	-80(%rbp), %rax
	movslq	%r12d, %rcx
	leaq	(%rax,%rcx), %r15
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L44:
	movb	%al, (%r15)
	movl	$1, %edx
	movq	%r14, %rsi
	xorl	%edi, %edi
	addl	$1, %r12d
	addq	$1, %r15
	call	read@PLT
	testq	%rax, %rax
	je	.L85
.L43:
	movzbl	-57(%rbp), %eax
	leal	-32(%rax), %edx
	cmpb	$94, %dl
	jbe	.L44
	movb	$0, (%r15)
	cmpb	$10, %al
	jne	.L45
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	$-1, %ebx
	jl	.L52
	xorl	%r12d, %r12d
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L86:
	cmpl	%r12d, %ebx
	jl	.L50
	movq	-80(%rbp), %rax
	movl	$1, %edx
	movl	$1, %edi
	leaq	-1(%rax,%r12), %rsi
	addq	$1, %r12
	call	write@PLT
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jl	.L52
.L46:
	testl	%r12d, %r12d
	jg	.L86
.L50:
	movl	$1, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	addq	$1, %r12
	call	write@PLT
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L46
.L52:
	movl	$1, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	call	write@PLT
	movl	-68(%rbp), %ecx
	leal	1(%rcx), %eax
	cmpl	%ecx, -72(%rbp)
	jl	.L35
	movl	%eax, -68(%rbp)
	testl	%eax, %eax
	jg	.L87
.L40:
	cmpl	$-1, %ebx
	jl	.L52
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L48:
	movl	$1, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	write@PLT
	movl	%r12d, %eax
	addl	$1, %r12d
	cmpl	%eax, %ebx
	jge	.L48
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L85:
	movq	-80(%rbp), %rax
	movslq	%r12d, %r12
	movb	$0, (%rax,%r12)
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L35:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L88
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L84:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L38
.L88:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.size	get_ans, .-get_ans
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB38:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	call	get_nums
	movl	(%rsp), %esi
	movl	4(%rsp), %edi
	movl	$-1, %ecx
	movl	$-1, %edx
	call	get_ans
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L92
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L92:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE38:
	.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
	.file	"temp.c"
	.text
	.p2align 4
	.globl	get_nums
	.type	get_nums, @function
get_nums:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%esi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movb	$0, 7(%rsp)
	leaq	7(%rsp), %rbx
.L2:
	movslq	%ebp, %r13
	cmpb	$10, %al
	jne	.L5
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	movsbl	7(%rsp), %eax
	cmpb	$32, %al
	jne	.L16
.L5:
	xorl	%edi, %edi
	movl	$1, %edx
	movq	%rbx, %rsi
	call	read@PLT
	cmpq	$-1, %rax
	jne	.L17
.L1:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xorl	%r14d, %r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	leal	(%r14,%r14,4), %edx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	leal	-48(%rax,%rdx,2), %r14d
	movl	$1, %edx
	call	read@PLT
	testq	%rax, %rax
	je	.L6
	movsbl	7(%rsp), %eax
.L4:
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	jbe	.L7
	movl	%r14d, (%r12,%rbp,4)
	addq	$1, %rbp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r14d, (%r12,%r13,4)
	jmp	.L1
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	get_nums, .-get_nums
	.p2align 4
	.globl	get_stirngs
	.type	get_stirngs, @function
get_stirngs:
.LFB36:
	.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
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movb	$0, 7(%rsp)
	leaq	7(%rsp), %r13
.L24:
	xorl	%edi, %edi
	movl	$1, %edx
	movq	%r13, %rsi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L19
	movslq	%ebp, %rbx
	addq	%r12, %rbx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L23:
	movb	%al, (%rbx)
	movl	$1, %edx
	movq	%r13, %rsi
	xorl	%edi, %edi
	addl	$1, %ebp
	addq	$1, %rbx
	call	read@PLT
	testq	%rax, %rax
	je	.L33
.L22:
	movzbl	7(%rsp), %eax
	leal	-32(%rax), %edx
	cmpb	$94, %dl
	jbe	.L23
	movb	$0, (%rbx)
	cmpb	$10, %al
	jne	.L24
	.p2align 4,,10
	.p2align 3
.L19:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L33:
	.cfi_restore_state
	movslq	%ebp, %rbp
	movb	$0, (%r12,%rbp)
	jmp	.L19
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	get_stirngs, .-get_stirngs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\n"
.LC1:
	.string	"#"
	.text
	.p2align 4
	.globl	get_ans
	.type	get_ans, @function
get_ans:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$40, %rsp
	movl	%esi, -72(%rbp)
	movq	%rsp, %rsi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leal	1(%rdi), %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L37
.L83:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L83
.L37:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L84
.L38:
	leal	1(%rcx), %eax
	movq	%rsp, -80(%rbp)
	leaq	.LC1(%rip), %r13
	movl	%eax, -68(%rbp)
	cmpl	-72(%rbp), %ecx
	jg	.L35
	testl	%eax, %eax
	jle	.L40
	.p2align 4,,10
	.p2align 3
.L87:
	cmpl	%eax, -72(%rbp)
	jl	.L40
	movb	$0, -57(%rbp)
	xorl	%r12d, %r12d
	leaq	-57(%rbp), %r14
.L45:
	xorl	%edi, %edi
	movl	$1, %edx
	movq	%r14, %rsi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L41
	movq	-80(%rbp), %rax
	movslq	%r12d, %rcx
	leaq	(%rax,%rcx), %r15
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L44:
	movb	%al, (%r15)
	movl	$1, %edx
	movq	%r14, %rsi
	xorl	%edi, %edi
	addl	$1, %r12d
	addq	$1, %r15
	call	read@PLT
	testq	%rax, %rax
	je	.L85
.L43:
	movzbl	-57(%rbp), %eax
	leal	-32(%rax), %edx
	cmpb	$94, %dl
	jbe	.L44
	movb	$0, (%r15)
	cmpb	$10, %al
	jne	.L45
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	$-1, %ebx
	jl	.L52
	xorl	%r12d, %r12d
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L86:
	cmpl	%r12d, %ebx
	jl	.L50
	movq	-80(%rbp), %rax
	movl	$1, %edx
	movl	$1, %edi
	leaq	-1(%rax,%r12), %rsi
	addq	$1, %r12
	call	write@PLT
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jl	.L52
.L46:
	testl	%r12d, %r12d
	jg	.L86
.L50:
	movl	$1, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	addq	$1, %r12
	call	write@PLT
	leal	-1(%r12), %eax
	cmpl	%eax, %ebx
	jge	.L46
.L52:
	movl	$1, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	call	write@PLT
	movl	-68(%rbp), %ecx
	leal	1(%rcx), %eax
	cmpl	%ecx, -72(%rbp)
	jl	.L35
	movl	%eax, -68(%rbp)
	testl	%eax, %eax
	jg	.L87
.L40:
	cmpl	$-1, %ebx
	jl	.L52
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L48:
	movl	$1, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	write@PLT
	movl	%r12d, %eax
	addl	$1, %r12d
	cmpl	%eax, %ebx
	jge	.L48
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L85:
	movq	-80(%rbp), %rax
	movslq	%r12d, %r12
	movb	$0, (%rax,%r12)
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L35:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L88
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L84:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L38
.L88:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.size	get_ans, .-get_ans
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB38:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rdi
	call	get_nums
	movl	(%rsp), %esi
	movl	4(%rsp), %edi
	movl	$-1, %ecx
	movl	$-1, %edx
	call	get_ans
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L92
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L92:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE38:
	.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:

#include <stdio.h>
#include <unistd.h>

void get_nums(int *array, int count)
{
    char c;
    int num;

    c = 0;
    while (c != 10)
    {
        if (read(0, &c, 1) == -1)
            return ;
        if (c != 32)
        {
            num = 0;
            while ('0' <= c && c <= '9')
            {
                num = num * 10 + c - '0';
                if (read(0, &c, 1) == 0)
                {
                    array[count++] = num;
                    return ;                    
                }
            }
            array[count++] = num;
        }
    }  
}

void get_stirngs(char *s, int i)
{
    char c;

    c = 0;
    while (c != 10)
    {
        if (read(0, &c, 1) == -1)
            return ;
        while (31 < c && c < 127)
        {
            s[i++] = c;
            if (read(0, &c, 1) == 0)
            {
                s[i] = 0;
                return ;                    
            }
        }
        s[i] = 0;
    }  
}

void get_ans(int x, int y, int i, int j)
{
    char s[x + 1];
    
    while (++j < y + 2)
    {
        if (0 < j  && j <= y)
            get_stirngs(s, 0);
        i = -1;
        while (++i < x + 2)
        {
            if (0 < j  && j <= y && 0 < i && i <= x)
                write(1, &s[i - 1], 1);
            else
                write(1, "#", 1);
        }
        write(1, "\n", 1);
    }
}

int main(void){
    int num[2];
    
    get_nums(num, 0);
    get_ans(num[1],num[0], -1, -1);
    return (0);
}

2 3
abc
brc
 1 1
y
 2 3
abc
bqc
 0 1
y
 2 1
abc
brc
 1 1
x
 1 2
z
 0 2
z

#####
#abc#
#brc#
#####
 ###
#y#
###
 #####
#abc#
#bqc#
#####
 ###
###
 ###
#a#
#b#
###
 ###
#x#
###
 ####
#z#
####
 ####
####

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 <unistd.h>

void get_nums(int *array, int count)
{
    char c;
    int num;

    c = 0;
    while (c != 10)
    {
        if (read(0, &c, 1) == -1)
            return ;
        if (c != 32)
        {
            num = 0;
            while ('0' <= c && c <= '9')
            {
                num = num * 10 + c - '0';
                if (read(0, &c, 1) == 0)
                {
                    array[count++] = num;
                    return ;                    
                }
            }
            array[count++] = num;
        }
    }  
}

void get_stirngs(char *s, int i)
{
    char c;

    c = 0;
    while (c != 10)
    {
        if (read(0, &c, 1) == -1)
            return ;
        while (31 < c && c < 127)
        {
            s[i++] = c;
            if (read(0, &c, 1) == 0)
            {
                s[i] = 0;
                return ;                    
            }
        }
        s[i] = 0;
    }  
}

void get_ans(int x, int y, int i, int j)
{
    char s[x + 1];
    
    while (++j < y + 2)
    {
        if (0 < j  && j <= y)
            get_stirngs(s, 0);
        i = -1;
        while (++i < x + 2)
        {
            if (0 < j  && j <= y && 0 < i && i <= x)
                write(1, &s[i - 1], 1);
            else
                write(1, "#", 1);
        }
        write(1, "\n", 1);
    }
}

int main(void){
    int num[2];
    
    get_nums(num, 0);
    get_ans(num[1],num[0], -1, -1);
    return (0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	get_nums
	.type	get_nums, @function
get_nums:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$0, -13(%rbp)
	jmp	.L2
.L8:
	leaq	-13(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L11
	movzbl	-13(%rbp), %eax
	cmpb	$32, %al
	je	.L2
	movl	$0, -12(%rbp)
	jmp	.L5
.L7:
	movl	-12(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movzbl	-13(%rbp), %eax
	movsbl	%al, %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -12(%rbp)
	leaq	-13(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	testq	%rax, %rax
	jne	.L5
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L1
.L5:
	movzbl	-13(%rbp), %eax
	cmpb	$47, %al
	jle	.L6
	movzbl	-13(%rbp), %eax
	cmpb	$57, %al
	jle	.L7
.L6:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
.L2:
	movzbl	-13(%rbp), %eax
	cmpb	$10, %al
	jne	.L8
	jmp	.L1
.L11:
	nop
.L1:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	get_nums, .-get_nums
	.globl	get_stirngs
	.type	get_stirngs, @function
get_stirngs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$0, -9(%rbp)
	jmp	.L13
.L19:
	leaq	-9(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L22
	jmp	.L16
.L18:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-9(%rbp), %eax
	movb	%al, (%rdx)
	leaq	-9(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	testq	%rax, %rax
	jne	.L16
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	jmp	.L12
.L16:
	movzbl	-9(%rbp), %eax
	cmpb	$31, %al
	jle	.L17
	movzbl	-9(%rbp), %eax
	cmpb	$127, %al
	jne	.L18
.L17:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
.L13:
	movzbl	-9(%rbp), %eax
	cmpb	$10, %al
	jne	.L19
	jmp	.L12
.L22:
	nop
.L12:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	get_stirngs, .-get_stirngs
	.section	.rodata
.LC0:
	.string	"#"
.LC1:
	.string	"\n"
	.text
	.globl	get_ans
	.type	get_ans, @function
get_ans:
.LFB2:
	.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	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, -52(%rbp)
	movl	%esi, -56(%rbp)
	movl	%edx, -60(%rbp)
	movl	%ecx, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -40(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r10
	movl	$0, %r11d
	movslq	%eax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L24:
	cmpq	%rdx, %rsp
	je	.L25
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L24
.L25:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L26
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L26:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -32(%rbp)
	jmp	.L27
.L32:
	cmpl	$0, -64(%rbp)
	jle	.L28
	movl	-64(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jg	.L28
	movq	-32(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	get_stirngs
.L28:
	movl	$-1, -60(%rbp)
	jmp	.L29
.L31:
	cmpl	$0, -64(%rbp)
	jle	.L30
	movl	-64(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jg	.L30
	cmpl	$0, -60(%rbp)
	jle	.L30
	movl	-60(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jg	.L30
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L29
.L30:
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L29:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	addl	$1, -60(%rbp)
	cmpl	%eax, -60(%rbp)
	jle	.L31
	movl	$1, %edx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L27:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	addl	$1, -64(%rbp)
	cmpl	%eax, -64(%rbp)
	jle	.L32
	movq	%rbx, %rsp
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	get_ans, .-get_ans
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	get_nums
	movl	-16(%rbp), %esi
	movl	-12(%rbp), %eax
	movl	$-1, %ecx
	movl	$-1, %edx
	movl	%eax, %edi
	call	get_ans
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.globl	get_nums
	.type	get_nums, @function
get_nums:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$0, -13(%rbp)
	jmp	.L2
.L8:
	leaq	-13(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L11
	movzbl	-13(%rbp), %eax
	cmpb	$32, %al
	je	.L2
	movl	$0, -12(%rbp)
	jmp	.L5
.L7:
	movl	-12(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movzbl	-13(%rbp), %eax
	movsbl	%al, %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -12(%rbp)
	leaq	-13(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	testq	%rax, %rax
	jne	.L5
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L1
.L5:
	movzbl	-13(%rbp), %eax
	cmpb	$47, %al
	jle	.L6
	movzbl	-13(%rbp), %eax
	cmpb	$57, %al
	jle	.L7
.L6:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
.L2:
	movzbl	-13(%rbp), %eax
	cmpb	$10, %al
	jne	.L8
	jmp	.L1
.L11:
	nop
.L1:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	get_nums, .-get_nums
	.globl	get_stirngs
	.type	get_stirngs, @function
get_stirngs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movb	$0, -9(%rbp)
	jmp	.L13
.L19:
	leaq	-9(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	cmpq	$-1, %rax
	je	.L22
	jmp	.L16
.L18:
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movzbl	-9(%rbp), %eax
	movb	%al, (%rdx)
	leaq	-9(%rbp), %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$0, %edi
	call	read@PLT
	testq	%rax, %rax
	jne	.L16
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	jmp	.L12
.L16:
	movzbl	-9(%rbp), %eax
	cmpb	$31, %al
	jle	.L17
	movzbl	-9(%rbp), %eax
	cmpb	$127, %al
	jne	.L18
.L17:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
.L13:
	movzbl	-9(%rbp), %eax
	cmpb	$10, %al
	jne	.L19
	jmp	.L12
.L22:
	nop
.L12:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	get_stirngs, .-get_stirngs
	.section	.rodata
.LC0:
	.string	"#"
.LC1:
	.string	"\n"
	.text
	.globl	get_ans
	.type	get_ans, @function
get_ans:
.LFB2:
	.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	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, -52(%rbp)
	movl	%esi, -56(%rbp)
	movl	%edx, -60(%rbp)
	movl	%ecx, -64(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -40(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r10
	movl	$0, %r11d
	movslq	%eax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L24:
	cmpq	%rdx, %rsp
	je	.L25
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L24
.L25:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L26
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L26:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -32(%rbp)
	jmp	.L27
.L32:
	cmpl	$0, -64(%rbp)
	jle	.L28
	movl	-64(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jg	.L28
	movq	-32(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	get_stirngs
.L28:
	movl	$-1, -60(%rbp)
	jmp	.L29
.L31:
	cmpl	$0, -64(%rbp)
	jle	.L30
	movl	-64(%rbp), %eax
	cmpl	-56(%rbp), %eax
	jg	.L30
	cmpl	$0, -60(%rbp)
	jle	.L30
	movl	-60(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jg	.L30
	movl	-60(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, %edx
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
	jmp	.L29
.L30:
	movl	$1, %edx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L29:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	addl	$1, -60(%rbp)
	cmpl	%eax, -60(%rbp)
	jle	.L31
	movl	$1, %edx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$1, %edi
	call	write@PLT
.L27:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	addl	$1, -64(%rbp)
	cmpl	%eax, -64(%rbp)
	jle	.L32
	movq	%rbx, %rsp
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	get_ans, .-get_ans
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	get_nums
	movl	-16(%rbp), %esi
	movl	-12(%rbp), %eax
	movl	$-1, %ecx
	movl	$-1, %edx
	movl	%eax, %edi
	call	get_ans
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L36
	call	__stack_chk_fail@PLT
.L36:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
