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>

typedef struct {
	long long key;
	int num;
} data;

void merge_sort(data x[], int n)
{
	static data y[200001] = {};
	if (n == 1) return;
	merge_sort(&(x[0]), n/2);
	merge_sort(&(x[n/2]), (n+1)/2);
	
	int i, p, q;
	for (i = 0, p = 0, q = n/2; i < n; i++) {
		if (p >= n/2) y[i] = x[q++];
		else if (q >= n) y[i] = x[p++];
		else y[i] = (x[p].key < x[q].key)? x[p++]: x[q++];
	}
	for (i = 0; i < n; i++) x[i] = y[i];
}

int main()
{
	int i, N, M, B[100001];
	long long A[100001], C[100001];
	scanf("%d %d", &N, &M);
	for (i = 0; i < N; i++) scanf("%lld", &(A[i]));
	for (i = 0; i < M; i++) scanf("%d %lld", &(B[i]), &(C[i]));
	
	data X[200001];
	for (i = 0; i < N; i++) {
		X[i].key = A[i];
		X[i].num = 1;
	}
	for (i = 0; i < M; i++) {
		X[N+i].key = C[i];
		X[N+i].num = B[i];
	}
	merge_sort(X, N + M);
	
	int count = N;
	long long sum = 0;
	for (i = N + M - 1; i >= 0; i--) {
		if (count <= X[i].num) {
			sum += X[i].key * count;
			break;
		} else {
			sum += X[i].key * X[i].num;
			count -= X[i].num;
		}
	}
	
	printf("%lld\n", sum);
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	cmpl	$1, -28(%rbp)
	je	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L9:
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -8(%rbp)
	jl	.L5
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L5:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L7
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L7:
	movl	-8(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L8:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L9
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	y.0(%rip), %rax
	leaq	(%rdx,%rax), %rdx
	movq	(%rdx), %rax
	movq	8(%rdx), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addl	$1, -12(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge_sort, .-merge_sort
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-5197824(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-5200100(%rbp), %rdx
	leaq	-5200104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -5200096(%rbp)
	jmp	.L14
.L15:
	leaq	-4800064(%rbp), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5200096(%rbp)
.L14:
	movl	-5200104(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L15
	movl	$0, -5200096(%rbp)
	jmp	.L16
.L17:
	leaq	-4000048(%rbp), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	leaq	-5200080(%rbp), %rcx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5200096(%rbp)
.L16:
	movl	-5200100(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L17
	movl	$0, -5200096(%rbp)
	jmp	.L18
.L19:
	movl	-5200096(%rbp), %eax
	cltq
	movq	-4800064(%rbp,%rax,8), %rax
	movl	-5200096(%rbp), %edx
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200032, %rdx
	movq	%rax, (%rdx)
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	$1, (%rax)
	addl	$1, -5200096(%rbp)
.L18:
	movl	-5200104(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L19
	movl	$0, -5200096(%rbp)
	jmp	.L20
.L21:
	movl	-5200104(%rbp), %edx
	movl	-5200096(%rbp), %eax
	addl	%eax, %edx
	movl	-5200096(%rbp), %eax
	cltq
	movq	-4000048(%rbp,%rax,8), %rax
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200032, %rdx
	movq	%rax, (%rdx)
	movl	-5200104(%rbp), %edx
	movl	-5200096(%rbp), %eax
	addl	%eax, %edx
	movl	-5200096(%rbp), %eax
	cltq
	movl	-5200080(%rbp,%rax,4), %eax
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200024, %rdx
	movl	%eax, (%rdx)
	addl	$1, -5200096(%rbp)
.L20:
	movl	-5200100(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L21
	movl	-5200104(%rbp), %edx
	movl	-5200100(%rbp), %eax
	addl	%eax, %edx
	leaq	-3200032(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	-5200104(%rbp), %eax
	movl	%eax, -5200092(%rbp)
	movq	$0, -5200088(%rbp)
	movl	-5200104(%rbp), %edx
	movl	-5200100(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -5200096(%rbp)
	jmp	.L22
.L25:
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	cmpl	%eax, -5200092(%rbp)
	jg	.L23
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200032, %rax
	movq	(%rax), %rdx
	movl	-5200092(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -5200088(%rbp)
	jmp	.L24
.L23:
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200032, %rax
	movq	(%rax), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -5200088(%rbp)
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	subl	%eax, -5200092(%rbp)
	subl	$1, -5200096(%rbp)
.L22:
	cmpl	$0, -5200096(%rbp)
	jns	.L25
.L24:
	movq	-5200088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	y.0
	.comm	y.0,3200016,32
	.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
	.type	merge_sort.part.0, @function
merge_sort.part.0:
.LFB41:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r12d
	shrl	$31, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	addl	%esi, %r12d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%esi, %ebx
	sarl	%r12d
	cmpl	$1, %r12d
	je	.L2
	movl	%r12d, %esi
	call	merge_sort.part.0
.L2:
	leal	1(%rbx), %eax
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	cmpl	$1, %esi
	je	.L3
	movslq	%r12d, %rdi
	salq	$4, %rdi
	addq	%rbp, %rdi
	call	merge_sort.part.0
.L3:
	testl	%ebx, %ebx
	jle	.L21
	leaq	y.0(%rip), %r8
	movl	%r12d, %edx
	xorl	%eax, %eax
	xorl	%esi, %esi
	movq	%r8, %rdi
.L12:
	cmpl	%esi, %r12d
	jg	.L5
	leal	1(%rdx), %ecx
	movslq	%edx, %rdx
	addl	$1, %eax
	salq	$4, %rdx
	movdqu	0(%rbp,%rdx), %xmm1
	movaps	%xmm1, (%rdi)
	cmpl	%eax, %ebx
	je	.L7
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	xorl	%edx, %edx
	salq	$4, %rcx
	salq	$4, %rsi
	addq	%rbp, %rcx
	addq	%r8, %rsi
.L11:
	movdqu	(%rcx,%rdx), %xmm0
	addl	$1, %eax
	movaps	%xmm0, (%rsi,%rdx)
	addq	$16, %rdx
	cmpl	%eax, %ebx
	jg	.L11
.L7:
	movslq	%ebx, %rdx
	movq	%rbp, %rdi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movq	%r8, %rsi
	popq	%rbp
	.cfi_def_cfa_offset 16
	salq	$4, %rdx
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	memcpy@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movslq	%esi, %rcx
	salq	$4, %rcx
	addq	%rbp, %rcx
	cmpl	%edx, %ebx
	jg	.L8
	movdqu	(%rcx), %xmm2
	addl	$1, %esi
	movaps	%xmm2, (%rdi)
.L9:
	addl	$1, %eax
	cmpl	%eax, %ebx
	je	.L7
	addq	$16, %rdi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edx, %r9
	salq	$4, %r9
	addq	%rbp, %r9
	movq	(%r9), %r10
	cmpq	%r10, (%rcx)
	jge	.L10
	movdqu	(%rcx), %xmm3
	addl	$1, %esi
	movaps	%xmm3, (%rdi)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%r9), %xmm4
	addl	$1, %edx
	movaps	%xmm4, (%rdi)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	merge_sort.part.0, .-merge_sort.part.0
	.p2align 4
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %esi
	je	.L24
	jmp	merge_sort.part.0
	.p2align 4,,10
	.p2align 3
.L24:
	ret
	.cfi_endproc
.LFE39:
	.size	merge_sort, .-merge_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-5197824(%rsp), %r11
	.cfi_def_cfa 11, 5197864
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2280, %rsp
	.cfi_def_cfa_offset 5200144
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 5200088(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L64
	leaq	400032(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$8, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L31
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L65
.L29:
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	1200048(%rsp), %r12
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L33:
	leaq	(%r12,%rbx,8), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %ecx
	jg	.L33
	movl	8(%rsp), %edi
	testl	%edi, %edi
	jle	.L34
	leaq	400032(%rsp), %r12
.L45:
	leaq	2000064(%rsp), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L35:
	movq	(%r12,%rax,8), %rsi
	addq	$1, %rax
	movl	$1, 8(%rdx)
	addq	$16, %rdx
	movq	%rsi, -16(%rdx)
	cmpl	%eax, %edi
	jg	.L35
.L34:
	testl	%ecx, %ecx
	jle	.L36
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L48
	movslq	%edi, %rax
	movl	%ecx, %r8d
	leaq	2000064(%rsp), %rdx
	salq	$4, %rax
	shrl	$2, %r8d
	leaq	16(%rsp), %r9
	leaq	1200048(%rsp), %r12
	leaq	(%rdx,%rax), %rsi
	salq	$4, %r8
	leaq	8(%rdx,%rax), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L38:
	movdqa	16(%r12,%rax,2), %xmm0
	movdqa	(%r12,%rax,2), %xmm1
	movq	%xmm0, 32(%rsi,%rax,4)
	movhps	%xmm0, 48(%rsi,%rax,4)
	movdqa	(%r9,%rax), %xmm0
	movq	%xmm1, (%rsi,%rax,4)
	movhps	%xmm1, 16(%rsi,%rax,4)
	pshufd	$85, %xmm0, %xmm1
	movd	%xmm1, 16(%rdx,%rax,4)
	movdqa	%xmm0, %xmm1
	movd	%xmm0, (%rdx,%rax,4)
	punpckhdq	%xmm0, %xmm1
	pshufd	$255, %xmm0, %xmm0
	movd	%xmm1, 32(%rdx,%rax,4)
	movd	%xmm0, 48(%rdx,%rax,4)
	addq	$16, %rax
	cmpq	%r8, %rax
	jne	.L38
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L36
.L37:
	movslq	%eax, %rsi
	leal	(%rdi,%rax), %edx
	movq	1200048(%rsp,%rsi,8), %r8
	movslq	%edx, %rdx
	movl	16(%rsp,%rsi,4), %esi
	salq	$4, %rdx
	movq	%r8, 2000064(%rsp,%rdx)
	movl	%esi, 2000072(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L36
	leal	(%rdi,%rdx), %esi
	movslq	%edx, %rdx
	addl	$2, %eax
	movq	1200048(%rsp,%rdx,8), %r8
	movslq	%esi, %rsi
	movl	16(%rsp,%rdx,4), %edx
	salq	$4, %rsi
	movq	%r8, 2000064(%rsp,%rsi)
	movl	%edx, 2000072(%rsp,%rsi)
	cmpl	%eax, %ecx
	jle	.L36
	leal	(%rdi,%rax), %edx
	cltq
	movq	1200048(%rsp,%rax,8), %rsi
	movslq	%edx, %rdx
	movl	16(%rsp,%rax,4), %eax
	salq	$4, %rdx
	movq	%rsi, 2000064(%rsp,%rdx)
	movl	%eax, 2000072(%rsp,%rdx)
.L36:
	leal	(%rcx,%rdi), %esi
	cmpl	$1, %esi
	je	.L41
	leaq	2000064(%rsp), %rdi
	call	merge_sort.part.0
.L41:
	movl	8(%rsp), %esi
	movl	12(%rsp), %ecx
	addl	%esi, %ecx
	testl	%ecx, %ecx
	jle	.L49
	movslq	%ecx, %rdx
	xorl	%r8d, %r8d
	salq	$4, %rdx
	leaq	2000032(%rsp,%rdx), %r9
	leaq	2000048(%rsp,%rdx), %rax
	leal	-1(%rcx), %edx
	salq	$4, %rdx
	subq	%rdx, %r9
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L43:
	movslq	%edx, %rcx
	subq	$16, %rax
	subl	%edx, %esi
	imulq	%rdi, %rcx
	addq	%rcx, %r8
	cmpq	%r9, %rax
	je	.L42
.L44:
	movl	8(%rax), %edx
	movq	(%rax), %rdi
	cmpl	%esi, %edx
	jl	.L43
	movslq	%esi, %rsi
	imulq	%rdi, %rsi
	addq	%rsi, %r8
.L42:
	movl	$1, %edi
	xorl	%eax, %eax
	movq	%r8, %rdx
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	5200088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L66
	addq	$5200104, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L64:
	.cfi_restore_state
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jg	.L29
	movl	8(%rsp), %edi
	jmp	.L36
.L65:
	movl	8(%rsp), %edi
	testl	%edi, %edi
	jg	.L45
	jmp	.L36
.L48:
	xorl	%eax, %eax
	jmp	.L37
.L49:
	xorl	%r8d, %r8d
	jmp	.L42
.L66:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.local	y.0
	.comm	y.0,3200016,32
	.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
	.type	merge_sort.part.0, @function
merge_sort.part.0:
.LFB41:
	.cfi_startproc
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r12d
	shrl	$31, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	addl	%esi, %r12d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%esi, %ebx
	sarl	%r12d
	cmpl	$1, %r12d
	je	.L2
	movl	%r12d, %esi
	call	merge_sort.part.0
.L2:
	leal	1(%rbx), %eax
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	cmpl	$1, %esi
	je	.L3
	movslq	%r12d, %rdi
	salq	$4, %rdi
	addq	%rbp, %rdi
	call	merge_sort.part.0
.L3:
	testl	%ebx, %ebx
	jle	.L21
	leaq	y.0(%rip), %r8
	movl	%r12d, %edx
	xorl	%eax, %eax
	xorl	%esi, %esi
	movq	%r8, %rdi
.L12:
	cmpl	%esi, %r12d
	jg	.L5
	leal	1(%rdx), %ecx
	movslq	%edx, %rdx
	addl	$1, %eax
	salq	$4, %rdx
	movdqu	0(%rbp,%rdx), %xmm1
	movaps	%xmm1, (%rdi)
	cmpl	%eax, %ebx
	je	.L7
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	xorl	%edx, %edx
	salq	$4, %rcx
	salq	$4, %rsi
	addq	%rbp, %rcx
	addq	%r8, %rsi
.L11:
	movdqu	(%rcx,%rdx), %xmm0
	addl	$1, %eax
	movaps	%xmm0, (%rsi,%rdx)
	addq	$16, %rdx
	cmpl	%eax, %ebx
	jg	.L11
.L7:
	movslq	%ebx, %rdx
	movq	%rbp, %rdi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movq	%r8, %rsi
	popq	%rbp
	.cfi_def_cfa_offset 16
	salq	$4, %rdx
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	memcpy@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movslq	%esi, %rcx
	salq	$4, %rcx
	addq	%rbp, %rcx
	cmpl	%edx, %ebx
	jg	.L8
	movdqu	(%rcx), %xmm2
	addl	$1, %esi
	movaps	%xmm2, (%rdi)
.L9:
	addl	$1, %eax
	cmpl	%eax, %ebx
	je	.L7
	addq	$16, %rdi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edx, %r9
	salq	$4, %r9
	addq	%rbp, %r9
	movq	(%r9), %r10
	cmpq	%r10, (%rcx)
	jge	.L10
	movdqu	(%rcx), %xmm3
	addl	$1, %esi
	movaps	%xmm3, (%rdi)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%r9), %xmm4
	addl	$1, %edx
	movaps	%xmm4, (%rdi)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	merge_sort.part.0, .-merge_sort.part.0
	.p2align 4
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %esi
	je	.L24
	jmp	merge_sort.part.0
	.p2align 4,,10
	.p2align 3
.L24:
	ret
	.cfi_endproc
.LFE39:
	.size	merge_sort, .-merge_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-5197824(%rsp), %r11
	.cfi_def_cfa 11, 5197864
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2280, %rsp
	.cfi_def_cfa_offset 5200144
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 5200088(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L64
	leaq	400032(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$8, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L31
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L65
.L29:
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	1200048(%rsp), %r12
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L33:
	leaq	(%r12,%rbx,8), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %ecx
	jg	.L33
	movl	8(%rsp), %edi
	testl	%edi, %edi
	jle	.L34
	leaq	400032(%rsp), %r12
.L45:
	leaq	2000064(%rsp), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L35:
	movq	(%r12,%rax,8), %rsi
	addq	$1, %rax
	movl	$1, 8(%rdx)
	addq	$16, %rdx
	movq	%rsi, -16(%rdx)
	cmpl	%eax, %edi
	jg	.L35
.L34:
	testl	%ecx, %ecx
	jle	.L36
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L48
	movslq	%edi, %rax
	movl	%ecx, %r8d
	leaq	2000064(%rsp), %rdx
	salq	$4, %rax
	shrl	$2, %r8d
	leaq	16(%rsp), %r9
	leaq	1200048(%rsp), %r12
	leaq	(%rdx,%rax), %rsi
	salq	$4, %r8
	leaq	8(%rdx,%rax), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L38:
	movdqa	16(%r12,%rax,2), %xmm0
	movdqa	(%r12,%rax,2), %xmm1
	movq	%xmm0, 32(%rsi,%rax,4)
	movhps	%xmm0, 48(%rsi,%rax,4)
	movdqa	(%r9,%rax), %xmm0
	movq	%xmm1, (%rsi,%rax,4)
	movhps	%xmm1, 16(%rsi,%rax,4)
	pshufd	$85, %xmm0, %xmm1
	movd	%xmm1, 16(%rdx,%rax,4)
	movdqa	%xmm0, %xmm1
	movd	%xmm0, (%rdx,%rax,4)
	punpckhdq	%xmm0, %xmm1
	pshufd	$255, %xmm0, %xmm0
	movd	%xmm1, 32(%rdx,%rax,4)
	movd	%xmm0, 48(%rdx,%rax,4)
	addq	$16, %rax
	cmpq	%r8, %rax
	jne	.L38
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L36
.L37:
	movslq	%eax, %rsi
	leal	(%rdi,%rax), %edx
	movq	1200048(%rsp,%rsi,8), %r8
	movslq	%edx, %rdx
	movl	16(%rsp,%rsi,4), %esi
	salq	$4, %rdx
	movq	%r8, 2000064(%rsp,%rdx)
	movl	%esi, 2000072(%rsp,%rdx)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L36
	leal	(%rdi,%rdx), %esi
	movslq	%edx, %rdx
	addl	$2, %eax
	movq	1200048(%rsp,%rdx,8), %r8
	movslq	%esi, %rsi
	movl	16(%rsp,%rdx,4), %edx
	salq	$4, %rsi
	movq	%r8, 2000064(%rsp,%rsi)
	movl	%edx, 2000072(%rsp,%rsi)
	cmpl	%eax, %ecx
	jle	.L36
	leal	(%rdi,%rax), %edx
	cltq
	movq	1200048(%rsp,%rax,8), %rsi
	movslq	%edx, %rdx
	movl	16(%rsp,%rax,4), %eax
	salq	$4, %rdx
	movq	%rsi, 2000064(%rsp,%rdx)
	movl	%eax, 2000072(%rsp,%rdx)
.L36:
	leal	(%rcx,%rdi), %esi
	cmpl	$1, %esi
	je	.L41
	leaq	2000064(%rsp), %rdi
	call	merge_sort.part.0
.L41:
	movl	8(%rsp), %esi
	movl	12(%rsp), %ecx
	addl	%esi, %ecx
	testl	%ecx, %ecx
	jle	.L49
	movslq	%ecx, %rdx
	xorl	%r8d, %r8d
	salq	$4, %rdx
	leaq	2000032(%rsp,%rdx), %r9
	leaq	2000048(%rsp,%rdx), %rax
	leal	-1(%rcx), %edx
	salq	$4, %rdx
	subq	%rdx, %r9
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L43:
	movslq	%edx, %rcx
	subq	$16, %rax
	subl	%edx, %esi
	imulq	%rdi, %rcx
	addq	%rcx, %r8
	cmpq	%r9, %rax
	je	.L42
.L44:
	movl	8(%rax), %edx
	movq	(%rax), %rdi
	cmpl	%esi, %edx
	jl	.L43
	movslq	%esi, %rsi
	imulq	%rdi, %rsi
	addq	%rsi, %r8
.L42:
	movl	$1, %edi
	xorl	%eax, %eax
	movq	%r8, %rdx
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	5200088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L66
	addq	$5200104, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L64:
	.cfi_restore_state
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jg	.L29
	movl	8(%rsp), %edi
	jmp	.L36
.L65:
	movl	8(%rsp), %edi
	testl	%edi, %edi
	jg	.L45
	jmp	.L36
.L48:
	xorl	%eax, %eax
	jmp	.L37
.L49:
	xorl	%r8d, %r8d
	jmp	.L42
.L66:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.local	y.0
	.comm	y.0,3200016,32
	.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>

typedef struct {
	long long key;
	int num;
} data;

void merge_sort(data x[], int n)
{
	static data y[200001] = {};
	if (n == 1) return;
	merge_sort(&(x[0]), n/2);
	merge_sort(&(x[n/2]), (n+1)/2);
	
	int i, p, q;
	for (i = 0, p = 0, q = n/2; i < n; i++) {
		if (p >= n/2) y[i] = x[q++];
		else if (q >= n) y[i] = x[p++];
		else y[i] = (x[p].key < x[q].key)? x[p++]: x[q++];
	}
	for (i = 0; i < n; i++) x[i] = y[i];
}

int main()
{
	int i, N, M, B[100001];
	long long A[100001], C[100001];
	scanf("%d %d", &N, &M);
	for (i = 0; i < N; i++) scanf("%lld", &(A[i]));
	for (i = 0; i < M; i++) scanf("%d %lld", &(B[i]), &(C[i]));
	
	data X[200001];
	for (i = 0; i < N; i++) {
		X[i].key = A[i];
		X[i].num = 1;
	}
	for (i = 0; i < M; i++) {
		X[N+i].key = C[i];
		X[N+i].num = B[i];
	}
	merge_sort(X, N + M);
	
	int count = N;
	long long sum = 0;
	for (i = N + M - 1; i >= 0; i--) {
		if (count <= X[i].num) {
			sum += X[i].key * count;
			break;
		} else {
			sum += X[i].key * X[i].num;
			count -= X[i].num;
		}
	}
	
	printf("%lld\n", sum);
	fflush(stdout);
	return 0;
}
10 3
1 8 5 7 100 4 7 33 13 5
3 10
4 30
1 4
 3 2
5 1 1
2 3
1 5
 3 2
100 100 100
0 99
3 99
 11 3
1 1 1 1 1 1 1 1 1 1 1
3 1000000000
4 1000000000
3 1000000001
 10 2
0 8 5 7 100 4 7 33 24 5
3 10
4 30
1 4
 3 2
5 1 1
2 3
1 7
 10 2
0 8 5 7 100 4 7 33 24 5
3 15
4 30
1 4
 3 2
5 1 1
2 3
1 6
 3 2
5 1 1
2 3
2 6
 10 2
0 4 5 7 100 4 7 33 33 5
3 15
4 30
1 4

296
 13
 300
 10000000004
 307
 15
 322
 14
 17
 331

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>

typedef struct {
	long long key;
	int num;
} data;

void merge_sort(data x[], int n)
{
	static data y[200001] = {};
	if (n == 1) return;
	merge_sort(&(x[0]), n/2);
	merge_sort(&(x[n/2]), (n+1)/2);
	
	int i, p, q;
	for (i = 0, p = 0, q = n/2; i < n; i++) {
		if (p >= n/2) y[i] = x[q++];
		else if (q >= n) y[i] = x[p++];
		else y[i] = (x[p].key < x[q].key)? x[p++]: x[q++];
	}
	for (i = 0; i < n; i++) x[i] = y[i];
}

int main()
{
	int i, N, M, B[100001];
	long long A[100001], C[100001];
	scanf("%d %d", &N, &M);
	for (i = 0; i < N; i++) scanf("%lld", &(A[i]));
	for (i = 0; i < M; i++) scanf("%d %lld", &(B[i]), &(C[i]));
	
	data X[200001];
	for (i = 0; i < N; i++) {
		X[i].key = A[i];
		X[i].num = 1;
	}
	for (i = 0; i < M; i++) {
		X[N+i].key = C[i];
		X[N+i].num = B[i];
	}
	merge_sort(X, N + M);
	
	int count = N;
	long long sum = 0;
	for (i = N + M - 1; i >= 0; i--) {
		if (count <= X[i].num) {
			sum += X[i].key * count;
			break;
		} else {
			sum += X[i].key * X[i].num;
			count -= X[i].num;
		}
	}
	
	printf("%lld\n", sum);
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	cmpl	$1, -28(%rbp)
	je	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L9:
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -8(%rbp)
	jl	.L5
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L5:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L7
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L7:
	movl	-8(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L8:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L9
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	y.0(%rip), %rax
	leaq	(%rdx,%rax), %rdx
	movq	(%rdx), %rax
	movq	8(%rdx), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addl	$1, -12(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge_sort, .-merge_sort
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-5197824(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-5200100(%rbp), %rdx
	leaq	-5200104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -5200096(%rbp)
	jmp	.L14
.L15:
	leaq	-4800064(%rbp), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5200096(%rbp)
.L14:
	movl	-5200104(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L15
	movl	$0, -5200096(%rbp)
	jmp	.L16
.L17:
	leaq	-4000048(%rbp), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	leaq	-5200080(%rbp), %rcx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5200096(%rbp)
.L16:
	movl	-5200100(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L17
	movl	$0, -5200096(%rbp)
	jmp	.L18
.L19:
	movl	-5200096(%rbp), %eax
	cltq
	movq	-4800064(%rbp,%rax,8), %rax
	movl	-5200096(%rbp), %edx
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200032, %rdx
	movq	%rax, (%rdx)
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	$1, (%rax)
	addl	$1, -5200096(%rbp)
.L18:
	movl	-5200104(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L19
	movl	$0, -5200096(%rbp)
	jmp	.L20
.L21:
	movl	-5200104(%rbp), %edx
	movl	-5200096(%rbp), %eax
	addl	%eax, %edx
	movl	-5200096(%rbp), %eax
	cltq
	movq	-4000048(%rbp,%rax,8), %rax
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200032, %rdx
	movq	%rax, (%rdx)
	movl	-5200104(%rbp), %edx
	movl	-5200096(%rbp), %eax
	addl	%eax, %edx
	movl	-5200096(%rbp), %eax
	cltq
	movl	-5200080(%rbp,%rax,4), %eax
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200024, %rdx
	movl	%eax, (%rdx)
	addl	$1, -5200096(%rbp)
.L20:
	movl	-5200100(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L21
	movl	-5200104(%rbp), %edx
	movl	-5200100(%rbp), %eax
	addl	%eax, %edx
	leaq	-3200032(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	-5200104(%rbp), %eax
	movl	%eax, -5200092(%rbp)
	movq	$0, -5200088(%rbp)
	movl	-5200104(%rbp), %edx
	movl	-5200100(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -5200096(%rbp)
	jmp	.L22
.L25:
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	cmpl	%eax, -5200092(%rbp)
	jg	.L23
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200032, %rax
	movq	(%rax), %rdx
	movl	-5200092(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -5200088(%rbp)
	jmp	.L24
.L23:
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200032, %rax
	movq	(%rax), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -5200088(%rbp)
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	subl	%eax, -5200092(%rbp)
	subl	$1, -5200096(%rbp)
.L22:
	cmpl	$0, -5200096(%rbp)
	jns	.L25
.L24:
	movq	-5200088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	y.0
	.comm	y.0,3200016,32
	.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_sort
	.type	merge_sort, @function
merge_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	cmpl	$1, -28(%rbp)
	je	.L12
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	jmp	.L4
.L9:
	movl	-28(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -8(%rbp)
	jl	.L5
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L5:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L7
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L7:
	movl	-8(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-4(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
	jmp	.L6
.L8:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -4(%rbp)
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	leaq	y.0(%rip), %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rsi,%rcx)
	movq	%rdx, 8(%rsi,%rcx)
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L9
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	y.0(%rip), %rax
	leaq	(%rdx,%rax), %rdx
	movq	(%rdx), %rax
	movq	8(%rdx), %rdx
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addl	$1, -12(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge_sort, .-merge_sort
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-5197824(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-5200100(%rbp), %rdx
	leaq	-5200104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -5200096(%rbp)
	jmp	.L14
.L15:
	leaq	-4800064(%rbp), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5200096(%rbp)
.L14:
	movl	-5200104(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L15
	movl	$0, -5200096(%rbp)
	jmp	.L16
.L17:
	leaq	-4000048(%rbp), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	leaq	-5200080(%rbp), %rcx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -5200096(%rbp)
.L16:
	movl	-5200100(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L17
	movl	$0, -5200096(%rbp)
	jmp	.L18
.L19:
	movl	-5200096(%rbp), %eax
	cltq
	movq	-4800064(%rbp,%rax,8), %rax
	movl	-5200096(%rbp), %edx
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200032, %rdx
	movq	%rax, (%rdx)
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	$1, (%rax)
	addl	$1, -5200096(%rbp)
.L18:
	movl	-5200104(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L19
	movl	$0, -5200096(%rbp)
	jmp	.L20
.L21:
	movl	-5200104(%rbp), %edx
	movl	-5200096(%rbp), %eax
	addl	%eax, %edx
	movl	-5200096(%rbp), %eax
	cltq
	movq	-4000048(%rbp,%rax,8), %rax
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200032, %rdx
	movq	%rax, (%rdx)
	movl	-5200104(%rbp), %edx
	movl	-5200096(%rbp), %eax
	addl	%eax, %edx
	movl	-5200096(%rbp), %eax
	cltq
	movl	-5200080(%rbp,%rax,4), %eax
	movslq	%edx, %rdx
	salq	$4, %rdx
	addq	%rbp, %rdx
	subq	$3200024, %rdx
	movl	%eax, (%rdx)
	addl	$1, -5200096(%rbp)
.L20:
	movl	-5200100(%rbp), %eax
	cmpl	%eax, -5200096(%rbp)
	jl	.L21
	movl	-5200104(%rbp), %edx
	movl	-5200100(%rbp), %eax
	addl	%eax, %edx
	leaq	-3200032(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	merge_sort
	movl	-5200104(%rbp), %eax
	movl	%eax, -5200092(%rbp)
	movq	$0, -5200088(%rbp)
	movl	-5200104(%rbp), %edx
	movl	-5200100(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -5200096(%rbp)
	jmp	.L22
.L25:
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	cmpl	%eax, -5200092(%rbp)
	jg	.L23
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200032, %rax
	movq	(%rax), %rdx
	movl	-5200092(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -5200088(%rbp)
	jmp	.L24
.L23:
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200032, %rax
	movq	(%rax), %rdx
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -5200088(%rbp)
	movl	-5200096(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$3200024, %rax
	movl	(%rax), %eax
	subl	%eax, -5200092(%rbp)
	subl	$1, -5200096(%rbp)
.L22:
	cmpl	$0, -5200096(%rbp)
	jns	.L25
.L24:
	movq	-5200088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	y.0
	.comm	y.0,3200016,32
	.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:
