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

```c
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007

typedef long long int lli;

int main(void) {
  int N, M, Q;
  scanf("%d %d %d", &N, &M, &Q);
  int line[501][501] = {0}; // line都市L][都市R]:列車(線路)が通っているか
  int L, R;
  int p[100001], q[100001];
  rep(i, 0, M) {
    scanf("%d %d", &L, &R);
    line[L][R]++;
  }
  rep(i, 0, Q) scanf("%d %d", &p[i], &q[i]);

  // rep(i, 1, N+1) {
  //   rep(j, 1, N+1) {
  //     printf("%d ", line[i][j]);
  //   }
  //   printf("\n");
  // }
  // printf("\n");
  int train[502][502] = {0}; // train[都市L][都市R]:完全に含まれる列車の本数
  for (int s = N; s > 0; s--) {
    int sum = 0;
    for (int g = s; g <= N; g++) {
      sum += line[s][g];
      train[s][g] += sum;
      train[s][g] += train[s + 1][g];
    }
  }
  // rep(i, 1, N+1) {
  //   rep(j, 1, N+1) {
  //     printf("%d ", train[i][j]);
  //   }
  //   printf("\n");
  // }
  // printf("\n");

  rep(i, 0, Q) {
    printf("%d\n", train[p[i]][q[i]]);
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	acs
	.type	acs, @function
acs:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	acs, .-acs
	.globl	des
	.type	des, @function
des:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	des, .-des
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp_str, .-cmp_str
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2809856(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2812116(%rbp), %rcx
	leaq	-2812120(%rbp), %rdx
	leaq	-2812124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2012048(%rbp), %rax
	movl	$1004004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -2812104(%rbp)
	jmp	.L10
.L11:
	leaq	-2812108(%rbp), %rdx
	leaq	-2812112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2812112(%rbp), %eax
	movl	-2812108(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rcx
	imulq	$501, %rcx, %rcx
	addq	%rsi, %rcx
	movl	-2012048(%rbp,%rcx,4), %ecx
	addl	$1, %ecx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	movl	%ecx, -2012048(%rbp,%rax,4)
	addl	$1, -2812104(%rbp)
.L10:
	movl	-2812120(%rbp), %eax
	cmpl	%eax, -2812104(%rbp)
	jl	.L11
	movl	$0, -2812100(%rbp)
	jmp	.L12
.L13:
	leaq	-2412064(%rbp), %rdx
	movl	-2812100(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-2812080(%rbp), %rcx
	movl	-2812100(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -2812100(%rbp)
.L12:
	movl	-2812116(%rbp), %eax
	cmpl	%eax, -2812100(%rbp)
	jl	.L13
	leaq	-1008032(%rbp), %rax
	movl	$1008016, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-2812124(%rbp), %eax
	movl	%eax, -2812096(%rbp)
	jmp	.L14
.L17:
	movl	$0, -2812092(%rbp)
	movl	-2812096(%rbp), %eax
	movl	%eax, -2812088(%rbp)
	jmp	.L15
.L16:
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	movl	-2012048(%rbp,%rax,4), %eax
	addl	%eax, -2812092(%rbp)
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rdx, %rax
	movl	-1008032(%rbp,%rax,4), %edx
	movl	-2812092(%rbp), %eax
	addl	%eax, %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rcx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -1008032(%rbp,%rax,4)
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rdx, %rax
	movl	-1008032(%rbp,%rax,4), %ecx
	movl	-2812096(%rbp), %eax
	leal	1(%rax), %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$502, %rax, %rax
	addq	%rsi, %rax
	movl	-1008032(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rcx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -1008032(%rbp,%rax,4)
	addl	$1, -2812088(%rbp)
.L15:
	movl	-2812124(%rbp), %eax
	cmpl	%eax, -2812088(%rbp)
	jle	.L16
	subl	$1, -2812096(%rbp)
.L14:
	cmpl	$0, -2812096(%rbp)
	jg	.L17
	movl	$0, -2812084(%rbp)
	jmp	.L18
.L19:
	movl	-2812084(%rbp), %eax
	cltq
	movl	-2812080(%rbp,%rax,4), %edx
	movl	-2812084(%rbp), %eax
	cltq
	movl	-2412064(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	-1008032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2812084(%rbp)
.L18:
	movl	-2812116(%rbp), %eax
	cmpl	%eax, -2812084(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	acs
	.type	acs, @function
acs:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	acs, .-acs
	.p2align 4
	.globl	des
	.type	des, @function
des:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	des, .-des
	.p2align 4
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB53:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	cmp_char, .-cmp_char
	.p2align 4
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB54:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rsi
	movq	(%rdi), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE54:
	.size	cmp_str, .-cmp_str
	.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:
.LFB55:
	.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	-2809856(%rsp), %r11
	.cfi_def_cfa 11, 2809912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2264, %rsp
	.cfi_def_cfa_offset 2812176
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2812104(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	leaq	800064(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	$1004004, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r12
	leaq	24(%rsp), %rbx
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	movslq	28(%rsp), %rdx
	addl	$1, %r14d
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	addl	$1, 800064(%rsp,%rax,4)
	cmpl	%r14d, 16(%rsp)
	jg	.L7
.L10:
	movl	20(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L29
	leaq	32(%rsp), %r15
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %rbp
	leaq	400048(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	(%r12,%r14,4), %rdx
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	addq	$1, %r14
	addq	$4, %r15
	cmpl	%r14d, %ebx
	jg	.L11
	leaq	1804080(%rsp), %r12
	movl	$1008016, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	12(%rsp), %r11d
	testl	%r11d, %r11d
	jle	.L17
.L12:
	movslq	%r11d, %rbp
	imulq	$2012, %rbp, %rax
	leaq	1(%rbp), %r8
	imulq	$2004, %rbp, %r9
	imulq	$-2008, %rbp, %r10
	imulq	$2008, %r8, %r8
	addq	%rax, %r12
	addq	%r13, %r9
	movl	%r11d, %r13d
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%r12, %rax
	movq	%rbp, %rcx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L15:
	movl	(%rax), %edx
	addl	(%r9,%rcx,4), %esi
	leaq	(%rax,%r10), %rdi
	addq	$1, %rcx
	addq	$4, %rax
	addl	%esi, %edx
	movl	%edx, -4(%rax)
	addl	(%rdi,%r8), %edx
	movl	%edx, -4(%rax)
	cmpl	%ecx, %r11d
	jge	.L15
	subq	$1, %rbp
	subq	$2012, %r12
	subq	$2004, %r9
	addq	$2008, %r10
	subq	$2008, %r8
	subl	$1, %r13d
	jne	.L16
.L17:
	testl	%ebx, %ebx
	jle	.L14
	xorl	%r13d, %r13d
	leaq	32(%rsp), %rbp
	leaq	400048(%rsp), %r12
	leaq	.LC2(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	0(%rbp,%r13,4), %rax
	movslq	(%r12,%r13,4), %rdx
	movq	%rbx, %rsi
	movl	$1, %edi
	addq	$1, %r13
	imulq	$502, %rax, %rax
	addq	%rdx, %rax
	movl	1804080(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r13d, 20(%rsp)
	jg	.L13
.L14:
	movq	2812104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$2812120, %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
.L29:
	.cfi_restore_state
	leaq	1804080(%rsp), %r12
	movl	$1008016, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	12(%rsp), %r11d
	testl	%r11d, %r11d
	jg	.L12
	jmp	.L14
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.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
	.p2align 4
	.globl	acs
	.type	acs, @function
acs:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	acs, .-acs
	.p2align 4
	.globl	des
	.type	des, @function
des:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	des, .-des
	.p2align 4
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB53:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	cmp_char, .-cmp_char
	.p2align 4
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB54:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rsi
	movq	(%rdi), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE54:
	.size	cmp_str, .-cmp_str
	.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:
.LFB55:
	.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	-2809856(%rsp), %r11
	.cfi_def_cfa 11, 2809912
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2264, %rsp
	.cfi_def_cfa_offset 2812176
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 2812104(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	leaq	800064(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	$1004004, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r12
	leaq	24(%rsp), %rbx
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rax
	movslq	28(%rsp), %rdx
	addl	$1, %r14d
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	addl	$1, 800064(%rsp,%rax,4)
	cmpl	%r14d, 16(%rsp)
	jg	.L7
.L10:
	movl	20(%rsp), %ebx
	testl	%ebx, %ebx
	jle	.L29
	leaq	32(%rsp), %r15
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %rbp
	leaq	400048(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	(%r12,%r14,4), %rdx
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	addq	$1, %r14
	addq	$4, %r15
	cmpl	%r14d, %ebx
	jg	.L11
	leaq	1804080(%rsp), %r12
	movl	$1008016, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	12(%rsp), %r11d
	testl	%r11d, %r11d
	jle	.L17
.L12:
	movslq	%r11d, %rbp
	imulq	$2012, %rbp, %rax
	leaq	1(%rbp), %r8
	imulq	$2004, %rbp, %r9
	imulq	$-2008, %rbp, %r10
	imulq	$2008, %r8, %r8
	addq	%rax, %r12
	addq	%r13, %r9
	movl	%r11d, %r13d
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%r12, %rax
	movq	%rbp, %rcx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L15:
	movl	(%rax), %edx
	addl	(%r9,%rcx,4), %esi
	leaq	(%rax,%r10), %rdi
	addq	$1, %rcx
	addq	$4, %rax
	addl	%esi, %edx
	movl	%edx, -4(%rax)
	addl	(%rdi,%r8), %edx
	movl	%edx, -4(%rax)
	cmpl	%ecx, %r11d
	jge	.L15
	subq	$1, %rbp
	subq	$2012, %r12
	subq	$2004, %r9
	addq	$2008, %r10
	subq	$2008, %r8
	subl	$1, %r13d
	jne	.L16
.L17:
	testl	%ebx, %ebx
	jle	.L14
	xorl	%r13d, %r13d
	leaq	32(%rsp), %rbp
	leaq	400048(%rsp), %r12
	leaq	.LC2(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	0(%rbp,%r13,4), %rax
	movslq	(%r12,%r13,4), %rdx
	movq	%rbx, %rsi
	movl	$1, %edi
	addq	$1, %r13
	imulq	$502, %rax, %rax
	addq	%rdx, %rax
	movl	1804080(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r13d, 20(%rsp)
	jg	.L13
.L14:
	movq	2812104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$2812120, %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
.L29:
	.cfi_restore_state
	leaq	1804080(%rsp), %r12
	movl	$1008016, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movl	12(%rsp), %r11d
	testl	%r11d, %r11d
	jg	.L12
	jmp	.L14
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.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 <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007

typedef long long int lli;

int main(void) {
  int N, M, Q;
  scanf("%d %d %d", &N, &M, &Q);
  int line[501][501] = {0}; // line都市L][都市R]:列車(線路)が通っているか
  int L, R;
  int p[100001], q[100001];
  rep(i, 0, M) {
    scanf("%d %d", &L, &R);
    line[L][R]++;
  }
  rep(i, 0, Q) scanf("%d %d", &p[i], &q[i]);

  // rep(i, 1, N+1) {
  //   rep(j, 1, N+1) {
  //     printf("%d ", line[i][j]);
  //   }
  //   printf("\n");
  // }
  // printf("\n");
  int train[502][502] = {0}; // train[都市L][都市R]:完全に含まれる列車の本数
  for (int s = N; s > 0; s--) {
    int sum = 0;
    for (int g = s; g <= N; g++) {
      sum += line[s][g];
      train[s][g] += sum;
      train[s][g] += train[s + 1][g];
    }
  }
  // rep(i, 1, N+1) {
  //   rep(j, 1, N+1) {
  //     printf("%d ", train[i][j]);
  //   }
  //   printf("\n");
  // }
  // printf("\n");

  rep(i, 0, Q) {
    printf("%d\n", train[p[i]][q[i]]);
  }
  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 <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007

typedef long long int lli;

int main(void) {
  int N, M, Q;
  scanf("%d %d %d", &N, &M, &Q);
  int line[501][501] = {0}; // line都市L][都市R]:列車(線路)が通っているか
  int L, R;
  int p[100001], q[100001];
  rep(i, 0, M) {
    scanf("%d %d", &L, &R);
    line[L][R]++;
  }
  rep(i, 0, Q) scanf("%d %d", &p[i], &q[i]);

  // rep(i, 1, N+1) {
  //   rep(j, 1, N+1) {
  //     printf("%d ", line[i][j]);
  //   }
  //   printf("\n");
  // }
  // printf("\n");
  int train[502][502] = {0}; // train[都市L][都市R]:完全に含まれる列車の本数
  for (int s = N; s > 0; s--) {
    int sum = 0;
    for (int g = s; g <= N; g++) {
      sum += line[s][g];
      train[s][g] += sum;
      train[s][g] += train[s + 1][g];
    }
  }
  // rep(i, 1, N+1) {
  //   rep(j, 1, N+1) {
  //     printf("%d ", train[i][j]);
  //   }
  //   printf("\n");
  // }
  // printf("\n");

  rep(i, 0, Q) {
    printf("%d\n", train[p[i]][q[i]]);
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	acs
	.type	acs, @function
acs:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	acs, .-acs
	.globl	des
	.type	des, @function
des:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	des, .-des
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp_str, .-cmp_str
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2809856(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2812116(%rbp), %rcx
	leaq	-2812120(%rbp), %rdx
	leaq	-2812124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2012048(%rbp), %rax
	movl	$1004004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -2812104(%rbp)
	jmp	.L10
.L11:
	leaq	-2812108(%rbp), %rdx
	leaq	-2812112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2812112(%rbp), %eax
	movl	-2812108(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rcx
	imulq	$501, %rcx, %rcx
	addq	%rsi, %rcx
	movl	-2012048(%rbp,%rcx,4), %ecx
	addl	$1, %ecx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	movl	%ecx, -2012048(%rbp,%rax,4)
	addl	$1, -2812104(%rbp)
.L10:
	movl	-2812120(%rbp), %eax
	cmpl	%eax, -2812104(%rbp)
	jl	.L11
	movl	$0, -2812100(%rbp)
	jmp	.L12
.L13:
	leaq	-2412064(%rbp), %rdx
	movl	-2812100(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-2812080(%rbp), %rcx
	movl	-2812100(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -2812100(%rbp)
.L12:
	movl	-2812116(%rbp), %eax
	cmpl	%eax, -2812100(%rbp)
	jl	.L13
	leaq	-1008032(%rbp), %rax
	movl	$1008016, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-2812124(%rbp), %eax
	movl	%eax, -2812096(%rbp)
	jmp	.L14
.L17:
	movl	$0, -2812092(%rbp)
	movl	-2812096(%rbp), %eax
	movl	%eax, -2812088(%rbp)
	jmp	.L15
.L16:
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	movl	-2012048(%rbp,%rax,4), %eax
	addl	%eax, -2812092(%rbp)
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rdx, %rax
	movl	-1008032(%rbp,%rax,4), %edx
	movl	-2812092(%rbp), %eax
	addl	%eax, %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rcx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -1008032(%rbp,%rax,4)
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rdx, %rax
	movl	-1008032(%rbp,%rax,4), %ecx
	movl	-2812096(%rbp), %eax
	leal	1(%rax), %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$502, %rax, %rax
	addq	%rsi, %rax
	movl	-1008032(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rcx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -1008032(%rbp,%rax,4)
	addl	$1, -2812088(%rbp)
.L15:
	movl	-2812124(%rbp), %eax
	cmpl	%eax, -2812088(%rbp)
	jle	.L16
	subl	$1, -2812096(%rbp)
.L14:
	cmpl	$0, -2812096(%rbp)
	jg	.L17
	movl	$0, -2812084(%rbp)
	jmp	.L18
.L19:
	movl	-2812084(%rbp), %eax
	cltq
	movl	-2812080(%rbp,%rax,4), %edx
	movl	-2812084(%rbp), %eax
	cltq
	movl	-2412064(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	-1008032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2812084(%rbp)
.L18:
	movl	-2812116(%rbp), %eax
	cmpl	%eax, -2812084(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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
	.globl	acs
	.type	acs, @function
acs:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	acs, .-acs
	.globl	des
	.type	des, @function
des:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	des, .-des
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	cmp_str, .-cmp_str
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2809856(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2272, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2812116(%rbp), %rcx
	leaq	-2812120(%rbp), %rdx
	leaq	-2812124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-2012048(%rbp), %rax
	movl	$1004004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -2812104(%rbp)
	jmp	.L10
.L11:
	leaq	-2812108(%rbp), %rdx
	leaq	-2812112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2812112(%rbp), %eax
	movl	-2812108(%rbp), %edx
	movslq	%edx, %rsi
	movslq	%eax, %rcx
	imulq	$501, %rcx, %rcx
	addq	%rsi, %rcx
	movl	-2012048(%rbp,%rcx,4), %ecx
	addl	$1, %ecx
	movslq	%edx, %rdx
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	movl	%ecx, -2012048(%rbp,%rax,4)
	addl	$1, -2812104(%rbp)
.L10:
	movl	-2812120(%rbp), %eax
	cmpl	%eax, -2812104(%rbp)
	jl	.L11
	movl	$0, -2812100(%rbp)
	jmp	.L12
.L13:
	leaq	-2412064(%rbp), %rdx
	movl	-2812100(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-2812080(%rbp), %rcx
	movl	-2812100(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -2812100(%rbp)
.L12:
	movl	-2812116(%rbp), %eax
	cmpl	%eax, -2812100(%rbp)
	jl	.L13
	leaq	-1008032(%rbp), %rax
	movl	$1008016, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	-2812124(%rbp), %eax
	movl	%eax, -2812096(%rbp)
	jmp	.L14
.L17:
	movl	$0, -2812092(%rbp)
	movl	-2812096(%rbp), %eax
	movl	%eax, -2812088(%rbp)
	jmp	.L15
.L16:
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	movl	-2012048(%rbp,%rax,4), %eax
	addl	%eax, -2812092(%rbp)
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rdx, %rax
	movl	-1008032(%rbp,%rax,4), %edx
	movl	-2812092(%rbp), %eax
	addl	%eax, %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rcx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -1008032(%rbp,%rax,4)
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rdx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rdx, %rax
	movl	-1008032(%rbp,%rax,4), %ecx
	movl	-2812096(%rbp), %eax
	leal	1(%rax), %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$502, %rax, %rax
	addq	%rsi, %rax
	movl	-1008032(%rbp,%rax,4), %eax
	leal	(%rcx,%rax), %edx
	movl	-2812088(%rbp), %eax
	movslq	%eax, %rcx
	movl	-2812096(%rbp), %eax
	cltq
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	%edx, -1008032(%rbp,%rax,4)
	addl	$1, -2812088(%rbp)
.L15:
	movl	-2812124(%rbp), %eax
	cmpl	%eax, -2812088(%rbp)
	jle	.L16
	subl	$1, -2812096(%rbp)
.L14:
	cmpl	$0, -2812096(%rbp)
	jg	.L17
	movl	$0, -2812084(%rbp)
	jmp	.L18
.L19:
	movl	-2812084(%rbp), %eax
	cltq
	movl	-2812080(%rbp,%rax,4), %edx
	movl	-2812084(%rbp), %eax
	cltq
	movl	-2412064(%rbp,%rax,4), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$502, %rax, %rax
	addq	%rcx, %rax
	movl	-1008032(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2812084(%rbp)
.L18:
	movl	-2812116(%rbp), %eax
	cmpl	%eax, -2812084(%rbp)
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
