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 N 262144
#define HALFN 131072 // 2^17
#define INFTY 1000000001 // 10^9 + 1

int L[HALFN] = {0}, R[HALFN] = {0};
long cnt = 0;

/* void swap(int *x, int *y) { */
/*   int tmp; */

/*   tmp = *x; */
/*   *x = *y; */
/*   *y = tmp; */
/* } */

/* int bubbleSort(int n, int *A) { */
/*   int i, j; */

/*   for (i = 0; i < n; i++) { */
/*     for (j = n - 1; i < j; j--) { */
/*       if (A[j] < A[j-1]) { */
/* 	swap(&A[j], &A[j-1]); */
/* 	cnt++; */
/*       } */
/*     } */
/*   } */
/*   return cnt; */
/* } */
	
void merge(int *A, int left, int mid, int right) {
  int i, j, k, n1, n2;
  
  n1 = mid - left;
  n2 = right - mid;

  for (i = 0; i < n1; i++)
    L[i] = A[left + i];
  for (i = 0; i < n2; i++)
    R[i] = A[mid + i];
  L[n1] = INFTY;
  R[n2] = INFTY;

  /* // count the number of inversions */
  /* for (j = 0; j < n2; j++) { */
  /*   for (i = 0; i < n1; i++) { */
  /*     if (R[j] < L[i]) { */
  /* 	cnt += (n1 - i); */
  /* 	break; */
  /*     } */
  /*   } */
  /* } */
  
  // sort array
  for (i = 0, j = 0, k = left; k < right; k++) {
    if (R[j] < L[i]) {
      cnt += (n1 - i);
      A[k] = R[j];
      j++;
    }
    else {
      A[k] = L[i];
      i++;
    }
  }
}

void mergeSort(int *A, int left, int right) {
  int mid;
  
  if ((left + 1) < right) {
    mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main(void){
  int i, n, A[N] = {0};

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

  mergeSort(A, 0, n);
  printf("%ld\n", cnt);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	L
	.bss
	.align 32
	.type	L, @object
	.size	L, 524288
L:
	.zero	524288
	.globl	R
	.align 32
	.type	R, @object
	.size	R, 524288
R:
	.zero	524288
	.globl	cnt
	.align 8
	.type	cnt, @object
	.size	cnt, 8
cnt:
	.zero	8
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	%ecx, -52(%rbp)
	movl	-48(%rbp), %eax
	subl	-44(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-52(%rbp), %eax
	subl	-48(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L3
	movl	$0, -20(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L5
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	$1000000001, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$1000000001, (%rdx,%rax)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-8(%rbp), %eax
	subl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	cnt(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, cnt(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -16(%rbp)
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -20(%rbp)
.L8:
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB1:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jle	.L12
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergeSort
	movl	-32(%rbp), %edx
	movl	-4(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergeSort
	movl	-32(%rbp), %ecx
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	merge
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	mergeSort, .-mergeSort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1048576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1048592(%rbp), %rax
	movl	$1048576, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-1048600(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1048596(%rbp)
	jmp	.L14
.L15:
	leaq	-1048592(%rbp), %rdx
	movl	-1048596(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1048596(%rbp)
.L14:
	movl	-1048600(%rbp), %eax
	cmpl	%eax, -1048596(%rbp)
	jl	.L15
	movl	-1048600(%rbp), %edx
	leaq	-1048592(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergeSort
	movq	cnt(%rip), %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	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.type	merge, @function
merge:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %r10d
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%ecx, %edx
	movq	%rdi, %r8
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%r10d, %ebx
	movl	%esi, %r9d
	subl	%r10d, %ecx
	subl	%esi, %ebx
	testl	%ebx, %ebx
	jle	.L41
	movslq	%esi, %rax
	leaq	L(%rip), %rsi
	leaq	4(,%rax,4), %rax
	leaq	(%rdi,%rax), %r11
	movq	%rsi, %rdi
	subq	%r11, %rdi
	cmpq	$8, %rdi
	jbe	.L5
	leal	-1(%rbx), %edi
	cmpl	$2, %edi
	jbe	.L5
	movl	%ebx, %edi
	leaq	-4(%r8,%rax), %r11
	xorl	%eax, %eax
	shrl	$2, %edi
	salq	$4, %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	(%r11,%rax), %xmm0
	movaps	%xmm0, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%rdi, %rax
	jne	.L6
	movl	%ebx, %eax
	andl	$-4, %eax
	testb	$3, %bl
	je	.L8
	leal	(%r9,%rax), %edi
	movslq	%edi, %rdi
	movl	(%r8,%rdi,4), %r11d
	movslq	%eax, %rdi
	movl	%r11d, (%rsi,%rdi,4)
	leal	1(%rax), %edi
	cmpl	%edi, %ebx
	jle	.L8
	leal	(%r9,%rdi), %r11d
	addl	$2, %eax
	movslq	%edi, %rdi
	movslq	%r11d, %r11
	movl	(%r8,%r11,4), %r11d
	movl	%r11d, (%rsi,%rdi,4)
	cmpl	%eax, %ebx
	jle	.L8
	leal	(%r9,%rax), %edi
	cltq
	movslq	%edi, %rdi
	movl	(%r8,%rdi,4), %edi
	movl	%edi, (%rsi,%rax,4)
.L8:
	leaq	R(%rip), %rdi
	testl	%ecx, %ecx
	jle	.L4
	movslq	%r10d, %rax
	leaq	R(%rip), %rdi
	leaq	4(,%rax,4), %rax
	movq	%rdi, %r11
	leaq	(%r8,%rax), %rbp
	subq	%rbp, %r11
	cmpq	$8, %r11
	jbe	.L14
	leal	-1(%rcx), %r11d
	cmpl	$2, %r11d
	jbe	.L14
	movl	%ecx, %r11d
	leaq	-4(%r8,%rax), %rbp
	xorl	%eax, %eax
	shrl	$2, %r11d
	salq	$4, %r11
	.p2align 4,,10
	.p2align 3
.L15:
	movdqu	0(%rbp,%rax), %xmm1
	movaps	%xmm1, (%rdi,%rax)
	addq	$16, %rax
	cmpq	%r11, %rax
	jne	.L15
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L4
	leal	(%r10,%rax), %r11d
	movslq	%r11d, %r11
	movl	(%r8,%r11,4), %ebp
	movslq	%eax, %r11
	movl	%ebp, (%rdi,%r11,4)
	leal	1(%rax), %r11d
	cmpl	%r11d, %ecx
	jle	.L4
	leal	(%r10,%r11), %ebp
	addl	$2, %eax
	movslq	%r11d, %r11
	movslq	%ebp, %rbp
	movl	(%r8,%rbp,4), %ebp
	movl	%ebp, (%rdi,%r11,4)
	cmpl	%eax, %ecx
	jle	.L4
	addl	%eax, %r10d
	cltq
	movslq	%r10d, %r10
	movl	(%r8,%r10,4), %r10d
	movl	%r10d, (%rdi,%rax,4)
.L4:
	movslq	%ebx, %rax
	movslq	%ecx, %rcx
	movl	$1000000001, (%rsi,%rax,4)
	movl	$1000000001, (%rdi,%rcx,4)
	cmpl	%edx, %r9d
	jge	.L1
	subl	$1, %edx
	movslq	%r9d, %rcx
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	subl	%r9d, %edx
	leaq	(%r8,%rcx,4), %rax
	xorl	%r9d, %r9d
	addq	%rcx, %rdx
	leaq	4(%r8,%rdx,4), %rbp
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%rdi,%r10,4), %ecx
	movl	(%rsi,%r9,4), %edx
	cmpl	%ecx, %edx
	jle	.L19
.L42:
	movl	%ebx, %edx
	addq	$4, %rax
	addl	$1, %r11d
	subl	%r8d, %edx
	movslq	%edx, %rdx
	addq	%rdx, cnt(%rip)
	movl	%ecx, -4(%rax)
	cmpq	%rax, %rbp
	je	.L1
	movslq	%r11d, %r10
	movl	(%rsi,%r9,4), %edx
	movl	(%rdi,%r10,4), %ecx
	cmpl	%ecx, %edx
	jg	.L42
.L19:
	movl	%edx, (%rax)
	addq	$4, %rax
	addl	$1, %r8d
	cmpq	%rbp, %rax
	je	.L1
	movslq	%r8d, %r9
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	leaq	-4(%r8,%rax), %r11
	movl	%ecx, %ebp
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r11,%rax,4), %r10d
	movl	%r10d, (%rdi,%rax,4)
	addq	$1, %rax
	cmpq	%rbp, %rax
	jne	.L17
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	-4(%r8,%rax), %r11
	movl	%ebx, %ebp
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r11,%rax,4), %edi
	movl	%edi, (%rsi,%rax,4)
	addq	$1, %rax
	cmpq	%rbp, %rax
	jne	.L10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L41:
	leaq	L(%rip), %rsi
	jmp	.L8
	.cfi_endproc
.LFE23:
	.size	merge, .-merge
	.p2align 4
	.type	mergeSort.part.0, @function
mergeSort.part.0:
.LFB26:
	.cfi_startproc
	leal	(%rsi,%rdx), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%eax, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	shrl	$31, %r12d
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	addl	%eax, %r12d
	leal	1(%rsi), %eax
	sarl	%r12d
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%eax, %r12d
	jg	.L59
	leal	1(%r12), %eax
	cmpl	%eax, %r13d
	jg	.L60
.L51:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	%ebp, %esi
	popq	%rbx
	.cfi_def_cfa_offset 48
	movq	%r15, %rdi
	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
	jmp	merge
	.p2align 4,,10
	.p2align 3
.L59:
	.cfi_restore_state
	leal	(%rsi,%r12), %edx
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L61
	leal	1(%r14), %eax
	cmpl	%eax, %r12d
	jg	.L62
.L48:
	movl	%r12d, %ecx
	movl	%r14d, %edx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
	leal	1(%r12), %eax
	cmpl	%eax, %r13d
	jle	.L51
.L60:
	leal	0(%r13,%r12), %edx
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L63
.L52:
	leal	1(%r14), %eax
	cmpl	%eax, %r13d
	jg	.L64
.L55:
	movl	%r13d, %ecx
	movl	%r14d, %edx
	movl	%r12d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L61:
	leal	(%rsi,%r14), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L65
.L46:
	leal	1(%rbx), %eax
	cmpl	%eax, %r14d
	jg	.L66
.L47:
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
	leal	1(%r14), %eax
	cmpl	%eax, %r12d
	jle	.L48
.L62:
	leal	(%r12,%r14), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L67
.L49:
	leal	1(%rbx), %eax
	cmpl	%eax, %r12d
	jg	.L68
.L50:
	movl	%r12d, %ecx
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L64:
	leal	0(%r13,%r14), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L69
.L56:
	leal	1(%rbx), %eax
	cmpl	%eax, %r13d
	jg	.L70
.L57:
	movl	%r13d, %ecx
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L63:
	leal	(%r12,%r14), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L71
.L53:
	leal	1(%rbx), %eax
	cmpl	%eax, %r14d
	jg	.L72
.L54:
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movl	%r12d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L65:
	movl	%ebx, %edx
	call	mergeSort.part.0
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L68:
	movl	%r12d, %edx
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L67:
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L72:
	movl	%r14d, %edx
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L71:
	movl	%ebx, %edx
	movl	%r12d, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L70:
	movl	%r13d, %edx
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L69:
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L66:
	movl	%r14d, %edx
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L47
	.cfi_endproc
.LFE26:
	.size	mergeSort.part.0, .-mergeSort.part.0
	.p2align 4
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB24:
	.cfi_startproc
	endbr64
	leal	1(%rsi), %eax
	cmpl	%edx, %eax
	jl	.L84
	ret
	.p2align 4,,10
	.p2align 3
.L84:
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	leal	(%rsi,%rdx), %edx
	movl	%edx, %r13d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	shrl	$31, %r13d
	addl	%edx, %r13d
	sarl	%r13d
	cmpl	%r13d, %eax
	jl	.L85
	leal	1(%r13), %eax
	cmpl	%eax, %r12d
	jg	.L86
.L78:
	movl	%r12d, %ecx
	movl	%r13d, %edx
	movl	%ebp, %esi
	movq	%r14, %rdi
	popq	%rbp
	.cfi_remember_state
	.cfi_restore 6
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_restore 13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_restore 14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_restore 15
	.cfi_def_cfa_offset 8
	jmp	merge
	.p2align 4,,10
	.p2align 3
.L85:
	.cfi_restore_state
	leal	(%rsi,%r13), %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	cmpl	%r15d, %eax
	jl	.L87
.L76:
	leal	1(%r15), %eax
	cmpl	%eax, %r13d
	jg	.L88
.L77:
	movl	%r13d, %ecx
	movl	%r15d, %edx
	movl	%ebp, %esi
	movq	%r14, %rdi
	call	merge
	leal	1(%r13), %eax
	cmpl	%eax, %r12d
	jle	.L78
.L86:
	leal	(%r12,%r13), %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	cmpl	%r15d, %eax
	jl	.L89
.L79:
	leal	1(%r15), %eax
	cmpl	%eax, %r12d
	jg	.L90
.L80:
	movl	%r12d, %ecx
	movl	%r15d, %edx
	movl	%r13d, %esi
	movq	%r14, %rdi
	call	merge
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L87:
	movl	%r15d, %edx
	call	mergeSort.part.0
	jmp	.L76
	.p2align 4,,10
	.p2align 3
.L90:
	movl	%r12d, %edx
	movl	%r15d, %esi
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L89:
	movl	%r15d, %edx
	movl	%r13d, %esi
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L88:
	movl	%r13d, %edx
	movl	%r15d, %esi
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L77
	.cfi_endproc
.LFE24:
	.size	mergeSort, .-mergeSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1048576(%rsp), %r11
	.cfi_def_cfa 11, 1048616
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$40, %rsp
	.cfi_def_cfa_offset 1048656
	movl	$1048576, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 1048600(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L92
	movq	%r13, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L93:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L93
	cmpl	$1, %edx
	jle	.L92
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	mergeSort.part.0
.L92:
	movq	cnt(%rip), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	1048600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L97
	addq	$1048616, %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
.L97:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 8
	.type	cnt, @object
	.size	cnt, 8
cnt:
	.zero	8
	.globl	R
	.align 32
	.type	R, @object
	.size	R, 524288
R:
	.zero	524288
	.globl	L
	.align 32
	.type	L, @object
	.size	L, 524288
L:
	.zero	524288
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %r10d
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%ecx, %edx
	movq	%rdi, %r8
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	%r10d, %ebx
	movl	%esi, %r9d
	subl	%r10d, %ecx
	subl	%esi, %ebx
	testl	%ebx, %ebx
	jle	.L41
	movslq	%esi, %rax
	leaq	L(%rip), %rsi
	leaq	4(,%rax,4), %rax
	leaq	(%rdi,%rax), %r11
	movq	%rsi, %rdi
	subq	%r11, %rdi
	cmpq	$8, %rdi
	jbe	.L5
	leal	-1(%rbx), %edi
	cmpl	$2, %edi
	jbe	.L5
	movl	%ebx, %edi
	leaq	-4(%r8,%rax), %r11
	xorl	%eax, %eax
	shrl	$2, %edi
	salq	$4, %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	(%r11,%rax), %xmm0
	movaps	%xmm0, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%rdi, %rax
	jne	.L6
	movl	%ebx, %eax
	andl	$-4, %eax
	testb	$3, %bl
	je	.L8
	leal	(%r9,%rax), %edi
	movslq	%edi, %rdi
	movl	(%r8,%rdi,4), %r11d
	movslq	%eax, %rdi
	movl	%r11d, (%rsi,%rdi,4)
	leal	1(%rax), %edi
	cmpl	%edi, %ebx
	jle	.L8
	leal	(%r9,%rdi), %r11d
	addl	$2, %eax
	movslq	%edi, %rdi
	movslq	%r11d, %r11
	movl	(%r8,%r11,4), %r11d
	movl	%r11d, (%rsi,%rdi,4)
	cmpl	%eax, %ebx
	jle	.L8
	leal	(%r9,%rax), %edi
	cltq
	movslq	%edi, %rdi
	movl	(%r8,%rdi,4), %edi
	movl	%edi, (%rsi,%rax,4)
.L8:
	leaq	R(%rip), %rdi
	testl	%ecx, %ecx
	jle	.L4
	movslq	%r10d, %rax
	leaq	R(%rip), %rdi
	leaq	4(,%rax,4), %rax
	movq	%rdi, %r11
	leaq	(%r8,%rax), %rbp
	subq	%rbp, %r11
	cmpq	$8, %r11
	jbe	.L14
	leal	-1(%rcx), %r11d
	cmpl	$2, %r11d
	jbe	.L14
	movl	%ecx, %r11d
	leaq	-4(%r8,%rax), %rbp
	xorl	%eax, %eax
	shrl	$2, %r11d
	salq	$4, %r11
	.p2align 4,,10
	.p2align 3
.L15:
	movdqu	0(%rbp,%rax), %xmm1
	movaps	%xmm1, (%rdi,%rax)
	addq	$16, %rax
	cmpq	%r11, %rax
	jne	.L15
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L4
	leal	(%r10,%rax), %r11d
	movslq	%r11d, %r11
	movl	(%r8,%r11,4), %ebp
	movslq	%eax, %r11
	movl	%ebp, (%rdi,%r11,4)
	leal	1(%rax), %r11d
	cmpl	%r11d, %ecx
	jle	.L4
	leal	(%r10,%r11), %ebp
	addl	$2, %eax
	movslq	%r11d, %r11
	movslq	%ebp, %rbp
	movl	(%r8,%rbp,4), %ebp
	movl	%ebp, (%rdi,%r11,4)
	cmpl	%eax, %ecx
	jle	.L4
	addl	%eax, %r10d
	cltq
	movslq	%r10d, %r10
	movl	(%r8,%r10,4), %r10d
	movl	%r10d, (%rdi,%rax,4)
.L4:
	movslq	%ebx, %rax
	movslq	%ecx, %rcx
	movl	$1000000001, (%rsi,%rax,4)
	movl	$1000000001, (%rdi,%rcx,4)
	cmpl	%edx, %r9d
	jge	.L1
	subl	$1, %edx
	movslq	%r9d, %rcx
	xorl	%r11d, %r11d
	xorl	%r10d, %r10d
	subl	%r9d, %edx
	leaq	(%r8,%rcx,4), %rax
	xorl	%r9d, %r9d
	addq	%rcx, %rdx
	leaq	4(%r8,%rdx,4), %rbp
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%rdi,%r10,4), %ecx
	movl	(%rsi,%r9,4), %edx
	cmpl	%ecx, %edx
	jle	.L19
.L42:
	movl	%ebx, %edx
	addq	$4, %rax
	addl	$1, %r11d
	subl	%r8d, %edx
	movslq	%edx, %rdx
	addq	%rdx, cnt(%rip)
	movl	%ecx, -4(%rax)
	cmpq	%rax, %rbp
	je	.L1
	movslq	%r11d, %r10
	movl	(%rsi,%r9,4), %edx
	movl	(%rdi,%r10,4), %ecx
	cmpl	%ecx, %edx
	jg	.L42
.L19:
	movl	%edx, (%rax)
	addq	$4, %rax
	addl	$1, %r8d
	cmpq	%rbp, %rax
	je	.L1
	movslq	%r8d, %r9
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	leaq	-4(%r8,%rax), %r11
	movl	%ecx, %ebp
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r11,%rax,4), %r10d
	movl	%r10d, (%rdi,%rax,4)
	addq	$1, %rax
	cmpq	%rbp, %rax
	jne	.L17
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	-4(%r8,%rax), %r11
	movl	%ebx, %ebp
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r11,%rax,4), %edi
	movl	%edi, (%rsi,%rax,4)
	addq	$1, %rax
	cmpq	%rbp, %rax
	jne	.L10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L41:
	leaq	L(%rip), %rsi
	jmp	.L8
	.cfi_endproc
.LFE23:
	.size	merge, .-merge
	.p2align 4
	.type	mergeSort.part.0, @function
mergeSort.part.0:
.LFB26:
	.cfi_startproc
	leal	(%rsi,%rdx), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%eax, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	shrl	$31, %r12d
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	addl	%eax, %r12d
	leal	1(%rsi), %eax
	sarl	%r12d
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%eax, %r12d
	jg	.L59
	leal	1(%r12), %eax
	cmpl	%eax, %r13d
	jg	.L60
.L51:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	%ebp, %esi
	popq	%rbx
	.cfi_def_cfa_offset 48
	movq	%r15, %rdi
	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
	jmp	merge
	.p2align 4,,10
	.p2align 3
.L59:
	.cfi_restore_state
	leal	(%rsi,%r12), %edx
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L61
	leal	1(%r14), %eax
	cmpl	%eax, %r12d
	jg	.L62
.L48:
	movl	%r12d, %ecx
	movl	%r14d, %edx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
	leal	1(%r12), %eax
	cmpl	%eax, %r13d
	jle	.L51
.L60:
	leal	0(%r13,%r12), %edx
	movl	%edx, %r14d
	shrl	$31, %r14d
	addl	%edx, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jl	.L63
.L52:
	leal	1(%r14), %eax
	cmpl	%eax, %r13d
	jg	.L64
.L55:
	movl	%r13d, %ecx
	movl	%r14d, %edx
	movl	%r12d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L61:
	leal	(%rsi,%r14), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L65
.L46:
	leal	1(%rbx), %eax
	cmpl	%eax, %r14d
	jg	.L66
.L47:
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
	leal	1(%r14), %eax
	cmpl	%eax, %r12d
	jle	.L48
.L62:
	leal	(%r12,%r14), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L67
.L49:
	leal	1(%rbx), %eax
	cmpl	%eax, %r12d
	jg	.L68
.L50:
	movl	%r12d, %ecx
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L64:
	leal	0(%r13,%r14), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L69
.L56:
	leal	1(%rbx), %eax
	cmpl	%eax, %r13d
	jg	.L70
.L57:
	movl	%r13d, %ecx
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L63:
	leal	(%r12,%r14), %edx
	movl	%edx, %ebx
	shrl	$31, %ebx
	addl	%edx, %ebx
	sarl	%ebx
	cmpl	%ebx, %eax
	jl	.L71
.L53:
	leal	1(%rbx), %eax
	cmpl	%eax, %r14d
	jg	.L72
.L54:
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movl	%r12d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L65:
	movl	%ebx, %edx
	call	mergeSort.part.0
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L68:
	movl	%r12d, %edx
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L67:
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L72:
	movl	%r14d, %edx
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L71:
	movl	%ebx, %edx
	movl	%r12d, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L70:
	movl	%r13d, %edx
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L69:
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L66:
	movl	%r14d, %edx
	movl	%ebx, %esi
	movq	%r15, %rdi
	call	mergeSort.part.0
	jmp	.L47
	.cfi_endproc
.LFE26:
	.size	mergeSort.part.0, .-mergeSort.part.0
	.p2align 4
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB24:
	.cfi_startproc
	endbr64
	leal	1(%rsi), %eax
	cmpl	%edx, %eax
	jl	.L84
	ret
	.p2align 4,,10
	.p2align 3
.L84:
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	leal	(%rsi,%rdx), %edx
	movl	%edx, %r13d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	shrl	$31, %r13d
	addl	%edx, %r13d
	sarl	%r13d
	cmpl	%r13d, %eax
	jl	.L85
	leal	1(%r13), %eax
	cmpl	%eax, %r12d
	jg	.L86
.L78:
	movl	%r12d, %ecx
	movl	%r13d, %edx
	movl	%ebp, %esi
	movq	%r14, %rdi
	popq	%rbp
	.cfi_remember_state
	.cfi_restore 6
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_restore 13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_restore 14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_restore 15
	.cfi_def_cfa_offset 8
	jmp	merge
	.p2align 4,,10
	.p2align 3
.L85:
	.cfi_restore_state
	leal	(%rsi,%r13), %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	cmpl	%r15d, %eax
	jl	.L87
.L76:
	leal	1(%r15), %eax
	cmpl	%eax, %r13d
	jg	.L88
.L77:
	movl	%r13d, %ecx
	movl	%r15d, %edx
	movl	%ebp, %esi
	movq	%r14, %rdi
	call	merge
	leal	1(%r13), %eax
	cmpl	%eax, %r12d
	jle	.L78
.L86:
	leal	(%r12,%r13), %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	cmpl	%r15d, %eax
	jl	.L89
.L79:
	leal	1(%r15), %eax
	cmpl	%eax, %r12d
	jg	.L90
.L80:
	movl	%r12d, %ecx
	movl	%r15d, %edx
	movl	%r13d, %esi
	movq	%r14, %rdi
	call	merge
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L87:
	movl	%r15d, %edx
	call	mergeSort.part.0
	jmp	.L76
	.p2align 4,,10
	.p2align 3
.L90:
	movl	%r12d, %edx
	movl	%r15d, %esi
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L89:
	movl	%r15d, %edx
	movl	%r13d, %esi
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L88:
	movl	%r13d, %edx
	movl	%r15d, %esi
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L77
	.cfi_endproc
.LFE24:
	.size	mergeSort, .-mergeSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-1048576(%rsp), %r11
	.cfi_def_cfa 11, 1048616
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$40, %rsp
	.cfi_def_cfa_offset 1048656
	movl	$1048576, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 1048600(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L92
	movq	%r13, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L93:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L93
	cmpl	$1, %edx
	jle	.L92
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	mergeSort.part.0
.L92:
	movq	cnt(%rip), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	1048600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L97
	addq	$1048616, %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
.L97:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 8
	.type	cnt, @object
	.size	cnt, 8
cnt:
	.zero	8
	.globl	R
	.align 32
	.type	R, @object
	.size	R, 524288
R:
	.zero	524288
	.globl	L
	.align 32
	.type	L, @object
	.size	L, 524288
L:
	.zero	524288
	.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 N 262144
#define HALFN 131072 // 2^17
#define INFTY 1000000001 // 10^9 + 1

int L[HALFN] = {0}, R[HALFN] = {0};
long cnt = 0;

/* void swap(int *x, int *y) { */
/*   int tmp; */

/*   tmp = *x; */
/*   *x = *y; */
/*   *y = tmp; */
/* } */

/* int bubbleSort(int n, int *A) { */
/*   int i, j; */

/*   for (i = 0; i < n; i++) { */
/*     for (j = n - 1; i < j; j--) { */
/*       if (A[j] < A[j-1]) { */
/* 	swap(&A[j], &A[j-1]); */
/* 	cnt++; */
/*       } */
/*     } */
/*   } */
/*   return cnt; */
/* } */
	
void merge(int *A, int left, int mid, int right) {
  int i, j, k, n1, n2;
  
  n1 = mid - left;
  n2 = right - mid;

  for (i = 0; i < n1; i++)
    L[i] = A[left + i];
  for (i = 0; i < n2; i++)
    R[i] = A[mid + i];
  L[n1] = INFTY;
  R[n2] = INFTY;

  /* // count the number of inversions */
  /* for (j = 0; j < n2; j++) { */
  /*   for (i = 0; i < n1; i++) { */
  /*     if (R[j] < L[i]) { */
  /* 	cnt += (n1 - i); */
  /* 	break; */
  /*     } */
  /*   } */
  /* } */
  
  // sort array
  for (i = 0, j = 0, k = left; k < right; k++) {
    if (R[j] < L[i]) {
      cnt += (n1 - i);
      A[k] = R[j];
      j++;
    }
    else {
      A[k] = L[i];
      i++;
    }
  }
}

void mergeSort(int *A, int left, int right) {
  int mid;
  
  if ((left + 1) < right) {
    mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main(void){
  int i, n, A[N] = {0};

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

  mergeSort(A, 0, n);
  printf("%ld\n", cnt);
  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 N 262144
#define HALFN 131072 // 2^17
#define INFTY 1000000001 // 10^9 + 1

int L[HALFN] = {0}, R[HALFN] = {0};
long cnt = 0;

/* void swap(int *x, int *y) { */
/*   int tmp; */

/*   tmp = *x; */
/*   *x = *y; */
/*   *y = tmp; */
/* } */

/* int bubbleSort(int n, int *A) { */
/*   int i, j; */

/*   for (i = 0; i < n; i++) { */
/*     for (j = n - 1; i < j; j--) { */
/*       if (A[j] < A[j-1]) { */
/* 	swap(&A[j], &A[j-1]); */
/* 	cnt++; */
/*       } */
/*     } */
/*   } */
/*   return cnt; */
/* } */
	
void merge(int *A, int left, int mid, int right) {
  int i, j, k, n1, n2;
  
  n1 = mid - left;
  n2 = right - mid;

  for (i = 0; i < n1; i++)
    L[i] = A[left + i];
  for (i = 0; i < n2; i++)
    R[i] = A[mid + i];
  L[n1] = INFTY;
  R[n2] = INFTY;

  /* // count the number of inversions */
  /* for (j = 0; j < n2; j++) { */
  /*   for (i = 0; i < n1; i++) { */
  /*     if (R[j] < L[i]) { */
  /* 	cnt += (n1 - i); */
  /* 	break; */
  /*     } */
  /*   } */
  /* } */
  
  // sort array
  for (i = 0, j = 0, k = left; k < right; k++) {
    if (R[j] < L[i]) {
      cnt += (n1 - i);
      A[k] = R[j];
      j++;
    }
    else {
      A[k] = L[i];
      i++;
    }
  }
}

void mergeSort(int *A, int left, int right) {
  int mid;
  
  if ((left + 1) < right) {
    mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main(void){
  int i, n, A[N] = {0};

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

  mergeSort(A, 0, n);
  printf("%ld\n", cnt);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	L
	.bss
	.align 32
	.type	L, @object
	.size	L, 524288
L:
	.zero	524288
	.globl	R
	.align 32
	.type	R, @object
	.size	R, 524288
R:
	.zero	524288
	.globl	cnt
	.align 8
	.type	cnt, @object
	.size	cnt, 8
cnt:
	.zero	8
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	%ecx, -52(%rbp)
	movl	-48(%rbp), %eax
	subl	-44(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-52(%rbp), %eax
	subl	-48(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L3
	movl	$0, -20(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L5
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	$1000000001, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$1000000001, (%rdx,%rax)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-8(%rbp), %eax
	subl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	cnt(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, cnt(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -16(%rbp)
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -20(%rbp)
.L8:
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB1:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jle	.L12
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergeSort
	movl	-32(%rbp), %edx
	movl	-4(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergeSort
	movl	-32(%rbp), %ecx
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	merge
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	mergeSort, .-mergeSort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1048576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1048592(%rbp), %rax
	movl	$1048576, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-1048600(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1048596(%rbp)
	jmp	.L14
.L15:
	leaq	-1048592(%rbp), %rdx
	movl	-1048596(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1048596(%rbp)
.L14:
	movl	-1048600(%rbp), %eax
	cmpl	%eax, -1048596(%rbp)
	jl	.L15
	movl	-1048600(%rbp), %edx
	leaq	-1048592(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergeSort
	movq	cnt(%rip), %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	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	L
	.bss
	.align 32
	.type	L, @object
	.size	L, 524288
L:
	.zero	524288
	.globl	R
	.align 32
	.type	R, @object
	.size	R, 524288
R:
	.zero	524288
	.globl	cnt
	.align 8
	.type	cnt, @object
	.size	cnt, 8
cnt:
	.zero	8
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	%ecx, -52(%rbp)
	movl	-48(%rbp), %eax
	subl	-44(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-52(%rbp), %eax
	subl	-48(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	L(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L3
	movl	$0, -20(%rbp)
	jmp	.L4
.L5:
	movl	-48(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L5
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	L(%rip), %rax
	movl	$1000000001, (%rdx,%rax)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	$1000000001, (%rdx,%rax)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L9:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-8(%rbp), %eax
	subl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	cnt(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, cnt(%rip)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	R(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -16(%rbp)
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	L(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -20(%rbp)
.L8:
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L9
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB1:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jle	.L12
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergeSort
	movl	-32(%rbp), %edx
	movl	-4(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergeSort
	movl	-32(%rbp), %ecx
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	merge
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	mergeSort, .-mergeSort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-1048576(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1048592(%rbp), %rax
	movl	$1048576, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-1048600(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1048596(%rbp)
	jmp	.L14
.L15:
	leaq	-1048592(%rbp), %rdx
	movl	-1048596(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1048596(%rbp)
.L14:
	movl	-1048600(%rbp), %eax
	cmpl	%eax, -1048596(%rbp)
	jl	.L15
	movl	-1048600(%rbp), %edx
	leaq	-1048592(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergeSort
	movq	cnt(%rip), %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	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
