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 MAX 200000
#define SENTINEL 2000000000
long long merge(int,int,int);
long long mergeSort(int,int);
int A[MAX];
int L[MAX / 2 + 2],R[MAX / 2 + 2];

int main(){
  int n,i;
  long long result;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%d",&A[i]);
  }
  result = mergeSort(0,n);
  printf("%lu\n",result);
  return 0;
}

long long merge(int left,int mid,int right){
  long long count = 0;
  int i,j,k;
  int n1,n2;
  n1 = mid - left;
  n2 = right - mid;
  for(i = 0; i < n1; i++) L[i] = A[left + i];
  for(j = 0; j < n2; j++) R[j] = A[mid + j];
  L[n1] = SENTINEL;
  R[n2] = SENTINEL;
  i = 0;
  j = 0;
  for(k = left; k < right; k++){
    if(L[i] <= R[j]){
      A[k] = L[i++];
    }
    else{
      A[k] = R[j++];
      count += n1 - i;
    }
  }
  return count;
}

long long mergeSort(int left, int right){
  int mid;
  long long a1,a2,a3;
  if(left + 1 < right){
    mid = (left + right)/2;
    a1 = mergeSort(left,mid);
    a2 = mergeSort(mid,right);
    a3 = merge(left,mid,right);
    return a1 + a2 + a3;
  }
  else 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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\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	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%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, -20(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L3
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	mergeSort
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	merge
	.type	merge, @function
merge:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	$0, -8(%rbp)
	movl	-40(%rbp), %eax
	subl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L7:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L8
	movl	$0, -24(%rbp)
	jmp	.L9
.L10:
	movl	-40(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %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	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L10
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L11
.L14:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	A(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L13
.L12:
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	A(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L14
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -40(%rbp)
	jle	.L17
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mergeSort
	movq	%rax, -24(%rbp)
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mergeSort
	movq	%rax, -16(%rbp)
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	-36(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	merge
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L18
.L17:
	movl	$0, %eax
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	mergeSort, .-mergeSort
	.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
	.type	merge, @function
merge:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %r15
	movl	%edx, %ecx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subl	%r15d, %ecx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r15d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subl	%edi, %ebp
	leaq	L(%rip), %rbx
	movslq	%ebp, %r14
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testl	%ebp, %ebp
	jle	.L2
	movslq	%edi, %rax
	movslq	%ebp, %r14
	movl	%ecx, 8(%rsp)
	leaq	L(%rip), %rbx
	leaq	A(%rip), %rsi
	leaq	0(,%r14,4), %rdx
	movq	%rbx, %rdi
	leaq	(%rsi,%rax,4), %rsi
	call	memcpy@PLT
	movl	8(%rsp), %ecx
.L2:
	testl	%ecx, %ecx
	leaq	R(%rip), %r10
	movslq	%ecx, %rcx
	jle	.L3
	leaq	A(%rip), %rax
	leaq	0(,%rcx,4), %rdx
	movq	%r10, %rdi
	movq	%rcx, 8(%rsp)
	leaq	(%rax,%r15,4), %rsi
	call	memcpy@PLT
	movq	8(%rsp), %rcx
	movq	%rax, %r10
.L3:
	movl	$2000000000, (%rbx,%r14,4)
	movl	$2000000000, (%r10,%rcx,4)
	cmpl	%r12d, %r13d
	jge	.L8
	subl	$1, %r12d
	movslq	%r13d, %rdx
	leaq	A(%rip), %rax
	xorl	%esi, %esi
	subl	%r13d, %r12d
	leaq	(%rax,%rdx,4), %rax
	xorl	%r9d, %r9d
	xorl	%r11d, %r11d
	addq	%rdx, %r12
	leaq	4+A(%rip), %rdx
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	leaq	(%rdx,%r12,4), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx,%r8,4), %ecx
	movl	(%r10,%rdi,4), %edx
	cmpl	%ecx, %edx
	jl	.L5
.L16:
	movl	%ecx, (%rax)
	addq	$4, %rax
	addl	$1, %esi
	cmpq	%rax, %r12
	je	.L1
	movslq	%esi, %r8
	movl	(%r10,%rdi,4), %edx
	movl	(%rbx,%r8,4), %ecx
	cmpl	%ecx, %edx
	jge	.L16
.L5:
	movl	%ebp, %ecx
	movl	%edx, (%rax)
	addq	$4, %rax
	addl	$1, %r9d
	subl	%esi, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r11
	cmpq	%rax, %r12
	je	.L1
	movslq	%r9d, %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%r11d, %r11d
.L1:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	movq	%r11, %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
	.cfi_endproc
.LFE24:
	.size	merge, .-merge
	.p2align 4
	.type	mergeSort.part.0, @function
mergeSort.part.0:
.LFB26:
	.cfi_startproc
	leal	(%rdi,%rsi), %eax
	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
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%eax, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	shrl	$31, %ebp
	xorl	%ebx, %ebx
	addl	%eax, %ebp
	leal	1(%rdi), %eax
	sarl	%ebp
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%eax, %ebp
	jg	.L40
	leal	1(%rbp), %eax
	cmpl	%eax, %r12d
	jg	.L41
.L25:
	movl	%r12d, %edx
	movl	%ebp, %esi
	movl	%r13d, %edi
	call	merge
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	addq	%rbx, %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
.L40:
	.cfi_restore_state
	leal	(%rdi,%rbp), %edx
	xorl	%r15d, %r15d
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L42
	leal	1(%r14), %eax
	cmpl	%eax, %ebp
	jg	.L43
.L22:
	movl	%ebp, %edx
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	merge
	leaq	(%rax,%r15), %rbx
	leal	1(%rbp), %eax
	cmpl	%eax, %r12d
	jle	.L25
.L41:
	leal	(%r12,%rbp), %edx
	xorl	%r15d, %r15d
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L44
.L26:
	leal	1(%r14), %eax
	cmpl	%eax, %r12d
	jg	.L45
.L29:
	movl	%r12d, %edx
	movl	%r14d, %esi
	movl	%ebp, %edi
	call	merge
	addq	%rax, %r15
	addq	%r15, %rbx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L42:
	leal	(%rdi,%r14), %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	cmpl	%r15d, %eax
	jl	.L46
.L20:
	leal	1(%r15), %eax
	cmpl	%eax, %r14d
	jg	.L47
.L21:
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%r13d, %edi
	call	merge
	leaq	(%rax,%rbx), %r15
	leal	1(%r14), %eax
	cmpl	%eax, %ebp
	jle	.L22
.L43:
	leal	0(%rbp,%r14), %edx
	xorl	%ecx, %ecx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L48
.L23:
	leal	1(%rbx), %eax
	cmpl	%eax, %ebp
	jg	.L49
.L24:
	movl	%ebp, %edx
	movl	%ebx, %esi
	movl	%r14d, %edi
	movq	%rcx, (%rsp)
	call	merge
	movq	(%rsp), %rcx
	addq	%rcx, %rax
	addq	%rax, %r15
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L45:
	leal	(%r12,%r14), %edx
	xorl	%ecx, %ecx
	movl	%edx, %r8d
	shrl	$31, %r8d
	addl	%edx, %r8d
	sarl	%r8d
	cmpl	%r8d, %eax
	jl	.L50
.L30:
	leal	1(%r8), %eax
	cmpl	%eax, %r12d
	jg	.L51
.L31:
	movl	%r12d, %edx
	movl	%r8d, %esi
	movl	%r14d, %edi
	movq	%rcx, (%rsp)
	call	merge
	movq	(%rsp), %rcx
	addq	%rcx, %rax
	addq	%rax, %r15
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L44:
	leal	0(%rbp,%r14), %edx
	xorl	%ecx, %ecx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	cmpl	%r15d, %eax
	jl	.L52
.L27:
	leal	1(%r15), %eax
	cmpl	%eax, %r14d
	jg	.L53
.L28:
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%ebp, %edi
	movq	%rcx, (%rsp)
	call	merge
	movq	(%rsp), %rcx
	leaq	(%rax,%rcx), %r15
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L46:
	movl	%r15d, %esi
	call	mergeSort.part.0
	movq	%rax, %rbx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L49:
	movl	%ebp, %esi
	movl	%ebx, %edi
	movq	%rcx, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %rcx
	addq	%rax, %rcx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%ebx, %esi
	movl	%r14d, %edi
	call	mergeSort.part.0
	movq	%rax, %rcx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%r14d, %esi
	movl	%r15d, %edi
	movq	%rcx, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %rcx
	addq	%rax, %rcx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L52:
	movl	%r15d, %esi
	movl	%ebp, %edi
	call	mergeSort.part.0
	movq	%rax, %rcx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L51:
	movl	%r8d, %edi
	movl	%r12d, %esi
	movq	%rcx, 8(%rsp)
	movl	%r8d, (%rsp)
	call	mergeSort.part.0
	movq	8(%rsp), %rcx
	movl	(%rsp), %r8d
	addq	%rax, %rcx
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L50:
	movl	%r8d, %esi
	movl	%r14d, %edi
	movl	%r8d, (%rsp)
	call	mergeSort.part.0
	movl	(%rsp), %r8d
	movq	%rax, %rcx
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L47:
	movl	%r14d, %esi
	movl	%r15d, %edi
	call	mergeSort.part.0
	addq	%rax, %rbx
	jmp	.L21
	.cfi_endproc
.LFE26:
	.size	mergeSort.part.0, .-mergeSort.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L58
	leaq	A(%rip), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L56
	xorl	%edx, %edx
	cmpl	$1, %esi
	jle	.L55
	xorl	%edi, %edi
	call	mergeSort.part.0
	movq	%rax, %rdx
.L55:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L62
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L55
.L62:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB25:
	.cfi_startproc
	endbr64
	leal	1(%rdi), %edx
	cmpl	%esi, %edx
	jl	.L80
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L80:
	leal	(%rdi,%rsi), %eax
	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
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%eax, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	shrl	$31, %ebp
	xorl	%ebx, %ebx
	addl	%eax, %ebp
	sarl	%ebp
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%ebp, %edx
	jl	.L81
	leal	1(%rbp), %eax
	cmpl	%eax, %r12d
	jg	.L82
.L68:
	movl	%r12d, %edx
	movl	%ebp, %esi
	movl	%r13d, %edi
	call	merge
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	addq	%rbx, %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
.L81:
	.cfi_restore_state
	leal	(%rdi,%rbp), %eax
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	cmpl	%r14d, %edx
	jl	.L83
.L66:
	leal	1(%r14), %eax
	cmpl	%eax, %ebp
	jg	.L84
.L67:
	movl	%ebp, %edx
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	merge
	addq	%rax, %rbx
	leal	1(%rbp), %eax
	cmpl	%eax, %r12d
	jle	.L68
.L82:
	leal	(%r12,%rbp), %edx
	xorl	%r15d, %r15d
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L85
.L69:
	leal	1(%r14), %eax
	cmpl	%eax, %r12d
	jg	.L86
.L70:
	movl	%r12d, %edx
	movl	%r14d, %esi
	movl	%ebp, %edi
	call	merge
	addq	%r15, %rax
	addq	%rax, %rbx
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L83:
	movl	%r14d, %esi
	call	mergeSort.part.0
	movq	%rax, %rbx
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L86:
	movl	%r12d, %esi
	movl	%r14d, %edi
	call	mergeSort.part.0
	addq	%rax, %r15
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L85:
	movl	%r14d, %esi
	movl	%ebp, %edi
	call	mergeSort.part.0
	movq	%rax, %r15
	jmp	.L69
	.p2align 4,,10
	.p2align 3
.L84:
	movl	%ebp, %esi
	movl	%r14d, %edi
	call	mergeSort.part.0
	addq	%rax, %rbx
	jmp	.L67
	.cfi_endproc
.LFE25:
	.size	mergeSort, .-mergeSort
	.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
	.type	merge, @function
merge:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %r15
	movl	%edx, %ecx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subl	%r15d, %ecx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%r15d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subl	%edi, %ebp
	leaq	L(%rip), %rbx
	movslq	%ebp, %r14
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testl	%ebp, %ebp
	jle	.L2
	movslq	%edi, %rax
	movslq	%ebp, %r14
	movl	%ecx, 8(%rsp)
	leaq	L(%rip), %rbx
	leaq	A(%rip), %rsi
	leaq	0(,%r14,4), %rdx
	movq	%rbx, %rdi
	leaq	(%rsi,%rax,4), %rsi
	call	memcpy@PLT
	movl	8(%rsp), %ecx
.L2:
	testl	%ecx, %ecx
	leaq	R(%rip), %r10
	movslq	%ecx, %rcx
	jle	.L3
	leaq	A(%rip), %rax
	leaq	0(,%rcx,4), %rdx
	movq	%r10, %rdi
	movq	%rcx, 8(%rsp)
	leaq	(%rax,%r15,4), %rsi
	call	memcpy@PLT
	movq	8(%rsp), %rcx
	movq	%rax, %r10
.L3:
	movl	$2000000000, (%rbx,%r14,4)
	movl	$2000000000, (%r10,%rcx,4)
	cmpl	%r12d, %r13d
	jge	.L8
	subl	$1, %r12d
	movslq	%r13d, %rdx
	leaq	A(%rip), %rax
	xorl	%esi, %esi
	subl	%r13d, %r12d
	leaq	(%rax,%rdx,4), %rax
	xorl	%r9d, %r9d
	xorl	%r11d, %r11d
	addq	%rdx, %r12
	leaq	4+A(%rip), %rdx
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	leaq	(%rdx,%r12,4), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx,%r8,4), %ecx
	movl	(%r10,%rdi,4), %edx
	cmpl	%ecx, %edx
	jl	.L5
.L16:
	movl	%ecx, (%rax)
	addq	$4, %rax
	addl	$1, %esi
	cmpq	%rax, %r12
	je	.L1
	movslq	%esi, %r8
	movl	(%r10,%rdi,4), %edx
	movl	(%rbx,%r8,4), %ecx
	cmpl	%ecx, %edx
	jge	.L16
.L5:
	movl	%ebp, %ecx
	movl	%edx, (%rax)
	addq	$4, %rax
	addl	$1, %r9d
	subl	%esi, %ecx
	movslq	%ecx, %rcx
	addq	%rcx, %r11
	cmpq	%rax, %r12
	je	.L1
	movslq	%r9d, %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%r11d, %r11d
.L1:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	movq	%r11, %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
	.cfi_endproc
.LFE24:
	.size	merge, .-merge
	.p2align 4
	.type	mergeSort.part.0, @function
mergeSort.part.0:
.LFB26:
	.cfi_startproc
	leal	(%rdi,%rsi), %eax
	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
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%eax, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	shrl	$31, %ebp
	xorl	%ebx, %ebx
	addl	%eax, %ebp
	leal	1(%rdi), %eax
	sarl	%ebp
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%eax, %ebp
	jg	.L40
	leal	1(%rbp), %eax
	cmpl	%eax, %r12d
	jg	.L41
.L25:
	movl	%r12d, %edx
	movl	%ebp, %esi
	movl	%r13d, %edi
	call	merge
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	addq	%rbx, %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
.L40:
	.cfi_restore_state
	leal	(%rdi,%rbp), %edx
	xorl	%r15d, %r15d
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L42
	leal	1(%r14), %eax
	cmpl	%eax, %ebp
	jg	.L43
.L22:
	movl	%ebp, %edx
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	merge
	leaq	(%rax,%r15), %rbx
	leal	1(%rbp), %eax
	cmpl	%eax, %r12d
	jle	.L25
.L41:
	leal	(%r12,%rbp), %edx
	xorl	%r15d, %r15d
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L44
.L26:
	leal	1(%r14), %eax
	cmpl	%eax, %r12d
	jg	.L45
.L29:
	movl	%r12d, %edx
	movl	%r14d, %esi
	movl	%ebp, %edi
	call	merge
	addq	%rax, %r15
	addq	%r15, %rbx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L42:
	leal	(%rdi,%r14), %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	cmpl	%r15d, %eax
	jl	.L46
.L20:
	leal	1(%r15), %eax
	cmpl	%eax, %r14d
	jg	.L47
.L21:
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%r13d, %edi
	call	merge
	leaq	(%rax,%rbx), %r15
	leal	1(%r14), %eax
	cmpl	%eax, %ebp
	jle	.L22
.L43:
	leal	0(%rbp,%r14), %edx
	xorl	%ecx, %ecx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L48
.L23:
	leal	1(%rbx), %eax
	cmpl	%eax, %ebp
	jg	.L49
.L24:
	movl	%ebp, %edx
	movl	%ebx, %esi
	movl	%r14d, %edi
	movq	%rcx, (%rsp)
	call	merge
	movq	(%rsp), %rcx
	addq	%rcx, %rax
	addq	%rax, %r15
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L45:
	leal	(%r12,%r14), %edx
	xorl	%ecx, %ecx
	movl	%edx, %r8d
	shrl	$31, %r8d
	addl	%edx, %r8d
	sarl	%r8d
	cmpl	%r8d, %eax
	jl	.L50
.L30:
	leal	1(%r8), %eax
	cmpl	%eax, %r12d
	jg	.L51
.L31:
	movl	%r12d, %edx
	movl	%r8d, %esi
	movl	%r14d, %edi
	movq	%rcx, (%rsp)
	call	merge
	movq	(%rsp), %rcx
	addq	%rcx, %rax
	addq	%rax, %r15
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L44:
	leal	0(%rbp,%r14), %edx
	xorl	%ecx, %ecx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	cmpl	%r15d, %eax
	jl	.L52
.L27:
	leal	1(%r15), %eax
	cmpl	%eax, %r14d
	jg	.L53
.L28:
	movl	%r15d, %esi
	movl	%r14d, %edx
	movl	%ebp, %edi
	movq	%rcx, (%rsp)
	call	merge
	movq	(%rsp), %rcx
	leaq	(%rax,%rcx), %r15
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L46:
	movl	%r15d, %esi
	call	mergeSort.part.0
	movq	%rax, %rbx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L49:
	movl	%ebp, %esi
	movl	%ebx, %edi
	movq	%rcx, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %rcx
	addq	%rax, %rcx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%ebx, %esi
	movl	%r14d, %edi
	call	mergeSort.part.0
	movq	%rax, %rcx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%r14d, %esi
	movl	%r15d, %edi
	movq	%rcx, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %rcx
	addq	%rax, %rcx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L52:
	movl	%r15d, %esi
	movl	%ebp, %edi
	call	mergeSort.part.0
	movq	%rax, %rcx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L51:
	movl	%r8d, %edi
	movl	%r12d, %esi
	movq	%rcx, 8(%rsp)
	movl	%r8d, (%rsp)
	call	mergeSort.part.0
	movq	8(%rsp), %rcx
	movl	(%rsp), %r8d
	addq	%rax, %rcx
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L50:
	movl	%r8d, %esi
	movl	%r14d, %edi
	movl	%r8d, (%rsp)
	call	mergeSort.part.0
	movl	(%rsp), %r8d
	movq	%rax, %rcx
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L47:
	movl	%r14d, %esi
	movl	%r15d, %edi
	call	mergeSort.part.0
	addq	%rax, %rbx
	jmp	.L21
	.cfi_endproc
.LFE26:
	.size	mergeSort.part.0, .-mergeSort.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L58
	leaq	A(%rip), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L56
	xorl	%edx, %edx
	cmpl	$1, %esi
	jle	.L55
	xorl	%edi, %edi
	call	mergeSort.part.0
	movq	%rax, %rdx
.L55:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L62
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L58:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L55
.L62:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB25:
	.cfi_startproc
	endbr64
	leal	1(%rdi), %edx
	cmpl	%esi, %edx
	jl	.L80
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L80:
	leal	(%rdi,%rsi), %eax
	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
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%eax, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	shrl	$31, %ebp
	xorl	%ebx, %ebx
	addl	%eax, %ebp
	sarl	%ebp
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%ebp, %edx
	jl	.L81
	leal	1(%rbp), %eax
	cmpl	%eax, %r12d
	jg	.L82
.L68:
	movl	%r12d, %edx
	movl	%ebp, %esi
	movl	%r13d, %edi
	call	merge
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	addq	%rbx, %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
.L81:
	.cfi_restore_state
	leal	(%rdi,%rbp), %eax
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	cmpl	%r14d, %edx
	jl	.L83
.L66:
	leal	1(%r14), %eax
	cmpl	%eax, %ebp
	jg	.L84
.L67:
	movl	%ebp, %edx
	movl	%r14d, %esi
	movl	%r13d, %edi
	call	merge
	addq	%rax, %rbx
	leal	1(%rbp), %eax
	cmpl	%eax, %r12d
	jle	.L68
.L82:
	leal	(%r12,%rbp), %edx
	xorl	%r15d, %r15d
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L85
.L69:
	leal	1(%r14), %eax
	cmpl	%eax, %r12d
	jg	.L86
.L70:
	movl	%r12d, %edx
	movl	%r14d, %esi
	movl	%ebp, %edi
	call	merge
	addq	%r15, %rax
	addq	%rax, %rbx
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L83:
	movl	%r14d, %esi
	call	mergeSort.part.0
	movq	%rax, %rbx
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L86:
	movl	%r12d, %esi
	movl	%r14d, %edi
	call	mergeSort.part.0
	addq	%rax, %r15
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L85:
	movl	%r14d, %esi
	movl	%ebp, %edi
	call	mergeSort.part.0
	movq	%rax, %r15
	jmp	.L69
	.p2align 4,,10
	.p2align 3
.L84:
	movl	%ebp, %esi
	movl	%r14d, %edi
	call	mergeSort.part.0
	addq	%rax, %rbx
	jmp	.L67
	.cfi_endproc
.LFE25:
	.size	mergeSort, .-mergeSort
	.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>
#define MAX 200000
#define SENTINEL 2000000000
long long merge(int,int,int);
long long mergeSort(int,int);
int A[MAX];
int L[MAX / 2 + 2],R[MAX / 2 + 2];

int main(){
  int n,i;
  long long result;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%d",&A[i]);
  }
  result = mergeSort(0,n);
  printf("%lu\n",result);
  return 0;
}

long long merge(int left,int mid,int right){
  long long count = 0;
  int i,j,k;
  int n1,n2;
  n1 = mid - left;
  n2 = right - mid;
  for(i = 0; i < n1; i++) L[i] = A[left + i];
  for(j = 0; j < n2; j++) R[j] = A[mid + j];
  L[n1] = SENTINEL;
  R[n2] = SENTINEL;
  i = 0;
  j = 0;
  for(k = left; k < right; k++){
    if(L[i] <= R[j]){
      A[k] = L[i++];
    }
    else{
      A[k] = R[j++];
      count += n1 - i;
    }
  }
  return count;
}

long long mergeSort(int left, int right){
  int mid;
  long long a1,a2,a3;
  if(left + 1 < right){
    mid = (left + right)/2;
    a1 = mergeSort(left,mid);
    a2 = mergeSort(mid,right);
    a3 = merge(left,mid,right);
    return a1 + a2 + a3;
  }
  else 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>
#define MAX 200000
#define SENTINEL 2000000000
long long merge(int,int,int);
long long mergeSort(int,int);
int A[MAX];
int L[MAX / 2 + 2],R[MAX / 2 + 2];

int main(){
  int n,i;
  long long result;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%d",&A[i]);
  }
  result = mergeSort(0,n);
  printf("%lu\n",result);
  return 0;
}

long long merge(int left,int mid,int right){
  long long count = 0;
  int i,j,k;
  int n1,n2;
  n1 = mid - left;
  n2 = right - mid;
  for(i = 0; i < n1; i++) L[i] = A[left + i];
  for(j = 0; j < n2; j++) R[j] = A[mid + j];
  L[n1] = SENTINEL;
  R[n2] = SENTINEL;
  i = 0;
  j = 0;
  for(k = left; k < right; k++){
    if(L[i] <= R[j]){
      A[k] = L[i++];
    }
    else{
      A[k] = R[j++];
      count += n1 - i;
    }
  }
  return count;
}

long long mergeSort(int left, int right){
  int mid;
  long long a1,a2,a3;
  if(left + 1 < right){
    mid = (left + right)/2;
    a1 = mergeSort(left,mid);
    a2 = mergeSort(mid,right);
    a3 = merge(left,mid,right);
    return a1 + a2 + a3;
  }
  else 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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\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	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%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, -20(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L3
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	mergeSort
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	merge
	.type	merge, @function
merge:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	$0, -8(%rbp)
	movl	-40(%rbp), %eax
	subl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L7:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L8
	movl	$0, -24(%rbp)
	jmp	.L9
.L10:
	movl	-40(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %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	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L10
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L11
.L14:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	A(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L13
.L12:
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	A(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L14
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -40(%rbp)
	jle	.L17
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mergeSort
	movq	%rax, -24(%rbp)
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mergeSort
	movq	%rax, -16(%rbp)
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	-36(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	merge
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L18
.L17:
	movl	$0, %eax
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	mergeSort, .-mergeSort
	.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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu\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	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%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, -20(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L3
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	mergeSort
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	merge
	.type	merge, @function
merge:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	$0, -8(%rbp)
	movl	-40(%rbp), %eax
	subl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L7:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L8
	movl	$0, -24(%rbp)
	jmp	.L9
.L10:
	movl	-40(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %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	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L9:
	movl	-24(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L10
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$2000000000, (%rdx,%rax)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L11
.L14:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	A(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	jmp	.L13
.L12:
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	A(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
.L13:
	addl	$1, -20(%rbp)
.L11:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L14
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -40(%rbp)
	jle	.L17
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mergeSort
	movq	%rax, -24(%rbp)
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	mergeSort
	movq	%rax, -16(%rbp)
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	-36(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	merge
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L18
.L17:
	movl	$0, %eax
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	mergeSort, .-mergeSort
	.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:
