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<string.h>
#define ll long long int
#define MO 1000000007

struct hoge{
  int p,A;
};

int ll_cmp(const void* a,const void* b){
  if ((*(ll*)a)>(*(ll*)b)) return -1;
  if ((*(ll*)a)<(*(ll*)b)) return 1;
  return 0;
}

ll a[2020][2];
ll dp[2020][2020];

ll max(ll a,ll b){
  if(a>b) return a;
  return b;
}

int main(){
  ll n;
  scanf("%lld",&n);
  for(int i=0;i<n;i++){
     scanf("%lld",&a[i][0]);
     a[i][1] = i+1;}
  
  ll ans=0;
  qsort(a,n,sizeof(ll)*2,ll_cmp);
  /*
  for(int i=0;i<n;i++){
    printf("%lld %lld\n",a[i][0],a[i][1]);}
  */
  dp[0][0] = 0;
  for(int y=1;y<=n;y++){
    dp[0][y] = dp[0][y-1]+a[y-1][0]*(n-y+1-a[y-1][1]);}
  for(int x=1;x<=n;x++){
    dp[x][0] = dp[x-1][0]+a[x-1][0]*(a[x-1][1]-x);
    for(int y=1;x+y<=n;y++){
      dp[x][y] = max(dp[x-1][y]+a[x+y-1][0]*(a[x+y-1][1]-x),dp[x][y-1]+a[x+y-1][0]*(n-y+1-a[x+y-1][1]));
    }}
  /*
  for(int i=0;i<=n;i++){
    for(int j=0;i+j<=n;j++){
      printf("%lld ",dp[i][j]);}
    printf("\n");}
  */
  int i=n,j=0;
  while(i>=0 && j>=0){
    if(ans<dp[i][j]) ans=dp[i][j];
    i--; j++;}
  
  printf("%lld\n",ans);
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ll_cmp
	.type	ll_cmp, @function
ll_cmp:
.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
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ll_cmp, .-ll_cmp
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 32320
a:
	.zero	32320
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 32643200
dp:
	.zero	32643200
	.text
	.globl	max
	.type	max, @function
max:
.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	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L6
	movq	-8(%rbp), %rax
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L9
.L10:
	movl	-48(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L9:
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L10
	movq	$0, -16(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	ll_cmp(%rip), %rax
	movq	%rax, %rcx
	movl	$16, %edx
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, dp(%rip)
	movl	$1, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-24(%rbp), %rdx
	movl	-44(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	leaq	1(%rdx), %rsi
	movl	-44(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rcx
	subq	%rcx, %rsi
	movq	%rsi, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L11:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L12
	movl	$1, -40(%rbp)
	jmp	.L13
.L16:
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$16160, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	(%rax,%rdx), %rsi
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-40(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-40(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-40(%rbp), %eax
	cltq
	imulq	$16160, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	%rcx, (%rax,%rdx)
	movl	$1, -36(%rbp)
	jmp	.L14
.L15:
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-24(%rbp), %rdx
	movl	-36(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	leaq	1(%rdx), %rsi
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %edx
	addl	%ecx, %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rcx
	subq	%rcx, %rsi
	movq	%rsi, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rdx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$2020, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rdi
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %eax
	addl	%ecx, %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-40(%rbp), %esi
	movl	-36(%rbp), %ecx
	addl	%esi, %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movq	%rcx, %rsi
	salq	$4, %rsi
	leaq	8+a(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	movl	-40(%rbp), %esi
	movslq	%esi, %rsi
	subq	%rsi, %rcx
	imulq	%rcx, %rax
	addq	%rdi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2020, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L14:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L15
	addl	$1, -40(%rbp)
.L13:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
	movq	-24(%rbp), %rax
	movl	%eax, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L17
.L20:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jge	.L18
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
.L18:
	subl	$1, -32(%rbp)
	addl	$1, -28(%rbp)
.L17:
	cmpl	$0, -32(%rbp)
	js	.L19
	cmpl	$0, -28(%rbp)
	jns	.L20
.L19:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	ll_cmp
	.type	ll_cmp, @function
ll_cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setl	%al
	movzbl	%al, %eax
	cmovg	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	ll_cmp, .-ll_cmp
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB52:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	movq	%rsi, %rax
	cmovge	%rdi, %rax
	ret
	.cfi_endproc
.LFE52:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.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
	leaq	a(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	32(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L7
	movq	%r14, %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$16, %rbp
	call	__isoc99_scanf@PLT
	movq	32(%rsp), %rsi
	movq	%rbx, %rax
	movq	%rbx, -8(%rbp)
	addq	$1, %rbx
	cmpq	%rsi, %rax
	jl	.L8
.L7:
	leaq	ll_cmp(%rip), %rcx
	movl	$16, %edx
	movq	%r14, %rdi
	call	qsort@PLT
	movq	32(%rsp), %r10
	movq	$0, dp(%rip)
	testq	%r10, %r10
	jle	.L9
	leaq	2(%r10), %r9
	movl	$2, %edx
	xorl	%esi, %esi
	movl	$1, %edi
	leaq	a(%rip), %rcx
	leaq	-8+dp(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r10, %rax
	addq	$16, %rcx
	subq	%rdi, %rax
	movq	%rdx, %rdi
	addq	$1, %rax
	subq	-8(%rcx), %rax
	imulq	-16(%rcx), %rax
	addq	%rax, %rsi
	movq	%rsi, (%r8,%rdx,8)
	addq	$1, %rdx
	cmpq	%r9, %rdx
	jne	.L10
	movq	8+a(%rip), %rax
	subq	$1, %rax
	imulq	a(%rip), %rax
	addq	dp(%rip), %rax
	movq	%rax, 16160+dp(%rip)
	cmpq	$1, %r10
	je	.L20
	leaq	16+a(%rip), %rax
	leaq	1(%r10), %r11
	xorl	%ebp, %ebp
	movq	$-16160, %rbx
	movq	%rax, 8(%rsp)
	leaq	16168+dp(%rip), %rax
	movl	$2, %r15d
	movq	%rax, (%rsp)
	leal	1(%r10), %eax
	movl	%eax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rsp), %rdi
	movl	24(%rsp), %ecx
	movq	%r15, 16(%rsp)
	movq	%r10, %rsi
	movl	%r15d, 28(%rsp)
	leaq	-1(%r15), %r13
	movl	%r15d, %edx
	addq	$1, %r11
	movq	-8(%rdi), %rax
	leal	2(%rcx), %r12d
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %edx
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%r14, %rdx
	movq	8(%rdx), %r9
	movq	(%rdx), %r8
	leaq	(%rbx,%rdi), %rdx
	movq	%r9, %rcx
	subq	%r13, %rcx
	imulq	%r8, %rcx
	addq	(%rdx,%rbp), %rcx
	movq	%rsi, %rdx
	subq	%r9, %rdx
	imulq	%r8, %rdx
	addq	%rdx, %rax
	movl	%r12d, %edx
	cmpq	%rax, %rcx
	cmovge	%rcx, %rax
	subl	%esi, %edx
	movq	%r11, %rcx
	subq	$1, %rsi
	subq	%rsi, %rcx
	addq	$8, %rdi
	movq	%rax, -8(%rdi)
	cmpq	%r10, %rcx
	jle	.L12
	movq	8(%rsp), %rdi
	movslq	28(%rsp), %rdx
	leaq	dp(%rip), %rcx
	subq	$16160, %rbx
	movq	(%rsp), %rsi
	addl	$1, 24(%rsp)
	addq	$16160, %rbp
	movq	8(%rdi), %rax
	imulq	$16160, %rdx, %rdx
	addq	$16, %rdi
	addq	$16160, %rsi
	subq	%r15, %rax
	imulq	-16(%rdi), %rax
	addq	-16168(%rsi), %rax
	movq	%rdi, 8(%rsp)
	movq	%rax, (%rcx,%rdx)
	addq	$1, %r15
	movq	%rsi, (%rsp)
	cmpq	%r10, 16(%rsp)
	jne	.L11
.L9:
	testl	%r10d, %r10d
	js	.L17
.L20:
	movslq	%r10d, %rax
	leaq	dp(%rip), %rdx
	leaq	-16152+dp(%rip), %rcx
	xorl	%r8d, %r8d
	imulq	$16160, %rax, %rax
	addq	%rax, %rcx
	addq	%rax, %rdx
	movl	%r10d, %eax
	imulq	$16152, %rax, %rax
	subq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%rdx), %rax
	cmpq	%rax, %r8
	cmovl	%rax, %r8
	subq	$16152, %rdx
	cmpq	%rdx, %rcx
	jne	.L15
.L14:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$56, %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
.L17:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L14
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 32643200
dp:
	.zero	32643200
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 32320
a:
	.zero	32320
	.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	ll_cmp
	.type	ll_cmp, @function
ll_cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	movl	$-1, %edx
	setl	%al
	movzbl	%al, %eax
	cmovg	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	ll_cmp, .-ll_cmp
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB52:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	movq	%rsi, %rax
	cmovge	%rdi, %rax
	ret
	.cfi_endproc
.LFE52:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.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
	leaq	a(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	32(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L7
	movq	%r14, %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$16, %rbp
	call	__isoc99_scanf@PLT
	movq	32(%rsp), %rsi
	movq	%rbx, %rax
	movq	%rbx, -8(%rbp)
	addq	$1, %rbx
	cmpq	%rsi, %rax
	jl	.L8
.L7:
	leaq	ll_cmp(%rip), %rcx
	movl	$16, %edx
	movq	%r14, %rdi
	call	qsort@PLT
	movq	32(%rsp), %r10
	movq	$0, dp(%rip)
	testq	%r10, %r10
	jle	.L9
	leaq	2(%r10), %r9
	movl	$2, %edx
	xorl	%esi, %esi
	movl	$1, %edi
	leaq	a(%rip), %rcx
	leaq	-8+dp(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r10, %rax
	addq	$16, %rcx
	subq	%rdi, %rax
	movq	%rdx, %rdi
	addq	$1, %rax
	subq	-8(%rcx), %rax
	imulq	-16(%rcx), %rax
	addq	%rax, %rsi
	movq	%rsi, (%r8,%rdx,8)
	addq	$1, %rdx
	cmpq	%r9, %rdx
	jne	.L10
	movq	8+a(%rip), %rax
	subq	$1, %rax
	imulq	a(%rip), %rax
	addq	dp(%rip), %rax
	movq	%rax, 16160+dp(%rip)
	cmpq	$1, %r10
	je	.L20
	leaq	16+a(%rip), %rax
	leaq	1(%r10), %r11
	xorl	%ebp, %ebp
	movq	$-16160, %rbx
	movq	%rax, 8(%rsp)
	leaq	16168+dp(%rip), %rax
	movl	$2, %r15d
	movq	%rax, (%rsp)
	leal	1(%r10), %eax
	movl	%eax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rsp), %rdi
	movl	24(%rsp), %ecx
	movq	%r15, 16(%rsp)
	movq	%r10, %rsi
	movl	%r15d, 28(%rsp)
	leaq	-1(%r15), %r13
	movl	%r15d, %edx
	addq	$1, %r11
	movq	-8(%rdi), %rax
	leal	2(%rcx), %r12d
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %edx
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%r14, %rdx
	movq	8(%rdx), %r9
	movq	(%rdx), %r8
	leaq	(%rbx,%rdi), %rdx
	movq	%r9, %rcx
	subq	%r13, %rcx
	imulq	%r8, %rcx
	addq	(%rdx,%rbp), %rcx
	movq	%rsi, %rdx
	subq	%r9, %rdx
	imulq	%r8, %rdx
	addq	%rdx, %rax
	movl	%r12d, %edx
	cmpq	%rax, %rcx
	cmovge	%rcx, %rax
	subl	%esi, %edx
	movq	%r11, %rcx
	subq	$1, %rsi
	subq	%rsi, %rcx
	addq	$8, %rdi
	movq	%rax, -8(%rdi)
	cmpq	%r10, %rcx
	jle	.L12
	movq	8(%rsp), %rdi
	movslq	28(%rsp), %rdx
	leaq	dp(%rip), %rcx
	subq	$16160, %rbx
	movq	(%rsp), %rsi
	addl	$1, 24(%rsp)
	addq	$16160, %rbp
	movq	8(%rdi), %rax
	imulq	$16160, %rdx, %rdx
	addq	$16, %rdi
	addq	$16160, %rsi
	subq	%r15, %rax
	imulq	-16(%rdi), %rax
	addq	-16168(%rsi), %rax
	movq	%rdi, 8(%rsp)
	movq	%rax, (%rcx,%rdx)
	addq	$1, %r15
	movq	%rsi, (%rsp)
	cmpq	%r10, 16(%rsp)
	jne	.L11
.L9:
	testl	%r10d, %r10d
	js	.L17
.L20:
	movslq	%r10d, %rax
	leaq	dp(%rip), %rdx
	leaq	-16152+dp(%rip), %rcx
	xorl	%r8d, %r8d
	imulq	$16160, %rax, %rax
	addq	%rax, %rcx
	addq	%rax, %rdx
	movl	%r10d, %eax
	imulq	$16152, %rax, %rax
	subq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%rdx), %rax
	cmpq	%rax, %r8
	cmovl	%rax, %r8
	subq	$16152, %rdx
	cmpq	%rdx, %rcx
	jne	.L15
.L14:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$56, %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
.L17:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L14
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 32643200
dp:
	.zero	32643200
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 32320
a:
	.zero	32320
	.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<string.h>
#define ll long long int
#define MO 1000000007

struct hoge{
  int p,A;
};

int ll_cmp(const void* a,const void* b){
  if ((*(ll*)a)>(*(ll*)b)) return -1;
  if ((*(ll*)a)<(*(ll*)b)) return 1;
  return 0;
}

ll a[2020][2];
ll dp[2020][2020];

ll max(ll a,ll b){
  if(a>b) return a;
  return b;
}

int main(){
  ll n;
  scanf("%lld",&n);
  for(int i=0;i<n;i++){
     scanf("%lld",&a[i][0]);
     a[i][1] = i+1;}
  
  ll ans=0;
  qsort(a,n,sizeof(ll)*2,ll_cmp);
  /*
  for(int i=0;i<n;i++){
    printf("%lld %lld\n",a[i][0],a[i][1]);}
  */
  dp[0][0] = 0;
  for(int y=1;y<=n;y++){
    dp[0][y] = dp[0][y-1]+a[y-1][0]*(n-y+1-a[y-1][1]);}
  for(int x=1;x<=n;x++){
    dp[x][0] = dp[x-1][0]+a[x-1][0]*(a[x-1][1]-x);
    for(int y=1;x+y<=n;y++){
      dp[x][y] = max(dp[x-1][y]+a[x+y-1][0]*(a[x+y-1][1]-x),dp[x][y-1]+a[x+y-1][0]*(n-y+1-a[x+y-1][1]));
    }}
  /*
  for(int i=0;i<=n;i++){
    for(int j=0;i+j<=n;j++){
      printf("%lld ",dp[i][j]);}
    printf("\n");}
  */
  int i=n,j=0;
  while(i>=0 && j>=0){
    if(ans<dp[i][j]) ans=dp[i][j];
    i--; j++;}
  
  printf("%lld\n",ans);
  
  return 0;
}

4
1 4 4 2
 6
8 6 11 1 2 1
 6
5 5 6 0 1 1
 4
1 8 4 2
 6
8 6 22 1 2 1
 6
5 5 9 0 1 1
 4
2 8 4 2
 6
8 6 22 1 1 1
 6
5 0 9 0 1 1
 6
8 6 33 1 1 1

22
 90
 58
 30
 123
 65
 32
 119
 55
 152

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<string.h>
#define ll long long int
#define MO 1000000007

struct hoge{
  int p,A;
};

int ll_cmp(const void* a,const void* b){
  if ((*(ll*)a)>(*(ll*)b)) return -1;
  if ((*(ll*)a)<(*(ll*)b)) return 1;
  return 0;
}

ll a[2020][2];
ll dp[2020][2020];

ll max(ll a,ll b){
  if(a>b) return a;
  return b;
}

int main(){
  ll n;
  scanf("%lld",&n);
  for(int i=0;i<n;i++){
     scanf("%lld",&a[i][0]);
     a[i][1] = i+1;}
  
  ll ans=0;
  qsort(a,n,sizeof(ll)*2,ll_cmp);
  /*
  for(int i=0;i<n;i++){
    printf("%lld %lld\n",a[i][0],a[i][1]);}
  */
  dp[0][0] = 0;
  for(int y=1;y<=n;y++){
    dp[0][y] = dp[0][y-1]+a[y-1][0]*(n-y+1-a[y-1][1]);}
  for(int x=1;x<=n;x++){
    dp[x][0] = dp[x-1][0]+a[x-1][0]*(a[x-1][1]-x);
    for(int y=1;x+y<=n;y++){
      dp[x][y] = max(dp[x-1][y]+a[x+y-1][0]*(a[x+y-1][1]-x),dp[x][y-1]+a[x+y-1][0]*(n-y+1-a[x+y-1][1]));
    }}
  /*
  for(int i=0;i<=n;i++){
    for(int j=0;i+j<=n;j++){
      printf("%lld ",dp[i][j]);}
    printf("\n");}
  */
  int i=n,j=0;
  while(i>=0 && j>=0){
    if(ans<dp[i][j]) ans=dp[i][j];
    i--; j++;}
  
  printf("%lld\n",ans);
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	ll_cmp
	.type	ll_cmp, @function
ll_cmp:
.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
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ll_cmp, .-ll_cmp
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 32320
a:
	.zero	32320
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 32643200
dp:
	.zero	32643200
	.text
	.globl	max
	.type	max, @function
max:
.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	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L6
	movq	-8(%rbp), %rax
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L9
.L10:
	movl	-48(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L9:
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L10
	movq	$0, -16(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	ll_cmp(%rip), %rax
	movq	%rax, %rcx
	movl	$16, %edx
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, dp(%rip)
	movl	$1, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-24(%rbp), %rdx
	movl	-44(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	leaq	1(%rdx), %rsi
	movl	-44(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rcx
	subq	%rcx, %rsi
	movq	%rsi, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L11:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L12
	movl	$1, -40(%rbp)
	jmp	.L13
.L16:
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$16160, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	(%rax,%rdx), %rsi
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-40(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-40(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-40(%rbp), %eax
	cltq
	imulq	$16160, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	%rcx, (%rax,%rdx)
	movl	$1, -36(%rbp)
	jmp	.L14
.L15:
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-24(%rbp), %rdx
	movl	-36(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	leaq	1(%rdx), %rsi
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %edx
	addl	%ecx, %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rcx
	subq	%rcx, %rsi
	movq	%rsi, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rdx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$2020, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rdi
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %eax
	addl	%ecx, %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-40(%rbp), %esi
	movl	-36(%rbp), %ecx
	addl	%esi, %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movq	%rcx, %rsi
	salq	$4, %rsi
	leaq	8+a(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	movl	-40(%rbp), %esi
	movslq	%esi, %rsi
	subq	%rsi, %rcx
	imulq	%rcx, %rax
	addq	%rdi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2020, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L14:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L15
	addl	$1, -40(%rbp)
.L13:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
	movq	-24(%rbp), %rax
	movl	%eax, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L17
.L20:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jge	.L18
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
.L18:
	subl	$1, -32(%rbp)
	addl	$1, -28(%rbp)
.L17:
	cmpl	$0, -32(%rbp)
	js	.L19
	cmpl	$0, -28(%rbp)
	jns	.L20
.L19:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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.
val
	.file	"temp.c"
	.text
	.globl	ll_cmp
	.type	ll_cmp, @function
ll_cmp:
.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
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ll_cmp, .-ll_cmp
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 32320
a:
	.zero	32320
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 32643200
dp:
	.zero	32643200
	.text
	.globl	max
	.type	max, @function
max:
.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	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L6
	movq	-8(%rbp), %rax
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -48(%rbp)
	jmp	.L9
.L10:
	movl	-48(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L9:
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L10
	movq	$0, -16(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	ll_cmp(%rip), %rax
	movq	%rax, %rcx
	movl	$16, %edx
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, dp(%rip)
	movl	$1, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-24(%rbp), %rdx
	movl	-44(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	leaq	1(%rdx), %rsi
	movl	-44(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rcx
	subq	%rcx, %rsi
	movq	%rsi, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L11:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L12
	movl	$1, -40(%rbp)
	jmp	.L13
.L16:
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	imulq	$16160, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	(%rax,%rdx), %rsi
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-40(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	-40(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rcx
	movl	-40(%rbp), %eax
	cltq
	imulq	$16160, %rax, %rax
	leaq	dp(%rip), %rdx
	movq	%rcx, (%rax,%rdx)
	movl	$1, -36(%rbp)
	jmp	.L14
.L15:
	movl	-36(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-24(%rbp), %rdx
	movl	-36(%rbp), %ecx
	movslq	%ecx, %rcx
	subq	%rcx, %rdx
	leaq	1(%rdx), %rsi
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %edx
	addl	%ecx, %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+a(%rip), %rdx
	movq	(%rcx,%rdx), %rcx
	subq	%rcx, %rsi
	movq	%rsi, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rdx
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$2020, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp(%rip), %rax
	movq	(%rcx,%rax), %rdi
	movl	-40(%rbp), %ecx
	movl	-36(%rbp), %eax
	addl	%ecx, %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-40(%rbp), %esi
	movl	-36(%rbp), %ecx
	addl	%esi, %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movq	%rcx, %rsi
	salq	$4, %rsi
	leaq	8+a(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	movl	-40(%rbp), %esi
	movslq	%esi, %rsi
	subq	%rsi, %rcx
	imulq	%rcx, %rax
	addq	%rdi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movl	-36(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2020, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L14:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L15
	addl	$1, -40(%rbp)
.L13:
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
	movq	-24(%rbp), %rax
	movl	%eax, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L17
.L20:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -16(%rbp)
	jge	.L18
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$2020, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -16(%rbp)
.L18:
	subl	$1, -32(%rbp)
	addl	$1, -28(%rbp)
.L17:
	cmpl	$0, -32(%rbp)
	js	.L19
	cmpl	$0, -28(%rbp)
	jns	.L20
.L19:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
