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

```c
/*
 * 3028_Ball.c
 *
 *  Created on: 2019/05/19
 *      Author: nagashima
 */

#include <stdio.h>
#include <stdlib.h>

typedef struct ball{
	int color;
	int value;
}ball;

ball aux[1000*100];

void merge(ball a[], int l, int m, int r);
void mergesort(ball a[], int l, int r);

int main(){
	int N,M,C;
	int *l;
	ball *b;
	int res=0;
    int count=0;

	scanf("%d %d %d",&N,&M,&C);
	l=(int *)malloc(C*sizeof(int));
	b=(ball *)malloc(N*sizeof(ball));
	for(int i=0;i<C;i++)scanf("%d",&l[i]);
	for(int i=0;i<N;i++)scanf("%d %d",&b[i].color,&b[i].value);

    mergesort(b, 0, N-1);

    for(int i=N-1;i>-1;i--){
    	//printf("i:%2d color:%2d color_num:%2d value:%2d\n",i,b[i].color,l[b[i].color-1],b[i].value);
    	if(l[b[i].color-1]>0){
    		res+=b[i].value;
    		l[b[i].color-1]--;
    		count++;
    	}
    	if(count>=M)break;
    }



	printf("%d\n",res);

	free(l);
	free(b);
	return 0;
}

void merge(ball a[], int l, int m, int r){
	int i, j, k;
	for(i=m+1;i>l;i--)aux[i-1]=a[i-1];
	for(j=m;j<r;j++)aux[r+m-j]=a[j+1];
	for(k=l;k<=r;k++)
		if(aux[j].value<aux[i].value)
			a[k]=aux[j--];
		else
			a[k]=aux[i++];
}
void mergesort(ball a[], int l, int r){
	int m=(r+l)/2;
	if(r<=l)return;
	mergesort(a, l, m);
	mergesort(a, m+1, r);
	merge(a, l, m, r);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	aux
	.bss
	.align 32
	.type	aux, @object
	.size	aux, 800000
aux:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-56(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
	movl	$0, -32(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	addq	$4, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -32(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L5
	movl	-56(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergesort
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L6
.L10:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L7
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	addl	%eax, -44(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -40(%rbp)
.L7:
	movl	-52(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L13
	subl	$1, -28(%rbp)
.L6:
	cmpl	$0, -28(%rbp)
	jns	.L10
	jmp	.L9
.L13:
	nop
.L9:
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	merge
	.type	merge, @function
merge:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L15
.L16:
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	aux(%rip), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx,%rdx)
	subl	$1, -12(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L16
	movl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-36(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	subl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	aux(%rip), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L18
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L19
.L22:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+aux(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+aux(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L20
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -8(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	aux(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rax, (%rdx)
	jmp	.L21
.L20:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	aux(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rax, (%rdx)
.L21:
	addl	$1, -4(%rbp)
.L19:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L22
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	merge, .-merge
	.globl	mergesort
	.type	mergesort, @function
mergesort:
.LFB8:
	.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	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L26
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergesort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	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
	jmp	.L23
.L26:
	nop
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mergesort, .-mergesort
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB40:
	.cfi_startproc
	endbr64
	leal	1(%rdx), %eax
	movq	%rdi, %r9
	movl	%esi, %r8d
	movl	%edx, %edi
	movl	%ecx, %r10d
	cmpl	%esi, %eax
	jle	.L2
	cltq
	leaq	-8+aux(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	-8(%r9,%rax,8), %rdx
	movq	%rdx, (%rcx,%rax,8)
	subq	$1, %rax
	cmpl	%eax, %r8d
	jl	.L3
	movl	%r8d, %eax
.L2:
	cmpl	%r10d, %edi
	jge	.L4
	movslq	%edi, %rdx
	movslq	%r10d, %r11
	leaq	aux(%rip), %rcx
	leaq	(%r9,%rdx,8), %rsi
	leaq	(%rcx,%r11,8), %rdx
	leal	-1(%r10), %ecx
	subl	%edi, %ecx
	subq	%rcx, %r11
	leaq	-8+aux(%rip), %rcx
	leaq	(%rcx,%r11,8), %rdi
	.p2align 4,,10
	.p2align 3
.L5:
	movq	8(%rsi), %rcx
	subq	$8, %rdx
	addq	$8, %rsi
	movq	%rcx, 8(%rdx)
	cmpq	%rdi, %rdx
	jne	.L5
	movl	%r10d, %edi
.L4:
	cmpl	%r10d, %r8d
	jg	.L1
	movslq	%r8d, %rcx
	subl	%r8d, %r10d
	addq	%rcx, %r10
	leaq	(%r9,%rcx,8), %rdx
	leaq	aux(%rip), %rcx
	leaq	8(%r9,%r10,8), %r9
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%rcx,%r8,8), %rsi
	addq	$8, %rdx
	subl	$1, %edi
	movq	%rsi, -8(%rdx)
	cmpq	%rdx, %r9
	je	.L1
.L9:
	movslq	%eax, %rsi
	movslq	%edi, %r8
	movl	4(%rcx,%rsi,8), %r11d
	cmpl	%r11d, 4(%rcx,%r8,8)
	jl	.L15
	movq	(%rcx,%rsi,8), %rsi
	addq	$8, %rdx
	addl	$1, %eax
	movq	%rsi, -8(%rdx)
	cmpq	%rdx, %r9
	jne	.L9
.L1:
	ret
	.cfi_endproc
.LFE40:
	.size	merge, .-merge
	.p2align 4
	.globl	mergesort
	.type	mergesort, @function
mergesort:
.LFB41:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edx
	jg	.L35
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	leal	(%rdx,%rsi), %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	%eax, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	shrl	$31, %r13d
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addl	%eax, %r13d
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sarl	%r13d
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%r13d, %esi
	jge	.L18
	leal	(%rsi,%r13), %eax
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	cmpl	%r14d, %esi
	jl	.L36
	leal	1(%r14), %r8d
	cmpl	%r8d, %r13d
	jg	.L37
.L22:
	movl	%r13d, %ecx
	movl	%r14d, %edx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
.L18:
	leal	1(%r13), %r8d
	cmpl	%r12d, %r8d
	jge	.L25
	leal	(%r8,%r12), %eax
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	cmpl	%r14d, %r8d
	jl	.L38
	leal	1(%r14), %r9d
	cmpl	%r9d, %r12d
	jg	.L39
.L29:
	movl	%r12d, %ecx
	movl	%r14d, %edx
	movl	%r8d, %esi
	movq	%r15, %rdi
	call	merge
.L25:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %ecx
	movl	%r13d, %edx
	movl	%ebp, %esi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 48
	movq	%r15, %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
.L39:
	.cfi_restore_state
	leal	(%r12,%r9), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpl	%ebx, %r9d
	jge	.L30
	leal	(%r9,%rbx), %eax
	movl	%r9d, %esi
	movq	%r15, %rdi
	movl	%r8d, 8(%rsp)
	movl	%eax, %r10d
	movl	%r9d, 4(%rsp)
	shrl	$31, %r10d
	addl	%eax, %r10d
	sarl	%r10d
	movl	%r10d, %edx
	movl	%r10d, (%rsp)
	call	mergesort
	movl	(%rsp), %r10d
	movl	%ebx, %edx
	movq	%r15, %rdi
	leal	1(%r10), %esi
	call	mergesort
	movl	4(%rsp), %r9d
	movl	(%rsp), %edx
	movl	%ebx, %ecx
	movq	%r15, %rdi
	movl	%r9d, %esi
	movl	%r9d, (%rsp)
	call	merge
	movl	8(%rsp), %r8d
	movl	(%rsp), %r9d
.L30:
	leal	1(%rbx), %r11d
	cmpl	%r11d, %r12d
	jle	.L31
	leal	(%r12,%r11), %eax
	movl	%r11d, %esi
	movq	%r15, %rdi
	movl	%r9d, 12(%rsp)
	movl	%eax, %r10d
	movl	%r8d, 8(%rsp)
	shrl	$31, %r10d
	movl	%r11d, 4(%rsp)
	addl	%eax, %r10d
	sarl	%r10d
	movl	%r10d, %edx
	movl	%r10d, (%rsp)
	call	mergesort
	movl	(%rsp), %r10d
	movl	%r12d, %edx
	movq	%r15, %rdi
	leal	1(%r10), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	4(%rsp), %esi
	movl	%r12d, %ecx
	movq	%r15, %rdi
	call	merge
	movl	12(%rsp), %r9d
	movl	8(%rsp), %r8d
.L31:
	movl	%r12d, %ecx
	movl	%ebx, %edx
	movl	%r9d, %esi
	movq	%r15, %rdi
	movl	%r8d, (%rsp)
	call	merge
	movl	(%rsp), %r8d
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L38:
	leal	(%r8,%r14), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpl	%ebx, %r8d
	jge	.L27
	leal	(%r8,%rbx), %eax
	movl	%r8d, %esi
	movq	%r15, %rdi
	movl	%r8d, 4(%rsp)
	movl	%eax, %r9d
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	movl	%r9d, %edx
	movl	%r9d, (%rsp)
	call	mergesort
	movl	(%rsp), %r9d
	movl	%ebx, %edx
	movq	%r15, %rdi
	leal	1(%r9), %esi
	call	mergesort
	movl	4(%rsp), %r8d
	movl	(%rsp), %edx
	movl	%ebx, %ecx
	movq	%r15, %rdi
	movl	%r8d, %esi
	movl	%r8d, (%rsp)
	call	merge
	movl	(%rsp), %r8d
.L27:
	leal	1(%rbx), %r10d
	cmpl	%r10d, %r14d
	jle	.L28
	leal	(%r14,%r10), %eax
	movl	%r10d, %esi
	movq	%r15, %rdi
	movl	%r8d, 8(%rsp)
	movl	%eax, %r9d
	movl	%r10d, 4(%rsp)
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	movl	%r9d, %edx
	movl	%r9d, (%rsp)
	call	mergesort
	movl	(%rsp), %r9d
	movl	%r14d, %edx
	movq	%r15, %rdi
	leal	1(%r9), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	4(%rsp), %esi
	movl	%r14d, %ecx
	movq	%r15, %rdi
	call	merge
	movl	8(%rsp), %r8d
.L28:
	movl	%r8d, %esi
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movq	%r15, %rdi
	movl	%r8d, (%rsp)
	call	merge
	leal	1(%r14), %r9d
	movl	(%rsp), %r8d
	cmpl	%r9d, %r12d
	jle	.L29
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L37:
	leal	0(%r13,%r8), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpl	%ebx, %r8d
	jge	.L23
	leal	(%r8,%rbx), %eax
	movl	%r8d, %esi
	movq	%r15, %rdi
	movl	%r8d, 4(%rsp)
	movl	%eax, %r9d
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	movl	%r9d, %edx
	movl	%r9d, (%rsp)
	call	mergesort
	movl	(%rsp), %r9d
	movl	%ebx, %edx
	movq	%r15, %rdi
	leal	1(%r9), %esi
	call	mergesort
	movl	4(%rsp), %r8d
	movl	(%rsp), %edx
	movl	%ebx, %ecx
	movq	%r15, %rdi
	movl	%r8d, %esi
	movl	%r8d, (%rsp)
	call	merge
	movl	(%rsp), %r8d
.L23:
	leal	1(%rbx), %r10d
	cmpl	%r10d, %r13d
	jle	.L24
	leal	0(%r13,%r10), %eax
	movl	%r10d, %esi
	movq	%r15, %rdi
	movl	%r8d, 8(%rsp)
	movl	%eax, %r9d
	movl	%r10d, 4(%rsp)
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	movl	%r9d, %edx
	movl	%r9d, (%rsp)
	call	mergesort
	movl	(%rsp), %r9d
	movl	%r13d, %edx
	movq	%r15, %rdi
	leal	1(%r9), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	4(%rsp), %esi
	movl	%r13d, %ecx
	movq	%r15, %rdi
	call	merge
	movl	8(%rsp), %r8d
.L24:
	movl	%r13d, %ecx
	movl	%ebx, %edx
	movl	%r8d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L36:
	leal	(%rsi,%r14), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpl	%ebx, %esi
	jge	.L20
	leal	(%rsi,%rbx), %eax
	movl	%eax, %r8d
	shrl	$31, %r8d
	addl	%eax, %r8d
	sarl	%r8d
	movl	%r8d, %edx
	movl	%r8d, (%rsp)
	call	mergesort
	movl	(%rsp), %r8d
	movl	%ebx, %edx
	movq	%r15, %rdi
	leal	1(%r8), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	%ebx, %ecx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
.L20:
	leal	1(%rbx), %r9d
	cmpl	%r9d, %r14d
	jle	.L21
	leal	(%r14,%r9), %eax
	movl	%r9d, %esi
	movq	%r15, %rdi
	movl	%r9d, 4(%rsp)
	movl	%eax, %r8d
	shrl	$31, %r8d
	addl	%eax, %r8d
	sarl	%r8d
	movl	%r8d, %edx
	movl	%r8d, (%rsp)
	call	mergesort
	movl	(%rsp), %r8d
	movl	%r14d, %edx
	movq	%r15, %rdi
	leal	1(%r8), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	4(%rsp), %esi
	movl	%r14d, %ecx
	movq	%r15, %rdi
	call	merge
.L21:
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
	leal	1(%r14), %r8d
	cmpl	%r8d, %r13d
	jle	.L22
	jmp	.L37
	.cfi_endproc
.LFE41:
	.size	mergesort, .-mergesort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	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	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$2, %rdi
	call	malloc@PLT
	movslq	12(%rsp), %rdi
	movq	%rax, %rbp
	salq	$3, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L41
	movq	%rbp, %r13
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r13
	cmpl	%ebx, 20(%rsp)
	jg	.L42
.L41:
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L43
	movq	%r12, %rbx
	xorl	%r13d, %r13d
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L44:
	leaq	4(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addl	$1, %r13d
	addq	$8, %rbx
	cmpl	%r13d, %edx
	jg	.L44
.L43:
	subl	$1, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	mergesort
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L49
	movslq	%edx, %rdi
	subl	$1, %edx
	movl	16(%rsp), %r9d
	xorl	%esi, %esi
	salq	$3, %rdi
	salq	$3, %rdx
	xorl	%r8d, %r8d
	leaq	(%r12,%rdi), %rax
	subq	$8, %rdi
	subq	%rdx, %rdi
	addq	%r12, %rdi
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L54:
	subq	$8, %rax
	cmpq	%rax, %rdi
	je	.L45
.L47:
	movslq	-8(%rax), %rdx
	leaq	-4(%rbp,%rdx,4), %rcx
	movl	(%rcx), %edx
	testl	%edx, %edx
	jle	.L46
	subl	$1, %edx
	addl	-4(%rax), %r8d
	addl	$1, %esi
	movl	%edx, (%rcx)
.L46:
	cmpl	%esi, %r9d
	jg	.L54
.L45:
	movl	%r8d, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	addq	$32, %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
.L49:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L45
.L55:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	aux
	.bss
	.align 32
	.type	aux, @object
	.size	aux, 800000
aux:
	.zero	800000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB40:
	.cfi_startproc
	endbr64
	leal	1(%rdx), %eax
	movq	%rdi, %r9
	movl	%esi, %r8d
	movl	%edx, %edi
	movl	%ecx, %r10d
	cmpl	%esi, %eax
	jle	.L2
	cltq
	leaq	-8+aux(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	-8(%r9,%rax,8), %rdx
	movq	%rdx, (%rcx,%rax,8)
	subq	$1, %rax
	cmpl	%eax, %r8d
	jl	.L3
	movl	%r8d, %eax
.L2:
	cmpl	%r10d, %edi
	jge	.L4
	movslq	%edi, %rdx
	movslq	%r10d, %r11
	leaq	aux(%rip), %rcx
	leaq	(%r9,%rdx,8), %rsi
	leaq	(%rcx,%r11,8), %rdx
	leal	-1(%r10), %ecx
	subl	%edi, %ecx
	subq	%rcx, %r11
	leaq	-8+aux(%rip), %rcx
	leaq	(%rcx,%r11,8), %rdi
	.p2align 4,,10
	.p2align 3
.L5:
	movq	8(%rsi), %rcx
	subq	$8, %rdx
	addq	$8, %rsi
	movq	%rcx, 8(%rdx)
	cmpq	%rdi, %rdx
	jne	.L5
	movl	%r10d, %edi
.L4:
	cmpl	%r10d, %r8d
	jg	.L1
	movslq	%r8d, %rcx
	subl	%r8d, %r10d
	addq	%rcx, %r10
	leaq	(%r9,%rcx,8), %rdx
	leaq	aux(%rip), %rcx
	leaq	8(%r9,%r10,8), %r9
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%rcx,%r8,8), %rsi
	addq	$8, %rdx
	subl	$1, %edi
	movq	%rsi, -8(%rdx)
	cmpq	%rdx, %r9
	je	.L1
.L9:
	movslq	%eax, %rsi
	movslq	%edi, %r8
	movl	4(%rcx,%rsi,8), %r11d
	cmpl	%r11d, 4(%rcx,%r8,8)
	jl	.L15
	movq	(%rcx,%rsi,8), %rsi
	addq	$8, %rdx
	addl	$1, %eax
	movq	%rsi, -8(%rdx)
	cmpq	%rdx, %r9
	jne	.L9
.L1:
	ret
	.cfi_endproc
.LFE40:
	.size	merge, .-merge
	.p2align 4
	.globl	mergesort
	.type	mergesort, @function
mergesort:
.LFB41:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edx
	jg	.L35
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	leal	(%rdx,%rsi), %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	%eax, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	shrl	$31, %r13d
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addl	%eax, %r13d
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sarl	%r13d
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%r13d, %esi
	jge	.L18
	leal	(%rsi,%r13), %eax
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	cmpl	%r14d, %esi
	jl	.L36
	leal	1(%r14), %r8d
	cmpl	%r8d, %r13d
	jg	.L37
.L22:
	movl	%r13d, %ecx
	movl	%r14d, %edx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
.L18:
	leal	1(%r13), %r8d
	cmpl	%r12d, %r8d
	jge	.L25
	leal	(%r8,%r12), %eax
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	cmpl	%r14d, %r8d
	jl	.L38
	leal	1(%r14), %r9d
	cmpl	%r9d, %r12d
	jg	.L39
.L29:
	movl	%r12d, %ecx
	movl	%r14d, %edx
	movl	%r8d, %esi
	movq	%r15, %rdi
	call	merge
.L25:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %ecx
	movl	%r13d, %edx
	movl	%ebp, %esi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 48
	movq	%r15, %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
.L39:
	.cfi_restore_state
	leal	(%r12,%r9), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpl	%ebx, %r9d
	jge	.L30
	leal	(%r9,%rbx), %eax
	movl	%r9d, %esi
	movq	%r15, %rdi
	movl	%r8d, 8(%rsp)
	movl	%eax, %r10d
	movl	%r9d, 4(%rsp)
	shrl	$31, %r10d
	addl	%eax, %r10d
	sarl	%r10d
	movl	%r10d, %edx
	movl	%r10d, (%rsp)
	call	mergesort
	movl	(%rsp), %r10d
	movl	%ebx, %edx
	movq	%r15, %rdi
	leal	1(%r10), %esi
	call	mergesort
	movl	4(%rsp), %r9d
	movl	(%rsp), %edx
	movl	%ebx, %ecx
	movq	%r15, %rdi
	movl	%r9d, %esi
	movl	%r9d, (%rsp)
	call	merge
	movl	8(%rsp), %r8d
	movl	(%rsp), %r9d
.L30:
	leal	1(%rbx), %r11d
	cmpl	%r11d, %r12d
	jle	.L31
	leal	(%r12,%r11), %eax
	movl	%r11d, %esi
	movq	%r15, %rdi
	movl	%r9d, 12(%rsp)
	movl	%eax, %r10d
	movl	%r8d, 8(%rsp)
	shrl	$31, %r10d
	movl	%r11d, 4(%rsp)
	addl	%eax, %r10d
	sarl	%r10d
	movl	%r10d, %edx
	movl	%r10d, (%rsp)
	call	mergesort
	movl	(%rsp), %r10d
	movl	%r12d, %edx
	movq	%r15, %rdi
	leal	1(%r10), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	4(%rsp), %esi
	movl	%r12d, %ecx
	movq	%r15, %rdi
	call	merge
	movl	12(%rsp), %r9d
	movl	8(%rsp), %r8d
.L31:
	movl	%r12d, %ecx
	movl	%ebx, %edx
	movl	%r9d, %esi
	movq	%r15, %rdi
	movl	%r8d, (%rsp)
	call	merge
	movl	(%rsp), %r8d
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L38:
	leal	(%r8,%r14), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpl	%ebx, %r8d
	jge	.L27
	leal	(%r8,%rbx), %eax
	movl	%r8d, %esi
	movq	%r15, %rdi
	movl	%r8d, 4(%rsp)
	movl	%eax, %r9d
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	movl	%r9d, %edx
	movl	%r9d, (%rsp)
	call	mergesort
	movl	(%rsp), %r9d
	movl	%ebx, %edx
	movq	%r15, %rdi
	leal	1(%r9), %esi
	call	mergesort
	movl	4(%rsp), %r8d
	movl	(%rsp), %edx
	movl	%ebx, %ecx
	movq	%r15, %rdi
	movl	%r8d, %esi
	movl	%r8d, (%rsp)
	call	merge
	movl	(%rsp), %r8d
.L27:
	leal	1(%rbx), %r10d
	cmpl	%r10d, %r14d
	jle	.L28
	leal	(%r14,%r10), %eax
	movl	%r10d, %esi
	movq	%r15, %rdi
	movl	%r8d, 8(%rsp)
	movl	%eax, %r9d
	movl	%r10d, 4(%rsp)
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	movl	%r9d, %edx
	movl	%r9d, (%rsp)
	call	mergesort
	movl	(%rsp), %r9d
	movl	%r14d, %edx
	movq	%r15, %rdi
	leal	1(%r9), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	4(%rsp), %esi
	movl	%r14d, %ecx
	movq	%r15, %rdi
	call	merge
	movl	8(%rsp), %r8d
.L28:
	movl	%r8d, %esi
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movq	%r15, %rdi
	movl	%r8d, (%rsp)
	call	merge
	leal	1(%r14), %r9d
	movl	(%rsp), %r8d
	cmpl	%r9d, %r12d
	jle	.L29
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L37:
	leal	0(%r13,%r8), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpl	%ebx, %r8d
	jge	.L23
	leal	(%r8,%rbx), %eax
	movl	%r8d, %esi
	movq	%r15, %rdi
	movl	%r8d, 4(%rsp)
	movl	%eax, %r9d
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	movl	%r9d, %edx
	movl	%r9d, (%rsp)
	call	mergesort
	movl	(%rsp), %r9d
	movl	%ebx, %edx
	movq	%r15, %rdi
	leal	1(%r9), %esi
	call	mergesort
	movl	4(%rsp), %r8d
	movl	(%rsp), %edx
	movl	%ebx, %ecx
	movq	%r15, %rdi
	movl	%r8d, %esi
	movl	%r8d, (%rsp)
	call	merge
	movl	(%rsp), %r8d
.L23:
	leal	1(%rbx), %r10d
	cmpl	%r10d, %r13d
	jle	.L24
	leal	0(%r13,%r10), %eax
	movl	%r10d, %esi
	movq	%r15, %rdi
	movl	%r8d, 8(%rsp)
	movl	%eax, %r9d
	movl	%r10d, 4(%rsp)
	shrl	$31, %r9d
	addl	%eax, %r9d
	sarl	%r9d
	movl	%r9d, %edx
	movl	%r9d, (%rsp)
	call	mergesort
	movl	(%rsp), %r9d
	movl	%r13d, %edx
	movq	%r15, %rdi
	leal	1(%r9), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	4(%rsp), %esi
	movl	%r13d, %ecx
	movq	%r15, %rdi
	call	merge
	movl	8(%rsp), %r8d
.L24:
	movl	%r13d, %ecx
	movl	%ebx, %edx
	movl	%r8d, %esi
	movq	%r15, %rdi
	call	merge
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L36:
	leal	(%rsi,%r14), %eax
	movl	%eax, %ebx
	shrl	$31, %ebx
	addl	%eax, %ebx
	sarl	%ebx
	cmpl	%ebx, %esi
	jge	.L20
	leal	(%rsi,%rbx), %eax
	movl	%eax, %r8d
	shrl	$31, %r8d
	addl	%eax, %r8d
	sarl	%r8d
	movl	%r8d, %edx
	movl	%r8d, (%rsp)
	call	mergesort
	movl	(%rsp), %r8d
	movl	%ebx, %edx
	movq	%r15, %rdi
	leal	1(%r8), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	%ebx, %ecx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
.L20:
	leal	1(%rbx), %r9d
	cmpl	%r9d, %r14d
	jle	.L21
	leal	(%r14,%r9), %eax
	movl	%r9d, %esi
	movq	%r15, %rdi
	movl	%r9d, 4(%rsp)
	movl	%eax, %r8d
	shrl	$31, %r8d
	addl	%eax, %r8d
	sarl	%r8d
	movl	%r8d, %edx
	movl	%r8d, (%rsp)
	call	mergesort
	movl	(%rsp), %r8d
	movl	%r14d, %edx
	movq	%r15, %rdi
	leal	1(%r8), %esi
	call	mergesort
	movl	(%rsp), %edx
	movl	4(%rsp), %esi
	movl	%r14d, %ecx
	movq	%r15, %rdi
	call	merge
.L21:
	movl	%r14d, %ecx
	movl	%ebx, %edx
	movl	%ebp, %esi
	movq	%r15, %rdi
	call	merge
	leal	1(%r14), %r8d
	cmpl	%r8d, %r13d
	jle	.L22
	jmp	.L37
	.cfi_endproc
.LFE41:
	.size	mergesort, .-mergesort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	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	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$2, %rdi
	call	malloc@PLT
	movslq	12(%rsp), %rdi
	movq	%rax, %rbp
	salq	$3, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L41
	movq	%rbp, %r13
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r13
	cmpl	%ebx, 20(%rsp)
	jg	.L42
.L41:
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L43
	movq	%r12, %rbx
	xorl	%r13d, %r13d
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L44:
	leaq	4(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addl	$1, %r13d
	addq	$8, %rbx
	cmpl	%r13d, %edx
	jg	.L44
.L43:
	subl	$1, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	mergesort
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L49
	movslq	%edx, %rdi
	subl	$1, %edx
	movl	16(%rsp), %r9d
	xorl	%esi, %esi
	salq	$3, %rdi
	salq	$3, %rdx
	xorl	%r8d, %r8d
	leaq	(%r12,%rdi), %rax
	subq	$8, %rdi
	subq	%rdx, %rdi
	addq	%r12, %rdi
	jmp	.L47
	.p2align 4,,10
	.p2align 3
.L54:
	subq	$8, %rax
	cmpq	%rax, %rdi
	je	.L45
.L47:
	movslq	-8(%rax), %rdx
	leaq	-4(%rbp,%rdx,4), %rcx
	movl	(%rcx), %edx
	testl	%edx, %edx
	jle	.L46
	subl	$1, %edx
	addl	-4(%rax), %r8d
	addl	$1, %esi
	movl	%edx, (%rcx)
.L46:
	cmpl	%esi, %r9d
	jg	.L54
.L45:
	movl	%r8d, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	addq	$32, %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
.L49:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L45
.L55:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	aux
	.bss
	.align 32
	.type	aux, @object
	.size	aux, 800000
aux:
	.zero	800000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

/*
 * 3028_Ball.c
 *
 *  Created on: 2019/05/19
 *      Author: nagashima
 */

#include <stdio.h>
#include <stdlib.h>

typedef struct ball{
	int color;
	int value;
}ball;

ball aux[1000*100];

void merge(ball a[], int l, int m, int r);
void mergesort(ball a[], int l, int r);

int main(){
	int N,M,C;
	int *l;
	ball *b;
	int res=0;
    int count=0;

	scanf("%d %d %d",&N,&M,&C);
	l=(int *)malloc(C*sizeof(int));
	b=(ball *)malloc(N*sizeof(ball));
	for(int i=0;i<C;i++)scanf("%d",&l[i]);
	for(int i=0;i<N;i++)scanf("%d %d",&b[i].color,&b[i].value);

    mergesort(b, 0, N-1);

    for(int i=N-1;i>-1;i--){
    	//printf("i:%2d color:%2d color_num:%2d value:%2d\n",i,b[i].color,l[b[i].color-1],b[i].value);
    	if(l[b[i].color-1]>0){
    		res+=b[i].value;
    		l[b[i].color-1]--;
    		count++;
    	}
    	if(count>=M)break;
    }



	printf("%d\n",res);

	free(l);
	free(b);
	return 0;
}

void merge(ball a[], int l, int m, int r){
	int i, j, k;
	for(i=m+1;i>l;i--)aux[i-1]=a[i-1];
	for(j=m;j<r;j++)aux[r+m-j]=a[j+1];
	for(k=l;k<=r;k++)
		if(aux[j].value<aux[i].value)
			a[k]=aux[j--];
		else
			a[k]=aux[i++];
}
void mergesort(ball a[], int l, int r){
	int m=(r+l)/2;
	if(r<=l)return;
	mergesort(a, l, m);
	mergesort(a, m+1, r);
	merge(a, l, m, r);
}


22 7 26
11 14 15 3 11 7 16 17 1 4 2 19 4 14 16 16 3 13 17 12 7 11 2 20 12 22
6 10
1 3
13 1
16 5
4 1
20 7
18 4
26 6
9 1
12 2
21 1
21 7
18 1
14 5
24 5
6 1
1 1
2 5
21 2
7 6
10 9
15 7
 3 3 3
1 0 1
1 1
2 100
1 1
 22 7 26
11 14 15 3 11 7 16 17 1 4 2 19 4 14 16 16 3 13 17 12 7 11 2 20 12 22
6 10
1 3
13 1
16 5
4 1
20 7
18 4
26 7
9 1
12 2
21 1
21 7
18 1
14 5
24 5
6 1
1 1
2 5
21 2
7 6
10 9
15 7
 3 3 2
1 1
1 1
1 100
2 16
 3 5 3
1 0 1
1 1
2 100
3 1
 22 7 26
11 14 15 3 11 7 16 17 1 4 2 17 4 14 16 16 3 13 17 12 7 11 2 20 12 22
6 10
1 3
13 1
16 5
4 1
20 7
18 4
26 7
9 1
12 2
21 1
21 7
18 1
14 5
24 5
6 1
1 1
2 5
21 2
7 6
10 14
15 7
 22 7 26
11 14 15 3 11 7 16 7 1 4 2 19 4 14 16 16 5 13 33 12 11 11 2 20 12 22
6 10
1 3
13 1
16 5
4 1
20 7
18 4
26 7
9 1
12 2
5 1
21 7
18 1
14 5
24 8
6 1
1 1
2 5
23 2
7 5
10 9
15 7
 3 4 2
1 1
1 1
1 100
2 30
 22 12 26
11 14 15 3 11 7 16 7 1 4 2 19 4 14 16 16 3 13 17 12 11 11 2 20 12 22
6 10
1 3
13 1
16 5
6 1
20 7
18 4
26 7
9 1
12 2
5 1
21 7
18 1
14 5
24 1
6 1
1 1
2 5
21 2
7 5
10 9
15 7
 3 4 2
1 0
1 1
1 100
2 30

52
 1
 53
 116
 2
 58
 55
 130
 74
 100

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

```c
/*
 * 3028_Ball.c
 *
 *  Created on: 2019/05/19
 *      Author: nagashima
 */

#include <stdio.h>
#include <stdlib.h>

typedef struct ball{
	int color;
	int value;
}ball;

ball aux[1000*100];

void merge(ball a[], int l, int m, int r);
void mergesort(ball a[], int l, int r);

int main(){
	int N,M,C;
	int *l;
	ball *b;
	int res=0;
    int count=0;

	scanf("%d %d %d",&N,&M,&C);
	l=(int *)malloc(C*sizeof(int));
	b=(ball *)malloc(N*sizeof(ball));
	for(int i=0;i<C;i++)scanf("%d",&l[i]);
	for(int i=0;i<N;i++)scanf("%d %d",&b[i].color,&b[i].value);

    mergesort(b, 0, N-1);

    for(int i=N-1;i>-1;i--){
    	//printf("i:%2d color:%2d color_num:%2d value:%2d\n",i,b[i].color,l[b[i].color-1],b[i].value);
    	if(l[b[i].color-1]>0){
    		res+=b[i].value;
    		l[b[i].color-1]--;
    		count++;
    	}
    	if(count>=M)break;
    }



	printf("%d\n",res);

	free(l);
	free(b);
	return 0;
}

void merge(ball a[], int l, int m, int r){
	int i, j, k;
	for(i=m+1;i>l;i--)aux[i-1]=a[i-1];
	for(j=m;j<r;j++)aux[r+m-j]=a[j+1];
	for(k=l;k<=r;k++)
		if(aux[j].value<aux[i].value)
			a[k]=aux[j--];
		else
			a[k]=aux[i++];
}
void mergesort(ball a[], int l, int r){
	int m=(r+l)/2;
	if(r<=l)return;
	mergesort(a, l, m);
	mergesort(a, m+1, r);
	merge(a, l, m, r);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	aux
	.bss
	.align 32
	.type	aux, @object
	.size	aux, 800000
aux:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-56(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
	movl	$0, -32(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	addq	$4, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -32(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L5
	movl	-56(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergesort
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L6
.L10:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L7
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	addl	%eax, -44(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -40(%rbp)
.L7:
	movl	-52(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L13
	subl	$1, -28(%rbp)
.L6:
	cmpl	$0, -28(%rbp)
	jns	.L10
	jmp	.L9
.L13:
	nop
.L9:
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	merge
	.type	merge, @function
merge:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L15
.L16:
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	aux(%rip), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx,%rdx)
	subl	$1, -12(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L16
	movl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-36(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	subl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	aux(%rip), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L18
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L19
.L22:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+aux(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+aux(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L20
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -8(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	aux(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rax, (%rdx)
	jmp	.L21
.L20:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	aux(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rax, (%rdx)
.L21:
	addl	$1, -4(%rbp)
.L19:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L22
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	merge, .-merge
	.globl	mergesort
	.type	mergesort, @function
mergesort:
.LFB8:
	.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	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L26
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergesort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	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
	jmp	.L23
.L26:
	nop
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mergesort, .-mergesort
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	aux
	.bss
	.align 32
	.type	aux, @object
	.size	aux, 800000
aux:
	.zero	800000
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-56(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
	movl	$0, -32(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	addq	$4, %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -32(%rbp)
.L4:
	movl	-56(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L5
	movl	-56(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-16(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	mergesort
	movl	-56(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	.L6
.L10:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L7
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	addl	%eax, -44(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -40(%rbp)
.L7:
	movl	-52(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L13
	subl	$1, -28(%rbp)
.L6:
	cmpl	$0, -28(%rbp)
	jns	.L10
	jmp	.L9
.L13:
	nop
.L9:
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	merge
	.type	merge, @function
merge:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L15
.L16:
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	aux(%rip), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx,%rdx)
	subl	$1, -12(%rbp)
.L15:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L16
	movl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L17
.L18:
	movl	-8(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-36(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	subl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	aux(%rip), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L18
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L19
.L22:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+aux(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+aux(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L20
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -8(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	aux(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rax, (%rdx)
	jmp	.L21
.L20:
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	aux(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	%rax, (%rdx)
.L21:
	addl	$1, -4(%rbp)
.L19:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L22
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	merge, .-merge
	.globl	mergesort
	.type	mergesort, @function
mergesort:
.LFB8:
	.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	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L26
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mergesort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	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
	jmp	.L23
.L26:
	nop
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	mergesort, .-mergesort
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
