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>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

int *tmp;

void msort(int *a,int n){
  if(n<=1) return;
  int m=n/2;
  msort(a,m);
  msort(a+m,n-m);
  int i=0;
  int j=m;
  int k=0;
  while(i<m && j<n){
    if(a[i]<=a[j]){
      tmp[k++]=a[i++];
    } else {
      tmp[k++]=a[j++];
    }
  }
  while(i<m) tmp[k++]=a[i++];
  for(i=0;i<k;i++) a[i]=tmp[i];
  return;
}

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)malloc(sizeof(int)*n);
  int *b=(int *)malloc(sizeof(int)*n);
  int *c=(int *)malloc(sizeof(int)*n);
  int i;
  for(i=0;i<n;i++) scanf("%d",a+i);
  for(i=0;i<n;i++) scanf("%d",b+i);
  for(i=0;i<n;i++) scanf("%d",c+i);
  tmp=(int *)malloc(sizeof(int)*n);
  msort(a,n);
  msort(b,n);
  msort(c,n);
  int64 *cnt=(int64 *)calloc(n,sizeof(int64));
  int j=0;
  for(i=0;i<n;i++){
    while(j<n && b[i]>=c[j]) j++;
    cnt[i]=n-j;
  }
  for(i=n-1;i>0;i--) cnt[i-1]+=cnt[i];
  int64 sum=0;
  j=0;
  for(i=0;i<n;i++){
    while(j<n && a[i]>=b[j]) j++;
    sum+=cnt[j];
  }
  printf("%lld\n",sum);
}

int main(void){
  run();
  return 0;
}```

Unoptimized Assembly Code:

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

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.type	msort.part.0, @function
msort.part.0:
.LFB42:
	.cfi_startproc
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sarl	%ebp
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpl	$1, %ebp
	je	.L2
	movl	%ebp, %esi
	call	msort.part.0
.L2:
	movl	%r12d, %esi
	subl	%ebp, %esi
	cmpl	$1, %esi
	jle	.L3
	movslq	%ebp, %rax
	leaq	(%rbx,%rax,4), %rdi
	call	msort.part.0
.L3:
	cmpl	%ebp, %r12d
	jle	.L23
	movq	tmp(%rip), %r8
	movl	%ebp, %ecx
	movl	$1, %eax
	xorl	%edx, %edx
	xorl	%r11d, %r11d
	movslq	%ebp, %r10
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rbx,%r11,4), %edi
	movl	(%rbx,%r10,4), %esi
	movl	%eax, %r9d
	cmpl	%edi, %esi
	jl	.L5
.L57:
	movl	%edi, -4(%r8,%rax,4)
	addl	$1, %edx
	addq	$1, %rax
	cmpl	%ecx, %r12d
	jle	.L8
	cmpl	%edx, %ebp
	jle	.L13
	movslq	%edx, %r11
	movl	(%rbx,%r10,4), %esi
	movl	%eax, %r9d
	movl	(%rbx,%r11,4), %edi
	cmpl	%edi, %esi
	jge	.L57
.L5:
	movl	%esi, -4(%r8,%rax,4)
	addl	$1, %ecx
	addq	$1, %rax
	cmpl	%edx, %ebp
	jle	.L13
	cmpl	%ecx, %r12d
	jle	.L8
	movslq	%ecx, %r10
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%edx, %ebp
	jle	.L13
.L4:
	movslq	%r9d, %rax
	movslq	%edx, %r11
	movl	%ebp, %edi
	salq	$2, %rax
	leaq	1(%r11), %rsi
	subl	%edx, %edi
	leaq	(%r8,%rax), %r10
	leaq	0(,%rsi,4), %rcx
	leaq	(%rbx,%rcx), %r13
	movq	%r10, %r12
	subq	%r13, %r12
	cmpq	$8, %r12
	jbe	.L10
	leal	-1(%rdi), %r12d
	cmpl	$2, %r12d
	jbe	.L10
	leaq	-4(%rbx,%rcx), %rsi
	movl	%edi, %ecx
	xorl	%eax, %eax
	shrl	$2, %ecx
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rsi,%rax), %xmm0
	movups	%xmm0, (%r10,%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L11
	movl	%edi, %eax
	andl	$-4, %eax
	addl	%eax, %edx
	leal	(%r9,%rax), %ecx
	cmpl	%eax, %edi
	je	.L16
	movslq	%edx, %r10
	leal	1(%rcx), %esi
	leal	1(%rdx), %eax
	movslq	%ecx, %rcx
	movl	(%rbx,%r10,4), %r10d
	movl	%r10d, (%r8,%rcx,4)
	cmpl	%eax, %ebp
	jle	.L16
	cltq
	movslq	%esi, %rcx
	addl	$2, %edx
	leaq	0(,%rax,4), %r10
	movl	(%rbx,%rax,4), %eax
	leaq	0(,%rcx,4), %rsi
	movl	%eax, (%r8,%rcx,4)
	cmpl	%edx, %ebp
	jle	.L16
	movl	4(%rbx,%r10), %eax
	movl	%eax, 4(%r8,%rsi)
.L16:
	addl	%edi, %r9d
.L13:
	leaq	4(%r8), %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	cmpq	$8, %rax
	jbe	.L24
	cmpl	$3, %r9d
	jle	.L24
	testl	%r9d, %r9d
	movl	$1, %ecx
	cmovg	%r9d, %ecx
	xorl	%eax, %eax
	movl	%ecx, %edx
	shrl	$2, %edx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L18:
	movdqu	(%r8,%rax), %xmm1
	movups	%xmm1, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L18
	movl	%ecx, %eax
	andl	$-4, %eax
	andl	$3, %ecx
	je	.L1
	movl	%eax, %ecx
	movl	(%r8,%rcx,4), %esi
	leaq	0(,%rcx,4), %rdx
	movl	%esi, (%rbx,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %r9d
	jle	.L1
	movl	4(%r8,%rdx), %ecx
	addl	$2, %eax
	movl	%ecx, 4(%rbx,%rdx)
	cmpl	%r9d, %eax
	jge	.L1
	movl	8(%r8,%rdx), %eax
	movl	%eax, 8(%rbx,%rdx)
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movq	%r11, %rdx
	negq	%rdx
	leaq	(%rax,%rdx,4), %rdx
	addq	%r8, %rdx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L58:
	addq	$1, %rsi
.L15:
	movl	(%rbx,%r11,4), %eax
	movl	%eax, (%rdx,%r11,4)
	movq	%rsi, %r11
	cmpl	%esi, %ebp
	jg	.L58
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L24:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r8,%rax,4), %edx
	movl	%edx, (%rbx,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %r9d
	jg	.L17
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	tmp(%rip), %r8
	xorl	%r9d, %r9d
	xorl	%edx, %edx
	jmp	.L4
	.cfi_endproc
.LFE42:
	.size	msort.part.0, .-msort.part.0
	.p2align 4
	.globl	msort
	.type	msort, @function
msort:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %esi
	jle	.L59
	jmp	msort.part.0
	.p2align 4,,10
	.p2align 3
.L59:
	ret
	.cfi_endproc
.LFE39:
	.size	msort, .-msort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB2:
	.text
.LHOTB2:
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %r15
	leaq	0(,%r15,4), %rdi
	movq	%rdi, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, (%rsp)
	movq	%rax, %rbx
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, %r14
	call	malloc@PLT
	testl	%r15d, %r15d
	movq	8(%rsp), %rdi
	movq	%rax, %r12
	jle	.L132
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L63:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebp
	addq	$4, %rbx
	cmpl	%r15d, %ebp
	jg	.L63
	testl	%ebp, %ebp
	jle	.L135
	movq	%r14, %rbx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L65:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebp
	addq	$4, %rbx
	cmpl	%r15d, %ebp
	jg	.L65
	testl	%ebp, %ebp
	jle	.L66
	movq	%r12, %rbx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L67:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebp
	addq	$4, %rbx
	cmpl	%r15d, %ebp
	jg	.L67
	movslq	%ebp, %r15
	leaq	0(,%r15,4), %rdi
	call	malloc@PLT
	movq	%rax, tmp(%rip)
	cmpl	$1, %ebp
	jle	.L71
	movq	(%rsp), %rdi
	movl	%ebp, %esi
	call	msort.part.0
	movl	20(%rsp), %ebp
	cmpl	$1, %ebp
	jle	.L134
	movl	%ebp, %esi
	movq	%r14, %rdi
	call	msort.part.0
	movl	20(%rsp), %ebp
	cmpl	$1, %ebp
	jle	.L134
	movl	%ebp, %esi
	movq	%r12, %rdi
	call	msort.part.0
	movslq	20(%rsp), %r15
	movq	%r15, %rbp
.L71:
	movl	$8, %esi
	movq	%r15, %rdi
	movq	%r15, %r13
	call	calloc@PLT
	leal	-1(%rbp), %esi
	movl	$1, %r8d
	movq	%rax, %rdi
	xorl	%eax, %eax
	testl	%ebp, %ebp
	jle	.L70
	.p2align 4,,10
	.p2align 3
.L98:
	movslq	%eax, %rdx
	movl	-4(%r14,%r8,4), %ecx
	leaq	(%r12,%rdx,4), %rdx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L74:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%ebp, %eax
	je	.L73
.L78:
	cmpl	(%rdx), %ecx
	jge	.L74
	movl	%ebp, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	movq	%rdx, -8(%rdi,%r8,8)
	cmpq	%r15, %r8
	je	.L101
	addq	$1, %r8
	cmpl	%ebp, %eax
	jl	.L98
	jmp	.L99
	.p2align 4,,10
	.p2align 3
.L73:
	movq	$0, -8(%rdi,%r8,8)
	cmpq	%r15, %r8
	jne	.L136
.L101:
	testl	%esi, %esi
	jle	.L80
.L79:
	movq	-8(%rdi,%r13,8), %rdx
	movslq	%esi, %rax
	.p2align 4,,10
	.p2align 3
.L82:
	addq	-8(%rdi,%rax,8), %rdx
	movq	%rdx, -8(%rdi,%rax,8)
	subq	$1, %rax
	testl	%eax, %eax
	jg	.L82
	testl	%ebp, %ebp
	jle	.L81
.L80:
	movl	%ebp, %r9d
	xorl	%r8d, %r8d
	xorl	%edx, %edx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L92:
	movq	(%rsp), %rax
	movl	-4(%rax,%rsi,4), %ecx
	movslq	%edx, %rax
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L86:
	leal	1(%rax), %edx
	addq	$1, %rax
	cmpl	%eax, %ebp
	jle	.L137
.L84:
	movl	%eax, %edx
	cmpl	(%r14,%rax,4), %ecx
	jge	.L86
.L85:
	addq	(%rdi,%rax,8), %r8
	cmpq	%r9, %rsi
	je	.L87
	addq	$1, %rsi
	cmpl	%ebp, %edx
	jl	.L92
	movslq	%edx, %rdx
	movq	(%rdi,%rdx,8), %rax
	leaq	(%r8,%rax), %rcx
	movq	%rcx, %r8
	cmpq	%r9, %rsi
	jne	.L138
.L87:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L139
	addq	$40, %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
.L137:
	.cfi_restore_state
	movslq	%edx, %rax
	jmp	.L85
.L136:
	addq	$1, %r8
.L99:
	movl	%ebp, %ecx
	movl	%r8d, %r9d
	subl	%eax, %ecx
	movslq	%ecx, %r10
	movq	%r10, -8(%rdi,%r8,8)
	cmpq	%r8, %r15
	je	.L101
	movl	%ebp, %eax
	movl	$1, %edx
	subl	%r8d, %eax
	cmpl	%ebp, %r8d
	cmovl	%eax, %edx
	subl	$1, %eax
	cmpl	$2, %eax
	jbe	.L102
	movd	%ecx, %xmm3
	pxor	%xmm1, %xmm1
	movl	%edx, %r11d
	movslq	%r9d, %rax
	pshufd	$0, %xmm3, %xmm0
	shrl	$2, %r11d
	leaq	(%rdi,%rax,8), %rax
	xorl	%r8d, %r8d
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm2
	punpckhdq	%xmm1, %xmm0
	jmp	.L76
.L66:
	movslq	%ebp, %r13
	leaq	0(,%r13,4), %rdi
	call	malloc@PLT
	movl	$8, %esi
	movq	%r13, %rdi
	movq	%rax, tmp(%rip)
	call	calloc@PLT
	leal	-1(%rbp), %esi
	movq	%rax, %rdi
.L70:
	testl	%esi, %esi
	jg	.L79
.L81:
	xorl	%r8d, %r8d
	jmp	.L87
.L132:
	movq	%r15, %rbp
.L62:
	call	malloc@PLT
	movq	%rax, tmp(%rip)
	jmp	.L71
.L139:
	call	__stack_chk_fail@PLT
.L135:
	movslq	%ebp, %r15
	leaq	0(,%r15,4), %rdi
	jmp	.L62
.L138:
	movl	%ebp, %r9d
	subl	%esi, %r9d
	cmpl	%ebp, %esi
	movl	$1, %esi
	cmovl	%r9d, %esi
	subl	$1, %r9d
	je	.L94
	movq	%rax, %xmm0
	movl	%esi, %r8d
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	shrl	%r8d
	punpcklqdq	%xmm0, %xmm0
	jmp	.L88
.L134:
	movslq	%ebp, %r15
	jmp	.L71
.L94:
	addq	(%rdi,%rdx,8), %r8
	jmp	.L87
.L102:
	movslq	%r9d, %rdx
	movq	%r10, (%rdi,%rdx,8)
	leaq	0(,%rdx,8), %rax
	leal	1(%r9), %edx
	cmpl	%ebp, %edx
	jl	.L122
	jmp	.L101
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	run.cold, @function
run.cold:
.LFSB40:
.L88:
	.cfi_def_cfa_offset 96
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	addl	$1, %eax
	paddq	%xmm0, %xmm1
	cmpl	%r8d, %eax
	jne	.L88
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	paddq	%xmm0, %xmm1
	movq	%xmm1, %r8
	addq	%rcx, %r8
	andb	$1, %sil
	je	.L87
	jmp	.L94
.L76:
	addl	$1, %r8d
	movups	%xmm2, (%rax)
	addq	$32, %rax
	movups	%xmm0, -16(%rax)
	cmpl	%r8d, %r11d
	jne	.L76
	movl	%edx, %eax
	andl	$-4, %eax
	addl	%eax, %r9d
	cmpl	%edx, %eax
	je	.L101
	jmp	.L102
.L122:
	addl	$2, %r9d
	movq	%r10, 8(%rdi,%rax)
	cmpl	%r9d, %ebp
	jle	.L101
	movq	%r10, 16(%rdi,%rax)
	jmp	.L101
	.cfi_endproc
.LFE40:
	.text
	.size	run, .-run
	.section	.text.unlikely
	.size	run.cold, .-run.cold
.LCOLDE2:
	.text
.LHOTE2:
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	tmp
	.bss
	.align 8
	.type	tmp, @object
	.size	tmp, 8
tmp:
	.zero	8
	.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	msort.part.0, @function
msort.part.0:
.LFB42:
	.cfi_startproc
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sarl	%ebp
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	cmpl	$1, %ebp
	je	.L2
	movl	%ebp, %esi
	call	msort.part.0
.L2:
	movl	%r12d, %esi
	subl	%ebp, %esi
	cmpl	$1, %esi
	jle	.L3
	movslq	%ebp, %rax
	leaq	(%rbx,%rax,4), %rdi
	call	msort.part.0
.L3:
	cmpl	%ebp, %r12d
	jle	.L23
	movq	tmp(%rip), %r8
	movl	%ebp, %ecx
	movl	$1, %eax
	xorl	%edx, %edx
	xorl	%r11d, %r11d
	movslq	%ebp, %r10
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rbx,%r11,4), %edi
	movl	(%rbx,%r10,4), %esi
	movl	%eax, %r9d
	cmpl	%edi, %esi
	jl	.L5
.L57:
	movl	%edi, -4(%r8,%rax,4)
	addl	$1, %edx
	addq	$1, %rax
	cmpl	%ecx, %r12d
	jle	.L8
	cmpl	%edx, %ebp
	jle	.L13
	movslq	%edx, %r11
	movl	(%rbx,%r10,4), %esi
	movl	%eax, %r9d
	movl	(%rbx,%r11,4), %edi
	cmpl	%edi, %esi
	jge	.L57
.L5:
	movl	%esi, -4(%r8,%rax,4)
	addl	$1, %ecx
	addq	$1, %rax
	cmpl	%edx, %ebp
	jle	.L13
	cmpl	%ecx, %r12d
	jle	.L8
	movslq	%ecx, %r10
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%edx, %ebp
	jle	.L13
.L4:
	movslq	%r9d, %rax
	movslq	%edx, %r11
	movl	%ebp, %edi
	salq	$2, %rax
	leaq	1(%r11), %rsi
	subl	%edx, %edi
	leaq	(%r8,%rax), %r10
	leaq	0(,%rsi,4), %rcx
	leaq	(%rbx,%rcx), %r13
	movq	%r10, %r12
	subq	%r13, %r12
	cmpq	$8, %r12
	jbe	.L10
	leal	-1(%rdi), %r12d
	cmpl	$2, %r12d
	jbe	.L10
	leaq	-4(%rbx,%rcx), %rsi
	movl	%edi, %ecx
	xorl	%eax, %eax
	shrl	$2, %ecx
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rsi,%rax), %xmm0
	movups	%xmm0, (%r10,%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L11
	movl	%edi, %eax
	andl	$-4, %eax
	addl	%eax, %edx
	leal	(%r9,%rax), %ecx
	cmpl	%eax, %edi
	je	.L16
	movslq	%edx, %r10
	leal	1(%rcx), %esi
	leal	1(%rdx), %eax
	movslq	%ecx, %rcx
	movl	(%rbx,%r10,4), %r10d
	movl	%r10d, (%r8,%rcx,4)
	cmpl	%eax, %ebp
	jle	.L16
	cltq
	movslq	%esi, %rcx
	addl	$2, %edx
	leaq	0(,%rax,4), %r10
	movl	(%rbx,%rax,4), %eax
	leaq	0(,%rcx,4), %rsi
	movl	%eax, (%r8,%rcx,4)
	cmpl	%edx, %ebp
	jle	.L16
	movl	4(%rbx,%r10), %eax
	movl	%eax, 4(%r8,%rsi)
.L16:
	addl	%edi, %r9d
.L13:
	leaq	4(%r8), %rdx
	movq	%rbx, %rax
	subq	%rdx, %rax
	cmpq	$8, %rax
	jbe	.L24
	cmpl	$3, %r9d
	jle	.L24
	testl	%r9d, %r9d
	movl	$1, %ecx
	cmovg	%r9d, %ecx
	xorl	%eax, %eax
	movl	%ecx, %edx
	shrl	$2, %edx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L18:
	movdqu	(%r8,%rax), %xmm1
	movups	%xmm1, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L18
	movl	%ecx, %eax
	andl	$-4, %eax
	andl	$3, %ecx
	je	.L1
	movl	%eax, %ecx
	movl	(%r8,%rcx,4), %esi
	leaq	0(,%rcx,4), %rdx
	movl	%esi, (%rbx,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %r9d
	jle	.L1
	movl	4(%r8,%rdx), %ecx
	addl	$2, %eax
	movl	%ecx, 4(%rbx,%rdx)
	cmpl	%r9d, %eax
	jge	.L1
	movl	8(%r8,%rdx), %eax
	movl	%eax, 8(%rbx,%rdx)
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movq	%r11, %rdx
	negq	%rdx
	leaq	(%rax,%rdx,4), %rdx
	addq	%r8, %rdx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L58:
	addq	$1, %rsi
.L15:
	movl	(%rbx,%r11,4), %eax
	movl	%eax, (%rdx,%r11,4)
	movq	%rsi, %r11
	cmpl	%esi, %ebp
	jg	.L58
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L24:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r8,%rax,4), %edx
	movl	%edx, (%rbx,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %r9d
	jg	.L17
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	tmp(%rip), %r8
	xorl	%r9d, %r9d
	xorl	%edx, %edx
	jmp	.L4
	.cfi_endproc
.LFE42:
	.size	msort.part.0, .-msort.part.0
	.p2align 4
	.globl	msort
	.type	msort, @function
msort:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	$1, %esi
	jle	.L59
	jmp	msort.part.0
	.p2align 4,,10
	.p2align 3
.L59:
	ret
	.cfi_endproc
.LFE39:
	.size	msort, .-msort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB2:
	.text
.LHOTB2:
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %r15
	leaq	0(,%r15,4), %rdi
	movq	%rdi, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, (%rsp)
	movq	%rax, %rbx
	call	malloc@PLT
	movq	8(%rsp), %rdi
	movq	%rax, %r14
	call	malloc@PLT
	testl	%r15d, %r15d
	movq	8(%rsp), %rdi
	movq	%rax, %r12
	jle	.L132
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L63:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebp
	addq	$4, %rbx
	cmpl	%r15d, %ebp
	jg	.L63
	testl	%ebp, %ebp
	jle	.L135
	movq	%r14, %rbx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L65:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebp
	addq	$4, %rbx
	cmpl	%r15d, %ebp
	jg	.L65
	testl	%ebp, %ebp
	jle	.L66
	movq	%r12, %rbx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L67:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebp
	addq	$4, %rbx
	cmpl	%r15d, %ebp
	jg	.L67
	movslq	%ebp, %r15
	leaq	0(,%r15,4), %rdi
	call	malloc@PLT
	movq	%rax, tmp(%rip)
	cmpl	$1, %ebp
	jle	.L71
	movq	(%rsp), %rdi
	movl	%ebp, %esi
	call	msort.part.0
	movl	20(%rsp), %ebp
	cmpl	$1, %ebp
	jle	.L134
	movl	%ebp, %esi
	movq	%r14, %rdi
	call	msort.part.0
	movl	20(%rsp), %ebp
	cmpl	$1, %ebp
	jle	.L134
	movl	%ebp, %esi
	movq	%r12, %rdi
	call	msort.part.0
	movslq	20(%rsp), %r15
	movq	%r15, %rbp
.L71:
	movl	$8, %esi
	movq	%r15, %rdi
	movq	%r15, %r13
	call	calloc@PLT
	leal	-1(%rbp), %esi
	movl	$1, %r8d
	movq	%rax, %rdi
	xorl	%eax, %eax
	testl	%ebp, %ebp
	jle	.L70
	.p2align 4,,10
	.p2align 3
.L98:
	movslq	%eax, %rdx
	movl	-4(%r14,%r8,4), %ecx
	leaq	(%r12,%rdx,4), %rdx
	jmp	.L78
	.p2align 4,,10
	.p2align 3
.L74:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%ebp, %eax
	je	.L73
.L78:
	cmpl	(%rdx), %ecx
	jge	.L74
	movl	%ebp, %edx
	subl	%eax, %edx
	movslq	%edx, %rdx
	movq	%rdx, -8(%rdi,%r8,8)
	cmpq	%r15, %r8
	je	.L101
	addq	$1, %r8
	cmpl	%ebp, %eax
	jl	.L98
	jmp	.L99
	.p2align 4,,10
	.p2align 3
.L73:
	movq	$0, -8(%rdi,%r8,8)
	cmpq	%r15, %r8
	jne	.L136
.L101:
	testl	%esi, %esi
	jle	.L80
.L79:
	movq	-8(%rdi,%r13,8), %rdx
	movslq	%esi, %rax
	.p2align 4,,10
	.p2align 3
.L82:
	addq	-8(%rdi,%rax,8), %rdx
	movq	%rdx, -8(%rdi,%rax,8)
	subq	$1, %rax
	testl	%eax, %eax
	jg	.L82
	testl	%ebp, %ebp
	jle	.L81
.L80:
	movl	%ebp, %r9d
	xorl	%r8d, %r8d
	xorl	%edx, %edx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L92:
	movq	(%rsp), %rax
	movl	-4(%rax,%rsi,4), %ecx
	movslq	%edx, %rax
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L86:
	leal	1(%rax), %edx
	addq	$1, %rax
	cmpl	%eax, %ebp
	jle	.L137
.L84:
	movl	%eax, %edx
	cmpl	(%r14,%rax,4), %ecx
	jge	.L86
.L85:
	addq	(%rdi,%rax,8), %r8
	cmpq	%r9, %rsi
	je	.L87
	addq	$1, %rsi
	cmpl	%ebp, %edx
	jl	.L92
	movslq	%edx, %rdx
	movq	(%rdi,%rdx,8), %rax
	leaq	(%r8,%rax), %rcx
	movq	%rcx, %r8
	cmpq	%r9, %rsi
	jne	.L138
.L87:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L139
	addq	$40, %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
.L137:
	.cfi_restore_state
	movslq	%edx, %rax
	jmp	.L85
.L136:
	addq	$1, %r8
.L99:
	movl	%ebp, %ecx
	movl	%r8d, %r9d
	subl	%eax, %ecx
	movslq	%ecx, %r10
	movq	%r10, -8(%rdi,%r8,8)
	cmpq	%r8, %r15
	je	.L101
	movl	%ebp, %eax
	movl	$1, %edx
	subl	%r8d, %eax
	cmpl	%ebp, %r8d
	cmovl	%eax, %edx
	subl	$1, %eax
	cmpl	$2, %eax
	jbe	.L102
	movd	%ecx, %xmm3
	pxor	%xmm1, %xmm1
	movl	%edx, %r11d
	movslq	%r9d, %rax
	pshufd	$0, %xmm3, %xmm0
	shrl	$2, %r11d
	leaq	(%rdi,%rax,8), %rax
	xorl	%r8d, %r8d
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm2
	punpckldq	%xmm1, %xmm2
	punpckhdq	%xmm1, %xmm0
	jmp	.L76
.L66:
	movslq	%ebp, %r13
	leaq	0(,%r13,4), %rdi
	call	malloc@PLT
	movl	$8, %esi
	movq	%r13, %rdi
	movq	%rax, tmp(%rip)
	call	calloc@PLT
	leal	-1(%rbp), %esi
	movq	%rax, %rdi
.L70:
	testl	%esi, %esi
	jg	.L79
.L81:
	xorl	%r8d, %r8d
	jmp	.L87
.L132:
	movq	%r15, %rbp
.L62:
	call	malloc@PLT
	movq	%rax, tmp(%rip)
	jmp	.L71
.L139:
	call	__stack_chk_fail@PLT
.L135:
	movslq	%ebp, %r15
	leaq	0(,%r15,4), %rdi
	jmp	.L62
.L138:
	movl	%ebp, %r9d
	subl	%esi, %r9d
	cmpl	%ebp, %esi
	movl	$1, %esi
	cmovl	%r9d, %esi
	subl	$1, %r9d
	je	.L94
	movq	%rax, %xmm0
	movl	%esi, %r8d
	pxor	%xmm1, %xmm1
	xorl	%eax, %eax
	shrl	%r8d
	punpcklqdq	%xmm0, %xmm0
	jmp	.L88
.L134:
	movslq	%ebp, %r15
	jmp	.L71
.L94:
	addq	(%rdi,%rdx,8), %r8
	jmp	.L87
.L102:
	movslq	%r9d, %rdx
	movq	%r10, (%rdi,%rdx,8)
	leaq	0(,%rdx,8), %rax
	leal	1(%r9), %edx
	cmpl	%ebp, %edx
	jl	.L122
	jmp	.L101
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	run.cold, @function
run.cold:
.LFSB40:
.L88:
	.cfi_def_cfa_offset 96
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	addl	$1, %eax
	paddq	%xmm0, %xmm1
	cmpl	%r8d, %eax
	jne	.L88
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	paddq	%xmm0, %xmm1
	movq	%xmm1, %r8
	addq	%rcx, %r8
	andb	$1, %sil
	je	.L87
	jmp	.L94
.L76:
	addl	$1, %r8d
	movups	%xmm2, (%rax)
	addq	$32, %rax
	movups	%xmm0, -16(%rax)
	cmpl	%r8d, %r11d
	jne	.L76
	movl	%edx, %eax
	andl	$-4, %eax
	addl	%eax, %r9d
	cmpl	%edx, %eax
	je	.L101
	jmp	.L102
.L122:
	addl	$2, %r9d
	movq	%r10, 8(%rdi,%rax)
	cmpl	%r9d, %ebp
	jle	.L101
	movq	%r10, 16(%rdi,%rax)
	jmp	.L101
	.cfi_endproc
.LFE40:
	.text
	.size	run, .-run
	.section	.text.unlikely
	.size	run.cold, .-run.cold
.LCOLDE2:
	.text
.LHOTE2:
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	tmp
	.bss
	.align 8
	.type	tmp, @object
	.size	tmp, 8
tmp:
	.zero	8
	.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>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

int *tmp;

void msort(int *a,int n){
  if(n<=1) return;
  int m=n/2;
  msort(a,m);
  msort(a+m,n-m);
  int i=0;
  int j=m;
  int k=0;
  while(i<m && j<n){
    if(a[i]<=a[j]){
      tmp[k++]=a[i++];
    } else {
      tmp[k++]=a[j++];
    }
  }
  while(i<m) tmp[k++]=a[i++];
  for(i=0;i<k;i++) a[i]=tmp[i];
  return;
}

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)malloc(sizeof(int)*n);
  int *b=(int *)malloc(sizeof(int)*n);
  int *c=(int *)malloc(sizeof(int)*n);
  int i;
  for(i=0;i<n;i++) scanf("%d",a+i);
  for(i=0;i<n;i++) scanf("%d",b+i);
  for(i=0;i<n;i++) scanf("%d",c+i);
  tmp=(int *)malloc(sizeof(int)*n);
  msort(a,n);
  msort(b,n);
  msort(c,n);
  int64 *cnt=(int64 *)calloc(n,sizeof(int64));
  int j=0;
  for(i=0;i<n;i++){
    while(j<n && b[i]>=c[j]) j++;
    cnt[i]=n-j;
  }
  for(i=n-1;i>0;i--) cnt[i-1]+=cnt[i];
  int64 sum=0;
  j=0;
  for(i=0;i<n;i++){
    while(j<n && a[i]>=b[j]) j++;
    sum+=cnt[j];
  }
  printf("%lld\n",sum);
}

int main(void){
  run();
  return 0;
}
3
1 0 1
2 2 2
3 3 3
 2
1 5
2 4
2 6
 6
3 14 159 2 6 53
58 9 7 323 84 6
2643 383 2 79 50 288
 3
1 0 2
2 2 2
3 3 3
 2
2 5
2 4
2 6
 6
3 14 159 2 6 53
58 9 7 323 84 6
2643 383 2 79 50 430
 3
1 0 4
2 2 2
3 1 3
 3
0 0 4
2 2 2
3 1 1
 6
5 14 159 0 6 53
58 9 7 323 166 6
2643 383 3 79 50 430
 3
0 0 0
2 2 2
3 1 1

27
 2
 87
 130259
 1
 93
 130253
 130247
 96
 9

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

```c
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

int *tmp;

void msort(int *a,int n){
  if(n<=1) return;
  int m=n/2;
  msort(a,m);
  msort(a+m,n-m);
  int i=0;
  int j=m;
  int k=0;
  while(i<m && j<n){
    if(a[i]<=a[j]){
      tmp[k++]=a[i++];
    } else {
      tmp[k++]=a[j++];
    }
  }
  while(i<m) tmp[k++]=a[i++];
  for(i=0;i<k;i++) a[i]=tmp[i];
  return;
}

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)malloc(sizeof(int)*n);
  int *b=(int *)malloc(sizeof(int)*n);
  int *c=(int *)malloc(sizeof(int)*n);
  int i;
  for(i=0;i<n;i++) scanf("%d",a+i);
  for(i=0;i<n;i++) scanf("%d",b+i);
  for(i=0;i<n;i++) scanf("%d",c+i);
  tmp=(int *)malloc(sizeof(int)*n);
  msort(a,n);
  msort(b,n);
  msort(c,n);
  int64 *cnt=(int64 *)calloc(n,sizeof(int64));
  int j=0;
  for(i=0;i<n;i++){
    while(j<n && b[i]>=c[j]) j++;
    cnt[i]=n-j;
  }
  for(i=n-1;i>0;i--) cnt[i-1]+=cnt[i];
  int64 sum=0;
  j=0;
  for(i=0;i<n;i++){
    while(j<n && a[i]>=b[j]) j++;
    sum+=cnt[j];
  }
  printf("%lld\n",sum);
}

int main(void){
  run();
  return 0;
}```

Unoptimized Assembly Code:

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

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