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>
typedef unsigned int uint;

inline static uint gl(void){
    uint x = 0;
    for(;;){
        const uint c = getchar_unlocked() - 48;
        if(c < 10){
            x = x*10 + c;
        }else{
            break;
        }
    }
    return x;
}

#define H 200000
uint v[H] __attribute__((aligned(64)));
int main(void){
    const uint h = gl();
    gl();
    const uint n = gl();
    memset(v, 0x33, sizeof(uint)*H);
    //for(uint i=0; i<H; i++){ v[i] = 0x33333333; }
    for(uint i=0; i<n; i++){
        const uint x = gl()-1;
        const uint y = gl()-1;
        v[x] = y<v[x] ? y : v[x];
    }
    uint right = 0;
    for(uint x=1; x<h; x++){
        const auto b = v[x];
        const auto r = right+1;
        if(b<r){
            printf("%d\n", x);
            return 0;
        }else if(b>r){
            right=r;
        }
    }
    printf("%d\n", h);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.type	gl, @function
gl:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
.L5:
	call	getchar_unlocked@PLT
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	cmpl	$9, -4(%rbp)
	ja	.L7
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L7:
	nop
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gl, .-gl
	.globl	v
	.bss
	.align 64
	.type	v, @object
	.size	v, 800000
v:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	call	gl
	movl	%eax, -24(%rbp)
	call	gl
	call	gl
	movl	%eax, -20(%rbp)
	movl	$800000, %edx
	movl	$51, %esi
	leaq	v(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -36(%rbp)
	jmp	.L9
.L10:
	call	gl
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	call	gl
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovbe	%edx, %eax
	movl	-8(%rbp), %edx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L9:
	movl	-36(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jb	.L10
	movl	$0, -32(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L11
.L15:
	movl	-28(%rbp), %eax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L14
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L14:
	addl	$1, -28(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jb	.L15
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.type	gl, @function
gl:
.LFB35:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L1
.L3:
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
.L5:
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L2
	call	__uflow@PLT
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L1
	movq	stdin(%rip), %rdi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	gl, .-gl
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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
	leaq	v(%rip), %r14
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	call	gl
	movl	%eax, %r13d
	call	gl
	call	gl
	movl	$800000, %edx
	movl	$51, %esi
	movq	%r14, %rdi
	movl	%eax, %r12d
	call	memset@PLT
	testl	%r12d, %r12d
	je	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movq	stdin(%rip), %rdi
	xorl	%ebx, %ebx
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L14
.L13:
	leal	(%rbx,%rbx,4), %esi
	leal	(%rax,%rsi,2), %ebx
	movq	%rdx, %rax
.L15:
	cmpq	%rcx, %rax
	jb	.L12
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	subl	$48, %eax
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$9, %eax
	jbe	.L13
	.p2align 4,,10
	.p2align 3
.L14:
	subl	$1, %ebx
	xorl	%r15d, %r15d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L18
.L17:
	leal	(%r15,%r15,4), %edx
	movq	16(%rdi), %rcx
	leal	(%rax,%rdx,2), %r15d
	movq	8(%rdi), %rdx
.L19:
	cmpq	%rcx, %rdx
	jb	.L16
	call	__uflow@PLT
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L18
	movq	stdin(%rip), %rdi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	movl	(%r14,%rbx,4), %edx
	leal	-1(%r15), %eax
	cmpl	%edx, %eax
	cmova	%edx, %eax
	addl	$1, %ebp
	movl	%eax, (%r14,%rbx,4)
	cmpl	%ebp, %r12d
	jne	.L10
.L11:
	cmpl	$1, %r13d
	jbe	.L20
	movl	%r13d, %esi
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L21:
	cmovg	%ecx, %edx
	addq	$1, %rax
	cmpq	%rax, %rsi
	je	.L20
.L24:
	leal	1(%rdx), %ecx
	cmpl	%ecx, (%r14,%rax,4)
	jge	.L21
	movl	%eax, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L22
.L20:
	movl	%r13d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L22:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	v
	.bss
	.align 64
	.type	v, @object
	.size	v, 800000
v:
	.zero	800000
	.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
	.type	gl, @function
gl:
.LFB35:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	stdin(%rip), %rdi
	xorl	%r12d, %r12d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L1
.L3:
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
.L5:
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L2
	call	__uflow@PLT
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L1
	movq	stdin(%rip), %rdi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	gl, .-gl
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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
	leaq	v(%rip), %r14
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	call	gl
	movl	%eax, %r13d
	call	gl
	call	gl
	movl	$800000, %edx
	movl	$51, %esi
	movq	%r14, %rdi
	movl	%eax, %r12d
	call	memset@PLT
	testl	%r12d, %r12d
	je	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movq	stdin(%rip), %rdi
	xorl	%ebx, %ebx
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L14
.L13:
	leal	(%rbx,%rbx,4), %esi
	leal	(%rax,%rsi,2), %ebx
	movq	%rdx, %rax
.L15:
	cmpq	%rcx, %rax
	jb	.L12
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	subl	$48, %eax
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$9, %eax
	jbe	.L13
	.p2align 4,,10
	.p2align 3
.L14:
	subl	$1, %ebx
	xorl	%r15d, %r15d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L18
.L17:
	leal	(%r15,%r15,4), %edx
	movq	16(%rdi), %rcx
	leal	(%rax,%rdx,2), %r15d
	movq	8(%rdi), %rdx
.L19:
	cmpq	%rcx, %rdx
	jb	.L16
	call	__uflow@PLT
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L18
	movq	stdin(%rip), %rdi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	movl	(%r14,%rbx,4), %edx
	leal	-1(%r15), %eax
	cmpl	%edx, %eax
	cmova	%edx, %eax
	addl	$1, %ebp
	movl	%eax, (%r14,%rbx,4)
	cmpl	%ebp, %r12d
	jne	.L10
.L11:
	cmpl	$1, %r13d
	jbe	.L20
	movl	%r13d, %esi
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L21:
	cmovg	%ecx, %edx
	addq	$1, %rax
	cmpq	%rax, %rsi
	je	.L20
.L24:
	leal	1(%rdx), %ecx
	cmpl	%ecx, (%r14,%rax,4)
	jge	.L21
	movl	%eax, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L22
.L20:
	movl	%r13d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L22:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	v
	.bss
	.align 64
	.type	v, @object
	.size	v, 800000
v:
	.zero	800000
	.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>
typedef unsigned int uint;

inline static uint gl(void){
    uint x = 0;
    for(;;){
        const uint c = getchar_unlocked() - 48;
        if(c < 10){
            x = x*10 + c;
        }else{
            break;
        }
    }
    return x;
}

#define H 200000
uint v[H] __attribute__((aligned(64)));
int main(void){
    const uint h = gl();
    gl();
    const uint n = gl();
    memset(v, 0x33, sizeof(uint)*H);
    //for(uint i=0; i<H; i++){ v[i] = 0x33333333; }
    for(uint i=0; i<n; i++){
        const uint x = gl()-1;
        const uint y = gl()-1;
        v[x] = y<v[x] ? y : v[x];
    }
    uint right = 0;
    for(uint x=1; x<h; x++){
        const auto b = v[x];
        const auto r = right+1;
        if(b<r){
            printf("%d\n", x);
            return 0;
        }else if(b>r){
            right=r;
        }
    }
    printf("%d\n", h);
    return 0;
}

3 6 1
3 2
 100001 100000 0
 10 10 14
4 3
2 2
7 3
9 10
7 9
8 1
10 10
5 4
3 4
2 8
6 4
4 4
5 8
9 2
 100101 100000 0
 10 10 14
4 3
2 1
7 3
9 10
7 9
8 1
10 10
5 4
3 4
2 8
6 4
4 4
5 8
9 2
 110101 100000 0
 110111 100000 0
 010101 111001 0
 110100 100000 0
 100111 100000 0

2
 100001
 6
 100101
 1
 110101
 110111
 10101
 110100
 100111

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>
typedef unsigned int uint;

inline static uint gl(void){
    uint x = 0;
    for(;;){
        const uint c = getchar_unlocked() - 48;
        if(c < 10){
            x = x*10 + c;
        }else{
            break;
        }
    }
    return x;
}

#define H 200000
uint v[H] __attribute__((aligned(64)));
int main(void){
    const uint h = gl();
    gl();
    const uint n = gl();
    memset(v, 0x33, sizeof(uint)*H);
    //for(uint i=0; i<H; i++){ v[i] = 0x33333333; }
    for(uint i=0; i<n; i++){
        const uint x = gl()-1;
        const uint y = gl()-1;
        v[x] = y<v[x] ? y : v[x];
    }
    uint right = 0;
    for(uint x=1; x<h; x++){
        const auto b = v[x];
        const auto r = right+1;
        if(b<r){
            printf("%d\n", x);
            return 0;
        }else if(b>r){
            right=r;
        }
    }
    printf("%d\n", h);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.type	gl, @function
gl:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
.L5:
	call	getchar_unlocked@PLT
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	cmpl	$9, -4(%rbp)
	ja	.L7
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L7:
	nop
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gl, .-gl
	.globl	v
	.bss
	.align 64
	.type	v, @object
	.size	v, 800000
v:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	call	gl
	movl	%eax, -24(%rbp)
	call	gl
	call	gl
	movl	%eax, -20(%rbp)
	movl	$800000, %edx
	movl	$51, %esi
	leaq	v(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -36(%rbp)
	jmp	.L9
.L10:
	call	gl
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	call	gl
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovbe	%edx, %eax
	movl	-8(%rbp), %edx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L9:
	movl	-36(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jb	.L10
	movl	$0, -32(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L11
.L15:
	movl	-28(%rbp), %eax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L14
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L14:
	addl	$1, -28(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jb	.L15
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.type	gl, @function
gl:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
.L5:
	call	getchar_unlocked@PLT
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	cmpl	$9, -4(%rbp)
	ja	.L7
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L7:
	nop
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gl, .-gl
	.globl	v
	.bss
	.align 64
	.type	v, @object
	.size	v, 800000
v:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	call	gl
	movl	%eax, -24(%rbp)
	call	gl
	call	gl
	movl	%eax, -20(%rbp)
	movl	$800000, %edx
	movl	$51, %esi
	leaq	v(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -36(%rbp)
	jmp	.L9
.L10:
	call	gl
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	call	gl
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovbe	%edx, %eax
	movl	-8(%rbp), %edx
	leaq	0(,%rdx,4), %rcx
	leaq	v(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L9:
	movl	-36(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jb	.L10
	movl	$0, -32(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L11
.L15:
	movl	-28(%rbp), %eax
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L14
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L14:
	addl	$1, -28(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jb	.L15
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
