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 mod 1000000007

int main(void){
  int i,j;
  int n;
  long long k;
  int a[2000];
  long long ans=0;

  scanf("%d %lld", &n, &k);
  int R[n];
  int L[n];
  //R[n]はa[n]の右にあるa[n]より小さい値

  for(i=0; i<n; i++){
    scanf("%d", &a[i]);
  }

  for(i=0; i<n; i++){
    R[i]=0;
    L[i]=0;
    //R[i],L[i]を求める
    //L[i]
    for(j=0; j<i; j++){
      if(a[j]<a[i]){
        L[i]++;
      }
    }
    //R[i]
    for(j=i+1; j<n; j++){
      if(a[j]<a[i]){
        R[i]++;
      }
    }
    // printf("L=%d R=%d\n", L[i], R[i]);
    //R[i]*(k+(k-1)+...+1)
    //右を見て

    // ans+=(R[i]*(k%mod)*((k+1)%mod)/2)%mod;
    ans+=(R[i]*(((k*(k+1))/2)%mod))%mod;
    ans%=mod;
    // ans+=(L[i]*(k%mod)*((k-1)%mod)/2)%mod;
    ans+=(L[i]*(((k*(k-1))/2)%mod))%mod;
    ans%=mod;
  }
  ans%=mod;
  printf("%lld\n", ans);

  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %lld"
.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4024, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$0, -8104(%rbp)
	leaq	-8112(%rbp), %rdx
	leaq	-8124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -8144(%rbp)
	movq	$0, -8136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -8160(%rbp)
	movq	$0, -8152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -8088(%rbp)
	movl	-8124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -8072(%rbp)
	movl	$0, -8120(%rbp)
	jmp	.L8
.L9:
	leaq	-8064(%rbp), %rdx
	movl	-8120(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8120(%rbp)
.L8:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8120(%rbp)
	jl	.L9
	movl	$0, -8120(%rbp)
	jmp	.L10
.L17:
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	$0, -8116(%rbp)
	jmp	.L11
.L13:
	movl	-8116(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %edx
	movl	-8120(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L12
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	1(%rax), %ecx
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
.L12:
	addl	$1, -8116(%rbp)
.L11:
	movl	-8116(%rbp), %eax
	cmpl	-8120(%rbp), %eax
	jl	.L13
	movl	-8120(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8116(%rbp)
	jmp	.L14
.L16:
	movl	-8116(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %edx
	movl	-8120(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L15
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	1(%rax), %ecx
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
.L15:
	addl	$1, -8116(%rbp)
.L14:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8116(%rbp)
	jl	.L16
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rsi
	movq	-8112(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-8112(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rsi
	movq	-8112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-8112(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	addl	$1, -8120(%rbp)
.L10:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8120(%rbp)
	jl	.L17
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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 %lld"
.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3976, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-8072(%rbp), %rdx
	leaq	-8076(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movslq	-8076(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L36:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L36
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L37
.L4:
	leaq	3(%rsp), %r12
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%r12, %r14
	andq	$-16, %rdx
	andq	$-4, %r12
	subq	%rax, %rsi
	shrq	$2, %r14
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L37:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L38
.L7:
	leaq	3(%rsp), %rbx
	movq	%rbx, %rax
	andq	$-4, %rbx
	shrq	$2, %rax
	movq	%rbx, -8104(%rbp)
	movq	%rax, -8088(%rbp)
	testl	%ecx, %ecx
	jle	.L12
	leaq	-8064(%rbp), %rax
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%rax, -8096(%rbp)
	movq	%rax, %r15
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-8076(%rbp), %r9d
	addq	$4, %r15
	cmpl	%ebx, %r9d
	jg	.L10
	testl	%r9d, %r9d
	jle	.L12
	movq	-8072(%rbp), %rsi
	movq	-8088(%rbp), %rax
	movabsq	$-8543223828751151131, %rdi
	movl	$0, 0(,%r14,4)
	movq	-8104(%rbp), %rbx
	movl	$0, 0(,%rax,4)
	leaq	1(%rsi), %rax
	imulq	%rsi, %rax
	addq	$4, %rbx
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	movq	%rcx, %r8
	sarq	$63, %rcx
	sarq	%r8
	movq	%r8, %rax
	imulq	%rdi
	leaq	(%rdx,%r8), %r11
	sarq	$29, %r11
	subq	%rcx, %r11
	imulq	$1000000007, %r11, %rax
	movq	%r8, %r11
	xorl	%r8d, %r8d
	subq	%rax, %r11
	leaq	-1(%rsi), %rax
	imulq	%rsi, %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	movq	%rcx, %rsi
	sarq	$63, %rcx
	sarq	%rsi
	movq	%rsi, %rax
	imulq	%rdi
	leaq	(%rdx,%rsi), %r10
	sarq	$29, %r10
	subq	%rcx, %r10
	imulq	$1000000007, %r10, %rax
	subq	%rax, %rsi
	movq	-8096(%rbp), %rax
	movq	%rsi, %r10
	movl	$1, %esi
	leaq	4(%rax), %r13
	leal	-1(%r9), %eax
	movl	%eax, -8104(%rbp)
	movl	%r9d, %eax
	movq	%r13, %rcx
	movq	%rax, -8088(%rbp)
	cmpl	%esi, %r9d
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L39:
	movl	-8104(%rbp), %eax
	movl	-4(%rcx), %r15d
	leaq	-4(%rcx), %rdx
	subl	%esi, %eax
	leaq	-1(%rsi,%rax), %rax
	leaq	0(%r13,%rax,4), %r14
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%r15d, 4(%rdx)
	jge	.L18
	addl	$1, %eax
	movl	%eax, -4(%r12,%rsi,4)
.L18:
	addq	$4, %rdx
	cmpq	%rdx, %r14
	jne	.L19
.L17:
	movslq	%eax, %r14
	imulq	%r11, %r14
	movq	%r14, %rax
	imulq	%rdi
	movq	%r14, %rax
	sarq	$63, %rax
	addq	%r14, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r14
	addq	%r14, %r8
	movslq	-4(%rbx), %r14
	movq	%r8, %rax
	imulq	%rdi
	movq	%r8, %rax
	sarq	$63, %rax
	imulq	%r10, %r14
	leaq	(%rdx,%r8), %r15
	sarq	$29, %r15
	subq	%rax, %r15
	imulq	$1000000007, %r15, %rax
	movq	%r8, %r15
	movq	%r14, %r8
	sarq	$63, %r8
	subq	%rax, %r15
	movq	%r14, %rax
	imulq	%rdi
	leaq	(%rdx,%r14), %rax
	sarq	$29, %rax
	subq	%r8, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %r14
	addq	%r15, %r14
	movq	%r14, %rax
	imulq	%rdi
	movq	%r14, %rax
	sarq	$63, %rax
	leaq	(%rdx,%r14), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	movq	%r14, %r8
	subq	%rax, %r8
	cmpq	%rsi, -8088(%rbp)
	je	.L9
	movl	$0, (%r12,%rsi,4)
	movl	(%rcx), %r14d
	xorl	%edx, %edx
	movl	$0, (%rbx)
	movq	-8096(%rbp), %rax
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	%r14d, (%rax)
	jge	.L15
	addl	$1, %edx
	movl	%edx, (%rbx)
.L15:
	addq	$4, %rax
	cmpq	%rax, %rcx
	jne	.L13
	addq	$1, %rsi
	addq	$4, %rcx
	addq	$4, %rbx
	cmpl	%esi, %r9d
	jg	.L39
.L22:
	xorl	%eax, %eax
	jmp	.L17
.L12:
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L40
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L38:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %lld"
.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3976, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-8072(%rbp), %rdx
	leaq	-8076(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movslq	-8076(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L36:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L36
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L37
.L4:
	leaq	3(%rsp), %r12
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%r12, %r14
	andq	$-16, %rdx
	andq	$-4, %r12
	subq	%rax, %rsi
	shrq	$2, %r14
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L37:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L38
.L7:
	leaq	3(%rsp), %rbx
	movq	%rbx, %rax
	andq	$-4, %rbx
	shrq	$2, %rax
	movq	%rbx, -8104(%rbp)
	movq	%rax, -8088(%rbp)
	testl	%ecx, %ecx
	jle	.L12
	leaq	-8064(%rbp), %rax
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%rax, -8096(%rbp)
	movq	%rax, %r15
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-8076(%rbp), %r9d
	addq	$4, %r15
	cmpl	%ebx, %r9d
	jg	.L10
	testl	%r9d, %r9d
	jle	.L12
	movq	-8072(%rbp), %rsi
	movq	-8088(%rbp), %rax
	movabsq	$-8543223828751151131, %rdi
	movl	$0, 0(,%r14,4)
	movq	-8104(%rbp), %rbx
	movl	$0, 0(,%rax,4)
	leaq	1(%rsi), %rax
	imulq	%rsi, %rax
	addq	$4, %rbx
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	movq	%rcx, %r8
	sarq	$63, %rcx
	sarq	%r8
	movq	%r8, %rax
	imulq	%rdi
	leaq	(%rdx,%r8), %r11
	sarq	$29, %r11
	subq	%rcx, %r11
	imulq	$1000000007, %r11, %rax
	movq	%r8, %r11
	xorl	%r8d, %r8d
	subq	%rax, %r11
	leaq	-1(%rsi), %rax
	imulq	%rsi, %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	movq	%rcx, %rsi
	sarq	$63, %rcx
	sarq	%rsi
	movq	%rsi, %rax
	imulq	%rdi
	leaq	(%rdx,%rsi), %r10
	sarq	$29, %r10
	subq	%rcx, %r10
	imulq	$1000000007, %r10, %rax
	subq	%rax, %rsi
	movq	-8096(%rbp), %rax
	movq	%rsi, %r10
	movl	$1, %esi
	leaq	4(%rax), %r13
	leal	-1(%r9), %eax
	movl	%eax, -8104(%rbp)
	movl	%r9d, %eax
	movq	%r13, %rcx
	movq	%rax, -8088(%rbp)
	cmpl	%esi, %r9d
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L39:
	movl	-8104(%rbp), %eax
	movl	-4(%rcx), %r15d
	leaq	-4(%rcx), %rdx
	subl	%esi, %eax
	leaq	-1(%rsi,%rax), %rax
	leaq	0(%r13,%rax,4), %r14
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	%r15d, 4(%rdx)
	jge	.L18
	addl	$1, %eax
	movl	%eax, -4(%r12,%rsi,4)
.L18:
	addq	$4, %rdx
	cmpq	%rdx, %r14
	jne	.L19
.L17:
	movslq	%eax, %r14
	imulq	%r11, %r14
	movq	%r14, %rax
	imulq	%rdi
	movq	%r14, %rax
	sarq	$63, %rax
	addq	%r14, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r14
	addq	%r14, %r8
	movslq	-4(%rbx), %r14
	movq	%r8, %rax
	imulq	%rdi
	movq	%r8, %rax
	sarq	$63, %rax
	imulq	%r10, %r14
	leaq	(%rdx,%r8), %r15
	sarq	$29, %r15
	subq	%rax, %r15
	imulq	$1000000007, %r15, %rax
	movq	%r8, %r15
	movq	%r14, %r8
	sarq	$63, %r8
	subq	%rax, %r15
	movq	%r14, %rax
	imulq	%rdi
	leaq	(%rdx,%r14), %rax
	sarq	$29, %rax
	subq	%r8, %rax
	imulq	$1000000007, %rax, %rax
	subq	%rax, %r14
	addq	%r15, %r14
	movq	%r14, %rax
	imulq	%rdi
	movq	%r14, %rax
	sarq	$63, %rax
	leaq	(%rdx,%r14), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	movq	%r14, %r8
	subq	%rax, %r8
	cmpq	%rsi, -8088(%rbp)
	je	.L9
	movl	$0, (%r12,%rsi,4)
	movl	(%rcx), %r14d
	xorl	%edx, %edx
	movl	$0, (%rbx)
	movq	-8096(%rbp), %rax
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	%r14d, (%rax)
	jge	.L15
	addl	$1, %edx
	movl	%edx, (%rbx)
.L15:
	addq	$4, %rax
	cmpq	%rax, %rcx
	jne	.L13
	addq	$1, %rsi
	addq	$4, %rcx
	addq	$4, %rbx
	cmpl	%esi, %r9d
	jg	.L39
.L22:
	xorl	%eax, %eax
	jmp	.L17
.L12:
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L40
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L38:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#define mod 1000000007

int main(void){
  int i,j;
  int n;
  long long k;
  int a[2000];
  long long ans=0;

  scanf("%d %lld", &n, &k);
  int R[n];
  int L[n];
  //R[n]はa[n]の右にあるa[n]より小さい値

  for(i=0; i<n; i++){
    scanf("%d", &a[i]);
  }

  for(i=0; i<n; i++){
    R[i]=0;
    L[i]=0;
    //R[i],L[i]を求める
    //L[i]
    for(j=0; j<i; j++){
      if(a[j]<a[i]){
        L[i]++;
      }
    }
    //R[i]
    for(j=i+1; j<n; j++){
      if(a[j]<a[i]){
        R[i]++;
      }
    }
    // printf("L=%d R=%d\n", L[i], R[i]);
    //R[i]*(k+(k-1)+...+1)
    //右を見て

    // ans+=(R[i]*(k%mod)*((k+1)%mod)/2)%mod;
    ans+=(R[i]*(((k*(k+1))/2)%mod))%mod;
    ans%=mod;
    // ans+=(L[i]*(k%mod)*((k-1)%mod)/2)%mod;
    ans+=(L[i]*(((k*(k-1))/2)%mod))%mod;
    ans%=mod;
  }
  ans%=mod;
  printf("%lld\n", ans);

  return 0;
}

2 2
2 2
 10 998244353
10 9 8 7 5 6 3 4 4 1
 3 5
1 1 0
 2 2
0 2
 10 998244353
10 9 8 7 5 5 3 4 4 1
 3 5
1 2 0
 10 998244353
10 9 8 7 5 5 0 4 4 1
 2 -4
2 -1
 2 2
2 0
 3 5
0 1 1

0
 27457649
 30
 1
 866106758
 40
 867862412
 6
 3
 20

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 mod 1000000007

int main(void){
  int i,j;
  int n;
  long long k;
  int a[2000];
  long long ans=0;

  scanf("%d %lld", &n, &k);
  int R[n];
  int L[n];
  //R[n]はa[n]の右にあるa[n]より小さい値

  for(i=0; i<n; i++){
    scanf("%d", &a[i]);
  }

  for(i=0; i<n; i++){
    R[i]=0;
    L[i]=0;
    //R[i],L[i]を求める
    //L[i]
    for(j=0; j<i; j++){
      if(a[j]<a[i]){
        L[i]++;
      }
    }
    //R[i]
    for(j=i+1; j<n; j++){
      if(a[j]<a[i]){
        R[i]++;
      }
    }
    // printf("L=%d R=%d\n", L[i], R[i]);
    //R[i]*(k+(k-1)+...+1)
    //右を見て

    // ans+=(R[i]*(k%mod)*((k+1)%mod)/2)%mod;
    ans+=(R[i]*(((k*(k+1))/2)%mod))%mod;
    ans%=mod;
    // ans+=(L[i]*(k%mod)*((k-1)%mod)/2)%mod;
    ans+=(L[i]*(((k*(k-1))/2)%mod))%mod;
    ans%=mod;
  }
  ans%=mod;
  printf("%lld\n", ans);

  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %lld"
.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4024, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$0, -8104(%rbp)
	leaq	-8112(%rbp), %rdx
	leaq	-8124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -8144(%rbp)
	movq	$0, -8136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -8160(%rbp)
	movq	$0, -8152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -8088(%rbp)
	movl	-8124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -8072(%rbp)
	movl	$0, -8120(%rbp)
	jmp	.L8
.L9:
	leaq	-8064(%rbp), %rdx
	movl	-8120(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8120(%rbp)
.L8:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8120(%rbp)
	jl	.L9
	movl	$0, -8120(%rbp)
	jmp	.L10
.L17:
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	$0, -8116(%rbp)
	jmp	.L11
.L13:
	movl	-8116(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %edx
	movl	-8120(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L12
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	1(%rax), %ecx
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
.L12:
	addl	$1, -8116(%rbp)
.L11:
	movl	-8116(%rbp), %eax
	cmpl	-8120(%rbp), %eax
	jl	.L13
	movl	-8120(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8116(%rbp)
	jmp	.L14
.L16:
	movl	-8116(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %edx
	movl	-8120(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L15
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	1(%rax), %ecx
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
.L15:
	addl	$1, -8116(%rbp)
.L14:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8116(%rbp)
	jl	.L16
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rsi
	movq	-8112(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-8112(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rsi
	movq	-8112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-8112(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	addl	$1, -8120(%rbp)
.L10:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8120(%rbp)
	jl	.L17
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %lld"
.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4024, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$0, -8104(%rbp)
	leaq	-8112(%rbp), %rdx
	leaq	-8124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8096(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -8144(%rbp)
	movq	$0, -8136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -8160(%rbp)
	movq	$0, -8152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -8088(%rbp)
	movl	-8124(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -8080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -8072(%rbp)
	movl	$0, -8120(%rbp)
	jmp	.L8
.L9:
	leaq	-8064(%rbp), %rdx
	movl	-8120(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8120(%rbp)
.L8:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8120(%rbp)
	jl	.L9
	movl	$0, -8120(%rbp)
	jmp	.L10
.L17:
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	$0, -8116(%rbp)
	jmp	.L11
.L13:
	movl	-8116(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %edx
	movl	-8120(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L12
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	1(%rax), %ecx
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
.L12:
	addl	$1, -8116(%rbp)
.L11:
	movl	-8116(%rbp), %eax
	cmpl	-8120(%rbp), %eax
	jl	.L13
	movl	-8120(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8116(%rbp)
	jmp	.L14
.L16:
	movl	-8116(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %edx
	movl	-8120(%rbp), %eax
	cltq
	movl	-8064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L15
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	leal	1(%rax), %ecx
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
.L15:
	addl	$1, -8116(%rbp)
.L14:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8116(%rbp)
	jl	.L16
	movq	-8088(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rsi
	movq	-8112(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-8112(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	movq	-8072(%rbp), %rax
	movl	-8120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rsi
	movq	-8112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-8112(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	addl	$1, -8120(%rbp)
.L10:
	movl	-8124(%rbp), %eax
	cmpl	%eax, -8120(%rbp)
	jl	.L17
	movq	-8104(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8104(%rbp)
	movq	-8104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
