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>
#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++;
        }
    }
}

```

Assembly Code:

```assembly
	.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:
```

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
	.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
```assembly
	.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:
```
```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++;
        }
    }
}

```
Given the following C 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++;
        }
    }
}

```

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 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 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++;
        }
    }
}

```

Assembly Code:

```assembly
	.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:
```

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
	.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:
```