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>
#define Q_MAX 100000
#define A_MAX 2147483647

int main() {
    int n, x, bit, i, q, a[Q_MAX][3];
    scanf("%d%d", &n, &q);
    a[0][0] = 0;
    a[0][1] = n-1;
    a[0][2] = A_MAX;
    i = 1;
    while (~scanf("%d", &bit)) {
        if (bit) {
            scanf("%d", &x);
            for (int j=i-1; j>=0; j--)
                if (x >= a[j][0] && x <= a[j][1]){
                    printf("%d\n", a[j][2]);
                    break;
                }
        } else {
            int *m = *(a+i);
            scanf("%d%d%d", m, m+1, m+2);
            i++;
        }
    }
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d%d"
	.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
	leaq	-1196032(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$4016, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1200036(%rbp), %rdx
	leaq	-1200048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1200016(%rbp)
	movl	-1200048(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1200012(%rbp)
	movl	$2147483647, -1200008(%rbp)
	movl	$1, -1200032(%rbp)
	jmp	.L2
.L8:
	movl	-1200040(%rbp), %eax
	testl	%eax, %eax
	je	.L3
	leaq	-1200044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1200032(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1200028(%rbp)
	jmp	.L4
.L7:
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200016, %rax
	movl	(%rax), %edx
	movl	-1200044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L5
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200012, %rax
	movl	(%rax), %edx
	movl	-1200044(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200008, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L5:
	subl	$1, -1200028(%rbp)
.L4:
	cmpl	$0, -1200028(%rbp)
	jns	.L7
	jmp	.L2
.L3:
	movl	-1200032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	-1200016(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -1200024(%rbp)
	movq	-1200024(%rbp), %rax
	leaq	8(%rax), %rcx
	movq	-1200024(%rbp), %rax
	leaq	4(%rax), %rdx
	movq	-1200024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1200032(%rbp)
.L2:
	leaq	-1200040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-1196032(%rsp), %r11
	.cfi_def_cfa 11, 1196088
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4008, %rsp
	.cfi_def_cfa_offset 1200096
	leaq	.LC0(%rip), %rdi
	movl	$1, %ebx
	leaq	.LC1(%rip), %rbp
	leaq	.LC3(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 1200024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	8(%rsp), %r12
	leaq	16(%rsp), %r13
	leaq	4(%rsp), %r15
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movl	$0, 16(%rsp)
	movl	$2147483647, 24(%rsp)
	subl	$1, %eax
	movl	%eax, 20(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jne	.L13
	movslq	%ebx, %rax
	movq	%r14, %rdi
	addl	$1, %ebx
	leaq	(%rax,%rax,2), %rax
	leaq	0(%r13,%rax,4), %rsi
	xorl	%eax, %eax
	leaq	8(%rsi), %rcx
	leaq	4(%rsi), %rdx
	call	__isoc99_scanf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%ebx, %rax
	movl	4(%rsp), %ecx
	leal	-1(%rbx), %edx
	leaq	(%rax,%rax,2), %rax
	leaq	0(%r13,%rax,4), %rax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	subl	$1, %edx
	subq	$12, %rax
	cmpl	$-1, %edx
	je	.L2
.L6:
	cmpl	%ecx, -12(%rax)
	jg	.L4
	cmpl	-8(%rax), %ecx
	jg	.L4
	movslq	%edx, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	leaq	(%rdx,%rdx,2), %rax
	movl	24(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movq	1200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$1200040, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-1196032(%rsp), %r11
	.cfi_def_cfa 11, 1196088
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4008, %rsp
	.cfi_def_cfa_offset 1200096
	leaq	.LC0(%rip), %rdi
	movl	$1, %ebx
	leaq	.LC1(%rip), %rbp
	leaq	.LC3(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 1200024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	8(%rsp), %r12
	leaq	16(%rsp), %r13
	leaq	4(%rsp), %r15
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movl	$0, 16(%rsp)
	movl	$2147483647, 24(%rsp)
	subl	$1, %eax
	movl	%eax, 20(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jne	.L13
	movslq	%ebx, %rax
	movq	%r14, %rdi
	addl	$1, %ebx
	leaq	(%rax,%rax,2), %rax
	leaq	0(%r13,%rax,4), %rsi
	xorl	%eax, %eax
	leaq	8(%rsi), %rcx
	leaq	4(%rsi), %rdx
	call	__isoc99_scanf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%ebx, %rax
	movl	4(%rsp), %ecx
	leal	-1(%rbx), %edx
	leaq	(%rax,%rax,2), %rax
	leaq	0(%r13,%rax,4), %rax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	subl	$1, %edx
	subq	$12, %rax
	cmpl	$-1, %edx
	je	.L2
.L6:
	cmpl	%ecx, -12(%rax)
	jg	.L4
	cmpl	-8(%rax), %ecx
	jg	.L4
	movslq	%edx, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	leaq	(%rdx,%rdx,2), %rax
	movl	24(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movq	1200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$1200040, %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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
#define Q_MAX 100000
#define A_MAX 2147483647

int main() {
    int n, x, bit, i, q, a[Q_MAX][3];
    scanf("%d%d", &n, &q);
    a[0][0] = 0;
    a[0][1] = n-1;
    a[0][2] = A_MAX;
    i = 1;
    while (~scanf("%d", &bit)) {
        if (bit) {
            scanf("%d", &x);
            for (int j=i-1; j>=0; j--)
                if (x >= a[j][0] && x <= a[j][1]){
                    printf("%d\n", a[j][2]);
                    break;
                }
        } else {
            int *m = *(a+i);
            scanf("%d%d%d", m, m+1, m+2);
            i++;
        }
    }
}


3 5
0 0 1 1
0 1 2 3
0 0 2 2
1 0
1 1
 2 3
1 0
0 0 0 5
1 0
 3 5
0 0 1 1
0 1 2 3
0 0 2 2
1 0
0 1
 2 3
1 0
0 0 0 5
1 1
 3 5
1 0 1 1
0 1 2 3
0 0 2 2
1 0
1 1
 2 1
1 0
0 0 0 5
1 1
 3 5
1 1 1 2
0 1 2 3
-1 0 2 2
0 0
0 1
 9 5
1 0 1 1
1 1 4 3
0 0 2 2
0 1
1 1
 9 5
0 0 1 1
1 0 4 3
0 0 2 2
0 1
1 1
 3 5
0 0 1 1
0 1 2 3
0 2 2 2
1 0
1 0

2
2
 2147483647
5
 2
 2147483647
2147483647
 2147483647
2147483647
2
2
 2147483647
2147483647
 2147483647
2147483647
2147483647
3
 2147483647
2147483647
2147483647
2147483647
 1
2147483647
 1
1

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>
#define Q_MAX 100000
#define A_MAX 2147483647

int main() {
    int n, x, bit, i, q, a[Q_MAX][3];
    scanf("%d%d", &n, &q);
    a[0][0] = 0;
    a[0][1] = n-1;
    a[0][2] = A_MAX;
    i = 1;
    while (~scanf("%d", &bit)) {
        if (bit) {
            scanf("%d", &x);
            for (int j=i-1; j>=0; j--)
                if (x >= a[j][0] && x <= a[j][1]){
                    printf("%d\n", a[j][2]);
                    break;
                }
        } else {
            int *m = *(a+i);
            scanf("%d%d%d", m, m+1, m+2);
            i++;
        }
    }
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d%d"
	.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
	leaq	-1196032(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$4016, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1200036(%rbp), %rdx
	leaq	-1200048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1200016(%rbp)
	movl	-1200048(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1200012(%rbp)
	movl	$2147483647, -1200008(%rbp)
	movl	$1, -1200032(%rbp)
	jmp	.L2
.L8:
	movl	-1200040(%rbp), %eax
	testl	%eax, %eax
	je	.L3
	leaq	-1200044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1200032(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1200028(%rbp)
	jmp	.L4
.L7:
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200016, %rax
	movl	(%rax), %edx
	movl	-1200044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L5
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200012, %rax
	movl	(%rax), %edx
	movl	-1200044(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200008, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L5:
	subl	$1, -1200028(%rbp)
.L4:
	cmpl	$0, -1200028(%rbp)
	jns	.L7
	jmp	.L2
.L3:
	movl	-1200032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	-1200016(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -1200024(%rbp)
	movq	-1200024(%rbp), %rax
	leaq	8(%rax), %rcx
	movq	-1200024(%rbp), %rax
	leaq	4(%rax), %rdx
	movq	-1200024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1200032(%rbp)
.L2:
	leaq	-1200040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d%d"
	.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
	leaq	-1196032(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$4016, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1200036(%rbp), %rdx
	leaq	-1200048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1200016(%rbp)
	movl	-1200048(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1200012(%rbp)
	movl	$2147483647, -1200008(%rbp)
	movl	$1, -1200032(%rbp)
	jmp	.L2
.L8:
	movl	-1200040(%rbp), %eax
	testl	%eax, %eax
	je	.L3
	leaq	-1200044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1200032(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -1200028(%rbp)
	jmp	.L4
.L7:
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200016, %rax
	movl	(%rax), %edx
	movl	-1200044(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L5
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200012, %rax
	movl	(%rax), %edx
	movl	-1200044(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	-1200028(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$1200008, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L5:
	subl	$1, -1200028(%rbp)
.L4:
	cmpl	$0, -1200028(%rbp)
	jns	.L7
	jmp	.L2
.L3:
	movl	-1200032(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	-1200016(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -1200024(%rbp)
	movq	-1200024(%rbp), %rax
	leaq	8(%rax), %rcx
	movq	-1200024(%rbp), %rax
	leaq	4(%rax), %rdx
	movq	-1200024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1200032(%rbp)
.L2:
	leaq	-1200040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
