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>

#define MIN(x,y) ((x)<(y)?(x):(y))

typedef long long int ll;

int a[2000];

int dp[2000];
ll dp2[2];

int main(){
  int n, x, i, j;
  scanf("%d%d", &n, &x);
  for(i=0;i<n;i++){
    scanf("%d", a+i);
    dp2[0] += dp[i] = a[i];
  }

  for(j=1;j<n;j++){
    int b = j&1;
    dp2[b] = (ll) j*x;
    for(i=0;i<n;i++){
      int k = i + n - j;
      if(k >= n) k -= n;
      dp2[b] += dp[i] = MIN(dp[i], a[k]);
    }
    dp2[b] = MIN(dp2[b^1], dp2[b]);
  }

  printf("%lld\n", dp2[~n&1]);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 8000
a:
	.zero	8000
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 8000
dp:
	.zero	8000
	.globl	dp2
	.align 16
	.type	dp2, @object
	.size	dp2, 16
dp2:
	.zero	16
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movq	dp2(%rip), %rdx
	cltq
	addq	%rdx, %rax
	movq	%rax, dp2(%rip)
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$1, -20(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-28(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$0, -24(%rbp)
	jmp	.L5
.L7:
	movl	-32(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L6
	movl	-32(%rbp), %eax
	subl	%eax, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	cltq
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	xorl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	dp2(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L8
	movl	-32(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	(%rdx,%rax), %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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	leaq	dp2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L10
	leaq	a(%rip), %rbx
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r15
	leaq	dp(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	movslq	-4(%r15), %rax
	movl	(%rsp), %r8d
	addq	%rax, 0(%rbp)
	movl	%eax, (%r12,%r14,4)
	addq	$1, %r14
	cmpl	%r14d, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L10
	movslq	4(%rsp), %r14
	leal	-1(%r8,%r8), %r9d
	movl	$1, %r10d
	movq	%r14, %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r10d, %r13d
	movl	%r10d, %r11d
	movl	%r10d, %esi
	movl	%r8d, %eax
	andl	$1, %r13d
	andl	$1, %r11d
	movq	%r12, %rdi
	negl	%esi
	movq	%r12, 0(%rbp,%r13,8)
	subl	%r10d, %eax
	leaq	dp(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%esi, %rcx
	cmpl	%eax, %r8d
	jle	.L17
	movslq	%eax, %rcx
.L17:
	movslq	(%rdx), %r15
	movslq	(%rbx,%rcx,4), %rcx
	cmpl	%r15d, %ecx
	cmovg	%r15, %rcx
	addl	$1, %eax
	addl	$1, %esi
	addq	$4, %rdx
	movl	%ecx, -4(%rdx)
	addq	%rcx, %rdi
	cmpl	%r9d, %eax
	jne	.L8
	xorl	$1, %r11d
	movq	%rdi, 0(%rbp,%r13,8)
	movslq	%r11d, %r11
	movq	0(%rbp,%r11,8), %rax
	cmpq	%rdi, %rax
	cmovg	%rdi, %rax
	addl	$1, %r10d
	addq	%r14, %r12
	subl	$1, %r9d
	movq	%rax, 0(%rbp,%r13,8)
	cmpl	%r10d, %r8d
	jne	.L9
.L10:
	notl	%r8d
	xorl	%eax, %eax
	movl	$1, %edi
	andl	$1, %r8d
	leaq	.LC2(%rip), %rsi
	movq	0(%rbp,%r8,8), %rdx
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$24, %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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	dp2
	.bss
	.align 16
	.type	dp2, @object
	.size	dp2, 16
dp2:
	.zero	16
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 8000
dp:
	.zero	8000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 8000
a:
	.zero	8000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	leaq	dp2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L10
	leaq	a(%rip), %rbx
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r15
	leaq	dp(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	movslq	-4(%r15), %rax
	movl	(%rsp), %r8d
	addq	%rax, 0(%rbp)
	movl	%eax, (%r12,%r14,4)
	addq	$1, %r14
	cmpl	%r14d, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L10
	movslq	4(%rsp), %r14
	leal	-1(%r8,%r8), %r9d
	movl	$1, %r10d
	movq	%r14, %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r10d, %r13d
	movl	%r10d, %r11d
	movl	%r10d, %esi
	movl	%r8d, %eax
	andl	$1, %r13d
	andl	$1, %r11d
	movq	%r12, %rdi
	negl	%esi
	movq	%r12, 0(%rbp,%r13,8)
	subl	%r10d, %eax
	leaq	dp(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%esi, %rcx
	cmpl	%eax, %r8d
	jle	.L17
	movslq	%eax, %rcx
.L17:
	movslq	(%rdx), %r15
	movslq	(%rbx,%rcx,4), %rcx
	cmpl	%r15d, %ecx
	cmovg	%r15, %rcx
	addl	$1, %eax
	addl	$1, %esi
	addq	$4, %rdx
	movl	%ecx, -4(%rdx)
	addq	%rcx, %rdi
	cmpl	%r9d, %eax
	jne	.L8
	xorl	$1, %r11d
	movq	%rdi, 0(%rbp,%r13,8)
	movslq	%r11d, %r11
	movq	0(%rbp,%r11,8), %rax
	cmpq	%rdi, %rax
	cmovg	%rdi, %rax
	addl	$1, %r10d
	addq	%r14, %r12
	subl	$1, %r9d
	movq	%rax, 0(%rbp,%r13,8)
	cmpl	%r10d, %r8d
	jne	.L9
.L10:
	notl	%r8d
	xorl	%eax, %eax
	movl	$1, %edi
	andl	$1, %r8d
	leaq	.LC2(%rip), %rsi
	movq	0(%rbp,%r8,8), %rdx
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$24, %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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	dp2
	.bss
	.align 16
	.type	dp2, @object
	.size	dp2, 16
dp2:
	.zero	16
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 8000
dp:
	.zero	8000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 8000
a:
	.zero	8000
	.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>

#define MIN(x,y) ((x)<(y)?(x):(y))

typedef long long int ll;

int a[2000];

int dp[2000];
ll dp2[2];

int main(){
  int n, x, i, j;
  scanf("%d%d", &n, &x);
  for(i=0;i<n;i++){
    scanf("%d", a+i);
    dp2[0] += dp[i] = a[i];
  }

  for(j=1;j<n;j++){
    int b = j&1;
    dp2[b] = (ll) j*x;
    for(i=0;i<n;i++){
      int k = i + n - j;
      if(k >= n) k -= n;
      dp2[b] += dp[i] = MIN(dp[i], a[k]);
    }
    dp2[b] = MIN(dp2[b^1], dp2[b]);
  }

  printf("%lld\n", dp2[~n&1]);
  return 0;
}

4 10
1 1 3 4
 2 10
1 101
 3 12
100 1 100
 3 12
000 1 100
 3 12
010 1 100
 3 12
011 1 100
 3 18
011 1 100
 3 18
011 2 100
 3 35
011 2 100
 3 35
011 4 100

9
 12
 27
 13
 24
 25
 31
 33
 50
 54

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>

#define MIN(x,y) ((x)<(y)?(x):(y))

typedef long long int ll;

int a[2000];

int dp[2000];
ll dp2[2];

int main(){
  int n, x, i, j;
  scanf("%d%d", &n, &x);
  for(i=0;i<n;i++){
    scanf("%d", a+i);
    dp2[0] += dp[i] = a[i];
  }

  for(j=1;j<n;j++){
    int b = j&1;
    dp2[b] = (ll) j*x;
    for(i=0;i<n;i++){
      int k = i + n - j;
      if(k >= n) k -= n;
      dp2[b] += dp[i] = MIN(dp[i], a[k]);
    }
    dp2[b] = MIN(dp2[b^1], dp2[b]);
  }

  printf("%lld\n", dp2[~n&1]);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 8000
a:
	.zero	8000
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 8000
dp:
	.zero	8000
	.globl	dp2
	.align 16
	.type	dp2, @object
	.size	dp2, 16
dp2:
	.zero	16
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movq	dp2(%rip), %rdx
	cltq
	addq	%rdx, %rax
	movq	%rax, dp2(%rip)
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$1, -20(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-28(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$0, -24(%rbp)
	jmp	.L5
.L7:
	movl	-32(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L6
	movl	-32(%rbp), %eax
	subl	%eax, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	cltq
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	xorl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	dp2(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L8
	movl	-32(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	(%rdx,%rax), %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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 8000
a:
	.zero	8000
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 8000
dp:
	.zero	8000
	.globl	dp2
	.align 16
	.type	dp2, @object
	.size	dp2, 16
dp2:
	.zero	16
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movq	dp2(%rip), %rdx
	cltq
	addq	%rdx, %rax
	movq	%rax, dp2(%rip)
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L3
	movl	$1, -20(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-28(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$0, -24(%rbp)
	jmp	.L5
.L7:
	movl	-32(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	subl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L6
	movl	-32(%rbp), %eax
	subl	%eax, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	dp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	cltq
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	xorl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	dp2(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	dp2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L8
	movl	-32(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	dp2(%rip), %rax
	movq	(%rdx,%rax), %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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
