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>
int e[100002],f[100002][2];
//大きい順
void merge(int i,int j,int *s){
  if(i!=j){
    merge(i,(i+j)/2,s);
    merge((i+j)/2+1,j,s);
    int a=i,b=(i+j)/2+1;
    int d;
    for(d=i;d<=j;d++){
      if((i+j)/2<a){
        e[d]=s[b];
        b++;
      }
      else if(j<b){
        e[d]=s[a];
        a++;
      }
      else if(s[a]>s[b]){
        e[d]=s[a];
        a++;
      }
      else{
        e[d]=s[b];
        b++;
      }
    }
    for(d=i;d<=j;d++)
      s[d]=e[d];
  }
}

//大きい順
void sort(int i,int j,int s[][2]){
  if(i!=j){
    sort(i,(i+j)/2,s);
    sort((i+j)/2+1,j,s);
    int a=i,b=(i+j)/2+1;
    int d;
    for(d=i;d<=j;d++){
      if((i+j)/2<a){
        f[d][0]=s[b][0];
        f[d][1]=s[b][1];
        b++;
      }
      else if(j<b){
        f[d][0]=s[a][0];
        f[d][1]=s[a][1];
        a++;
      }
      else if(s[a][1]>s[b][1]){
        f[d][0]=s[a][0];
        f[d][1]=s[a][1];
        a++;
      }
      else{
        f[d][0]=s[b][0];
        f[d][1]=s[b][1];
        b++;
      }
    }
    for(d=i;d<=j;d++){
      s[d][0]=f[d][0];
      s[d][1]=f[d][1];
    }
  }
}

int main(){
  int n,m,i;
  scanf("%d%d",&n,&m);
  int a[n+1],b[m+1][2];
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);
  merge(0,n-1,a);
  for(i=0;i<m;i++)
    scanf("%d%d",&b[i][0],&b[i][1]);
  sort(0,m-1,b);
  int bcount=0,anum=0,bnum=0;
  long long sum=0;
  for(i=0;i<n;i++){
    long long num;
    if(a[anum]<b[bnum][1] && bnum<m){
      num=b[bnum][1];
      sum+=num;
      bcount++;
    }
    else{
      num=a[anum];
      sum+=num;
      anum++;
    }
    if(bcount==b[bnum][0]){
      bnum++;
      bcount=0;
    }
  }
  printf("%lld\n",sum);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	e
	.bss
	.align 32
	.type	e, @object
	.size	e, 400008
e:
	.zero	400008
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 800016
f:
	.zero	800016
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L11
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	merge
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	merge
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L8:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -12(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L6
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L5
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L5
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L5:
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L8
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	e(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L10
.L11:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	merge, .-merge
	.globl	sort
	.type	sort, @function
sort:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L22
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	sort
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	sort
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L14
.L19:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -12(%rbp)
	jle	.L15
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
	jmp	.L16
.L15:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L17
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L16
.L18:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L16:
	addl	$1, -4(%rbp)
.L14:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	f(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+f(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, 4(%rdx)
	addl	$1, -4(%rbp)
.L20:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L21
.L22:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-124(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L24:
	cmpq	%rdx, %rsp
	je	.L25
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L24
.L25:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L26
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L26:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-124(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	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
.L27:
	cmpq	%rdx, %rsp
	je	.L28
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L27
.L28:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L29
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L29:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L30
.L31:
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L30:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L31
	movl	-128(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-88(%rbp), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	movl	$0, %edi
	call	merge
	movl	$0, -120(%rbp)
	jmp	.L32
.L33:
	movl	-120(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	%rax, %rdx
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L32:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L33
	movl	-124(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-72(%rbp), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	movl	$0, %edi
	call	sort
	movl	$0, -116(%rbp)
	movl	$0, -112(%rbp)
	movl	$0, -108(%rbp)
	movq	$0, -104(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L34
.L38:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,8), %eax
	cmpl	%eax, %ecx
	jge	.L35
	movl	-124(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jge	.L35
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,8), %eax
	cltq
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	addq	%rax, -104(%rbp)
	addl	$1, -116(%rbp)
	jmp	.L36
.L35:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	addq	%rax, -104(%rbp)
	addl	$1, -112(%rbp)
.L36:
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,8), %eax
	cmpl	%eax, -116(%rbp)
	jne	.L37
	addl	$1, -108(%rbp)
	movl	$0, -116(%rbp)
.L37:
	addl	$1, -120(%rbp)
.L34:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L38
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.text.unlikely,"ax",@progbits
.LCOLDB0:
	.text
.LHOTB0:
	.p2align 4
	.type	merge.part.0, @function
merge.part.0:
.LFB26:
	.cfi_startproc
	leal	(%rdi,%rsi), %eax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	%eax, %r13d
	shrl	$31, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	addl	%eax, %r13d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%esi, %ebp
	sarl	%r13d
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	cmpl	%r13d, %edi
	je	.L2
	movl	%r13d, %esi
	call	merge.part.0
.L2:
	leal	1(%r13), %ebx
	cmpl	%ebx, %ebp
	je	.L3
	movq	%r12, %rdx
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	merge.part.0
.L3:
	cmpl	%ebp, %r14d
	jg	.L1
	leal	1(%r14), %eax
	movl	%r14d, %edx
	leaq	-4+e(%rip), %rsi
	cltq
.L21:
	cmpl	%edx, %r13d
	jge	.L5
	movslq	%ebx, %rdx
	movl	%eax, %r11d
	addl	$1, %ebx
	movl	(%r12,%rdx,4), %edx
	movl	%edx, (%rsi,%rax,4)
	cmpl	%eax, %ebp
	jl	.L42
	movl	%ebp, %r10d
	leaq	e(%rip), %rcx
	movslq	%ebx, %rdx
	subl	%eax, %r10d
	cltq
	leaq	4(,%rdx,4), %rdx
	leaq	0(,%rax,4), %rsi
	leaq	(%r12,%rdx), %r9
	leaq	(%rcx,%rsi), %rdi
	movq	%rdi, %r8
	subq	%r9, %r8
	cmpq	$8, %r8
	jbe	.L25
	cmpl	$2, %r10d
	jbe	.L25
	cmpl	%r11d, %ebp
	leal	1(%r10), %eax
	movl	$1, %esi
	cmovl	%esi, %eax
	leaq	-4(%r12,%rdx), %r8
	xorl	%edx, %edx
	movl	%eax, %r9d
	shrl	$2, %r9d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%edx, %rcx
	movl	(%r12,%rcx,4), %ecx
	cmpl	%ebx, %ebp
	jl	.L39
	movslq	%ebx, %rdi
	movl	(%r12,%rdi,4), %edi
	cmpl	%ecx, %edi
	jl	.L39
	movl	%edi, %ecx
	addl	$1, %ebx
	movl	%ecx, (%rsi,%rax,4)
	cmpl	%eax, %ebp
	jl	.L43
.L22:
	addq	$1, %rax
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%ecx, (%rsi,%rax,4)
	addl	$1, %edx
	cmpl	%eax, %ebp
	jge	.L22
.L43:
	leaq	e(%rip), %rcx
.L7:
	movslq	%r14d, %rax
	movl	%ebp, %edi
	leaq	0(,%rax,4), %rdx
	subl	%r14d, %edi
	leaq	(%r12,%rdx), %r8
	leaq	4(%rcx,%rdx), %r9
	movq	%r8, %rsi
	subq	%r9, %rsi
	cmpq	$8, %rsi
	jbe	.L30
	cmpl	$2, %edi
	jbe	.L30
	addl	$1, %edi
	addq	%rcx, %rdx
	xorl	%eax, %eax
	movl	%edi, %esi
	shrl	$2, %esi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L16:
	movdqu	(%rdx,%rax), %xmm0
	movups	%xmm0, (%r8,%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L16
	movl	%edi, %eax
	andl	$-4, %eax
	addl	%eax, %r14d
	cmpl	%eax, %edi
	je	.L1
	movslq	%r14d, %rax
	movl	(%rcx,%rax,4), %edx
	movl	%edx, (%r12,%rax,4)
	leal	1(%r14), %eax
	cmpl	%eax, %ebp
	jl	.L1
	cltq
	addl	$2, %r14d
	movl	(%rcx,%rax,4), %edx
	leaq	0(,%rax,4), %rsi
	movl	%edx, (%r12,%rax,4)
	cmpl	%r14d, %ebp
	jl	.L1
	movslq	%r14d, %r14
	movl	(%rcx,%r14,4), %eax
	movl	%eax, 4(%r12,%rsi)
.L1:
	popq	%rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	movl	(%rcx,%rax,4), %edx
	movl	%edx, (%r12,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %ebp
	jl	.L1
	movl	(%rcx,%rax,4), %edx
	movl	%edx, (%r12,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %ebp
	jge	.L30
	jmp	.L1
.L42:
	leaq	e(%rip), %rcx
	jmp	.L7
.L25:
	movq	%r12, %rdi
	subq	%rsi, %rdi
	leaq	-4(%rdi,%rdx), %rdx
	jmp	.L13
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	merge.part.0.cold, @function
merge.part.0.cold:
.LFSB26:
.L11:
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	movq	%rdx, %rsi
	addq	$1, %rdx
	salq	$4, %rsi
	movdqu	(%r8,%rsi), %xmm1
	movups	%xmm1, (%rdi,%rsi)
	cmpl	%edx, %r9d
	ja	.L11
	movl	%eax, %edx
	andl	$-4, %edx
	addl	%edx, %ebx
	addl	%edx, %r11d
	cmpl	%edx, %eax
	je	.L7
	movslq	%ebx, %rax
	addl	$1, %ebx
	movl	(%r12,%rax,4), %edx
	movslq	%r11d, %rax
	movl	%edx, (%rcx,%rax,4)
	leal	1(%r11), %edx
	cmpl	%edx, %ebp
	jl	.L7
	movslq	%ebx, %rax
	movslq	%edx, %rdx
	addl	$2, %r11d
	leaq	0(,%rax,4), %rsi
	movl	(%r12,%rax,4), %eax
	movl	%eax, (%rcx,%rdx,4)
	cmpl	%r11d, %ebp
	jl	.L7
	movl	4(%r12,%rsi), %eax
	movslq	%r11d, %r11
	movl	%eax, (%rcx,%r11,4)
	jmp	.L7
.L13:
	movl	(%rdx,%rax,4), %esi
	movl	%esi, (%rcx,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %ebp
	jge	.L13
	jmp	.L7
	.cfi_endproc
.LFE26:
	.text
	.size	merge.part.0, .-merge.part.0
	.section	.text.unlikely
	.size	merge.part.0.cold, .-merge.part.0.cold
.LCOLDE0:
	.text
.LHOTE0:
	.section	.text.unlikely
.LCOLDB1:
	.text
.LHOTB1:
	.p2align 4
	.type	sort.part.0, @function
sort.part.0:
.LFB27:
	.cfi_startproc
	leal	(%rdi,%rsi), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edi, %r14d
	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	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addl	%eax, %r13d
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sarl	%r13d
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%r13d, %edi
	je	.L45
	movl	%r13d, %esi
	call	sort.part.0
.L45:
	leal	1(%r13), %ebx
	cmpl	%ebx, %r12d
	je	.L46
	movq	%rbp, %rdx
	movl	%r12d, %esi
	movl	%ebx, %edi
	call	sort.part.0
.L46:
	cmpl	%r12d, %r14d
	jg	.L44
	movslq	%r14d, %rax
	leaq	f(%rip), %rsi
	movl	%r14d, %ecx
	movl	%r14d, %edx
	movq	%rax, 8(%rsp)
	salq	$3, %rax
	leaq	(%rsi,%rax), %r9
	movq	%rax, (%rsp)
	movq	%r9, %r10
	movq	%r9, %rax
.L68:
	cmpl	%edx, %r13d
	jge	.L48
	movslq	%ebx, %rdx
	addl	$1, %ebx
	leaq	0(%rbp,%rdx,8), %rdx
	movl	(%rdx), %edi
	movl	%edi, (%rax)
	movl	4(%rdx), %edx
	movl	%edx, 4(%rax)
	leal	1(%rcx), %eax
	cmpl	%eax, %r12d
	jl	.L50
	movslq	%eax, %r11
	movslq	%ebx, %rbx
	leaq	0(,%r11,8), %rdx
	leaq	0(%rbp,%rbx,8), %r8
	leaq	(%rsi,%rdx), %r13
	leaq	16(%rsi,%rdx), %rdx
	leaq	16(,%rbx,8), %rdi
	cmpq	%rdx, %r8
	jnb	.L70
	addq	%rbp, %rdi
	cmpq	%rdi, %r13
	jb	.L83
.L70:
	movl	%r12d, %edx
	subl	%ecx, %edx
	cmpl	%eax, %r12d
	movl	$1, %ecx
	cmovl	%ecx, %edx
	je	.L72
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L48:
	movslq	%edx, %rdi
	leaq	0(%rbp,%rdi,8), %r8
	cmpl	%ebx, %r12d
	jge	.L51
	movl	(%r8), %edi
	addl	$1, %edx
	movl	%edi, (%rax)
	movl	4(%r8), %edi
.L52:
	addl	$1, %ecx
	movl	%edi, 4(%rax)
	cmpl	%ecx, %r12d
	jl	.L50
.L69:
	addq	$8, %rax
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L51:
	movslq	%ebx, %rdi
	movl	4(%r8), %r15d
	leaq	0(%rbp,%rdi,8), %r11
	movl	4(%r11), %edi
	cmpl	%edi, %r15d
	jle	.L53
	movl	(%r8), %edi
	addl	$1, %ecx
	addl	$1, %edx
	movl	%edi, (%rax)
	movl	%r15d, %edi
	movl	%edi, 4(%rax)
	cmpl	%ecx, %r12d
	jge	.L69
.L50:
	movq	(%rsp), %rcx
	leaq	16(%rcx), %rax
	leaq	0(%rbp,%rcx), %rdx
	leaq	(%rsi,%rax), %rcx
	cmpq	%rcx, %rdx
	jnb	.L74
	addq	%rbp, %rax
	cmpq	%rax, %r9
	jb	.L59
.L74:
	movl	%r12d, %edi
	subl	%r14d, %edi
	addl	$1, %edi
	cmpl	%r12d, %r14d
	je	.L73
	movl	%edi, %ecx
	xorl	%eax, %eax
	shrl	%ecx
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L62:
	movdqu	(%r9,%rax), %xmm0
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L62
	movl	%edi, %eax
	andl	$-2, %eax
	andl	$1, %edi
	je	.L44
.L61:
	addq	8(%rsp), %rax
	movq	(%rsi,%rax,8), %rdx
	movq	%rdx, 0(%rbp,%rax,8)
.L44:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	movl	(%r11), %r8d
	addl	$1, %ebx
	movl	%r8d, (%rax)
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L83:
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L59:
	subl	%r14d, %r12d
	addq	8(%rsp), %r12
	movq	%rdx, %rax
	leaq	8(%rbp,%r12,8), %rcx
	.p2align 4,,10
	.p2align 3
.L66:
	movq	(%r10), %rdx
	addq	$8, %rax
	addq	$8, %r10
	movq	%rdx, -8(%rax)
	cmpq	%rcx, %rax
	jne	.L66
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L73:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L61
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	sort.part.0.cold, @function
sort.part.0.cold:
.LFSB27:
.L72:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	xorl	%eax, %eax
.L54:
	addq	%rax, %rbx
	addq	%r11, %rax
	movq	0(%rbp,%rbx,8), %rdx
	movq	%rdx, (%rsi,%rax,8)
	jmp	.L50
.L57:
	movq	(%r8), %rax
	addq	$8, %r8
	movq	%rax, (%rsi,%r11,8)
	addq	$1, %r11
	cmpl	%r11d, %r12d
	jge	.L57
	jmp	.L50
.L79:
	movl	%edx, %edi
	xorl	%eax, %eax
	shrl	%edi
.L55:
	movq	%rax, %rcx
	addq	$1, %rax
	salq	$4, %rcx
	movdqu	(%r8,%rcx), %xmm1
	movups	%xmm1, 0(%r13,%rcx)
	cmpl	%eax, %edi
	ja	.L55
	movl	%edx, %eax
	andl	$-2, %eax
	andb	$1, %dl
	jne	.L54
	jmp	.L50
	.cfi_endproc
.LFE27:
	.text
	.size	sort.part.0, .-sort.part.0
	.section	.text.unlikely
	.size	sort.part.0.cold, .-sort.part.0.cold
.LCOLDE1:
	.text
.LHOTE1:
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	jne	.L86
	ret
	.p2align 4,,10
	.p2align 3
.L86:
	jmp	merge.part.0
	.cfi_endproc
.LFE23:
	.size	merge, .-merge
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	jne	.L89
	ret
	.p2align 4,,10
	.p2align 3
.L89:
	jmp	sort.part.0
	.cfi_endproc
.LFE24:
	.size	sort, .-sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	leaq	.LC2(%rip), %r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %esi
	movq	%rsp, %rcx
	leal	1(%rsi), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L92
.L126:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L126
.L92:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L127
.L93:
	movl	-60(%rbp), %eax
	movq	%rsp, -72(%rbp)
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L94:
	cmpq	%rcx, %rsp
	je	.L95
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L94
.L127:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L93
.L95:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L128
.L96:
	movq	%rsp, %r12
	testl	%esi, %esi
	jle	.L97
	movq	-72(%rbp), %r13
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L98:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %esi
	addq	$4, %r13
	cmpl	%ebx, %esi
	jg	.L98
.L97:
	subl	$1, %esi
	je	.L99
	movq	-72(%rbp), %rdx
	xorl	%edi, %edi
	call	merge.part.0
.L99:
	movl	-60(%rbp), %esi
	testl	%esi, %esi
	jle	.L100
	movq	%r12, %rbx
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L101:
	movq	%rbx, %rsi
	leaq	4(%rbx), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	addl	$1, %r14d
	addq	$8, %rbx
	cmpl	%r14d, %esi
	jg	.L101
.L100:
	subl	$1, %esi
	je	.L102
	movq	%r12, %rdx
	xorl	%edi, %edi
	call	sort.part.0
.L102:
	movl	-64(%rbp), %r11d
	testl	%r11d, %r11d
	jle	.L109
	movl	-60(%rbp), %ebx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%r10d, %r10d
	xorl	%edx, %edx
	jmp	.L107
	.p2align 4,,10
	.p2align 3
.L129:
	cmpl	%ebx, %r8d
	jge	.L104
	addq	%rsi, %r9
	addl	$1, %r10d
.L105:
	cmpl	(%r12,%rcx,8), %r10d
	jne	.L106
	addl	$1, %r8d
	xorl	%r10d, %r10d
.L106:
	addl	$1, %edx
	cmpl	%edx, %r11d
	je	.L103
.L107:
	movq	-72(%rbp), %rcx
	movslq	%edi, %rax
	movslq	(%rcx,%rax,4), %rax
	movslq	%r8d, %rcx
	movslq	4(%r12,%rcx,8), %rsi
	cmpl	%esi, %eax
	jl	.L129
.L104:
	addq	%rax, %r9
	addl	$1, %edi
	jmp	.L105
.L109:
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L103:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L130
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L128:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L96
.L130:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	f
	.bss
	.align 32
	.type	f, @object
	.size	f, 800016
f:
	.zero	800016
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 400008
e:
	.zero	400008
	.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
	.section	.text.unlikely,"ax",@progbits
.LCOLDB0:
	.text
.LHOTB0:
	.p2align 4
	.type	merge.part.0, @function
merge.part.0:
.LFB26:
	.cfi_startproc
	leal	(%rdi,%rsi), %eax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movl	%eax, %r13d
	shrl	$31, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	addl	%eax, %r13d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%esi, %ebp
	sarl	%r13d
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	cmpl	%r13d, %edi
	je	.L2
	movl	%r13d, %esi
	call	merge.part.0
.L2:
	leal	1(%r13), %ebx
	cmpl	%ebx, %ebp
	je	.L3
	movq	%r12, %rdx
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	merge.part.0
.L3:
	cmpl	%ebp, %r14d
	jg	.L1
	leal	1(%r14), %eax
	movl	%r14d, %edx
	leaq	-4+e(%rip), %rsi
	cltq
.L21:
	cmpl	%edx, %r13d
	jge	.L5
	movslq	%ebx, %rdx
	movl	%eax, %r11d
	addl	$1, %ebx
	movl	(%r12,%rdx,4), %edx
	movl	%edx, (%rsi,%rax,4)
	cmpl	%eax, %ebp
	jl	.L42
	movl	%ebp, %r10d
	leaq	e(%rip), %rcx
	movslq	%ebx, %rdx
	subl	%eax, %r10d
	cltq
	leaq	4(,%rdx,4), %rdx
	leaq	0(,%rax,4), %rsi
	leaq	(%r12,%rdx), %r9
	leaq	(%rcx,%rsi), %rdi
	movq	%rdi, %r8
	subq	%r9, %r8
	cmpq	$8, %r8
	jbe	.L25
	cmpl	$2, %r10d
	jbe	.L25
	cmpl	%r11d, %ebp
	leal	1(%r10), %eax
	movl	$1, %esi
	cmovl	%esi, %eax
	leaq	-4(%r12,%rdx), %r8
	xorl	%edx, %edx
	movl	%eax, %r9d
	shrl	$2, %r9d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%edx, %rcx
	movl	(%r12,%rcx,4), %ecx
	cmpl	%ebx, %ebp
	jl	.L39
	movslq	%ebx, %rdi
	movl	(%r12,%rdi,4), %edi
	cmpl	%ecx, %edi
	jl	.L39
	movl	%edi, %ecx
	addl	$1, %ebx
	movl	%ecx, (%rsi,%rax,4)
	cmpl	%eax, %ebp
	jl	.L43
.L22:
	addq	$1, %rax
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%ecx, (%rsi,%rax,4)
	addl	$1, %edx
	cmpl	%eax, %ebp
	jge	.L22
.L43:
	leaq	e(%rip), %rcx
.L7:
	movslq	%r14d, %rax
	movl	%ebp, %edi
	leaq	0(,%rax,4), %rdx
	subl	%r14d, %edi
	leaq	(%r12,%rdx), %r8
	leaq	4(%rcx,%rdx), %r9
	movq	%r8, %rsi
	subq	%r9, %rsi
	cmpq	$8, %rsi
	jbe	.L30
	cmpl	$2, %edi
	jbe	.L30
	addl	$1, %edi
	addq	%rcx, %rdx
	xorl	%eax, %eax
	movl	%edi, %esi
	shrl	$2, %esi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L16:
	movdqu	(%rdx,%rax), %xmm0
	movups	%xmm0, (%r8,%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L16
	movl	%edi, %eax
	andl	$-4, %eax
	addl	%eax, %r14d
	cmpl	%eax, %edi
	je	.L1
	movslq	%r14d, %rax
	movl	(%rcx,%rax,4), %edx
	movl	%edx, (%r12,%rax,4)
	leal	1(%r14), %eax
	cmpl	%eax, %ebp
	jl	.L1
	cltq
	addl	$2, %r14d
	movl	(%rcx,%rax,4), %edx
	leaq	0(,%rax,4), %rsi
	movl	%edx, (%r12,%rax,4)
	cmpl	%r14d, %ebp
	jl	.L1
	movslq	%r14d, %r14
	movl	(%rcx,%r14,4), %eax
	movl	%eax, 4(%r12,%rsi)
.L1:
	popq	%rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	movl	(%rcx,%rax,4), %edx
	movl	%edx, (%r12,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %ebp
	jl	.L1
	movl	(%rcx,%rax,4), %edx
	movl	%edx, (%r12,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %ebp
	jge	.L30
	jmp	.L1
.L42:
	leaq	e(%rip), %rcx
	jmp	.L7
.L25:
	movq	%r12, %rdi
	subq	%rsi, %rdi
	leaq	-4(%rdi,%rdx), %rdx
	jmp	.L13
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	merge.part.0.cold, @function
merge.part.0.cold:
.LFSB26:
.L11:
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	movq	%rdx, %rsi
	addq	$1, %rdx
	salq	$4, %rsi
	movdqu	(%r8,%rsi), %xmm1
	movups	%xmm1, (%rdi,%rsi)
	cmpl	%edx, %r9d
	ja	.L11
	movl	%eax, %edx
	andl	$-4, %edx
	addl	%edx, %ebx
	addl	%edx, %r11d
	cmpl	%edx, %eax
	je	.L7
	movslq	%ebx, %rax
	addl	$1, %ebx
	movl	(%r12,%rax,4), %edx
	movslq	%r11d, %rax
	movl	%edx, (%rcx,%rax,4)
	leal	1(%r11), %edx
	cmpl	%edx, %ebp
	jl	.L7
	movslq	%ebx, %rax
	movslq	%edx, %rdx
	addl	$2, %r11d
	leaq	0(,%rax,4), %rsi
	movl	(%r12,%rax,4), %eax
	movl	%eax, (%rcx,%rdx,4)
	cmpl	%r11d, %ebp
	jl	.L7
	movl	4(%r12,%rsi), %eax
	movslq	%r11d, %r11
	movl	%eax, (%rcx,%r11,4)
	jmp	.L7
.L13:
	movl	(%rdx,%rax,4), %esi
	movl	%esi, (%rcx,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %ebp
	jge	.L13
	jmp	.L7
	.cfi_endproc
.LFE26:
	.text
	.size	merge.part.0, .-merge.part.0
	.section	.text.unlikely
	.size	merge.part.0.cold, .-merge.part.0.cold
.LCOLDE0:
	.text
.LHOTE0:
	.section	.text.unlikely
.LCOLDB1:
	.text
.LHOTB1:
	.p2align 4
	.type	sort.part.0, @function
sort.part.0:
.LFB27:
	.cfi_startproc
	leal	(%rdi,%rsi), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%edi, %r14d
	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	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	addl	%eax, %r13d
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sarl	%r13d
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	%r13d, %edi
	je	.L45
	movl	%r13d, %esi
	call	sort.part.0
.L45:
	leal	1(%r13), %ebx
	cmpl	%ebx, %r12d
	je	.L46
	movq	%rbp, %rdx
	movl	%r12d, %esi
	movl	%ebx, %edi
	call	sort.part.0
.L46:
	cmpl	%r12d, %r14d
	jg	.L44
	movslq	%r14d, %rax
	leaq	f(%rip), %rsi
	movl	%r14d, %ecx
	movl	%r14d, %edx
	movq	%rax, 8(%rsp)
	salq	$3, %rax
	leaq	(%rsi,%rax), %r9
	movq	%rax, (%rsp)
	movq	%r9, %r10
	movq	%r9, %rax
.L68:
	cmpl	%edx, %r13d
	jge	.L48
	movslq	%ebx, %rdx
	addl	$1, %ebx
	leaq	0(%rbp,%rdx,8), %rdx
	movl	(%rdx), %edi
	movl	%edi, (%rax)
	movl	4(%rdx), %edx
	movl	%edx, 4(%rax)
	leal	1(%rcx), %eax
	cmpl	%eax, %r12d
	jl	.L50
	movslq	%eax, %r11
	movslq	%ebx, %rbx
	leaq	0(,%r11,8), %rdx
	leaq	0(%rbp,%rbx,8), %r8
	leaq	(%rsi,%rdx), %r13
	leaq	16(%rsi,%rdx), %rdx
	leaq	16(,%rbx,8), %rdi
	cmpq	%rdx, %r8
	jnb	.L70
	addq	%rbp, %rdi
	cmpq	%rdi, %r13
	jb	.L83
.L70:
	movl	%r12d, %edx
	subl	%ecx, %edx
	cmpl	%eax, %r12d
	movl	$1, %ecx
	cmovl	%ecx, %edx
	je	.L72
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L48:
	movslq	%edx, %rdi
	leaq	0(%rbp,%rdi,8), %r8
	cmpl	%ebx, %r12d
	jge	.L51
	movl	(%r8), %edi
	addl	$1, %edx
	movl	%edi, (%rax)
	movl	4(%r8), %edi
.L52:
	addl	$1, %ecx
	movl	%edi, 4(%rax)
	cmpl	%ecx, %r12d
	jl	.L50
.L69:
	addq	$8, %rax
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L51:
	movslq	%ebx, %rdi
	movl	4(%r8), %r15d
	leaq	0(%rbp,%rdi,8), %r11
	movl	4(%r11), %edi
	cmpl	%edi, %r15d
	jle	.L53
	movl	(%r8), %edi
	addl	$1, %ecx
	addl	$1, %edx
	movl	%edi, (%rax)
	movl	%r15d, %edi
	movl	%edi, 4(%rax)
	cmpl	%ecx, %r12d
	jge	.L69
.L50:
	movq	(%rsp), %rcx
	leaq	16(%rcx), %rax
	leaq	0(%rbp,%rcx), %rdx
	leaq	(%rsi,%rax), %rcx
	cmpq	%rcx, %rdx
	jnb	.L74
	addq	%rbp, %rax
	cmpq	%rax, %r9
	jb	.L59
.L74:
	movl	%r12d, %edi
	subl	%r14d, %edi
	addl	$1, %edi
	cmpl	%r12d, %r14d
	je	.L73
	movl	%edi, %ecx
	xorl	%eax, %eax
	shrl	%ecx
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L62:
	movdqu	(%r9,%rax), %xmm0
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L62
	movl	%edi, %eax
	andl	$-2, %eax
	andl	$1, %edi
	je	.L44
.L61:
	addq	8(%rsp), %rax
	movq	(%rsi,%rax,8), %rdx
	movq	%rdx, 0(%rbp,%rax,8)
.L44:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	.cfi_restore_state
	movl	(%r11), %r8d
	addl	$1, %ebx
	movl	%r8d, (%rax)
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L83:
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L59:
	subl	%r14d, %r12d
	addq	8(%rsp), %r12
	movq	%rdx, %rax
	leaq	8(%rbp,%r12,8), %rcx
	.p2align 4,,10
	.p2align 3
.L66:
	movq	(%r10), %rdx
	addq	$8, %rax
	addq	$8, %r10
	movq	%rdx, -8(%rax)
	cmpq	%rcx, %rax
	jne	.L66
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L73:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L61
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	sort.part.0.cold, @function
sort.part.0.cold:
.LFSB27:
.L72:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	xorl	%eax, %eax
.L54:
	addq	%rax, %rbx
	addq	%r11, %rax
	movq	0(%rbp,%rbx,8), %rdx
	movq	%rdx, (%rsi,%rax,8)
	jmp	.L50
.L57:
	movq	(%r8), %rax
	addq	$8, %r8
	movq	%rax, (%rsi,%r11,8)
	addq	$1, %r11
	cmpl	%r11d, %r12d
	jge	.L57
	jmp	.L50
.L79:
	movl	%edx, %edi
	xorl	%eax, %eax
	shrl	%edi
.L55:
	movq	%rax, %rcx
	addq	$1, %rax
	salq	$4, %rcx
	movdqu	(%r8,%rcx), %xmm1
	movups	%xmm1, 0(%r13,%rcx)
	cmpl	%eax, %edi
	ja	.L55
	movl	%edx, %eax
	andl	$-2, %eax
	andb	$1, %dl
	jne	.L54
	jmp	.L50
	.cfi_endproc
.LFE27:
	.text
	.size	sort.part.0, .-sort.part.0
	.section	.text.unlikely
	.size	sort.part.0.cold, .-sort.part.0.cold
.LCOLDE1:
	.text
.LHOTE1:
	.p2align 4
	.globl	merge
	.type	merge, @function
merge:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	jne	.L86
	ret
	.p2align 4,,10
	.p2align 3
.L86:
	jmp	merge.part.0
	.cfi_endproc
.LFE23:
	.size	merge, .-merge
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	jne	.L89
	ret
	.p2align 4,,10
	.p2align 3
.L89:
	jmp	sort.part.0
	.cfi_endproc
.LFE24:
	.size	sort, .-sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	leaq	.LC2(%rip), %r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %esi
	movq	%rsp, %rcx
	leal	1(%rsi), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L92
.L126:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L126
.L92:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L127
.L93:
	movl	-60(%rbp), %eax
	movq	%rsp, -72(%rbp)
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L94:
	cmpq	%rcx, %rsp
	je	.L95
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L94
.L127:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L93
.L95:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L128
.L96:
	movq	%rsp, %r12
	testl	%esi, %esi
	jle	.L97
	movq	-72(%rbp), %r13
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L98:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %esi
	addq	$4, %r13
	cmpl	%ebx, %esi
	jg	.L98
.L97:
	subl	$1, %esi
	je	.L99
	movq	-72(%rbp), %rdx
	xorl	%edi, %edi
	call	merge.part.0
.L99:
	movl	-60(%rbp), %esi
	testl	%esi, %esi
	jle	.L100
	movq	%r12, %rbx
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L101:
	movq	%rbx, %rsi
	leaq	4(%rbx), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	addl	$1, %r14d
	addq	$8, %rbx
	cmpl	%r14d, %esi
	jg	.L101
.L100:
	subl	$1, %esi
	je	.L102
	movq	%r12, %rdx
	xorl	%edi, %edi
	call	sort.part.0
.L102:
	movl	-64(%rbp), %r11d
	testl	%r11d, %r11d
	jle	.L109
	movl	-60(%rbp), %ebx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%r10d, %r10d
	xorl	%edx, %edx
	jmp	.L107
	.p2align 4,,10
	.p2align 3
.L129:
	cmpl	%ebx, %r8d
	jge	.L104
	addq	%rsi, %r9
	addl	$1, %r10d
.L105:
	cmpl	(%r12,%rcx,8), %r10d
	jne	.L106
	addl	$1, %r8d
	xorl	%r10d, %r10d
.L106:
	addl	$1, %edx
	cmpl	%edx, %r11d
	je	.L103
.L107:
	movq	-72(%rbp), %rcx
	movslq	%edi, %rax
	movslq	(%rcx,%rax,4), %rax
	movslq	%r8d, %rcx
	movslq	4(%r12,%rcx,8), %rsi
	cmpl	%esi, %eax
	jl	.L129
.L104:
	addq	%rax, %r9
	addl	$1, %edi
	jmp	.L105
.L109:
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L103:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L130
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L128:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L96
.L130:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	f
	.bss
	.align 32
	.type	f, @object
	.size	f, 800016
f:
	.zero	800016
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 400008
e:
	.zero	400008
	.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>
int e[100002],f[100002][2];
//大きい順
void merge(int i,int j,int *s){
  if(i!=j){
    merge(i,(i+j)/2,s);
    merge((i+j)/2+1,j,s);
    int a=i,b=(i+j)/2+1;
    int d;
    for(d=i;d<=j;d++){
      if((i+j)/2<a){
        e[d]=s[b];
        b++;
      }
      else if(j<b){
        e[d]=s[a];
        a++;
      }
      else if(s[a]>s[b]){
        e[d]=s[a];
        a++;
      }
      else{
        e[d]=s[b];
        b++;
      }
    }
    for(d=i;d<=j;d++)
      s[d]=e[d];
  }
}

//大きい順
void sort(int i,int j,int s[][2]){
  if(i!=j){
    sort(i,(i+j)/2,s);
    sort((i+j)/2+1,j,s);
    int a=i,b=(i+j)/2+1;
    int d;
    for(d=i;d<=j;d++){
      if((i+j)/2<a){
        f[d][0]=s[b][0];
        f[d][1]=s[b][1];
        b++;
      }
      else if(j<b){
        f[d][0]=s[a][0];
        f[d][1]=s[a][1];
        a++;
      }
      else if(s[a][1]>s[b][1]){
        f[d][0]=s[a][0];
        f[d][1]=s[a][1];
        a++;
      }
      else{
        f[d][0]=s[b][0];
        f[d][1]=s[b][1];
        b++;
      }
    }
    for(d=i;d<=j;d++){
      s[d][0]=f[d][0];
      s[d][1]=f[d][1];
    }
  }
}

int main(){
  int n,m,i;
  scanf("%d%d",&n,&m);
  int a[n+1],b[m+1][2];
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);
  merge(0,n-1,a);
  for(i=0;i<m;i++)
    scanf("%d%d",&b[i][0],&b[i][1]);
  sort(0,m-1,b);
  int bcount=0,anum=0,bnum=0;
  long long sum=0;
  for(i=0;i<n;i++){
    long long num;
    if(a[anum]<b[bnum][1] && bnum<m){
      num=b[bnum][1];
      sum+=num;
      bcount++;
    }
    else{
      num=a[anum];
      sum+=num;
      anum++;
    }
    if(bcount==b[bnum][0]){
      bnum++;
      bcount=0;
    }
  }
  printf("%lld\n",sum);
  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>
int e[100002],f[100002][2];
//大きい順
void merge(int i,int j,int *s){
  if(i!=j){
    merge(i,(i+j)/2,s);
    merge((i+j)/2+1,j,s);
    int a=i,b=(i+j)/2+1;
    int d;
    for(d=i;d<=j;d++){
      if((i+j)/2<a){
        e[d]=s[b];
        b++;
      }
      else if(j<b){
        e[d]=s[a];
        a++;
      }
      else if(s[a]>s[b]){
        e[d]=s[a];
        a++;
      }
      else{
        e[d]=s[b];
        b++;
      }
    }
    for(d=i;d<=j;d++)
      s[d]=e[d];
  }
}

//大きい順
void sort(int i,int j,int s[][2]){
  if(i!=j){
    sort(i,(i+j)/2,s);
    sort((i+j)/2+1,j,s);
    int a=i,b=(i+j)/2+1;
    int d;
    for(d=i;d<=j;d++){
      if((i+j)/2<a){
        f[d][0]=s[b][0];
        f[d][1]=s[b][1];
        b++;
      }
      else if(j<b){
        f[d][0]=s[a][0];
        f[d][1]=s[a][1];
        a++;
      }
      else if(s[a][1]>s[b][1]){
        f[d][0]=s[a][0];
        f[d][1]=s[a][1];
        a++;
      }
      else{
        f[d][0]=s[b][0];
        f[d][1]=s[b][1];
        b++;
      }
    }
    for(d=i;d<=j;d++){
      s[d][0]=f[d][0];
      s[d][1]=f[d][1];
    }
  }
}

int main(){
  int n,m,i;
  scanf("%d%d",&n,&m);
  int a[n+1],b[m+1][2];
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);
  merge(0,n-1,a);
  for(i=0;i<m;i++)
    scanf("%d%d",&b[i][0],&b[i][1]);
  sort(0,m-1,b);
  int bcount=0,anum=0,bnum=0;
  long long sum=0;
  for(i=0;i<n;i++){
    long long num;
    if(a[anum]<b[bnum][1] && bnum<m){
      num=b[bnum][1];
      sum+=num;
      bcount++;
    }
    else{
      num=a[anum];
      sum+=num;
      anum++;
    }
    if(bcount==b[bnum][0]){
      bnum++;
      bcount=0;
    }
  }
  printf("%lld\n",sum);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	e
	.bss
	.align 32
	.type	e, @object
	.size	e, 400008
e:
	.zero	400008
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 800016
f:
	.zero	800016
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L11
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	merge
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	merge
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L8:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -12(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L6
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L5
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L5
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L5:
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L8
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	e(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L10
.L11:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	merge, .-merge
	.globl	sort
	.type	sort, @function
sort:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L22
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	sort
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	sort
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L14
.L19:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -12(%rbp)
	jle	.L15
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
	jmp	.L16
.L15:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L17
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L16
.L18:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L16:
	addl	$1, -4(%rbp)
.L14:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	f(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+f(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, 4(%rdx)
	addl	$1, -4(%rbp)
.L20:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L21
.L22:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-124(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L24:
	cmpq	%rdx, %rsp
	je	.L25
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L24
.L25:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L26
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L26:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-124(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	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
.L27:
	cmpq	%rdx, %rsp
	je	.L28
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L27
.L28:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L29
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L29:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L30
.L31:
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L30:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L31
	movl	-128(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-88(%rbp), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	movl	$0, %edi
	call	merge
	movl	$0, -120(%rbp)
	jmp	.L32
.L33:
	movl	-120(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	%rax, %rdx
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L32:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L33
	movl	-124(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-72(%rbp), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	movl	$0, %edi
	call	sort
	movl	$0, -116(%rbp)
	movl	$0, -112(%rbp)
	movl	$0, -108(%rbp)
	movq	$0, -104(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L34
.L38:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,8), %eax
	cmpl	%eax, %ecx
	jge	.L35
	movl	-124(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jge	.L35
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,8), %eax
	cltq
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	addq	%rax, -104(%rbp)
	addl	$1, -116(%rbp)
	jmp	.L36
.L35:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	addq	%rax, -104(%rbp)
	addl	$1, -112(%rbp)
.L36:
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,8), %eax
	cmpl	%eax, -116(%rbp)
	jne	.L37
	addl	$1, -108(%rbp)
	movl	$0, -116(%rbp)
.L37:
	addl	$1, -120(%rbp)
.L34:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L38
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	e
	.bss
	.align 32
	.type	e, @object
	.size	e, 400008
e:
	.zero	400008
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 800016
f:
	.zero	800016
	.text
	.globl	merge
	.type	merge, @function
merge:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L11
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	merge
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	merge
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L3
.L8:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -12(%rbp)
	jle	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L6
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L5
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L5
.L7:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L5:
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L8
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	e(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L10
.L11:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	merge, .-merge
	.globl	sort
	.type	sort, @function
sort:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	je	.L22
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %ecx
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	sort
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	sort
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L14
.L19:
	movl	-20(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -12(%rbp)
	jle	.L15
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
	jmp	.L16
.L15:
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L17
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L16
.L17:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jle	.L18
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	jmp	.L16
.L18:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+f(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -8(%rbp)
.L16:
	addl	$1, -4(%rbp)
.L14:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	f(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+f(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, 4(%rdx)
	addl	$1, -4(%rbp)
.L20:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L21
.L22:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$120, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-124(%rbp), %rdx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L24:
	cmpq	%rdx, %rsp
	je	.L25
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L24
.L25:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L26
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L26:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	-124(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	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
.L27:
	cmpq	%rdx, %rsp
	je	.L28
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L27
.L28:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L29
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L29:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L30
.L31:
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L30:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L31
	movl	-128(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-88(%rbp), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	movl	$0, %edi
	call	merge
	movl	$0, -120(%rbp)
	jmp	.L32
.L33:
	movl	-120(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	%rax, %rdx
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L32:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L33
	movl	-124(%rbp), %eax
	leal	-1(%rax), %ecx
	movq	-72(%rbp), %rax
	movq	%rax, %rdx
	movl	%ecx, %esi
	movl	$0, %edi
	call	sort
	movl	$0, -116(%rbp)
	movl	$0, -112(%rbp)
	movl	$0, -108(%rbp)
	movq	$0, -104(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L34
.L38:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,8), %eax
	cmpl	%eax, %ecx
	jge	.L35
	movl	-124(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jge	.L35
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	4(%rax,%rdx,8), %eax
	cltq
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	addq	%rax, -104(%rbp)
	addl	$1, -116(%rbp)
	jmp	.L36
.L35:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	addq	%rax, -104(%rbp)
	addl	$1, -112(%rbp)
.L36:
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,8), %eax
	cmpl	%eax, -116(%rbp)
	jne	.L37
	addl	$1, -108(%rbp)
	movl	$0, -116(%rbp)
.L37:
	addl	$1, -120(%rbp)
.L34:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L38
	movq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
