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>
int main(){
  int f[1000]={2,3};
  int n,m,i,j,c,r[1000],t;
  for(i=2;i<1000;i++)f[i]=(f[i-1]+f[i-2])%1001;
  while(scanf("%d %d",&n,&m)!=EOF){
    for(i=0;i<n;i++){
      r[i]=i;
      for(j=i;j;j--){
	if(f[r[j-1]]>f[r[j]]){
	  t=r[j-1];
	  r[j-1]=r[j];
	  r[j]=t;
	}
      }
    }
    for(i=c=1;i<n;i++){//printf("%d\n",f[r[i]]);
      if(f[r[i]]-f[r[i-1]]>=m)c++;
    }
    printf("%d\n",c);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3952, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$2, -8016(%rbp)
	movl	$3, -8012(%rbp)
	movl	$2, -8032(%rbp)
	jmp	.L2
.L3:
	movl	-8032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8032(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1098413215, %rax, %rax
	shrq	$32, %rax
	sarl	$8, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1001, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-8032(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -8016(%rbp,%rdx,4)
	addl	$1, -8032(%rbp)
.L2:
	cmpl	$999, -8032(%rbp)
	jle	.L3
	jmp	.L4
.L13:
	movl	$0, -8032(%rbp)
	jmp	.L5
.L9:
	movl	-8032(%rbp), %eax
	cltq
	movl	-8032(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-8032(%rbp), %eax
	movl	%eax, -8028(%rbp)
	jmp	.L6
.L8:
	movl	-8028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-8028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, -8020(%rbp)
	movl	-8028(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-8028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-8028(%rbp), %eax
	cltq
	movl	-8020(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
.L7:
	subl	$1, -8028(%rbp)
.L6:
	cmpl	$0, -8028(%rbp)
	jne	.L8
	addl	$1, -8032(%rbp)
.L5:
	movl	-8040(%rbp), %eax
	cmpl	%eax, -8032(%rbp)
	jl	.L9
	movl	$1, -8024(%rbp)
	movl	-8024(%rbp), %eax
	movl	%eax, -8032(%rbp)
	jmp	.L10
.L12:
	movl	-8032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-8036(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L11
	addl	$1, -8024(%rbp)
.L11:
	addl	$1, -8032(%rbp)
.L10:
	movl	-8040(%rbp), %eax
	cmpl	%eax, -8032(%rbp)
	jl	.L12
	movl	-8024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	leaq	-8036(%rbp), %rdx
	leaq	-8040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$3936, %rsp
	.cfi_def_cfa_offset 8080
	movl	$500, %ecx
	movl	$3, %edx
	movl	$2, %esi
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	rep stosq
	movq	.LC0(%rip), %rax
	leaq	24(%rsp), %rcx
	movq	%rax, 16(%rsp)
	movl	$2, %eax
.L2:
	leal	(%rax,%rdx), %edi
	addl	$2, %esi
	addq	$8, %rcx
	movslq	%edi, %rax
	movl	%edi, %r8d
	imulq	$1098413215, %rax, %rax
	sarl	$31, %r8d
	sarq	$40, %rax
	subl	%r8d, %eax
	imull	$1001, %eax, %r8d
	movl	%edi, %eax
	subl	%r8d, %eax
	leal	(%rax,%rdx), %edi
	movl	%eax, -8(%rcx)
	movslq	%edi, %rdx
	movl	%edi, %r8d
	imulq	$1098413215, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$40, %rdx
	subl	%r8d, %edx
	imull	$1001, %edx, %r8d
	subl	%r8d, %edi
	movl	%edi, -4(%rcx)
	movl	%edi, %edx
	cmpl	$998, %esi
	jne	.L2
	movl	$1001, %esi
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
	movl	4004(%rsp), %ecx
	movl	4000(%rsp), %eax
	leaq	.LC2(%rip), %rbx
	leaq	.LC1(%rip), %r13
	addl	%ecx, %eax
	cltd
	idivl	%esi
	leal	(%rcx,%rdx), %eax
	movl	%edx, 4008(%rsp)
	cltd
	idivl	%esi
	movl	%edx, 4012(%rsp)
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L13
	movl	8(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L29
	movl	$0, 4016(%rsp)
	leaq	4020(%rsp), %r9
	movl	$1, %edi
	leaq	4016(%rsp), %rsi
	cmpl	$1, %r8d
	je	.L29
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edi, (%r9)
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	-4(%rdx), %xmm0
	movslq	-4(%rdx), %rcx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cltq
	movl	16(%rsp,%rax,4), %eax
	cmpl	%eax, 16(%rsp,%rcx,4)
	jle	.L4
	movq	%xmm1, -4(%rdx)
.L4:
	subq	$4, %rdx
	cmpq	%rdx, %rsi
	jne	.L5
	addl	$1, %edi
	addq	$4, %r9
	cmpl	%edi, %r8d
	jne	.L6
	movl	12(%rsp), %edi
	cmpl	$3, %r8d
	jle	.L31
	leal	-4(%r8), %eax
	movslq	4016(%rsp), %rdx
	movl	$1, %ecx
	leaq	4024(%rsp), %r10
	andl	$-2, %eax
	movl	$1, %r9d
	addl	$3, %eax
.L10:
	movslq	-4(%r10), %r11
	movl	16(%rsp,%r11,4), %r14d
	movl	%r14d, %r11d
	subl	16(%rsp,%rdx,4), %r11d
	cmpl	%r11d, %edi
	setle	%dl
	movzbl	%dl, %edx
	addl	%edx, %r9d
	movslq	(%r10), %rdx
	movl	16(%rsp,%rdx,4), %r11d
	subl	%r14d, %r11d
	cmpl	%r11d, %edi
	setle	%r11b
	addl	$2, %ecx
	addq	$8, %r10
	movzbl	%r11b, %r11d
	addl	%r11d, %r9d
	cmpl	%ecx, %eax
	jne	.L10
.L18:
	movslq	%ecx, %rax
	leaq	(%rsi,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%rax), %rdx
	movslq	-4(%rax), %rsi
	movl	16(%rsp,%rdx,4), %edx
	subl	16(%rsp,%rsi,4), %edx
	cmpl	%edx, %edi
	setle	%dl
	addl	$1, %ecx
	addq	$4, %rax
	movzbl	%dl, %edx
	addl	%edx, %r9d
	cmpl	%ecx, %r8d
	jg	.L12
.L15:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L29:
	movl	$1, %r9d
	jmp	.L15
.L13:
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$8032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L31:
	.cfi_restore_state
	movl	$1, %r9d
	movl	$1, %ecx
	jmp	.L18
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	2
	.long	3
	.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
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$3936, %rsp
	.cfi_def_cfa_offset 8080
	movl	$500, %ecx
	movl	$3, %edx
	movl	$2, %esi
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	rep stosq
	movq	.LC0(%rip), %rax
	leaq	24(%rsp), %rcx
	movq	%rax, 16(%rsp)
	movl	$2, %eax
.L2:
	leal	(%rax,%rdx), %edi
	addl	$2, %esi
	addq	$8, %rcx
	movslq	%edi, %rax
	movl	%edi, %r8d
	imulq	$1098413215, %rax, %rax
	sarl	$31, %r8d
	sarq	$40, %rax
	subl	%r8d, %eax
	imull	$1001, %eax, %r8d
	movl	%edi, %eax
	subl	%r8d, %eax
	leal	(%rax,%rdx), %edi
	movl	%eax, -8(%rcx)
	movslq	%edi, %rdx
	movl	%edi, %r8d
	imulq	$1098413215, %rdx, %rdx
	sarl	$31, %r8d
	sarq	$40, %rdx
	subl	%r8d, %edx
	imull	$1001, %edx, %r8d
	subl	%r8d, %edi
	movl	%edi, -4(%rcx)
	movl	%edi, %edx
	cmpl	$998, %esi
	jne	.L2
	movl	$1001, %esi
	leaq	12(%rsp), %r12
	leaq	8(%rsp), %rbp
	movl	4004(%rsp), %ecx
	movl	4000(%rsp), %eax
	leaq	.LC2(%rip), %rbx
	leaq	.LC1(%rip), %r13
	addl	%ecx, %eax
	cltd
	idivl	%esi
	leal	(%rcx,%rdx), %eax
	movl	%edx, 4008(%rsp)
	cltd
	idivl	%esi
	movl	%edx, 4012(%rsp)
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L13
	movl	8(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L29
	movl	$0, 4016(%rsp)
	leaq	4020(%rsp), %r9
	movl	$1, %edi
	leaq	4016(%rsp), %rsi
	cmpl	$1, %r8d
	je	.L29
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%edi, (%r9)
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	-4(%rdx), %xmm0
	movslq	-4(%rdx), %rcx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cltq
	movl	16(%rsp,%rax,4), %eax
	cmpl	%eax, 16(%rsp,%rcx,4)
	jle	.L4
	movq	%xmm1, -4(%rdx)
.L4:
	subq	$4, %rdx
	cmpq	%rdx, %rsi
	jne	.L5
	addl	$1, %edi
	addq	$4, %r9
	cmpl	%edi, %r8d
	jne	.L6
	movl	12(%rsp), %edi
	cmpl	$3, %r8d
	jle	.L31
	leal	-4(%r8), %eax
	movslq	4016(%rsp), %rdx
	movl	$1, %ecx
	leaq	4024(%rsp), %r10
	andl	$-2, %eax
	movl	$1, %r9d
	addl	$3, %eax
.L10:
	movslq	-4(%r10), %r11
	movl	16(%rsp,%r11,4), %r14d
	movl	%r14d, %r11d
	subl	16(%rsp,%rdx,4), %r11d
	cmpl	%r11d, %edi
	setle	%dl
	movzbl	%dl, %edx
	addl	%edx, %r9d
	movslq	(%r10), %rdx
	movl	16(%rsp,%rdx,4), %r11d
	subl	%r14d, %r11d
	cmpl	%r11d, %edi
	setle	%r11b
	addl	$2, %ecx
	addq	$8, %r10
	movzbl	%r11b, %r11d
	addl	%r11d, %r9d
	cmpl	%ecx, %eax
	jne	.L10
.L18:
	movslq	%ecx, %rax
	leaq	(%rsi,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%rax), %rdx
	movslq	-4(%rax), %rsi
	movl	16(%rsp,%rdx,4), %edx
	subl	16(%rsp,%rsi,4), %edx
	cmpl	%edx, %edi
	setle	%dl
	addl	$1, %ecx
	addq	$4, %rax
	movzbl	%dl, %edx
	addl	%edx, %r9d
	cmpl	%ecx, %r8d
	jg	.L12
.L15:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L3
.L29:
	movl	$1, %r9d
	jmp	.L15
.L13:
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$8032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L31:
	.cfi_restore_state
	movl	$1, %r9d
	movl	$1, %ecx
	jmp	.L18
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	2
	.long	3
	.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>
int main(){
  int f[1000]={2,3};
  int n,m,i,j,c,r[1000],t;
  for(i=2;i<1000;i++)f[i]=(f[i-1]+f[i-2])%1001;
  while(scanf("%d %d",&n,&m)!=EOF){
    for(i=0;i<n;i++){
      r[i]=i;
      for(j=i;j;j--){
	if(f[r[j-1]]>f[r[j]]){
	  t=r[j-1];
	  r[j-1]=r[j];
	  r[j]=t;
	}
      }
    }
    for(i=c=1;i<n;i++){//printf("%d\n",f[r[i]]);
      if(f[r[i]]-f[r[i-1]]>=m)c++;
    }
    printf("%d\n",c);
  }
  return 0;
}
5 5
50 2
13 13
 2 5
50 1
13 13
 2 5
50 1
15 13
 5 10
50 1
13 20
 5 10
50 1
22 20
 8 10
50 1
22 20
 8 2
50 1
22 20
 8 2
50 2
22 20
 5 5
50 1
13 18
 5 5
50 2
13 4

2
47
8
 1
50
8
 1
50
10
 1
50
7
 1
50
13
 3
50
13
 7
50
13
 7
47
13
 2
50
7
 2
47
10

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>
int main(){
  int f[1000]={2,3};
  int n,m,i,j,c,r[1000],t;
  for(i=2;i<1000;i++)f[i]=(f[i-1]+f[i-2])%1001;
  while(scanf("%d %d",&n,&m)!=EOF){
    for(i=0;i<n;i++){
      r[i]=i;
      for(j=i;j;j--){
	if(f[r[j-1]]>f[r[j]]){
	  t=r[j-1];
	  r[j-1]=r[j];
	  r[j]=t;
	}
      }
    }
    for(i=c=1;i<n;i++){//printf("%d\n",f[r[i]]);
      if(f[r[i]]-f[r[i-1]]>=m)c++;
    }
    printf("%d\n",c);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3952, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$2, -8016(%rbp)
	movl	$3, -8012(%rbp)
	movl	$2, -8032(%rbp)
	jmp	.L2
.L3:
	movl	-8032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8032(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1098413215, %rax, %rax
	shrq	$32, %rax
	sarl	$8, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1001, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-8032(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -8016(%rbp,%rdx,4)
	addl	$1, -8032(%rbp)
.L2:
	cmpl	$999, -8032(%rbp)
	jle	.L3
	jmp	.L4
.L13:
	movl	$0, -8032(%rbp)
	jmp	.L5
.L9:
	movl	-8032(%rbp), %eax
	cltq
	movl	-8032(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-8032(%rbp), %eax
	movl	%eax, -8028(%rbp)
	jmp	.L6
.L8:
	movl	-8028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-8028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, -8020(%rbp)
	movl	-8028(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-8028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-8028(%rbp), %eax
	cltq
	movl	-8020(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
.L7:
	subl	$1, -8028(%rbp)
.L6:
	cmpl	$0, -8028(%rbp)
	jne	.L8
	addl	$1, -8032(%rbp)
.L5:
	movl	-8040(%rbp), %eax
	cmpl	%eax, -8032(%rbp)
	jl	.L9
	movl	$1, -8024(%rbp)
	movl	-8024(%rbp), %eax
	movl	%eax, -8032(%rbp)
	jmp	.L10
.L12:
	movl	-8032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-8036(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L11
	addl	$1, -8024(%rbp)
.L11:
	addl	$1, -8032(%rbp)
.L10:
	movl	-8040(%rbp), %eax
	cmpl	%eax, -8032(%rbp)
	jl	.L12
	movl	-8024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	leaq	-8036(%rbp), %rdx
	leaq	-8040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3952, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$2, -8016(%rbp)
	movl	$3, -8012(%rbp)
	movl	$2, -8032(%rbp)
	jmp	.L2
.L3:
	movl	-8032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8032(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movslq	%edx, %rax
	imulq	$1098413215, %rax, %rax
	shrq	$32, %rax
	sarl	$8, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1001, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-8032(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -8016(%rbp,%rdx,4)
	addl	$1, -8032(%rbp)
.L2:
	cmpl	$999, -8032(%rbp)
	jle	.L3
	jmp	.L4
.L13:
	movl	$0, -8032(%rbp)
	jmp	.L5
.L9:
	movl	-8032(%rbp), %eax
	cltq
	movl	-8032(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-8032(%rbp), %eax
	movl	%eax, -8028(%rbp)
	jmp	.L6
.L8:
	movl	-8028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-8028(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, -8020(%rbp)
	movl	-8028(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-8028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-8028(%rbp), %eax
	cltq
	movl	-8020(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
.L7:
	subl	$1, -8028(%rbp)
.L6:
	cmpl	$0, -8028(%rbp)
	jne	.L8
	addl	$1, -8032(%rbp)
.L5:
	movl	-8040(%rbp), %eax
	cmpl	%eax, -8032(%rbp)
	jl	.L9
	movl	$1, -8024(%rbp)
	movl	-8024(%rbp), %eax
	movl	%eax, -8032(%rbp)
	jmp	.L10
.L12:
	movl	-8032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %edx
	movl	-8032(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-8036(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L11
	addl	$1, -8024(%rbp)
.L11:
	addl	$1, -8032(%rbp)
.L10:
	movl	-8040(%rbp), %eax
	cmpl	%eax, -8032(%rbp)
	jl	.L12
	movl	-8024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	leaq	-8036(%rbp), %rdx
	leaq	-8040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
