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 <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define ARR_MAX 2000
#define BUF_SIZE (ARR_MAX*11+50)

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
#ifdef BUF_SIZE
    char line[BUF_SIZE];
    char *tmpbuf = line;
    int i;
    if(!fgets(line, BUF_SIZE, stdin)) return -1;
    for(i = 0; i < size; i++) {
        char *tmp = strtok(tmpbuf, " ");
        arr[i] = strtol(tmp, NULL, 10);
        tmpbuf = NULL;
    }
#else
#error
#endif
    return 0;
}

struct pair {
    uint64_t elem;
    int idx;
};

int desc_by_elem(const void *a1, const void *a2) {
    struct pair *pa1 =(struct pair*)a1;
    struct pair *pa2 =(struct pair*)a2;
    int e1 = pa1->elem;
    int e2 = pa2->elem;
    return e2 - e1;
}


int main(void) {
    int num = get_int();
    int arr[ARR_MAX];
    static uint64_t dp[ARR_MAX+1][ARR_MAX+1];
    fget_array(arr, num);
    struct pair brr[ARR_MAX];
    int i, j;
    // brr: 1-indexed
    for(i = 0; i < num; i++) brr[i] = (struct pair){arr[i], i};

    qsort(brr, num, sizeof(struct pair), desc_by_elem);

    for(i = 1; i <= num; i++) {
        struct pair p = brr[i-1];
        for(j = 0; j < i; j++) {
            int head = j;
            int tail = num - (i-j);
#ifdef DEBUG
            printf("%d, %d -> %d %d\n", i, j, head, tail);
#endif
            dp[i][j+1] = max(
                dp[i][j+1],
                dp[i-1][j] + p.elem * abs(p.idx - head)
            );
            dp[i][j] = max(
                dp[i][j],
                dp[i-1][j] + p.elem * abs(tail - p.idx)
            );
        }
    }

    uint64_t ans = 0;
    for(i = 0; i <= num; i++) {
        ans = max(ans, dp[num][i]);
    }
    printf("%llu\n", ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1600, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-22064(%rbp), %rax
	movl	$22050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$0, %eax
	jmp	.L4
.L2:
	leaq	-22068(%rbp), %rdx
	leaq	-22064(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-22068(%rbp), %eax
.L4:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	" "
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	subq	$1632, %rsp
	movq	%rdi, -22104(%rbp)
	movl	%esi, -22108(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-22064(%rbp), %rax
	movq	%rax, -22080(%rbp)
	movq	stdin(%rip), %rdx
	leaq	-22064(%rbp), %rax
	movl	$22050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L7
	movl	$-1, %eax
	jmp	.L11
.L7:
	movl	$0, -22084(%rbp)
	jmp	.L9
.L10:
	movq	-22080(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, -22072(%rbp)
	movq	-22072(%rbp), %rax
	movl	$10, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	strtol@PLT
	movl	-22084(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-22104(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
	movq	$0, -22080(%rbp)
	addl	$1, -22084(%rbp)
.L9:
	movl	-22084(%rbp), %eax
	cmpl	-22108(%rbp), %eax
	jl	.L10
	movl	$0, %eax
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.globl	desc_by_elem
	.type	desc_by_elem, @function
desc_by_elem:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	desc_by_elem, .-desc_by_elem
	.section	.rodata
.LC2:
	.string	"%llu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL2:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL2
	subq	$3200, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	call	get_int
	movl	%eax, -40052(%rbp)
	movl	-40052(%rbp), %edx
	leaq	-40016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -40060(%rbp)
	jmp	.L16
.L17:
	movl	-40060(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cltq
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$32016, %rdx
	movq	%rax, (%rdx)
	movl	-40060(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	leaq	-32008(%rax), %rdx
	movl	-40060(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -40060(%rbp)
.L16:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jl	.L17
	movl	-40052(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-32016(%rbp), %rax
	leaq	desc_by_elem(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -40060(%rbp)
	jmp	.L18
.L21:
	movl	-40060(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$32016, %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -40032(%rbp)
	movq	%rdx, -40024(%rbp)
	movl	$0, -40056(%rbp)
	jmp	.L19
.L20:
	movl	-40056(%rbp), %eax
	movl	%eax, -40048(%rbp)
	movl	-40060(%rbp), %eax
	subl	-40056(%rbp), %eax
	movl	%eax, %edx
	movl	-40052(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -40044(%rbp)
	movl	-40060(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-40032(%rbp), %rdx
	movl	-40024(%rbp), %eax
	subl	-40048(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rdx
	movl	-40056(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-40060(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-40056(%rbp), %ecx
	addl	$1, %ecx
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movslq	%ecx, %rcx
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-40060(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-40032(%rbp), %rdx
	movl	-40024(%rbp), %ecx
	movl	-40044(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rdx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40060(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movl	-40056(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -40056(%rbp)
.L19:
	movl	-40056(%rbp), %eax
	cmpl	-40060(%rbp), %eax
	jl	.L20
	addl	$1, -40060(%rbp)
.L18:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jle	.L21
	movq	$0, -40040(%rbp)
	movl	$0, -40060(%rbp)
	jmp	.L22
.L23:
	movl	-40060(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40052(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-40040(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -40040(%rbp)
	addl	$1, -40060(%rbp)
.L22:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jle	.L23
	movq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,32032008,32
	.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	desc_by_elem
	.type	desc_by_elem, @function
desc_by_elem:
.LFB53:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	desc_by_elem, .-desc_by_elem
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20496
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1600, %rsp
	.cfi_def_cfa_offset 22096
	movq	stdin(%rip), %rdx
	movl	$22050, %esi
	movq	%fs:40, %rax
	movq	%rax, 22072(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	%rax, %r8
	xorl	%eax, %eax
	testq	%r8, %r8
	je	.L3
	leaq	12(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rbp, %rdi
	call	__isoc99_sscanf@PLT
	movl	12(%rsp), %eax
.L3:
	movq	22072(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L9
	addq	$22080, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.section	.rodata.str1.1
.LC1:
	.string	" "
	.text
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20512
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	.cfi_def_cfa_register 7
	subq	$1584, %rsp
	.cfi_def_cfa_offset 22096
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 22056(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rdi, %rbx
	movl	%esi, %r12d
	movq	%rbp, %rdi
	movl	$22050, %esi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L16
	testl	%r12d, %r12d
	jle	.L14
	leal	-1(%r12), %eax
	movq	%rbp, %rdi
	leaq	.LC1(%rip), %rbp
	leaq	4(%rbx,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbp, %rsi
	addq	$4, %rbx
	call	strtok@PLT
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	call	strtol@PLT
	xorl	%edi, %edi
	movl	%eax, -4(%rbx)
	cmpq	%r12, %rbx
	jne	.L13
.L14:
	xorl	%eax, %eax
.L10:
	movq	22056(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L19
	addq	$22064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movl	$-1, %eax
	jmp	.L10
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	fget_array, .-fget_array
	.section	.rodata.str1.1
.LC4:
	.string	"%llu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB54:
	.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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL2:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL2
	.cfi_def_cfa_register 7
	subq	$3208, %rsp
	.cfi_def_cfa_offset 40128
	movq	%fs:40, %rax
	movq	%rax, 40056(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbx
	call	get_int
	movq	%rbx, %rdi
	movl	%eax, %r14d
	movl	%eax, %esi
	movl	%eax, 28(%rsp)
	call	fget_array
	testl	%r14d, %r14d
	jle	.L21
	leal	-1(%r14), %r12d
	movl	%r14d, %esi
	cmpl	$2, %r12d
	jbe	.L33
	shrl	$2, %esi
	movq	%rbx, %rdx
	pxor	%xmm5, %xmm5
	movdqa	.LC2(%rip), %xmm2
	movl	%esi, %ecx
	movdqa	.LC3(%rip), %xmm6
	leaq	8056(%rsp), %rax
	subl	$1, %ecx
	salq	$6, %rcx
	leaq	8120(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	movdqa	(%rdx), %xmm1
	movdqa	%xmm5, %xmm4
	movdqa	%xmm2, %xmm0
	addq	$64, %rax
	movd	%xmm0, -64(%rax)
	paddd	%xmm6, %xmm2
	addq	$16, %rdx
	pcmpgtd	%xmm1, %xmm4
	movdqa	%xmm1, %xmm3
	punpckhdq	%xmm4, %xmm1
	punpckldq	%xmm4, %xmm3
	movq	%xmm1, -40(%rax)
	movhps	%xmm1, -24(%rax)
	pshufd	$85, %xmm0, %xmm1
	movd	%xmm1, -48(%rax)
	movdqa	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm1
	pshufd	$255, %xmm0, %xmm0
	movq	%xmm3, -72(%rax)
	movhps	%xmm3, -56(%rax)
	movd	%xmm1, -32(%rax)
	movd	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L23
	movl	28(%rsp), %ebx
	movl	%ebx, %eax
	andl	$-4, %eax
	andl	$3, %ebx
	je	.L24
.L22:
	movslq	%eax, %rcx
	movl	28(%rsp), %edi
	movq	%rcx, %rdx
	movslq	48(%rsp,%rcx,4), %rcx
	salq	$4, %rdx
	movq	%rcx, 8048(%rsp,%rdx)
	movl	%eax, 8056(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L24
	movslq	%edx, %rsi
	addl	$2, %eax
	movq	%rsi, %rcx
	movslq	48(%rsp,%rsi,4), %rsi
	salq	$4, %rcx
	movq	%rsi, 8048(%rsp,%rcx)
	movl	%edx, 8056(%rsp,%rcx)
	cmpl	%eax, %edi
	jle	.L24
	movslq	%eax, %rcx
	movq	%rcx, %rdx
	movslq	48(%rsp,%rcx,4), %rcx
	salq	$4, %rdx
	movq	%rcx, 8048(%rsp,%rdx)
	movl	%eax, 8056(%rsp,%rdx)
.L24:
	movslq	28(%rsp), %rax
	leaq	8048(%rsp), %r14
	leaq	desc_by_elem(%rip), %rcx
	movl	$16, %edx
	movq	%r14, %rdi
	leaq	16008+dp.0(%rip), %r15
	movq	%rax, %rbx
	movq	%rax, %rsi
	movq	%rax, 40(%rsp)
	call	qsort@PLT
	leal	1(%rbx), %eax
	movl	$1, %edi
	movq	$0, 16(%rsp)
	movl	%eax, 24(%rsp)
	leaq	-16008(%r15), %rax
	movq	%rax, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L28:
	movq	(%r14), %rdx
	movl	8(%r14), %esi
	cmpl	$2, %edi
	jle	.L34
	leal	-3(%rdi), %ecx
	leal	-2(%rsi), %r8d
	movq	(%r15), %rax
	movq	%r15, %r10
	andl	$-2, %ecx
	leal	1(%r12), %ebx
	leal	2(%rsi), %r13d
	movl	%esi, %r9d
	subl	%ecx, %r8d
	movl	%ebx, 8(%rsp)
	leaq	-16008(%r15), %r11
	movl	%r8d, 4(%rsp)
.L26:
	movl	%r9d, %ecx
	movq	8(%r10), %r8
	movl	%r12d, %ebx
	negl	%ecx
	cmovs	%r9d, %ecx
	movslq	%ecx, %rcx
	imulq	%rdx, %rcx
	addq	(%r11), %rcx
	cmpq	%r8, %rcx
	cmovb	%r8, %rcx
	subl	%r9d, %ebx
	movl	%ebx, %r8d
	negl	%r8d
	movq	%rcx, %xmm7
	cmovs	%ebx, %r8d
	movl	8(%rsp), %ebx
	movslq	%r8d, %r8
	imulq	%rdx, %r8
	addq	(%r11), %r8
	cmpq	%rax, %r8
	cmovnb	%r8, %rax
	leal	-1(%r9), %r8d
	movq	%rax, %xmm0
	movl	%r13d, %eax
	subl	%r9d, %eax
	punpcklqdq	%xmm7, %xmm0
	movl	%eax, 12(%rsp)
	movl	%r8d, %eax
	negl	%eax
	movups	%xmm0, (%r10)
	movq	8(%r11), %rbp
	cmovs	%r8d, %eax
	movq	16(%r10), %r8
	cltq
	imulq	%rdx, %rax
	addq	%rbp, %rax
	cmpq	%r8, %rax
	cmovb	%r8, %rax
	subl	%r9d, %ebx
	movl	%ebx, %r8d
	negl	%r8d
	movq	%rax, 16(%r10)
	cmovs	%ebx, %r8d
	movslq	%r8d, %r8
	imulq	%rdx, %r8
	addq	%rbp, %r8
	cmpq	%rcx, %r8
	cmovb	%rcx, %r8
	addq	$16, %r11
	subl	$2, %r9d
	addq	$16, %r10
	movq	%r8, -8(%r10)
	cmpl	4(%rsp), %r9d
	jne	.L26
.L25:
	movq	16(%rsp), %rbx
	movslq	12(%rsp), %r8
	movl	%r12d, %r10d
	movq	32(%rsp), %rcx
	subl	%esi, %r10d
	leaq	(%r8,%rbx), %rax
	addq	$2001, %rbx
	movq	%rbx, 16(%rsp)
	leaq	(%rcx,%rax,8), %r9
	leaq	(%r8,%rbx), %rax
	leaq	(%rcx,%rax,8), %rcx
	.p2align 4,,10
	.p2align 3
.L27:
	movl	%esi, %r11d
	subl	%r8d, %r11d
	movl	%r11d, %eax
	negl	%eax
	cmovs	%r11d, %eax
	movq	8(%rcx), %r11
	cltq
	imulq	%rdx, %rax
	addq	(%r9), %rax
	cmpq	%r11, %rax
	cmovb	%r11, %rax
	leal	(%r10,%r8), %r11d
	movq	%rax, 8(%rcx)
	movl	%r11d, %eax
	negl	%eax
	cmovs	%r11d, %eax
	movq	(%rcx), %r11
	cltq
	imulq	%rdx, %rax
	addq	(%r9), %rax
	cmpq	%r11, %rax
	cmovb	%r11, %rax
	addq	$1, %r8
	addq	$8, %r9
	addq	$8, %rcx
	movq	%rax, -8(%rcx)
	cmpl	%r8d, %edi
	jg	.L27
	addl	$1, %edi
	addq	$16, %r14
	subl	$1, %r12d
	addq	$16008, %r15
	cmpl	24(%rsp), %edi
	jne	.L28
.L30:
	movl	28(%rsp), %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	imulq	$16008, 40(%rsp), %rsi
	addq	32(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rsi,%rax,8), %rcx
	cmpq	%rcx, %rdx
	cmovb	%rcx, %rdx
	addq	$1, %rax
	cmpl	%eax, %edi
	jge	.L29
.L31:
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$40072, %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
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	movl	$0, 12(%rsp)
	jmp	.L25
.L21:
	movslq	28(%rsp), %rax
	movl	$16, %edx
	leaq	8048(%rsp), %rdi
	leaq	desc_by_elem(%rip), %rcx
	movq	%rax, %rbx
	movq	%rax, %rsi
	movq	%rax, 40(%rsp)
	call	qsort@PLT
	xorl	%edx, %edx
	testl	%ebx, %ebx
	jne	.L31
	leaq	dp.0(%rip), %rax
	movq	%rax, 32(%rsp)
	jmp	.L30
.L33:
	xorl	%eax, %eax
	jmp	.L22
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,32032008,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.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	desc_by_elem
	.type	desc_by_elem, @function
desc_by_elem:
.LFB53:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	desc_by_elem, .-desc_by_elem
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20496
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1600, %rsp
	.cfi_def_cfa_offset 22096
	movq	stdin(%rip), %rdx
	movl	$22050, %esi
	movq	%fs:40, %rax
	movq	%rax, 22072(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	movq	%rax, %r8
	xorl	%eax, %eax
	testq	%r8, %r8
	je	.L3
	leaq	12(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movq	%rbp, %rdi
	call	__isoc99_sscanf@PLT
	movl	12(%rsp), %eax
.L3:
	movq	22072(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L9
	addq	$22080, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.section	.rodata.str1.1
.LC1:
	.string	" "
	.text
	.p2align 4
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20512
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	.cfi_def_cfa_register 7
	subq	$1584, %rsp
	.cfi_def_cfa_offset 22096
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 22056(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rdi, %rbx
	movl	%esi, %r12d
	movq	%rbp, %rdi
	movl	$22050, %esi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L16
	testl	%r12d, %r12d
	jle	.L14
	leal	-1(%r12), %eax
	movq	%rbp, %rdi
	leaq	.LC1(%rip), %rbp
	leaq	4(%rbx,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbp, %rsi
	addq	$4, %rbx
	call	strtok@PLT
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rax, %rdi
	call	strtol@PLT
	xorl	%edi, %edi
	movl	%eax, -4(%rbx)
	cmpq	%r12, %rbx
	jne	.L13
.L14:
	xorl	%eax, %eax
.L10:
	movq	22056(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L19
	addq	$22064, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movl	$-1, %eax
	jmp	.L10
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	fget_array, .-fget_array
	.section	.rodata.str1.1
.LC4:
	.string	"%llu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB54:
	.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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36920
.LPSRL2:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL2
	.cfi_def_cfa_register 7
	subq	$3208, %rsp
	.cfi_def_cfa_offset 40128
	movq	%fs:40, %rax
	movq	%rax, 40056(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rbx
	call	get_int
	movq	%rbx, %rdi
	movl	%eax, %r14d
	movl	%eax, %esi
	movl	%eax, 28(%rsp)
	call	fget_array
	testl	%r14d, %r14d
	jle	.L21
	leal	-1(%r14), %r12d
	movl	%r14d, %esi
	cmpl	$2, %r12d
	jbe	.L33
	shrl	$2, %esi
	movq	%rbx, %rdx
	pxor	%xmm5, %xmm5
	movdqa	.LC2(%rip), %xmm2
	movl	%esi, %ecx
	movdqa	.LC3(%rip), %xmm6
	leaq	8056(%rsp), %rax
	subl	$1, %ecx
	salq	$6, %rcx
	leaq	8120(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L23:
	movdqa	(%rdx), %xmm1
	movdqa	%xmm5, %xmm4
	movdqa	%xmm2, %xmm0
	addq	$64, %rax
	movd	%xmm0, -64(%rax)
	paddd	%xmm6, %xmm2
	addq	$16, %rdx
	pcmpgtd	%xmm1, %xmm4
	movdqa	%xmm1, %xmm3
	punpckhdq	%xmm4, %xmm1
	punpckldq	%xmm4, %xmm3
	movq	%xmm1, -40(%rax)
	movhps	%xmm1, -24(%rax)
	pshufd	$85, %xmm0, %xmm1
	movd	%xmm1, -48(%rax)
	movdqa	%xmm0, %xmm1
	punpckhdq	%xmm0, %xmm1
	pshufd	$255, %xmm0, %xmm0
	movq	%xmm3, -72(%rax)
	movhps	%xmm3, -56(%rax)
	movd	%xmm1, -32(%rax)
	movd	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L23
	movl	28(%rsp), %ebx
	movl	%ebx, %eax
	andl	$-4, %eax
	andl	$3, %ebx
	je	.L24
.L22:
	movslq	%eax, %rcx
	movl	28(%rsp), %edi
	movq	%rcx, %rdx
	movslq	48(%rsp,%rcx,4), %rcx
	salq	$4, %rdx
	movq	%rcx, 8048(%rsp,%rdx)
	movl	%eax, 8056(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L24
	movslq	%edx, %rsi
	addl	$2, %eax
	movq	%rsi, %rcx
	movslq	48(%rsp,%rsi,4), %rsi
	salq	$4, %rcx
	movq	%rsi, 8048(%rsp,%rcx)
	movl	%edx, 8056(%rsp,%rcx)
	cmpl	%eax, %edi
	jle	.L24
	movslq	%eax, %rcx
	movq	%rcx, %rdx
	movslq	48(%rsp,%rcx,4), %rcx
	salq	$4, %rdx
	movq	%rcx, 8048(%rsp,%rdx)
	movl	%eax, 8056(%rsp,%rdx)
.L24:
	movslq	28(%rsp), %rax
	leaq	8048(%rsp), %r14
	leaq	desc_by_elem(%rip), %rcx
	movl	$16, %edx
	movq	%r14, %rdi
	leaq	16008+dp.0(%rip), %r15
	movq	%rax, %rbx
	movq	%rax, %rsi
	movq	%rax, 40(%rsp)
	call	qsort@PLT
	leal	1(%rbx), %eax
	movl	$1, %edi
	movq	$0, 16(%rsp)
	movl	%eax, 24(%rsp)
	leaq	-16008(%r15), %rax
	movq	%rax, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L28:
	movq	(%r14), %rdx
	movl	8(%r14), %esi
	cmpl	$2, %edi
	jle	.L34
	leal	-3(%rdi), %ecx
	leal	-2(%rsi), %r8d
	movq	(%r15), %rax
	movq	%r15, %r10
	andl	$-2, %ecx
	leal	1(%r12), %ebx
	leal	2(%rsi), %r13d
	movl	%esi, %r9d
	subl	%ecx, %r8d
	movl	%ebx, 8(%rsp)
	leaq	-16008(%r15), %r11
	movl	%r8d, 4(%rsp)
.L26:
	movl	%r9d, %ecx
	movq	8(%r10), %r8
	movl	%r12d, %ebx
	negl	%ecx
	cmovs	%r9d, %ecx
	movslq	%ecx, %rcx
	imulq	%rdx, %rcx
	addq	(%r11), %rcx
	cmpq	%r8, %rcx
	cmovb	%r8, %rcx
	subl	%r9d, %ebx
	movl	%ebx, %r8d
	negl	%r8d
	movq	%rcx, %xmm7
	cmovs	%ebx, %r8d
	movl	8(%rsp), %ebx
	movslq	%r8d, %r8
	imulq	%rdx, %r8
	addq	(%r11), %r8
	cmpq	%rax, %r8
	cmovnb	%r8, %rax
	leal	-1(%r9), %r8d
	movq	%rax, %xmm0
	movl	%r13d, %eax
	subl	%r9d, %eax
	punpcklqdq	%xmm7, %xmm0
	movl	%eax, 12(%rsp)
	movl	%r8d, %eax
	negl	%eax
	movups	%xmm0, (%r10)
	movq	8(%r11), %rbp
	cmovs	%r8d, %eax
	movq	16(%r10), %r8
	cltq
	imulq	%rdx, %rax
	addq	%rbp, %rax
	cmpq	%r8, %rax
	cmovb	%r8, %rax
	subl	%r9d, %ebx
	movl	%ebx, %r8d
	negl	%r8d
	movq	%rax, 16(%r10)
	cmovs	%ebx, %r8d
	movslq	%r8d, %r8
	imulq	%rdx, %r8
	addq	%rbp, %r8
	cmpq	%rcx, %r8
	cmovb	%rcx, %r8
	addq	$16, %r11
	subl	$2, %r9d
	addq	$16, %r10
	movq	%r8, -8(%r10)
	cmpl	4(%rsp), %r9d
	jne	.L26
.L25:
	movq	16(%rsp), %rbx
	movslq	12(%rsp), %r8
	movl	%r12d, %r10d
	movq	32(%rsp), %rcx
	subl	%esi, %r10d
	leaq	(%r8,%rbx), %rax
	addq	$2001, %rbx
	movq	%rbx, 16(%rsp)
	leaq	(%rcx,%rax,8), %r9
	leaq	(%r8,%rbx), %rax
	leaq	(%rcx,%rax,8), %rcx
	.p2align 4,,10
	.p2align 3
.L27:
	movl	%esi, %r11d
	subl	%r8d, %r11d
	movl	%r11d, %eax
	negl	%eax
	cmovs	%r11d, %eax
	movq	8(%rcx), %r11
	cltq
	imulq	%rdx, %rax
	addq	(%r9), %rax
	cmpq	%r11, %rax
	cmovb	%r11, %rax
	leal	(%r10,%r8), %r11d
	movq	%rax, 8(%rcx)
	movl	%r11d, %eax
	negl	%eax
	cmovs	%r11d, %eax
	movq	(%rcx), %r11
	cltq
	imulq	%rdx, %rax
	addq	(%r9), %rax
	cmpq	%r11, %rax
	cmovb	%r11, %rax
	addq	$1, %r8
	addq	$8, %r9
	addq	$8, %rcx
	movq	%rax, -8(%rcx)
	cmpl	%r8d, %edi
	jg	.L27
	addl	$1, %edi
	addq	$16, %r14
	subl	$1, %r12d
	addq	$16008, %r15
	cmpl	24(%rsp), %edi
	jne	.L28
.L30:
	movl	28(%rsp), %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	imulq	$16008, 40(%rsp), %rsi
	addq	32(%rsp), %rsi
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rsi,%rax,8), %rcx
	cmpq	%rcx, %rdx
	cmovb	%rcx, %rdx
	addq	$1, %rax
	cmpl	%eax, %edi
	jge	.L29
.L31:
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	40056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$40072, %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
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	movl	$0, 12(%rsp)
	jmp	.L25
.L21:
	movslq	28(%rsp), %rax
	movl	$16, %edx
	leaq	8048(%rsp), %rdi
	leaq	desc_by_elem(%rip), %rcx
	movq	%rax, %rbx
	movq	%rax, %rsi
	movq	%rax, 40(%rsp)
	call	qsort@PLT
	xorl	%edx, %edx
	testl	%ebx, %ebx
	jne	.L31
	leaq	dp.0(%rip), %rax
	movq	%rax, 32(%rsp)
	jmp	.L30
.L33:
	xorl	%eax, %eax
	jmp	.L22
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,32032008,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.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 <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define ARR_MAX 2000
#define BUF_SIZE (ARR_MAX*11+50)

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
#ifdef BUF_SIZE
    char line[BUF_SIZE];
    char *tmpbuf = line;
    int i;
    if(!fgets(line, BUF_SIZE, stdin)) return -1;
    for(i = 0; i < size; i++) {
        char *tmp = strtok(tmpbuf, " ");
        arr[i] = strtol(tmp, NULL, 10);
        tmpbuf = NULL;
    }
#else
#error
#endif
    return 0;
}

struct pair {
    uint64_t elem;
    int idx;
};

int desc_by_elem(const void *a1, const void *a2) {
    struct pair *pa1 =(struct pair*)a1;
    struct pair *pa2 =(struct pair*)a2;
    int e1 = pa1->elem;
    int e2 = pa2->elem;
    return e2 - e1;
}


int main(void) {
    int num = get_int();
    int arr[ARR_MAX];
    static uint64_t dp[ARR_MAX+1][ARR_MAX+1];
    fget_array(arr, num);
    struct pair brr[ARR_MAX];
    int i, j;
    // brr: 1-indexed
    for(i = 0; i < num; i++) brr[i] = (struct pair){arr[i], i};

    qsort(brr, num, sizeof(struct pair), desc_by_elem);

    for(i = 1; i <= num; i++) {
        struct pair p = brr[i-1];
        for(j = 0; j < i; j++) {
            int head = j;
            int tail = num - (i-j);
#ifdef DEBUG
            printf("%d, %d -> %d %d\n", i, j, head, tail);
#endif
            dp[i][j+1] = max(
                dp[i][j+1],
                dp[i-1][j] + p.elem * abs(p.idx - head)
            );
            dp[i][j] = max(
                dp[i][j],
                dp[i-1][j] + p.elem * abs(tail - p.idx)
            );
        }
    }

    uint64_t ans = 0;
    for(i = 0; i <= num; i++) {
        ans = max(ans, dp[num][i]);
    }
    printf("%llu\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 <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define ARR_MAX 2000
#define BUF_SIZE (ARR_MAX*11+50)

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
#ifdef BUF_SIZE
    char line[BUF_SIZE];
    char *tmpbuf = line;
    int i;
    if(!fgets(line, BUF_SIZE, stdin)) return -1;
    for(i = 0; i < size; i++) {
        char *tmp = strtok(tmpbuf, " ");
        arr[i] = strtol(tmp, NULL, 10);
        tmpbuf = NULL;
    }
#else
#error
#endif
    return 0;
}

struct pair {
    uint64_t elem;
    int idx;
};

int desc_by_elem(const void *a1, const void *a2) {
    struct pair *pa1 =(struct pair*)a1;
    struct pair *pa2 =(struct pair*)a2;
    int e1 = pa1->elem;
    int e2 = pa2->elem;
    return e2 - e1;
}


int main(void) {
    int num = get_int();
    int arr[ARR_MAX];
    static uint64_t dp[ARR_MAX+1][ARR_MAX+1];
    fget_array(arr, num);
    struct pair brr[ARR_MAX];
    int i, j;
    // brr: 1-indexed
    for(i = 0; i < num; i++) brr[i] = (struct pair){arr[i], i};

    qsort(brr, num, sizeof(struct pair), desc_by_elem);

    for(i = 1; i <= num; i++) {
        struct pair p = brr[i-1];
        for(j = 0; j < i; j++) {
            int head = j;
            int tail = num - (i-j);
#ifdef DEBUG
            printf("%d, %d -> %d %d\n", i, j, head, tail);
#endif
            dp[i][j+1] = max(
                dp[i][j+1],
                dp[i-1][j] + p.elem * abs(p.idx - head)
            );
            dp[i][j] = max(
                dp[i][j],
                dp[i-1][j] + p.elem * abs(tail - p.idx)
            );
        }
    }

    uint64_t ans = 0;
    for(i = 0; i <= num; i++) {
        ans = max(ans, dp[num][i]);
    }
    printf("%llu\n", ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1600, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-22064(%rbp), %rax
	movl	$22050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$0, %eax
	jmp	.L4
.L2:
	leaq	-22068(%rbp), %rdx
	leaq	-22064(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-22068(%rbp), %eax
.L4:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	" "
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	subq	$1632, %rsp
	movq	%rdi, -22104(%rbp)
	movl	%esi, -22108(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-22064(%rbp), %rax
	movq	%rax, -22080(%rbp)
	movq	stdin(%rip), %rdx
	leaq	-22064(%rbp), %rax
	movl	$22050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L7
	movl	$-1, %eax
	jmp	.L11
.L7:
	movl	$0, -22084(%rbp)
	jmp	.L9
.L10:
	movq	-22080(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, -22072(%rbp)
	movq	-22072(%rbp), %rax
	movl	$10, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	strtol@PLT
	movl	-22084(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-22104(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
	movq	$0, -22080(%rbp)
	addl	$1, -22084(%rbp)
.L9:
	movl	-22084(%rbp), %eax
	cmpl	-22108(%rbp), %eax
	jl	.L10
	movl	$0, %eax
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.globl	desc_by_elem
	.type	desc_by_elem, @function
desc_by_elem:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	desc_by_elem, .-desc_by_elem
	.section	.rodata
.LC2:
	.string	"%llu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL2:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL2
	subq	$3200, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	call	get_int
	movl	%eax, -40052(%rbp)
	movl	-40052(%rbp), %edx
	leaq	-40016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -40060(%rbp)
	jmp	.L16
.L17:
	movl	-40060(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cltq
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$32016, %rdx
	movq	%rax, (%rdx)
	movl	-40060(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	leaq	-32008(%rax), %rdx
	movl	-40060(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -40060(%rbp)
.L16:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jl	.L17
	movl	-40052(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-32016(%rbp), %rax
	leaq	desc_by_elem(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -40060(%rbp)
	jmp	.L18
.L21:
	movl	-40060(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$32016, %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -40032(%rbp)
	movq	%rdx, -40024(%rbp)
	movl	$0, -40056(%rbp)
	jmp	.L19
.L20:
	movl	-40056(%rbp), %eax
	movl	%eax, -40048(%rbp)
	movl	-40060(%rbp), %eax
	subl	-40056(%rbp), %eax
	movl	%eax, %edx
	movl	-40052(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -40044(%rbp)
	movl	-40060(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-40032(%rbp), %rdx
	movl	-40024(%rbp), %eax
	subl	-40048(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rdx
	movl	-40056(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-40060(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-40056(%rbp), %ecx
	addl	$1, %ecx
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movslq	%ecx, %rcx
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-40060(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-40032(%rbp), %rdx
	movl	-40024(%rbp), %ecx
	movl	-40044(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rdx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40060(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movl	-40056(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -40056(%rbp)
.L19:
	movl	-40056(%rbp), %eax
	cmpl	-40060(%rbp), %eax
	jl	.L20
	addl	$1, -40060(%rbp)
.L18:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jle	.L21
	movq	$0, -40040(%rbp)
	movl	$0, -40060(%rbp)
	jmp	.L22
.L23:
	movl	-40060(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40052(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-40040(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -40040(%rbp)
	addl	$1, -40060(%rbp)
.L22:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jle	.L23
	movq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,32032008,32
	.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"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1600, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-22064(%rbp), %rax
	movl	$22050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$0, %eax
	jmp	.L4
.L2:
	leaq	-22068(%rbp), %rdx
	leaq	-22064(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-22068(%rbp), %eax
.L4:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	" "
	.text
	.globl	fget_array
	.type	fget_array, @function
fget_array:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL1:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL1
	subq	$1632, %rsp
	movq	%rdi, -22104(%rbp)
	movl	%esi, -22108(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-22064(%rbp), %rax
	movq	%rax, -22080(%rbp)
	movq	stdin(%rip), %rdx
	leaq	-22064(%rbp), %rax
	movl	$22050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L7
	movl	$-1, %eax
	jmp	.L11
.L7:
	movl	$0, -22084(%rbp)
	jmp	.L9
.L10:
	movq	-22080(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, -22072(%rbp)
	movq	-22072(%rbp), %rax
	movl	$10, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	strtol@PLT
	movl	-22084(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-22104(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, (%rdx)
	movq	$0, -22080(%rbp)
	addl	$1, -22084(%rbp)
.L9:
	movl	-22084(%rbp), %eax
	cmpl	-22108(%rbp), %eax
	jl	.L10
	movl	$0, %eax
.L11:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fget_array, .-fget_array
	.globl	desc_by_elem
	.type	desc_by_elem, @function
desc_by_elem:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	desc_by_elem, .-desc_by_elem
	.section	.rodata
.LC2:
	.string	"%llu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL2:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL2
	subq	$3200, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	call	get_int
	movl	%eax, -40052(%rbp)
	movl	-40052(%rbp), %edx
	leaq	-40016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	fget_array
	movl	$0, -40060(%rbp)
	jmp	.L16
.L17:
	movl	-40060(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cltq
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$32016, %rdx
	movq	%rax, (%rdx)
	movl	-40060(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	leaq	-32008(%rax), %rdx
	movl	-40060(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -40060(%rbp)
.L16:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jl	.L17
	movl	-40052(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-32016(%rbp), %rax
	leaq	desc_by_elem(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -40060(%rbp)
	jmp	.L18
.L21:
	movl	-40060(%rbp), %eax
	subl	$1, %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$32016, %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -40032(%rbp)
	movq	%rdx, -40024(%rbp)
	movl	$0, -40056(%rbp)
	jmp	.L19
.L20:
	movl	-40056(%rbp), %eax
	movl	%eax, -40048(%rbp)
	movl	-40060(%rbp), %eax
	subl	-40056(%rbp), %eax
	movl	%eax, %edx
	movl	-40052(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -40044(%rbp)
	movl	-40060(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-40032(%rbp), %rdx
	movl	-40024(%rbp), %eax
	subl	-40048(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rdx
	movl	-40056(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-40060(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-40056(%rbp), %ecx
	addl	$1, %ecx
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movslq	%ecx, %rcx
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-40060(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movq	-40032(%rbp), %rdx
	movl	-40024(%rbp), %ecx
	movl	-40044(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cltq
	imulq	%rdx, %rax
	leaq	(%rsi,%rax), %rdx
	movl	-40056(%rbp), %eax
	movslq	%eax, %rcx
	movl	-40060(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	dp.0(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movl	-40056(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40060(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$2001, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -40056(%rbp)
.L19:
	movl	-40056(%rbp), %eax
	cmpl	-40060(%rbp), %eax
	jl	.L20
	addl	$1, -40060(%rbp)
.L18:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jle	.L21
	movq	$0, -40040(%rbp)
	movl	$0, -40060(%rbp)
	jmp	.L22
.L23:
	movl	-40060(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40052(%rbp), %eax
	cltq
	imulq	$2001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	dp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-40040(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -40040(%rbp)
	addl	$1, -40060(%rbp)
.L22:
	movl	-40060(%rbp), %eax
	cmpl	-40052(%rbp), %eax
	jle	.L23
	movq	-40040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.local	dp.0
	.comm	dp.0,32032008,32
	.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:
