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>
void merge(long long int arr[],long long int l,long long int m,long long int r)
{
    long long int i, j, k;
    long long int n1 = m - l + 1;
    long long int n2 = r - m;

    /* create temp arrays */
    long long int L[n1], R[n2];

    /* Copy data to temp arrays L[] and R[] */
    for (i = 0; i < n1; i++)
        L[i] = arr[l + i];
    for (j = 0; j < n2; j++)
        R[j] = arr[m + 1 + j];

    /* Merge the temp arrays back into arr[l..r]*/
    i = 0; // Initial index of first subarray
    j = 0; // Initial index of second subarray
    k = l; // Initial index of merged subarray
    while (i < n1 && j < n2) {
        if (L[i] <= R[j]) {
            arr[k] = L[i];
            i++;
        }
        else {
            arr[k] = R[j];
            j++;
        }
        k++;
    }

    /* Copy the remaining elements of L[], if there
       are any */
    while (i < n1) {
        arr[k] = L[i];
        i++;
        k++;
    }

    /* Copy the remaining elements of R[], if there
       are any */
    while (j < n2) {
        arr[k] = R[j];
        j++;
        k++;
    }
}

/* l is for left index and r is right index of the
   sub-array of arr to be sorted */
void mergeSort(long long int arr[],long long int l,long long int r)
{
    if (l < r) {
        // Same as (l+r)/2, but avoids overflow for
        // large l and h
        long long int m = l + (r - l) / 2;

        // Sort first and second halves
        mergeSort(arr, l, m);
        mergeSort(arr, m + 1, r);

        merge(arr, l, m, r);
    }
}
int main()
{
    long long int n;
    scanf("%lld",&n);
    long long int ans=0;
    long long int* arr;
    arr=(long long int*)malloc(n*sizeof(long long int));
    for(long long int i=0;i<n;i++)
    {
        scanf("%lld",&arr[i]);
    }
    mergeSort(arr,0,n-1);
    ans+=arr[n-1];
    long long int x=n-2;
    long long int count=n-2;
    for(;;)
    {
        if(count==0)
        {
            break;
        }
        if(count!=1){
            ans+=2*arr[x];
            count-=2;
            x--;
        }
        else{
            ans+=arr[x];
            count--;
        }
    }
    printf("%lld",ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	subq	$112, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	movq	%rdi, -120(%rbp)
	movq	%rsi, -128(%rbp)
	movq	%rdx, -136(%rbp)
	movq	%rcx, -144(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rsi
	movq	-136(%rbp), %rax
	subq	-128(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -88(%rbp)
	movq	-144(%rbp), %rax
	subq	-136(%rbp), %rax
	movq	%rax, -80(%rbp)
	movq	-88(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	-80(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -56(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r10
	movl	$0, %r11d
	movq	%rax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L8
.L9:
	movq	-128(%rbp), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -112(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jl	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-136(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -104(%rbp)
.L10:
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L11
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	-128(%rbp), %rax
	movq	%rax, -96(%rbp)
	jmp	.L12
.L16:
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jg	.L13
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -112(%rbp)
	jmp	.L14
.L13:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -104(%rbp)
.L14:
	addq	$1, -96(%rbp)
.L12:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jge	.L17
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L16
	jmp	.L17
.L18:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -112(%rbp)
	addq	$1, -96(%rbp)
.L17:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jl	.L18
	jmp	.L19
.L20:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -104(%rbp)
	addq	$1, -96(%rbp)
.L19:
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L20
	movq	%rsi, %rsp
	nop
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leaq	-32(%rbp), %rsp
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB7:
	.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
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jge	.L24
	movq	-40(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-32(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	mergeSort
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	mergeSort
	movq	-40(%rbp), %rcx
	movq	-8(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	merge
.L24:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mergeSort, .-mergeSort
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -48(%rbp)
	movq	-56(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	$0, -40(%rbp)
	jmp	.L26
.L27:
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -40(%rbp)
.L26:
	movq	-56(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L27
	movq	-56(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergeSort
	movq	-56(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -48(%rbp)
	movq	-56(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -24(%rbp)
.L32:
	cmpq	$0, -24(%rbp)
	je	.L36
	cmpq	$1, -24(%rbp)
	je	.L30
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, %rax
	addq	%rax, -48(%rbp)
	subq	$2, -24(%rbp)
	subq	$1, -32(%rbp)
	jmp	.L32
.L30:
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -48(%rbp)
	subq	$1, -24(%rbp)
	jmp	.L32
.L36:
	nop
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdx, %r9
	subq	%rsi, %r9
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	movq	%rdi, %r14
	pushq	%r13
	.cfi_offset 13, -40
	movq	%rcx, %r13
	leaq	1(%r9), %rcx
	pushq	%r12
	subq	%rdx, %r13
	.cfi_offset 12, -48
	movq	%rdx, %r12
	pushq	%rbx
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$56, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	23(,%r9,8), %rax
	movq	%rsp, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L40:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L40
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L41
.L4:
	leaq	0(,%r13,8), %r15
	movq	%rsp, %rsi
	movq	%rsp, %r10
	leaq	15(%r15), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L6
.L42:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L42
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L43
.L7:
	movq	%rsp, %r8
	testq	%rcx, %rcx
	jle	.L44
	leaq	0(,%rcx,8), %rdx
	movq	%r10, %rdi
	leaq	(%r14,%rbx,8), %rsi
	movq	%r8, -88(%rbp)
	movq	%r9, -80(%rbp)
	movq	%rcx, -72(%rbp)
	call	memcpy@PLT
	testq	%r13, %r13
	movq	-72(%rbp), %rcx
	movq	-80(%rbp), %r9
	movq	-88(%rbp), %r8
	movq	%rax, %r10
	jle	.L10
	leaq	8(%r14,%r12,8), %rsi
	movq	%r15, %rdx
	movq	%r8, %rdi
	movq	%rcx, -88(%rbp)
	movq	%r9, -72(%rbp)
	xorl	%r12d, %r12d
	movq	%rax, -80(%rbp)
	call	memcpy@PLT
	movq	-80(%rbp), %r10
	movq	-72(%rbp), %r9
	movq	%rax, %r8
	movq	-88(%rbp), %rcx
	xorl	%eax, %eax
	movq	(%r10), %rsi
	movq	(%r8), %rdx
	.p2align 4,,10
	.p2align 3
.L17:
	cmpq	%rdx, %rsi
	jg	.L14
.L45:
	movq	%rsi, (%r14,%rbx,8)
	leaq	1(%rax), %r15
	addq	$1, %rbx
	cmpq	%rax, %r9
	jle	.L12
	cmpq	%r12, %r13
	jle	.L12
	movq	(%r10,%r15,8), %rsi
	movq	%r15, %rax
	cmpq	%rdx, %rsi
	jle	.L45
.L14:
	movq	%rdx, (%r14,%rbx,8)
	addq	$1, %r12
	addq	$1, %rbx
	cmpq	%rax, %rcx
	jle	.L22
	cmpq	%r12, %r13
	jle	.L22
	movq	(%r8,%r12,8), %rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L41:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rax, %r15
.L12:
	cmpq	%r15, %rcx
	jle	.L18
	movq	%rcx, %rdx
	leaq	(%r14,%rbx,8), %rdi
	leaq	(%r10,%r15,8), %rsi
	movq	%r8, -80(%rbp)
	subq	%r15, %rdx
	movq	%rcx, -72(%rbp)
	salq	$3, %rdx
	call	memcpy@PLT
	movq	-72(%rbp), %rcx
	movq	-80(%rbp), %r8
	addq	%rbx, %rcx
	subq	%r15, %rcx
	movq	%rcx, %rbx
.L18:
	cmpq	%r12, %r13
	jle	.L1
.L13:
	subq	%r12, %r13
	leaq	(%r14,%rbx,8), %rdi
	leaq	(%r8,%r12,8), %rsi
	leaq	0(,%r13,8), %rdx
	call	memcpy@PLT
.L1:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L46
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L44:
	.cfi_restore_state
	testq	%r13, %r13
	jle	.L10
	leaq	8(%r14,%r12,8), %rsi
	movq	%r8, %rdi
	movq	%r15, %rdx
	xorl	%r12d, %r12d
	call	memcpy@PLT
	movq	%rax, %r8
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	.L12
.L43:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	merge, .-merge
	.p2align 4
	.type	mergeSort.part.0, @function
mergeSort.part.0:
.LFB42:
	.cfi_startproc
	movq	%rdx, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	subq	%rsi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rax, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	sarq	%r13
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%rsi, %r13
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpq	%r13, %rsi
	jl	.L63
	leaq	1(%r13), %r14
	cmpq	%r14, %r12
	jg	.L64
.L55:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	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
	jmp	merge
	.p2align 4,,10
	.p2align 3
.L63:
	.cfi_restore_state
	movq	%rax, %r15
	sarq	$2, %r15
	addq	%rsi, %r15
	cmpq	%r15, %rsi
	jl	.L65
	leaq	1(%r15), %r14
	cmpq	%r14, %r13
	jg	.L66
.L52:
	movq	%r13, %rcx
	movq	%r15, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	merge
	leaq	1(%r13), %r14
	cmpq	%r14, %r12
	jle	.L55
.L64:
	movq	%r12, %rax
	subq	%r14, %rax
	movq	%rax, %r15
	sarq	%r15
	addq	%r14, %r15
	cmpq	%r15, %r14
	jl	.L67
.L56:
	leaq	1(%r15), %r8
	cmpq	%r8, %r12
	jg	.L68
.L59:
	movq	%r12, %rcx
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	merge
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L65:
	sarq	$3, %rax
	leaq	(%rax,%rsi), %r14
	cmpq	%r14, %rsi
	jl	.L69
.L50:
	leaq	1(%r14), %rsi
	cmpq	%rsi, %r15
	jg	.L70
.L51:
	movq	%r14, %rdx
	movq	%r15, %rcx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	merge
	leaq	1(%r15), %r14
	cmpq	%r14, %r13
	jle	.L52
.L66:
	movq	%r13, %r8
	subq	%r14, %r8
	sarq	%r8
	addq	%r14, %r8
	cmpq	%r8, %r14
	jl	.L71
.L53:
	leaq	1(%r8), %rsi
	cmpq	%rsi, %r13
	jg	.L72
.L54:
	movq	%r13, %rcx
	movq	%r8, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	merge
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L68:
	movq	%r12, %r9
	subq	%r8, %r9
	sarq	%r9
	addq	%r8, %r9
	cmpq	%r9, %r8
	jl	.L73
.L60:
	leaq	1(%r9), %rsi
	cmpq	%rsi, %r12
	jg	.L74
.L61:
	movq	%r12, %rcx
	movq	%r9, %rdx
	movq	%r8, %rsi
	movq	%rbx, %rdi
	call	merge
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L67:
	sarq	$2, %rax
	leaq	(%rax,%r14), %r8
	cmpq	%r8, %r14
	jl	.L75
.L57:
	leaq	1(%r8), %rsi
	cmpq	%rsi, %r15
	jg	.L76
.L58:
	movq	%r15, %rcx
	movq	%r8, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	merge
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L69:
	movq	%r14, %rdx
	call	mergeSort.part.0
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %r8
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L71:
	movq	%r8, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %r8
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L76:
	movq	%r15, %rdx
	movq	%rbx, %rdi
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %r8
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L75:
	movq	%r8, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %r8
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L74:
	movq	%r12, %rdx
	movq	%rbx, %rdi
	movq	%r9, 8(%rsp)
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	8(%rsp), %r9
	movq	(%rsp), %r8
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L73:
	movq	%r9, %rdx
	movq	%r8, %rsi
	movq	%rbx, %rdi
	movq	%r9, 8(%rsp)
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	8(%rsp), %r9
	movq	(%rsp), %r8
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L70:
	movq	%r15, %rdx
	movq	%rbx, %rdi
	call	mergeSort.part.0
	jmp	.L51
	.cfi_endproc
.LFE42:
	.size	mergeSort.part.0, .-mergeSort.part.0
	.p2align 4
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB40:
	.cfi_startproc
	endbr64
	cmpq	%rdx, %rsi
	jl	.L88
	ret
	.p2align 4,,10
	.p2align 3
.L88:
	movq	%rdx, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	subq	%rsi, %rax
	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
	movq	%rax, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	sarq	%r13
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%rsi, %r13
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpq	%r13, %rsi
	jl	.L89
	leaq	1(%r13), %r15
	cmpq	%r15, %r12
	jg	.L90
.L82:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 48
	movq	%r14, %rdi
	popq	%rbp
	.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
.L89:
	.cfi_restore_state
	sarq	$2, %rax
	leaq	(%rax,%rsi), %r15
	cmpq	%r15, %rsi
	jl	.L91
.L80:
	leaq	1(%r15), %rsi
	cmpq	%rsi, %r13
	jg	.L92
.L81:
	movq	%r15, %rdx
	movq	%r13, %rcx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	merge
	leaq	1(%r13), %r15
	cmpq	%r15, %r12
	jle	.L82
.L90:
	movq	%r12, %rbx
	subq	%r15, %rbx
	sarq	%rbx
	addq	%r15, %rbx
	cmpq	%rbx, %r15
	jl	.L93
.L83:
	leaq	1(%rbx), %rsi
	cmpq	%rsi, %r12
	jg	.L94
.L84:
	movq	%r12, %rcx
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	merge
	jmp	.L82
	.p2align 4,,10
	.p2align 3
.L91:
	movq	%r15, %rdx
	call	mergeSort.part.0
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L94:
	movq	%r12, %rdx
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L93:
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L83
	.p2align 4,,10
	.p2align 3
.L92:
	movq	%r13, %rdx
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L81
	.cfi_endproc
.LFE40:
	.size	mergeSort, .-mergeSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbx
	leaq	0(,%rbx,8), %rdi
	call	malloc@PLT
	movq	%rax, %r13
	testq	%rbx, %rbx
	jle	.L96
	movq	%rax, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L97:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbx
	addq	$8, %r12
	cmpq	%rbp, %rbx
	jg	.L97
.L96:
	leaq	-1(%rbx), %rdx
	testq	%rdx, %rdx
	jg	.L118
.L98:
	movq	%rbx, %rax
	movq	-8(%r13,%rbx,8), %r8
	subq	$2, %rax
	je	.L99
	movq	%rax, %rdx
	cmpq	$1, %rax
	je	.L101
	.p2align 4,,10
	.p2align 3
.L100:
	movq	0(%r13,%rdx,8), %rcx
	subq	$1, %rdx
	leaq	(%r8,%rcx,2), %r8
	subq	$2, %rax
	je	.L99
	cmpq	$1, %rax
	jne	.L100
.L101:
	addq	0(%r13,%rdx,8), %r8
.L99:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L119
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L118:
	.cfi_restore_state
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	mergeSort.part.0
	jmp	.L98
.L119:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdx, %r9
	subq	%rsi, %r9
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	movq	%rdi, %r14
	pushq	%r13
	.cfi_offset 13, -40
	movq	%rcx, %r13
	leaq	1(%r9), %rcx
	pushq	%r12
	subq	%rdx, %r13
	.cfi_offset 12, -48
	movq	%rdx, %r12
	pushq	%rbx
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$56, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	23(,%r9,8), %rax
	movq	%rsp, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L40:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L40
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L41
.L4:
	leaq	0(,%r13,8), %r15
	movq	%rsp, %rsi
	movq	%rsp, %r10
	leaq	15(%r15), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L6
.L42:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L42
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L43
.L7:
	movq	%rsp, %r8
	testq	%rcx, %rcx
	jle	.L44
	leaq	0(,%rcx,8), %rdx
	movq	%r10, %rdi
	leaq	(%r14,%rbx,8), %rsi
	movq	%r8, -88(%rbp)
	movq	%r9, -80(%rbp)
	movq	%rcx, -72(%rbp)
	call	memcpy@PLT
	testq	%r13, %r13
	movq	-72(%rbp), %rcx
	movq	-80(%rbp), %r9
	movq	-88(%rbp), %r8
	movq	%rax, %r10
	jle	.L10
	leaq	8(%r14,%r12,8), %rsi
	movq	%r15, %rdx
	movq	%r8, %rdi
	movq	%rcx, -88(%rbp)
	movq	%r9, -72(%rbp)
	xorl	%r12d, %r12d
	movq	%rax, -80(%rbp)
	call	memcpy@PLT
	movq	-80(%rbp), %r10
	movq	-72(%rbp), %r9
	movq	%rax, %r8
	movq	-88(%rbp), %rcx
	xorl	%eax, %eax
	movq	(%r10), %rsi
	movq	(%r8), %rdx
	.p2align 4,,10
	.p2align 3
.L17:
	cmpq	%rdx, %rsi
	jg	.L14
.L45:
	movq	%rsi, (%r14,%rbx,8)
	leaq	1(%rax), %r15
	addq	$1, %rbx
	cmpq	%rax, %r9
	jle	.L12
	cmpq	%r12, %r13
	jle	.L12
	movq	(%r10,%r15,8), %rsi
	movq	%r15, %rax
	cmpq	%rdx, %rsi
	jle	.L45
.L14:
	movq	%rdx, (%r14,%rbx,8)
	addq	$1, %r12
	addq	$1, %rbx
	cmpq	%rax, %rcx
	jle	.L22
	cmpq	%r12, %r13
	jle	.L22
	movq	(%r8,%r12,8), %rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L41:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rax, %r15
.L12:
	cmpq	%r15, %rcx
	jle	.L18
	movq	%rcx, %rdx
	leaq	(%r14,%rbx,8), %rdi
	leaq	(%r10,%r15,8), %rsi
	movq	%r8, -80(%rbp)
	subq	%r15, %rdx
	movq	%rcx, -72(%rbp)
	salq	$3, %rdx
	call	memcpy@PLT
	movq	-72(%rbp), %rcx
	movq	-80(%rbp), %r8
	addq	%rbx, %rcx
	subq	%r15, %rcx
	movq	%rcx, %rbx
.L18:
	cmpq	%r12, %r13
	jle	.L1
.L13:
	subq	%r12, %r13
	leaq	(%r14,%rbx,8), %rdi
	leaq	(%r8,%r12,8), %rsi
	leaq	0(,%r13,8), %rdx
	call	memcpy@PLT
.L1:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L46
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L44:
	.cfi_restore_state
	testq	%r13, %r13
	jle	.L10
	leaq	8(%r14,%r12,8), %rsi
	movq	%r8, %rdi
	movq	%r15, %rdx
	xorl	%r12d, %r12d
	call	memcpy@PLT
	movq	%rax, %r8
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	.L12
.L43:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	merge, .-merge
	.p2align 4
	.type	mergeSort.part.0, @function
mergeSort.part.0:
.LFB42:
	.cfi_startproc
	movq	%rdx, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	subq	%rsi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%rax, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	sarq	%r13
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%rsi, %r13
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpq	%r13, %rsi
	jl	.L63
	leaq	1(%r13), %r14
	cmpq	%r14, %r12
	jg	.L64
.L55:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	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
	jmp	merge
	.p2align 4,,10
	.p2align 3
.L63:
	.cfi_restore_state
	movq	%rax, %r15
	sarq	$2, %r15
	addq	%rsi, %r15
	cmpq	%r15, %rsi
	jl	.L65
	leaq	1(%r15), %r14
	cmpq	%r14, %r13
	jg	.L66
.L52:
	movq	%r13, %rcx
	movq	%r15, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	merge
	leaq	1(%r13), %r14
	cmpq	%r14, %r12
	jle	.L55
.L64:
	movq	%r12, %rax
	subq	%r14, %rax
	movq	%rax, %r15
	sarq	%r15
	addq	%r14, %r15
	cmpq	%r15, %r14
	jl	.L67
.L56:
	leaq	1(%r15), %r8
	cmpq	%r8, %r12
	jg	.L68
.L59:
	movq	%r12, %rcx
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	merge
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L65:
	sarq	$3, %rax
	leaq	(%rax,%rsi), %r14
	cmpq	%r14, %rsi
	jl	.L69
.L50:
	leaq	1(%r14), %rsi
	cmpq	%rsi, %r15
	jg	.L70
.L51:
	movq	%r14, %rdx
	movq	%r15, %rcx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	merge
	leaq	1(%r15), %r14
	cmpq	%r14, %r13
	jle	.L52
.L66:
	movq	%r13, %r8
	subq	%r14, %r8
	sarq	%r8
	addq	%r14, %r8
	cmpq	%r8, %r14
	jl	.L71
.L53:
	leaq	1(%r8), %rsi
	cmpq	%rsi, %r13
	jg	.L72
.L54:
	movq	%r13, %rcx
	movq	%r8, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	merge
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L68:
	movq	%r12, %r9
	subq	%r8, %r9
	sarq	%r9
	addq	%r8, %r9
	cmpq	%r9, %r8
	jl	.L73
.L60:
	leaq	1(%r9), %rsi
	cmpq	%rsi, %r12
	jg	.L74
.L61:
	movq	%r12, %rcx
	movq	%r9, %rdx
	movq	%r8, %rsi
	movq	%rbx, %rdi
	call	merge
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L67:
	sarq	$2, %rax
	leaq	(%rax,%r14), %r8
	cmpq	%r8, %r14
	jl	.L75
.L57:
	leaq	1(%r8), %rsi
	cmpq	%rsi, %r15
	jg	.L76
.L58:
	movq	%r15, %rcx
	movq	%r8, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	merge
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L69:
	movq	%r14, %rdx
	call	mergeSort.part.0
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%r13, %rdx
	movq	%rbx, %rdi
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %r8
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L71:
	movq	%r8, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %r8
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L76:
	movq	%r15, %rdx
	movq	%rbx, %rdi
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %r8
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L75:
	movq	%r8, %rdx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	(%rsp), %r8
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L74:
	movq	%r12, %rdx
	movq	%rbx, %rdi
	movq	%r9, 8(%rsp)
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	8(%rsp), %r9
	movq	(%rsp), %r8
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L73:
	movq	%r9, %rdx
	movq	%r8, %rsi
	movq	%rbx, %rdi
	movq	%r9, 8(%rsp)
	movq	%r8, (%rsp)
	call	mergeSort.part.0
	movq	8(%rsp), %r9
	movq	(%rsp), %r8
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L70:
	movq	%r15, %rdx
	movq	%rbx, %rdi
	call	mergeSort.part.0
	jmp	.L51
	.cfi_endproc
.LFE42:
	.size	mergeSort.part.0, .-mergeSort.part.0
	.p2align 4
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB40:
	.cfi_startproc
	endbr64
	cmpq	%rdx, %rsi
	jl	.L88
	ret
	.p2align 4,,10
	.p2align 3
.L88:
	movq	%rdx, %rax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	subq	%rsi, %rax
	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
	movq	%rax, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	sarq	%r13
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addq	%rsi, %r13
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpq	%r13, %rsi
	jl	.L89
	leaq	1(%r13), %r15
	cmpq	%r15, %r12
	jg	.L90
.L82:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rcx
	movq	%r13, %rdx
	movq	%rbp, %rsi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 48
	movq	%r14, %rdi
	popq	%rbp
	.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
.L89:
	.cfi_restore_state
	sarq	$2, %rax
	leaq	(%rax,%rsi), %r15
	cmpq	%r15, %rsi
	jl	.L91
.L80:
	leaq	1(%r15), %rsi
	cmpq	%rsi, %r13
	jg	.L92
.L81:
	movq	%r15, %rdx
	movq	%r13, %rcx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	merge
	leaq	1(%r13), %r15
	cmpq	%r15, %r12
	jle	.L82
.L90:
	movq	%r12, %rbx
	subq	%r15, %rbx
	sarq	%rbx
	addq	%r15, %rbx
	cmpq	%rbx, %r15
	jl	.L93
.L83:
	leaq	1(%rbx), %rsi
	cmpq	%rsi, %r12
	jg	.L94
.L84:
	movq	%r12, %rcx
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	merge
	jmp	.L82
	.p2align 4,,10
	.p2align 3
.L91:
	movq	%r15, %rdx
	call	mergeSort.part.0
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L94:
	movq	%r12, %rdx
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L93:
	movq	%rbx, %rdx
	movq	%r15, %rsi
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L83
	.p2align 4,,10
	.p2align 3
.L92:
	movq	%r13, %rdx
	movq	%r14, %rdi
	call	mergeSort.part.0
	jmp	.L81
	.cfi_endproc
.LFE40:
	.size	mergeSort, .-mergeSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbx
	leaq	0(,%rbx,8), %rdi
	call	malloc@PLT
	movq	%rax, %r13
	testq	%rbx, %rbx
	jle	.L96
	movq	%rax, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L97:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbx
	addq	$8, %r12
	cmpq	%rbp, %rbx
	jg	.L97
.L96:
	leaq	-1(%rbx), %rdx
	testq	%rdx, %rdx
	jg	.L118
.L98:
	movq	%rbx, %rax
	movq	-8(%r13,%rbx,8), %r8
	subq	$2, %rax
	je	.L99
	movq	%rax, %rdx
	cmpq	$1, %rax
	je	.L101
	.p2align 4,,10
	.p2align 3
.L100:
	movq	0(%r13,%rdx,8), %rcx
	subq	$1, %rdx
	leaq	(%r8,%rcx,2), %r8
	subq	$2, %rax
	je	.L99
	cmpq	$1, %rax
	jne	.L100
.L101:
	addq	0(%r13,%rdx,8), %r8
.L99:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L119
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L118:
	.cfi_restore_state
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	mergeSort.part.0
	jmp	.L98
.L119:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<stdlib.h>
void merge(long long int arr[],long long int l,long long int m,long long int r)
{
    long long int i, j, k;
    long long int n1 = m - l + 1;
    long long int n2 = r - m;

    /* create temp arrays */
    long long int L[n1], R[n2];

    /* Copy data to temp arrays L[] and R[] */
    for (i = 0; i < n1; i++)
        L[i] = arr[l + i];
    for (j = 0; j < n2; j++)
        R[j] = arr[m + 1 + j];

    /* Merge the temp arrays back into arr[l..r]*/
    i = 0; // Initial index of first subarray
    j = 0; // Initial index of second subarray
    k = l; // Initial index of merged subarray
    while (i < n1 && j < n2) {
        if (L[i] <= R[j]) {
            arr[k] = L[i];
            i++;
        }
        else {
            arr[k] = R[j];
            j++;
        }
        k++;
    }

    /* Copy the remaining elements of L[], if there
       are any */
    while (i < n1) {
        arr[k] = L[i];
        i++;
        k++;
    }

    /* Copy the remaining elements of R[], if there
       are any */
    while (j < n2) {
        arr[k] = R[j];
        j++;
        k++;
    }
}

/* l is for left index and r is right index of the
   sub-array of arr to be sorted */
void mergeSort(long long int arr[],long long int l,long long int r)
{
    if (l < r) {
        // Same as (l+r)/2, but avoids overflow for
        // large l and h
        long long int m = l + (r - l) / 2;

        // Sort first and second halves
        mergeSort(arr, l, m);
        mergeSort(arr, m + 1, r);

        merge(arr, l, m, r);
    }
}
int main()
{
    long long int n;
    scanf("%lld",&n);
    long long int ans=0;
    long long int* arr;
    arr=(long long int*)malloc(n*sizeof(long long int));
    for(long long int i=0;i<n;i++)
    {
        scanf("%lld",&arr[i]);
    }
    mergeSort(arr,0,n-1);
    ans+=arr[n-1];
    long long int x=n-2;
    long long int count=n-2;
    for(;;)
    {
        if(count==0)
        {
            break;
        }
        if(count!=1){
            ans+=2*arr[x];
            count-=2;
            x--;
        }
        else{
            ans+=arr[x];
            count--;
        }
    }
    printf("%lld",ans);
    return 0;
}

4
1 2 1 3
 7
1 1 1 1 1 0 1
 4
1 3 1 3
 4
1 5 1 3
 4
1 4 1 3
 4
1 10 1 3
 4
0 10 1 2
 7
1 2 2 -1 2 0 2
 4
2 4 1 2
 7
1 2 4 -3 2 0 0

7 6 9 11 10 16 14 12 8 13
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>
void merge(long long int arr[],long long int l,long long int m,long long int r)
{
    long long int i, j, k;
    long long int n1 = m - l + 1;
    long long int n2 = r - m;

    /* create temp arrays */
    long long int L[n1], R[n2];

    /* Copy data to temp arrays L[] and R[] */
    for (i = 0; i < n1; i++)
        L[i] = arr[l + i];
    for (j = 0; j < n2; j++)
        R[j] = arr[m + 1 + j];

    /* Merge the temp arrays back into arr[l..r]*/
    i = 0; // Initial index of first subarray
    j = 0; // Initial index of second subarray
    k = l; // Initial index of merged subarray
    while (i < n1 && j < n2) {
        if (L[i] <= R[j]) {
            arr[k] = L[i];
            i++;
        }
        else {
            arr[k] = R[j];
            j++;
        }
        k++;
    }

    /* Copy the remaining elements of L[], if there
       are any */
    while (i < n1) {
        arr[k] = L[i];
        i++;
        k++;
    }

    /* Copy the remaining elements of R[], if there
       are any */
    while (j < n2) {
        arr[k] = R[j];
        j++;
        k++;
    }
}

/* l is for left index and r is right index of the
   sub-array of arr to be sorted */
void mergeSort(long long int arr[],long long int l,long long int r)
{
    if (l < r) {
        // Same as (l+r)/2, but avoids overflow for
        // large l and h
        long long int m = l + (r - l) / 2;

        // Sort first and second halves
        mergeSort(arr, l, m);
        mergeSort(arr, m + 1, r);

        merge(arr, l, m, r);
    }
}
int main()
{
    long long int n;
    scanf("%lld",&n);
    long long int ans=0;
    long long int* arr;
    arr=(long long int*)malloc(n*sizeof(long long int));
    for(long long int i=0;i<n;i++)
    {
        scanf("%lld",&arr[i]);
    }
    mergeSort(arr,0,n-1);
    ans+=arr[n-1];
    long long int x=n-2;
    long long int count=n-2;
    for(;;)
    {
        if(count==0)
        {
            break;
        }
        if(count!=1){
            ans+=2*arr[x];
            count-=2;
            x--;
        }
        else{
            ans+=arr[x];
            count--;
        }
    }
    printf("%lld",ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	subq	$112, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	movq	%rdi, -120(%rbp)
	movq	%rsi, -128(%rbp)
	movq	%rdx, -136(%rbp)
	movq	%rcx, -144(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rsi
	movq	-136(%rbp), %rax
	subq	-128(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -88(%rbp)
	movq	-144(%rbp), %rax
	subq	-136(%rbp), %rax
	movq	%rax, -80(%rbp)
	movq	-88(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	-80(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -56(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r10
	movl	$0, %r11d
	movq	%rax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L8
.L9:
	movq	-128(%rbp), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -112(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jl	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-136(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -104(%rbp)
.L10:
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L11
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	-128(%rbp), %rax
	movq	%rax, -96(%rbp)
	jmp	.L12
.L16:
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jg	.L13
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -112(%rbp)
	jmp	.L14
.L13:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -104(%rbp)
.L14:
	addq	$1, -96(%rbp)
.L12:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jge	.L17
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L16
	jmp	.L17
.L18:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -112(%rbp)
	addq	$1, -96(%rbp)
.L17:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jl	.L18
	jmp	.L19
.L20:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -104(%rbp)
	addq	$1, -96(%rbp)
.L19:
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L20
	movq	%rsi, %rsp
	nop
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leaq	-32(%rbp), %rsp
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB7:
	.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
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jge	.L24
	movq	-40(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-32(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	mergeSort
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	mergeSort
	movq	-40(%rbp), %rcx
	movq	-8(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	merge
.L24:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mergeSort, .-mergeSort
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -48(%rbp)
	movq	-56(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	$0, -40(%rbp)
	jmp	.L26
.L27:
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -40(%rbp)
.L26:
	movq	-56(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L27
	movq	-56(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergeSort
	movq	-56(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -48(%rbp)
	movq	-56(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -24(%rbp)
.L32:
	cmpq	$0, -24(%rbp)
	je	.L36
	cmpq	$1, -24(%rbp)
	je	.L30
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, %rax
	addq	%rax, -48(%rbp)
	subq	$2, -24(%rbp)
	subq	$1, -32(%rbp)
	jmp	.L32
.L30:
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -48(%rbp)
	subq	$1, -24(%rbp)
	jmp	.L32
.L36:
	nop
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	merge
	.type	merge, @function
merge:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	subq	$112, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	movq	%rdi, -120(%rbp)
	movq	%rsi, -128(%rbp)
	movq	%rdx, -136(%rbp)
	movq	%rcx, -144(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rsi
	movq	-136(%rbp), %rax
	subq	-128(%rbp), %rax
	addq	$1, %rax
	movq	%rax, -88(%rbp)
	movq	-144(%rbp), %rax
	subq	-136(%rbp), %rax
	movq	%rax, -80(%rbp)
	movq	-88(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	-80(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -56(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r10
	movl	$0, %r11d
	movq	%rax, %rdx
	movq	%rdx, %r8
	movl	$0, %r9d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L8
.L9:
	movq	-128(%rbp), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -112(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jl	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-136(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	%rcx, (%rax,%rdx,8)
	addq	$1, -104(%rbp)
.L10:
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L11
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	-128(%rbp), %rax
	movq	%rax, -96(%rbp)
	jmp	.L12
.L16:
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jg	.L13
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -112(%rbp)
	jmp	.L14
.L13:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -104(%rbp)
.L14:
	addq	$1, -96(%rbp)
.L12:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jge	.L17
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L16
	jmp	.L17
.L18:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-64(%rbp), %rax
	movq	-112(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -112(%rbp)
	addq	$1, -96(%rbp)
.L17:
	movq	-112(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jl	.L18
	jmp	.L19
.L20:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-120(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-48(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, (%rcx)
	addq	$1, -104(%rbp)
	addq	$1, -96(%rbp)
.L19:
	movq	-104(%rbp), %rax
	cmpq	-80(%rbp), %rax
	jl	.L20
	movq	%rsi, %rsp
	nop
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leaq	-32(%rbp), %rsp
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge, .-merge
	.globl	mergeSort
	.type	mergeSort, @function
mergeSort:
.LFB7:
	.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
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jge	.L24
	movq	-40(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-32(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	mergeSort
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	mergeSort
	movq	-40(%rbp), %rcx
	movq	-8(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	merge
.L24:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	mergeSort, .-mergeSort
	.section	.rodata
.LC0:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -48(%rbp)
	movq	-56(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	$0, -40(%rbp)
	jmp	.L26
.L27:
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -40(%rbp)
.L26:
	movq	-56(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jl	.L27
	movq	-56(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergeSort
	movq	-56(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -48(%rbp)
	movq	-56(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -24(%rbp)
.L32:
	cmpq	$0, -24(%rbp)
	je	.L36
	cmpq	$1, -24(%rbp)
	je	.L30
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, %rax
	addq	%rax, -48(%rbp)
	subq	$2, -24(%rbp)
	subq	$1, -32(%rbp)
	jmp	.L32
.L30:
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -48(%rbp)
	subq	$1, -24(%rbp)
	jmp	.L32
.L36:
	nop
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
