Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#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){
    memset(v, 0x33, sizeof(uint)*H);
    {
        const uint h = gl();
        gl();
        const uint n = gl();
        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];
        }
        v[h] = 0;
    }
    {
        uint right = 0;
        for(uint x=1; ; 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;
            }
        }
    }
    return 0;
}
```

Assembly Code:

```assembly
	.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
	movl	$800000, %edx
	movl	$51, %esi
	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
	movq	%r14, %rdi
	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	memset@PLT
	call	gl
	movl	%eax, %r13d
	call	gl
	call	gl
	movl	%eax, %r12d
	testl	%eax, %eax
	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:
	movl	$0, (%r14,%r13,4)
	movl	4+v(%rip), %edx
	movl	$1, %r8d
	testl	%edx, %edx
	jle	.L22
	movl	$1, %ecx
	movl	$2, %eax
	xorl	%r9d, %r9d
	movl	$1, %edi
	cmpl	%edx, %ecx
	movl	%eax, %r8d
	movl	(%r14,%rax,4), %edx
	jge	.L21
	.p2align 4,,10
	.p2align 3
.L31:
	leal	1(%rdi), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jg	.L22
	movl	%edi, %r9d
.L23:
	cmpl	%edx, %ecx
	movl	%esi, %edi
	movl	(%r14,%rax,4), %edx
	movl	%eax, %r8d
	jl	.L31
.L21:
	leal	1(%r9), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jle	.L23
.L22:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.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
	movl	$800000, %edx
	movl	$51, %esi
	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
	movq	%r14, %rdi
	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	memset@PLT
	call	gl
	movl	%eax, %r13d
	call	gl
	call	gl
	movl	%eax, %r12d
	testl	%eax, %eax
	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:
	movl	$0, (%r14,%r13,4)
	movl	4+v(%rip), %edx
	movl	$1, %r8d
	testl	%edx, %edx
	jle	.L22
	movl	$1, %ecx
	movl	$2, %eax
	xorl	%r9d, %r9d
	movl	$1, %edi
	cmpl	%edx, %ecx
	movl	%eax, %r8d
	movl	(%r14,%rax,4), %edx
	jge	.L21
	.p2align 4,,10
	.p2align 3
.L31:
	leal	1(%rdi), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jg	.L22
	movl	%edi, %r9d
.L23:
	cmpl	%edx, %ecx
	movl	%esi, %edi
	movl	(%r14,%rax,4), %edx
	movl	%eax, %r8d
	jl	.L31
.L21:
	leal	1(%r9), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jle	.L23
.L22:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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
```assembly
	.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
	movl	$800000, %edx
	movl	$51, %esi
	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
	movq	%r14, %rdi
	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	memset@PLT
	call	gl
	movl	%eax, %r13d
	call	gl
	call	gl
	movl	%eax, %r12d
	testl	%eax, %eax
	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:
	movl	$0, (%r14,%r13,4)
	movl	4+v(%rip), %edx
	movl	$1, %r8d
	testl	%edx, %edx
	jle	.L22
	movl	$1, %ecx
	movl	$2, %eax
	xorl	%r9d, %r9d
	movl	$1, %edi
	cmpl	%edx, %ecx
	movl	%eax, %r8d
	movl	(%r14,%rax,4), %edx
	jge	.L21
	.p2align 4,,10
	.p2align 3
.L31:
	leal	1(%rdi), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jg	.L22
	movl	%edi, %r9d
.L23:
	cmpl	%edx, %ecx
	movl	%esi, %edi
	movl	(%r14,%rax,4), %edx
	movl	%eax, %r8d
	jl	.L31
.L21:
	leal	1(%r9), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jle	.L23
.L22:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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:
```
```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){
    memset(v, 0x33, sizeof(uint)*H);
    {
        const uint h = gl();
        gl();
        const uint n = gl();
        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];
        }
        v[h] = 0;
    }
    {
        uint right = 0;
        for(uint x=1; ; 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;
            }
        }
    }
    return 0;
}
```
Given the following C 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){
    memset(v, 0x33, sizeof(uint)*H);
    {
        const uint h = gl();
        gl();
        const uint n = gl();
        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];
        }
        v[h] = 0;
    }
    {
        uint right = 0;
        for(uint x=1; ; 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;
            }
        }
    }
    return 0;
}
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

3 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 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){
    memset(v, 0x33, sizeof(uint)*H);
    {
        const uint h = gl();
        gl();
        const uint n = gl();
        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];
        }
        v[h] = 0;
    }
    {
        uint right = 0;
        for(uint x=1; ; 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;
            }
        }
    }
    return 0;
}
```

Assembly Code:

```assembly
	.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
	movl	$800000, %edx
	movl	$51, %esi
	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
	movq	%r14, %rdi
	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	memset@PLT
	call	gl
	movl	%eax, %r13d
	call	gl
	call	gl
	movl	%eax, %r12d
	testl	%eax, %eax
	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:
	movl	$0, (%r14,%r13,4)
	movl	4+v(%rip), %edx
	movl	$1, %r8d
	testl	%edx, %edx
	jle	.L22
	movl	$1, %ecx
	movl	$2, %eax
	xorl	%r9d, %r9d
	movl	$1, %edi
	cmpl	%edx, %ecx
	movl	%eax, %r8d
	movl	(%r14,%rax,4), %edx
	jge	.L21
	.p2align 4,,10
	.p2align 3
.L31:
	leal	1(%rdi), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jg	.L22
	movl	%edi, %r9d
.L23:
	cmpl	%edx, %ecx
	movl	%esi, %edi
	movl	(%r14,%rax,4), %edx
	movl	%eax, %r8d
	jl	.L31
.L21:
	leal	1(%r9), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jle	.L23
.L22:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.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
	movl	$800000, %edx
	movl	$51, %esi
	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
	movq	%r14, %rdi
	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	memset@PLT
	call	gl
	movl	%eax, %r13d
	call	gl
	call	gl
	movl	%eax, %r12d
	testl	%eax, %eax
	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:
	movl	$0, (%r14,%r13,4)
	movl	4+v(%rip), %edx
	movl	$1, %r8d
	testl	%edx, %edx
	jle	.L22
	movl	$1, %ecx
	movl	$2, %eax
	xorl	%r9d, %r9d
	movl	$1, %edi
	cmpl	%edx, %ecx
	movl	%eax, %r8d
	movl	(%r14,%rax,4), %edx
	jge	.L21
	.p2align 4,,10
	.p2align 3
.L31:
	leal	1(%rdi), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jg	.L22
	movl	%edi, %r9d
.L23:
	cmpl	%edx, %ecx
	movl	%esi, %edi
	movl	(%r14,%rax,4), %edx
	movl	%eax, %r8d
	jl	.L31
.L21:
	leal	1(%r9), %esi
	addq	$1, %rax
	movl	%esi, %ecx
	cmpl	%edx, %esi
	jle	.L23
.L22:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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:
```