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<stdlib.h>
#include<math.h>
#include<string.h>


//二次元の累積和で実装もしよう　以下
/*

500*500の二次元グリッド
列車をプロットしていく
終着点の座標を固定して累積和を取っていく
始点は動かさない
*/
int main(void){
    int N,M,Q,counter = 0;
    int i,j;
    scanf("%d %d %d",&N,&M,&Q);
    int L[M],R[M],p[Q],q[Q];
    int grid[N+1][N+1];
    for(i=0;i<=N;i++){
        for(j=0;j<=N;j++){
            grid[i][j] = 0;
        }
    }
    for(i=0;i<M;i++){
        scanf("%d %d",&L[i],&R[i]);
        grid[L[i]][R[i]]++;
    }
    for(i=1;i<=N;i++){
        for(j=1;j<=N;j++){
            grid[i][j] += grid[i][j-1];
        }
    }
    for(i=0;i<Q;i++){
        scanf("%d %d",&p[i],&q[i]);
    }
    for(i=0;i<Q;i++){
        for(j=p[i];j<=q[i];j++){
            counter += grid[j][q[i]]-grid[j][p[i]-1];
        }
        printf("%d\n",counter);
        counter = 0;
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	subq	$328, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -360(%rbp)
	movl	$0, -156(%rbp)
	leaq	-160(%rbp), %rcx
	leaq	-164(%rbp), %rdx
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-164(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -144(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -136(%rbp)
	movl	-164(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -128(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -120(%rbp)
	movl	-160(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edx, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L10
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	-160(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%edx, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%edx, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-168(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-168(%rbp), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -352(%rbp)
	movq	$0, -344(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	-208(%rbp), %r9
	movq	-200(%rbp), %r10
	movq	%r10, %rdx
	imulq	-192(%rbp), %rdx
	movq	-184(%rbp), %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r9, %rax
	mulq	-192(%rbp)
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L17
.L20:
	movl	$0, -148(%rbp)
	jmp	.L18
.L19:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -148(%rbp)
.L18:
	movl	-168(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L19
	addl	$1, -152(%rbp)
.L17:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L20
	movl	$0, -152(%rbp)
	jmp	.L21
.L22:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-120(%rbp), %rax
	addq	%rax, %rdx
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-136(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-136(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movq	-120(%rbp), %rdx
	movl	-152(%rbp), %esi
	movslq	%esi, %rsi
	movl	(%rdx,%rsi,4), %edx
	movq	-64(%rbp), %rsi
	movslq	%edx, %r8
	movslq	%eax, %rdi
	imulq	%rcx, %rdi
	addq	%r8, %rdi
	movl	(%rsi,%rdi,4), %esi
	leal	1(%rsi), %edi
	movq	-64(%rbp), %rsi
	movslq	%edx, %rdx
	cltq
	imulq	%rcx, %rax
	addq	%rdx, %rax
	movl	%edi, (%rsi,%rax,4)
	addl	$1, -152(%rbp)
.L21:
	movl	-164(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L22
	movl	$1, -152(%rbp)
	jmp	.L23
.L26:
	movl	$1, -148(%rbp)
	jmp	.L24
.L25:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %edi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movl	-148(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movq	%rbx, %rsi
	shrq	$2, %rsi
	leal	(%rdi,%rax), %ecx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rdi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -148(%rbp)
.L24:
	movl	-168(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L25
	addl	$1, -152(%rbp)
.L23:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L26
	movl	$0, -152(%rbp)
	jmp	.L27
.L28:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rax, %rdx
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -152(%rbp)
.L27:
	movl	-160(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L28
	movl	$0, -152(%rbp)
	jmp	.L29
.L32:
	movq	-104(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -148(%rbp)
	jmp	.L30
.L31:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-88(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-104(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdi
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	addl	%eax, -156(%rbp)
	addl	$1, -148(%rbp)
.L30:
	movq	-88(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L31
	movl	-156(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -156(%rbp)
	addl	$1, -152(%rbp)
.L29:
	movl	-160(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L32
	movl	$0, %eax
	movq	-360(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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 %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	movq	%rsp, %rcx
	movl	%eax, -88(%rbp)
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
	cmpq	%rcx, %rsp
	je	.L3
.L60:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L60
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L61
.L4:
	movq	%rsp, -120(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L61:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L62
.L7:
	movslq	-60(%rbp), %rax
	movq	%rsp, -128(%rbp)
	movq	%rsp, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L62:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L10
	orq	$0, -8(%rsp,%rdx)
.L10:
	movq	%rsp, -96(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L11:
	cmpq	%rcx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L13
	orq	$0, -8(%rsp,%rax)
.L13:
	movl	-68(%rbp), %r12d
	movq	%rsp, -104(%rbp)
	movq	%rsp, %rcx
	leal	1(%r12), %eax
	cltq
	leaq	0(,%rax,4), %rbx
	imulq	%rax, %rax
	leaq	15(,%rax,4), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L14:
	cmpq	%rcx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L16
	orq	$0, -8(%rsp,%rax)
.L16:
	movq	%rsp, %r13
	testl	%r12d, %r12d
	js	.L21
	movslq	%r12d, %rax
	movq	%r13, %rdi
	xorl	%r14d, %r14d
	leaq	4(,%rax,4), %r15
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r15, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rax, %rdi
	movl	%r14d, %eax
	addl	$1, %r14d
	addq	%rbx, %rdi
	cmpl	%eax, %r12d
	jne	.L20
.L21:
	movl	-88(%rbp), %edx
	testl	%edx, %edx
	jle	.L19
	movq	%rbx, %rax
	movq	-120(%rbp), %rsi
	movq	-128(%rbp), %r12
	xorl	%r14d, %r14d
	shrq	$2, %rax
	leaq	.LC1(%rip), %r15
	movq	%rax, -112(%rbp)
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r12, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rsi, -88(%rbp)
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rsi
	movslq	(%r12), %rax
	addl	$1, %r14d
	addq	$4, %r12
	movslq	(%rsi), %rdi
	imulq	-112(%rbp), %rdi
	addq	$4, %rsi
	addq	%rdi, %rax
	addl	$1, 0(%r13,%rax,4)
	cmpl	%r14d, -64(%rbp)
	jg	.L24
.L19:
	movl	-68(%rbp), %r9d
	testl	%r9d, %r9d
	jle	.L23
	movq	%rbx, %rax
	leal	-1(%r9), %edx
	addl	$1, %r9d
	movl	$1, %r8d
	shrq	$2, %rax
	leaq	4(%r13,%rbx), %rdi
	addq	%rdx, %rax
	leaq	8(%r13,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L28:
	movl	-4(%rdi), %edx
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L27:
	addl	(%rax), %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%rax, %rsi
	jne	.L27
	addl	$1, %r8d
	addq	%rbx, %rdi
	addq	%rbx, %rsi
	cmpl	%r9d, %r8d
	jne	.L28
.L23:
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jle	.L26
	movq	-96(%rbp), %rsi
	movq	-104(%rbp), %r14
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L29:
	movq	%r14, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rsi, -88(%rbp)
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rsi
	movl	-60(%rbp), %eax
	addl	$1, %r12d
	addq	$4, %r14
	addq	$4, %rsi
	cmpl	%r12d, %eax
	jg	.L29
	testl	%eax, %eax
	jle	.L26
	shrq	$2, %rbx
	xorl	%r15d, %r15d
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L32:
	movq	-96(%rbp), %rax
	movl	(%rax,%r15,4), %edx
	movq	-104(%rbp), %rax
	movslq	(%rax,%r15,4), %rsi
	cmpl	%edx, %esi
	jl	.L34
	leal	-1(%rdx), %edi
	leal	1(%rsi), %r9d
	xorl	%r8d, %r8d
	movslq	%edi, %rdi
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%edx, %rax
	addl	$1, %edx
	imulq	%rbx, %rax
	leaq	(%rsi,%rax), %r10
	addq	%rdi, %rax
	addl	0(%r13,%r10,4), %r8d
	subl	0(%r13,%rax,4), %r8d
	cmpl	%r9d, %edx
	jne	.L31
.L30:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %r15
	cmpl	%r15d, -60(%rbp)
	jg	.L32
.L26:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L63
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L30
.L63:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	movq	%rsp, %rcx
	movl	%eax, -88(%rbp)
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
	cmpq	%rcx, %rsp
	je	.L3
.L60:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L60
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L61
.L4:
	movq	%rsp, -120(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L61:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L62
.L7:
	movslq	-60(%rbp), %rax
	movq	%rsp, -128(%rbp)
	movq	%rsp, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L62:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L10
	orq	$0, -8(%rsp,%rdx)
.L10:
	movq	%rsp, -96(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L11:
	cmpq	%rcx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L13
	orq	$0, -8(%rsp,%rax)
.L13:
	movl	-68(%rbp), %r12d
	movq	%rsp, -104(%rbp)
	movq	%rsp, %rcx
	leal	1(%r12), %eax
	cltq
	leaq	0(,%rax,4), %rbx
	imulq	%rax, %rax
	leaq	15(,%rax,4), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L14:
	cmpq	%rcx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L16
	orq	$0, -8(%rsp,%rax)
.L16:
	movq	%rsp, %r13
	testl	%r12d, %r12d
	js	.L21
	movslq	%r12d, %rax
	movq	%r13, %rdi
	xorl	%r14d, %r14d
	leaq	4(,%rax,4), %r15
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r15, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rax, %rdi
	movl	%r14d, %eax
	addl	$1, %r14d
	addq	%rbx, %rdi
	cmpl	%eax, %r12d
	jne	.L20
.L21:
	movl	-88(%rbp), %edx
	testl	%edx, %edx
	jle	.L19
	movq	%rbx, %rax
	movq	-120(%rbp), %rsi
	movq	-128(%rbp), %r12
	xorl	%r14d, %r14d
	shrq	$2, %rax
	leaq	.LC1(%rip), %r15
	movq	%rax, -112(%rbp)
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%r12, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rsi, -88(%rbp)
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rsi
	movslq	(%r12), %rax
	addl	$1, %r14d
	addq	$4, %r12
	movslq	(%rsi), %rdi
	imulq	-112(%rbp), %rdi
	addq	$4, %rsi
	addq	%rdi, %rax
	addl	$1, 0(%r13,%rax,4)
	cmpl	%r14d, -64(%rbp)
	jg	.L24
.L19:
	movl	-68(%rbp), %r9d
	testl	%r9d, %r9d
	jle	.L23
	movq	%rbx, %rax
	leal	-1(%r9), %edx
	addl	$1, %r9d
	movl	$1, %r8d
	shrq	$2, %rax
	leaq	4(%r13,%rbx), %rdi
	addq	%rdx, %rax
	leaq	8(%r13,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L28:
	movl	-4(%rdi), %edx
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L27:
	addl	(%rax), %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%rax, %rsi
	jne	.L27
	addl	$1, %r8d
	addq	%rbx, %rdi
	addq	%rbx, %rsi
	cmpl	%r9d, %r8d
	jne	.L28
.L23:
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jle	.L26
	movq	-96(%rbp), %rsi
	movq	-104(%rbp), %r14
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L29:
	movq	%r14, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rsi, -88(%rbp)
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rsi
	movl	-60(%rbp), %eax
	addl	$1, %r12d
	addq	$4, %r14
	addq	$4, %rsi
	cmpl	%r12d, %eax
	jg	.L29
	testl	%eax, %eax
	jle	.L26
	shrq	$2, %rbx
	xorl	%r15d, %r15d
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L32:
	movq	-96(%rbp), %rax
	movl	(%rax,%r15,4), %edx
	movq	-104(%rbp), %rax
	movslq	(%rax,%r15,4), %rsi
	cmpl	%edx, %esi
	jl	.L34
	leal	-1(%rdx), %edi
	leal	1(%rsi), %r9d
	xorl	%r8d, %r8d
	movslq	%edi, %rdi
	.p2align 4,,10
	.p2align 3
.L31:
	movslq	%edx, %rax
	addl	$1, %edx
	imulq	%rbx, %rax
	leaq	(%rsi,%rax), %r10
	addq	%rdi, %rax
	addl	0(%r13,%r10,4), %r8d
	subl	0(%r13,%rax,4), %r8d
	cmpl	%r9d, %edx
	jne	.L31
.L30:
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %r15
	cmpl	%r15d, -60(%rbp)
	jg	.L32
.L26:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L63
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L30
.L63:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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<stdlib.h>
#include<math.h>
#include<string.h>


//二次元の累積和で実装もしよう　以下
/*

500*500の二次元グリッド
列車をプロットしていく
終着点の座標を固定して累積和を取っていく
始点は動かさない
*/
int main(void){
    int N,M,Q,counter = 0;
    int i,j;
    scanf("%d %d %d",&N,&M,&Q);
    int L[M],R[M],p[Q],q[Q];
    int grid[N+1][N+1];
    for(i=0;i<=N;i++){
        for(j=0;j<=N;j++){
            grid[i][j] = 0;
        }
    }
    for(i=0;i<M;i++){
        scanf("%d %d",&L[i],&R[i]);
        grid[L[i]][R[i]]++;
    }
    for(i=1;i<=N;i++){
        for(j=1;j<=N;j++){
            grid[i][j] += grid[i][j-1];
        }
    }
    for(i=0;i<Q;i++){
        scanf("%d %d",&p[i],&q[i]);
    }
    for(i=0;i<Q;i++){
        for(j=p[i];j<=q[i];j++){
            counter += grid[j][q[i]]-grid[j][p[i]-1];
        }
        printf("%d\n",counter);
        counter = 0;
    }
    return 0;
}
10 3 2
1 5
2 8
7 10
1 7
3 3
 10 3 2
1 10
2 8
7 10
1 7
3 10
 10 10 10
1 6
2 9
4 5
4 7
4 7
5 8
6 6
6 7
7 9
10 10
1 8
1 9
1 10
2 8
2 7
2 10
3 8
3 9
3 10
1 10
 10 3 2
1 5
2 8
7 10
1 2
3 3
 10 3 2
1 10
3 8
7 10
1 7
3 10
 10 3 2
1 10
5 8
7 10
1 10
3 10
 10 3 2
1 5
2 8
7 10
1 7
5 10
 10 10 10
1 6
2 9
4 5
4 7
4 7
5 8
6 6
6 7
7 9
10 10
1 8
1 9
1 10
2 8
2 7
2 10
3 8
3 9
3 10
2 10
 10 10 10
1 6
2 9
4 5
1 7
4 7
5 8
6 6
6 7
7 9
10 10
1 8
1 9
1 10
2 8
2 7
2 10
3 8
3 9
3 10
2 10
 10 3 1
1 5
2 8
0 10
1 2
3 3

1
0
 0
1
 7
9
10
6
5
9
6
7
8
10
 0
0
 0
2
 3
2
 1
1
 7
9
10
6
5
9
6
7
8
9
 7
9
10
5
4
8
5
6
7
8
 0

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<stdlib.h>
#include<math.h>
#include<string.h>


//二次元の累積和で実装もしよう　以下
/*

500*500の二次元グリッド
列車をプロットしていく
終着点の座標を固定して累積和を取っていく
始点は動かさない
*/
int main(void){
    int N,M,Q,counter = 0;
    int i,j;
    scanf("%d %d %d",&N,&M,&Q);
    int L[M],R[M],p[Q],q[Q];
    int grid[N+1][N+1];
    for(i=0;i<=N;i++){
        for(j=0;j<=N;j++){
            grid[i][j] = 0;
        }
    }
    for(i=0;i<M;i++){
        scanf("%d %d",&L[i],&R[i]);
        grid[L[i]][R[i]]++;
    }
    for(i=1;i<=N;i++){
        for(j=1;j<=N;j++){
            grid[i][j] += grid[i][j-1];
        }
    }
    for(i=0;i<Q;i++){
        scanf("%d %d",&p[i],&q[i]);
    }
    for(i=0;i<Q;i++){
        for(j=p[i];j<=q[i];j++){
            counter += grid[j][q[i]]-grid[j][p[i]-1];
        }
        printf("%d\n",counter);
        counter = 0;
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	subq	$328, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -360(%rbp)
	movl	$0, -156(%rbp)
	leaq	-160(%rbp), %rcx
	leaq	-164(%rbp), %rdx
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-164(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -144(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -136(%rbp)
	movl	-164(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -128(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -120(%rbp)
	movl	-160(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edx, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L10
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	-160(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%edx, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%edx, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-168(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-168(%rbp), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -352(%rbp)
	movq	$0, -344(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	-208(%rbp), %r9
	movq	-200(%rbp), %r10
	movq	%r10, %rdx
	imulq	-192(%rbp), %rdx
	movq	-184(%rbp), %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r9, %rax
	mulq	-192(%rbp)
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L17
.L20:
	movl	$0, -148(%rbp)
	jmp	.L18
.L19:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -148(%rbp)
.L18:
	movl	-168(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L19
	addl	$1, -152(%rbp)
.L17:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L20
	movl	$0, -152(%rbp)
	jmp	.L21
.L22:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-120(%rbp), %rax
	addq	%rax, %rdx
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-136(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-136(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movq	-120(%rbp), %rdx
	movl	-152(%rbp), %esi
	movslq	%esi, %rsi
	movl	(%rdx,%rsi,4), %edx
	movq	-64(%rbp), %rsi
	movslq	%edx, %r8
	movslq	%eax, %rdi
	imulq	%rcx, %rdi
	addq	%r8, %rdi
	movl	(%rsi,%rdi,4), %esi
	leal	1(%rsi), %edi
	movq	-64(%rbp), %rsi
	movslq	%edx, %rdx
	cltq
	imulq	%rcx, %rax
	addq	%rdx, %rax
	movl	%edi, (%rsi,%rax,4)
	addl	$1, -152(%rbp)
.L21:
	movl	-164(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L22
	movl	$1, -152(%rbp)
	jmp	.L23
.L26:
	movl	$1, -148(%rbp)
	jmp	.L24
.L25:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %edi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movl	-148(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movq	%rbx, %rsi
	shrq	$2, %rsi
	leal	(%rdi,%rax), %ecx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rdi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -148(%rbp)
.L24:
	movl	-168(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L25
	addl	$1, -152(%rbp)
.L23:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L26
	movl	$0, -152(%rbp)
	jmp	.L27
.L28:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rax, %rdx
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -152(%rbp)
.L27:
	movl	-160(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L28
	movl	$0, -152(%rbp)
	jmp	.L29
.L32:
	movq	-104(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -148(%rbp)
	jmp	.L30
.L31:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-88(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-104(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdi
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	addl	%eax, -156(%rbp)
	addl	$1, -148(%rbp)
.L30:
	movq	-88(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L31
	movl	-156(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -156(%rbp)
	addl	$1, -152(%rbp)
.L29:
	movl	-160(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L32
	movl	$0, %eax
	movq	-360(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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 %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	subq	$328, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -360(%rbp)
	movl	$0, -156(%rbp)
	leaq	-160(%rbp), %rcx
	leaq	-164(%rbp), %rdx
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-164(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -144(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -136(%rbp)
	movl	-164(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -128(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -120(%rbp)
	movl	-160(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%edx, %rax
	movq	%rax, -304(%rbp)
	movq	$0, -296(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L8:
	cmpq	%rcx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L10
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	-160(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%edx, %rax
	movq	%rax, -320(%rbp)
	movq	$0, -312(%rbp)
	movslq	%edx, %rax
	movq	%rax, -336(%rbp)
	movq	$0, -328(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-168(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-168(%rbp), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -352(%rbp)
	movq	$0, -344(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	-208(%rbp), %r9
	movq	-200(%rbp), %r10
	movq	%r10, %rdx
	imulq	-192(%rbp), %rdx
	movq	-184(%rbp), %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r9, %rax
	mulq	-192(%rbp)
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -152(%rbp)
	jmp	.L17
.L20:
	movl	$0, -148(%rbp)
	jmp	.L18
.L19:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -148(%rbp)
.L18:
	movl	-168(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L19
	addl	$1, -152(%rbp)
.L17:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L20
	movl	$0, -152(%rbp)
	jmp	.L21
.L22:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-120(%rbp), %rax
	addq	%rax, %rdx
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-136(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-136(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movq	-120(%rbp), %rdx
	movl	-152(%rbp), %esi
	movslq	%esi, %rsi
	movl	(%rdx,%rsi,4), %edx
	movq	-64(%rbp), %rsi
	movslq	%edx, %r8
	movslq	%eax, %rdi
	imulq	%rcx, %rdi
	addq	%r8, %rdi
	movl	(%rsi,%rdi,4), %esi
	leal	1(%rsi), %edi
	movq	-64(%rbp), %rsi
	movslq	%edx, %rdx
	cltq
	imulq	%rcx, %rax
	addq	%rdx, %rax
	movl	%edi, (%rsi,%rax,4)
	addl	$1, -152(%rbp)
.L21:
	movl	-164(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L22
	movl	$1, -152(%rbp)
	jmp	.L23
.L26:
	movl	$1, -148(%rbp)
	jmp	.L24
.L25:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %edi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movl	-148(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	movq	%rbx, %rsi
	shrq	$2, %rsi
	leal	(%rdi,%rax), %ecx
	movq	-64(%rbp), %rax
	movl	-148(%rbp), %edx
	movslq	%edx, %rdi
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	addl	$1, -148(%rbp)
.L24:
	movl	-168(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L25
	addl	$1, -152(%rbp)
.L23:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L26
	movl	$0, -152(%rbp)
	jmp	.L27
.L28:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rax, %rdx
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -152(%rbp)
.L27:
	movl	-160(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L28
	movl	$0, -152(%rbp)
	jmp	.L29
.L32:
	movq	-104(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -148(%rbp)
	jmp	.L30
.L31:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-88(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-104(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdi
	movl	-148(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	addl	%eax, -156(%rbp)
	addl	$1, -148(%rbp)
.L30:
	movq	-88(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L31
	movl	-156(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -156(%rbp)
	addl	$1, -152(%rbp)
.L29:
	movl	-160(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jl	.L32
	movl	$0, %eax
	movq	-360(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
