Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#define N 200000

unsigned int a[N];

int L[N/2 + 2], R[N/2 + 2];

long long merge_sort(int *a, int l, int r){
int m  = (l+r)/2, count, i, j;
int n1, n2;
long long v1, v2, cnt = 0;
  if(l == r)
   return 0;

  v1 = merge_sort(a, l, m);
  v2 = merge_sort(a, m + 1, r);
  n1 = m-l+1;
  n2 = r - m;
  L[n1]  = R[n2] = 2000000000;
  for(count = l; count <= m; count++){
     L[count - l] = a[count];
  }
  for(count = m + 1; count <= r; count++){
    R[count - m - 1] = a[count];
  }
  for(i = 0, j = 0, count = l; count <= r; count++){
    if(L[i] <= R[j]){
     a[count] = L[i++];
    }
    else{
     a[count] = R[j++];
     cnt += n1 - i;
    }

  }

   return cnt + v1 + v2;
}

int main(int argc, char** argv){
int n, i = 0;
   scanf("%d", &n);

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


 printf("%lld\n", merge_sort(a, 0, n-1));

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.globl	L
	.align 32
	.type	L, @object
	.size	L, 400008
L:
	.zero	400008
	.globl	R
	.align 32
	.type	R, @object
	.size	R, 400008
R:
	.zero	400008
	.text
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -56(%rbp)
	movl	%esi, -60(%rbp)
	movl	%edx, -64(%rbp)
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -36(%rbp)
	movq	$0, -24(%rbp)
	movl	-60(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	-36(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, -16(%rbp)
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-64(%rbp), %edx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	subl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-64(%rbp), %eax
	subl	-36(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-60(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	subl	-60(%rbp), %eax
	movl	%eax, %edx
	movl	(%rcx), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L5
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	jmp	.L6
.L7:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-48(%rbp), %eax
	subl	-36(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	(%rdx), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L6:
	movl	-48(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jle	.L7
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L8
.L11:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-44(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -44(%rbp)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L10
.L9:
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -40(%rbp)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	movl	-32(%rbp), %eax
	subl	-44(%rbp), %eax
	cltq
	addq	%rax, -24(%rbp)
.L10:
	addl	$1, -48(%rbp)
.L8:
	movl	-48(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jle	.L11
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge_sort, .-merge_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L13:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L14
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	movl	$0, %esi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%edx, %esi
	je	.L43
	leal	(%rsi,%rdx), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%eax, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	shrl	$31, %r13d
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addl	%eax, %r13d
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sarl	%r13d
	movl	%edx, %ebx
	leal	1(%r13), %ebp
	movl	%r13d, %edx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	merge_sort
	movl	%ebx, %edx
	movl	%ebp, %esi
	movq	%r12, %rdi
	movq	%rax, %r15
	call	merge_sort
	movl	%r13d, %r9d
	movl	%ebx, %ecx
	leaq	R(%rip), %rdx
	subl	%r14d, %r9d
	subl	%r13d, %ecx
	movslq	%ecx, %rcx
	leal	1(%r9), %esi
	movl	$2000000000, (%rdx,%rcx,4)
	movslq	%esi, %rdi
	leaq	L(%rip), %rcx
	movl	$2000000000, (%rcx,%rdi,4)
	cmpl	%r13d, %r14d
	jg	.L9
	movslq	%r14d, %r8
	leaq	1(%r8), %rdi
	leaq	0(,%rdi,4), %r10
	movq	%rdi, 8(%rsp)
	movq	%rcx, %rdi
	leaq	(%r12,%r10), %r11
	subq	%r11, %rdi
	cmpq	$8, %rdi
	jbe	.L6
	cmpl	$2, %r9d
	jbe	.L6
	movl	%esi, %r8d
	leaq	-4(%r12,%r10), %r9
	xorl	%edi, %edi
	shrl	$2, %r8d
	salq	$4, %r8
	.p2align 4,,10
	.p2align 3
.L7:
	movdqu	(%r9,%rdi), %xmm0
	movaps	%xmm0, (%rcx,%rdi)
	addq	$16, %rdi
	cmpq	%r8, %rdi
	jne	.L7
	movl	%esi, %r8d
	andl	$-4, %r8d
	leal	(%r14,%r8), %edi
	cmpl	%r8d, %esi
	je	.L9
	movslq	%edi, %r9
	movslq	%r8d, %r8
	movl	(%r12,%r9,4), %r9d
	movl	%r9d, (%rcx,%r8,4)
	leal	1(%rdi), %r8d
	cmpl	%r8d, %r13d
	jl	.L9
	movslq	%r8d, %r10
	subl	%r14d, %r8d
	addl	$2, %edi
	leaq	0(,%r10,4), %r9
	movl	(%r12,%r10,4), %r10d
	movslq	%r8d, %r8
	movl	%r10d, (%rcx,%r8,4)
	cmpl	%r13d, %edi
	jg	.L9
	movl	4(%r12,%r9), %r8d
	subl	%r14d, %edi
	movslq	%edi, %rdi
	movl	%r8d, (%rcx,%rdi,4)
.L9:
	cmpl	%ebx, %ebp
	jg	.L5
	movslq	%r13d, %r8
	movq	%rdx, %r9
	movl	%ebx, %r10d
	leaq	8(,%r8,4), %rdi
	subl	%r13d, %r10d
	leaq	(%r12,%rdi), %r11
	subq	%r11, %r9
	cmpq	$8, %r9
	jbe	.L15
	leal	-1(%r10), %r9d
	cmpl	$2, %r9d
	jbe	.L15
	movl	%r10d, %r8d
	leaq	-4(%r12,%rdi), %r9
	xorl	%edi, %edi
	shrl	$2, %r8d
	salq	$4, %r8
	.p2align 4,,10
	.p2align 3
.L16:
	movdqu	(%r9,%rdi), %xmm1
	movaps	%xmm1, (%rdx,%rdi)
	addq	$16, %rdi
	cmpq	%r8, %rdi
	jne	.L16
	movl	%r10d, %edi
	andl	$-4, %edi
	addl	%edi, %ebp
	cmpl	%edi, %r10d
	je	.L5
	movslq	%ebp, %rdi
	movl	(%r12,%rdi,4), %r8d
	movl	%ebp, %edi
	subl	%r13d, %edi
	subl	$1, %edi
	movslq	%edi, %rdi
	movl	%r8d, (%rdx,%rdi,4)
	leal	1(%rbp), %edi
	cmpl	%edi, %ebx
	jl	.L5
	movslq	%edi, %r9
	subl	%r13d, %edi
	addl	$2, %ebp
	leaq	0(,%r9,4), %r8
	subl	$1, %edi
	movl	(%r12,%r9,4), %r9d
	movslq	%edi, %rdi
	movl	%r9d, (%rdx,%rdi,4)
	cmpl	%ebp, %ebx
	jl	.L5
	subl	%r13d, %ebp
	movl	4(%r12,%r8), %r8d
	leal	-1(%rbp), %edi
	movslq	%edi, %rdi
	movl	%r8d, (%rdx,%rdi,4)
.L5:
	cmpl	%ebx, %r14d
	jg	.L14
	movslq	%r14d, %r8
	subl	%r14d, %ebx
	xorl	%ebp, %ebp
	xorl	%r10d, %r10d
	addq	%r8, %rbx
	leaq	(%r12,%r8,4), %rdi
	xorl	%r11d, %r11d
	xorl	%r13d, %r13d
	leaq	4(%r12,%rbx,4), %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rcx,%r11,4), %r9d
	movl	(%rdx,%r13,4), %r8d
	cmpl	%r9d, %r8d
	jl	.L20
.L49:
	movl	%r9d, (%rdi)
	addq	$4, %rdi
	addl	$1, %r10d
	cmpq	%rdi, %r12
	je	.L22
	movslq	%r10d, %r11
	movl	(%rdx,%r13,4), %r8d
	movl	(%rcx,%r11,4), %r9d
	cmpl	%r9d, %r8d
	jge	.L49
.L20:
	movl	%esi, %r9d
	movl	%r8d, (%rdi)
	addq	$4, %rdi
	addl	$1, %ebx
	subl	%r10d, %r9d
	movslq	%r9d, %r9
	addq	%r9, %rbp
	cmpq	%rdi, %r12
	je	.L22
	movslq	%ebx, %r13
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L22:
	addq	%rbp, %r15
.L14:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	addq	%r15, %rax
	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
.L43:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	negq	%r8
	movslq	%ebp, %rbp
	leaq	(%rdx,%r8,4), %r8
	.p2align 4,,10
	.p2align 3
.L18:
	movl	(%r12,%rbp,4), %edi
	movl	%edi, -4(%r8,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %ebx
	jge	.L18
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r8, %r9
	movq	8(%rsp), %rdi
	negq	%r9
	leaq	(%rcx,%r9,4), %r10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L50:
	addq	$1, %rdi
.L11:
	movl	(%r12,%r8,4), %r9d
	movl	%r9d, (%r10,%r8,4)
	movq	%rdi, %r8
	cmpl	%edi, %r13d
	jge	.L50
	jmp	.L9
	.cfi_endproc
.LFE39:
	.size	merge_sort, .-merge_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L52
	movq	%r13, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L53:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L53
.L52:
	subl	$1, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	merge_sort
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	R
	.bss
	.align 32
	.type	R, @object
	.size	R, 400008
R:
	.zero	400008
	.globl	L
	.align 32
	.type	L, @object
	.size	L, 400008
L:
	.zero	400008
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.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	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%edx, %esi
	je	.L43
	leal	(%rsi,%rdx), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%eax, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	shrl	$31, %r13d
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addl	%eax, %r13d
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sarl	%r13d
	movl	%edx, %ebx
	leal	1(%r13), %ebp
	movl	%r13d, %edx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	merge_sort
	movl	%ebx, %edx
	movl	%ebp, %esi
	movq	%r12, %rdi
	movq	%rax, %r15
	call	merge_sort
	movl	%r13d, %r9d
	movl	%ebx, %ecx
	leaq	R(%rip), %rdx
	subl	%r14d, %r9d
	subl	%r13d, %ecx
	movslq	%ecx, %rcx
	leal	1(%r9), %esi
	movl	$2000000000, (%rdx,%rcx,4)
	movslq	%esi, %rdi
	leaq	L(%rip), %rcx
	movl	$2000000000, (%rcx,%rdi,4)
	cmpl	%r13d, %r14d
	jg	.L9
	movslq	%r14d, %r8
	leaq	1(%r8), %rdi
	leaq	0(,%rdi,4), %r10
	movq	%rdi, 8(%rsp)
	movq	%rcx, %rdi
	leaq	(%r12,%r10), %r11
	subq	%r11, %rdi
	cmpq	$8, %rdi
	jbe	.L6
	cmpl	$2, %r9d
	jbe	.L6
	movl	%esi, %r8d
	leaq	-4(%r12,%r10), %r9
	xorl	%edi, %edi
	shrl	$2, %r8d
	salq	$4, %r8
	.p2align 4,,10
	.p2align 3
.L7:
	movdqu	(%r9,%rdi), %xmm0
	movaps	%xmm0, (%rcx,%rdi)
	addq	$16, %rdi
	cmpq	%r8, %rdi
	jne	.L7
	movl	%esi, %r8d
	andl	$-4, %r8d
	leal	(%r14,%r8), %edi
	cmpl	%r8d, %esi
	je	.L9
	movslq	%edi, %r9
	movslq	%r8d, %r8
	movl	(%r12,%r9,4), %r9d
	movl	%r9d, (%rcx,%r8,4)
	leal	1(%rdi), %r8d
	cmpl	%r8d, %r13d
	jl	.L9
	movslq	%r8d, %r10
	subl	%r14d, %r8d
	addl	$2, %edi
	leaq	0(,%r10,4), %r9
	movl	(%r12,%r10,4), %r10d
	movslq	%r8d, %r8
	movl	%r10d, (%rcx,%r8,4)
	cmpl	%r13d, %edi
	jg	.L9
	movl	4(%r12,%r9), %r8d
	subl	%r14d, %edi
	movslq	%edi, %rdi
	movl	%r8d, (%rcx,%rdi,4)
.L9:
	cmpl	%ebx, %ebp
	jg	.L5
	movslq	%r13d, %r8
	movq	%rdx, %r9
	movl	%ebx, %r10d
	leaq	8(,%r8,4), %rdi
	subl	%r13d, %r10d
	leaq	(%r12,%rdi), %r11
	subq	%r11, %r9
	cmpq	$8, %r9
	jbe	.L15
	leal	-1(%r10), %r9d
	cmpl	$2, %r9d
	jbe	.L15
	movl	%r10d, %r8d
	leaq	-4(%r12,%rdi), %r9
	xorl	%edi, %edi
	shrl	$2, %r8d
	salq	$4, %r8
	.p2align 4,,10
	.p2align 3
.L16:
	movdqu	(%r9,%rdi), %xmm1
	movaps	%xmm1, (%rdx,%rdi)
	addq	$16, %rdi
	cmpq	%r8, %rdi
	jne	.L16
	movl	%r10d, %edi
	andl	$-4, %edi
	addl	%edi, %ebp
	cmpl	%edi, %r10d
	je	.L5
	movslq	%ebp, %rdi
	movl	(%r12,%rdi,4), %r8d
	movl	%ebp, %edi
	subl	%r13d, %edi
	subl	$1, %edi
	movslq	%edi, %rdi
	movl	%r8d, (%rdx,%rdi,4)
	leal	1(%rbp), %edi
	cmpl	%edi, %ebx
	jl	.L5
	movslq	%edi, %r9
	subl	%r13d, %edi
	addl	$2, %ebp
	leaq	0(,%r9,4), %r8
	subl	$1, %edi
	movl	(%r12,%r9,4), %r9d
	movslq	%edi, %rdi
	movl	%r9d, (%rdx,%rdi,4)
	cmpl	%ebp, %ebx
	jl	.L5
	subl	%r13d, %ebp
	movl	4(%r12,%r8), %r8d
	leal	-1(%rbp), %edi
	movslq	%edi, %rdi
	movl	%r8d, (%rdx,%rdi,4)
.L5:
	cmpl	%ebx, %r14d
	jg	.L14
	movslq	%r14d, %r8
	subl	%r14d, %ebx
	xorl	%ebp, %ebp
	xorl	%r10d, %r10d
	addq	%r8, %rbx
	leaq	(%r12,%r8,4), %rdi
	xorl	%r11d, %r11d
	xorl	%r13d, %r13d
	leaq	4(%r12,%rbx,4), %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rcx,%r11,4), %r9d
	movl	(%rdx,%r13,4), %r8d
	cmpl	%r9d, %r8d
	jl	.L20
.L49:
	movl	%r9d, (%rdi)
	addq	$4, %rdi
	addl	$1, %r10d
	cmpq	%rdi, %r12
	je	.L22
	movslq	%r10d, %r11
	movl	(%rdx,%r13,4), %r8d
	movl	(%rcx,%r11,4), %r9d
	cmpl	%r9d, %r8d
	jge	.L49
.L20:
	movl	%esi, %r9d
	movl	%r8d, (%rdi)
	addq	$4, %rdi
	addl	$1, %ebx
	subl	%r10d, %r9d
	movslq	%r9d, %r9
	addq	%r9, %rbp
	cmpq	%rdi, %r12
	je	.L22
	movslq	%ebx, %r13
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L22:
	addq	%rbp, %r15
.L14:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	addq	%r15, %rax
	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
.L43:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	negq	%r8
	movslq	%ebp, %rbp
	leaq	(%rdx,%r8,4), %r8
	.p2align 4,,10
	.p2align 3
.L18:
	movl	(%r12,%rbp,4), %edi
	movl	%edi, -4(%r8,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %ebx
	jge	.L18
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r8, %r9
	movq	8(%rsp), %rdi
	negq	%r9
	leaq	(%rcx,%r9,4), %r10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L50:
	addq	$1, %rdi
.L11:
	movl	(%r12,%r8,4), %r9d
	movl	%r9d, (%r10,%r8,4)
	movq	%rdi, %r8
	cmpl	%edi, %r13d
	jge	.L50
	jmp	.L9
	.cfi_endproc
.LFE39:
	.size	merge_sort, .-merge_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L52
	movq	%r13, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L53:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L53
.L52:
	subl	$1, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	merge_sort
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	R
	.bss
	.align 32
	.type	R, @object
	.size	R, 400008
R:
	.zero	400008
	.globl	L
	.align 32
	.type	L, @object
	.size	L, 400008
L:
	.zero	400008
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#define N 200000

unsigned int a[N];

int L[N/2 + 2], R[N/2 + 2];

long long merge_sort(int *a, int l, int r){
int m  = (l+r)/2, count, i, j;
int n1, n2;
long long v1, v2, cnt = 0;
  if(l == r)
   return 0;

  v1 = merge_sort(a, l, m);
  v2 = merge_sort(a, m + 1, r);
  n1 = m-l+1;
  n2 = r - m;
  L[n1]  = R[n2] = 2000000000;
  for(count = l; count <= m; count++){
     L[count - l] = a[count];
  }
  for(count = m + 1; count <= r; count++){
    R[count - m - 1] = a[count];
  }
  for(i = 0, j = 0, count = l; count <= r; count++){
    if(L[i] <= R[j]){
     a[count] = L[i++];
    }
    else{
     a[count] = R[j++];
     cnt += n1 - i;
    }

  }

   return cnt + v1 + v2;
}

int main(int argc, char** argv){
int n, i = 0;
   scanf("%d", &n);

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


 printf("%lld\n", merge_sort(a, 0, n-1));

  return 0;
}
3
6 1 2
 5
3 10 2 1 4
 3
6 1 0
 5
3 10 1 1 4
 3
0 -1 1
 5
1 6 1 0 0
 3
-2 -2 -2
 5
0 -13 17 1 0
 5
2 0 -1 -2 -1
 5
4 1 0 0 -1

2
 6
 3
 5
 1
 7
 0
 4
 8
 9

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#define N 200000

unsigned int a[N];

int L[N/2 + 2], R[N/2 + 2];

long long merge_sort(int *a, int l, int r){
int m  = (l+r)/2, count, i, j;
int n1, n2;
long long v1, v2, cnt = 0;
  if(l == r)
   return 0;

  v1 = merge_sort(a, l, m);
  v2 = merge_sort(a, m + 1, r);
  n1 = m-l+1;
  n2 = r - m;
  L[n1]  = R[n2] = 2000000000;
  for(count = l; count <= m; count++){
     L[count - l] = a[count];
  }
  for(count = m + 1; count <= r; count++){
    R[count - m - 1] = a[count];
  }
  for(i = 0, j = 0, count = l; count <= r; count++){
    if(L[i] <= R[j]){
     a[count] = L[i++];
    }
    else{
     a[count] = R[j++];
     cnt += n1 - i;
    }

  }

   return cnt + v1 + v2;
}

int main(int argc, char** argv){
int n, i = 0;
   scanf("%d", &n);

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


 printf("%lld\n", merge_sort(a, 0, n-1));

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.globl	L
	.align 32
	.type	L, @object
	.size	L, 400008
L:
	.zero	400008
	.globl	R
	.align 32
	.type	R, @object
	.size	R, 400008
R:
	.zero	400008
	.text
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -56(%rbp)
	movl	%esi, -60(%rbp)
	movl	%edx, -64(%rbp)
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -36(%rbp)
	movq	$0, -24(%rbp)
	movl	-60(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	-36(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, -16(%rbp)
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-64(%rbp), %edx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	subl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-64(%rbp), %eax
	subl	-36(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-60(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	subl	-60(%rbp), %eax
	movl	%eax, %edx
	movl	(%rcx), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L5
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	jmp	.L6
.L7:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-48(%rbp), %eax
	subl	-36(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	(%rdx), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L6:
	movl	-48(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jle	.L7
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L8
.L11:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-44(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -44(%rbp)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L10
.L9:
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -40(%rbp)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	movl	-32(%rbp), %eax
	subl	-44(%rbp), %eax
	cltq
	addq	%rax, -24(%rbp)
.L10:
	addl	$1, -48(%rbp)
.L8:
	movl	-48(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jle	.L11
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge_sort, .-merge_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L13:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L14
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	movl	$0, %esi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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, 800000
a:
	.zero	800000
	.globl	L
	.align 32
	.type	L, @object
	.size	L, 400008
L:
	.zero	400008
	.globl	R
	.align 32
	.type	R, @object
	.size	R, 400008
R:
	.zero	400008
	.text
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -56(%rbp)
	movl	%esi, -60(%rbp)
	movl	%edx, -64(%rbp)
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -36(%rbp)
	movq	$0, -24(%rbp)
	movl	-60(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jne	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	-36(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, -16(%rbp)
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-64(%rbp), %edx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	subl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-64(%rbp), %eax
	subl	-36(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-60(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	subl	-60(%rbp), %eax
	movl	%eax, %edx
	movl	(%rcx), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L5
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	jmp	.L6
.L7:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-48(%rbp), %eax
	subl	-36(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	(%rdx), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -48(%rbp)
.L6:
	movl	-48(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jle	.L7
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L8
.L11:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-44(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -44(%rbp)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L10
.L9:
	movl	-40(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -40(%rbp)
	movl	-48(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	movl	-32(%rbp), %eax
	subl	-44(%rbp), %eax
	cltq
	addq	%rax, -24(%rbp)
.L10:
	addl	$1, -48(%rbp)
.L8:
	movl	-48(%rbp), %eax
	cmpl	-64(%rbp), %eax
	jle	.L11
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge_sort, .-merge_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L13:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L14
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	movl	$0, %esi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	merge_sort
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
