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>

#define MAX_DATA 100000

int temp[MAX_DATA];    /* 最小でも配列と同じサイズの領域が必要 */

void MergeSort(int x[ ], int left, int right);

  /* 配列 x[ ] の left から right の要素のマージソートを行う */
void MergeSort(int x[ ], int left, int right)
{
    int mid, i, j, k;
	
    if (left >= right)              /* 配列の要素がひとつなら */
        return;                     /* 何もしないで戻る */

                                    /* ここでは分割しているだけ */
    mid = (left + right) / 2;       /* 中央の値より */
    MergeSort(x, left, mid);        /* 左を再帰呼び出し */
    MergeSort(x, mid + 1, right);   /* 右を再帰呼び出し */

      /* x[left] から x[mid] を作業領域にコピー */
    for (i = left; i <= mid; i++)
        temp[i] = x[i];

      /* x[mid + 1] から x[right] は逆順にコピー */
    for (i = mid + 1, j = right; i <= right; i++, j--)
        temp[i] = x[j];

    i = left;         /* i とj は作業領域のデーターを */
    j = right;        /* k は配列の要素を指している */

    for (k = left; k <= right; k++)    /* 小さい方から配列に戻す */
        if (temp[i] <= temp[j])        /* ここでソートされる */
            x[k] = temp[i++];
        else
            x[k] = temp[j--];
}

int main(void)
{
  int i,j;
      /* ソートされるデータ */
    int A[100000],N;
    long int eg[2];
    for(i=0;i<100000;i++){
      A[i]=0;
    }
    scanf("%d",&N);
    for(i=0;i<N;i++){
      scanf("%d",&A[i]);
    }
    MergeSort(A, 0, N - 1);
    for(j=0;j<2;j++){
      for(i=1;i<N;i++){
	if(A[N-i]==A[N-i-1]){
	  eg[j]=A[N-i];
	  A[N-i]=-2;A[N-i-1]=-1;
	  break;
	}
      }
    }
    printf("%ld\n",eg[0]*eg[1]);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	temp
	.bss
	.align 32
	.type	temp, @object
	.size	temp, 400000
temp:
	.zero	400000
	.text
	.globl	MergeSort
	.type	MergeSort, @function
MergeSort:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L12
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	temp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	temp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
	subl	$1, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L7
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	temp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L10
.L9:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
.L10:
	addl	$1, -8(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MergeSort, .-MergeSort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400040(%rbp)
	jmp	.L14
.L15:
	movl	-400040(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	addl	$1, -400040(%rbp)
.L14:
	cmpl	$99999, -400040(%rbp)
	jle	.L15
	leaq	-400044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L16
.L17:
	leaq	-400016(%rbp), %rdx
	movl	-400040(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400040(%rbp)
.L16:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L17
	movl	-400044(%rbp), %eax
	leal	-1(%rax), %edx
	leaq	-400016(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	$0, -400036(%rbp)
	jmp	.L18
.L23:
	movl	$1, -400040(%rbp)
	jmp	.L19
.L22:
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-400036(%rbp), %eax
	cltq
	movq	%rdx, -400032(%rbp,%rax,8)
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	$-2, -400016(%rbp,%rax,4)
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	jmp	.L21
.L20:
	addl	$1, -400040(%rbp)
.L19:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L22
.L21:
	addl	$1, -400036(%rbp)
.L18:
	cmpl	$1, -400036(%rbp)
	jle	.L23
	movq	-400032(%rbp), %rdx
	movq	-400024(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	MergeSort.part.0, @function
MergeSort.part.0:
.LFB25:
	.cfi_startproc
	leal	(%rsi,%rdx), %eax
	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
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%eax, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	shrl	$31, %r12d
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	addl	%eax, %r12d
	movl	%edx, %ebx
	sarl	%r12d
	leal	1(%r12), %r14d
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%r12d, %esi
	jl	.L47
	cmpl	%r14d, %edx
	jg	.L48
	cmpl	%r12d, %esi
	jne	.L16
.L3:
	movslq	%ebp, %rax
	leaq	temp(%rip), %rdx
	movl	%r12d, %edi
	leaq	0(,%rax,4), %rcx
	subl	%ebp, %edi
	leaq	(%rdx,%rcx), %r8
	leaq	4(%r13,%rcx), %r9
	movq	%r8, %rsi
	subq	%r9, %rsi
	cmpq	$8, %rsi
	jbe	.L35
	cmpl	%r12d, %ebp
	setle	%r9b
	cmpl	$2, %edi
	seta	%sil
	testb	%sil, %r9b
	je	.L35
	addl	$1, %edi
	movl	$1, %eax
	cmpl	%r12d, %ebp
	cmovg	%eax, %edi
	addq	%r13, %rcx
	xorl	%eax, %eax
	movl	%edi, %esi
	shrl	$2, %esi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	movdqu	(%rcx,%rax), %xmm1
	movups	%xmm1, (%r8,%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L14
	movl	%edi, %ecx
	andl	$-4, %ecx
	leal	(%rcx,%rbp), %eax
	cmpl	%ecx, %edi
	je	.L16
	movslq	%eax, %rcx
	movl	0(%r13,%rcx,4), %esi
	movl	%esi, (%rdx,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %r12d
	jl	.L16
	movslq	%ecx, %rcx
	addl	$2, %eax
	movl	0(%r13,%rcx,4), %esi
	leaq	0(,%rcx,4), %rdi
	movl	%esi, (%rdx,%rcx,4)
	cmpl	%eax, %r12d
	jl	.L16
	movl	4(%r13,%rdi), %ecx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L16:
	cmpl	%r14d, %ebx
	jl	.L12
.L6:
	movl	%ebx, %r10d
	movslq	%ebx, %rcx
	movl	$4, %eax
	movslq	%r14d, %rsi
	subl	%r12d, %r10d
	leaq	4(,%rcx,4), %r11
	leaq	0(,%rcx,4), %rdi
	movq	%rax, %rcx
	movl	%r10d, %r9d
	leaq	0(,%rsi,4), %r15
	leaq	temp(%rip), %rdx
	salq	$2, %r9
	cmpl	%r12d, %ebx
	leaq	(%rdx,%r15), %r8
	cmovg	%r9, %rcx
	subq	%r9, %rax
	xorl	%r9d, %r9d
	addq	%r15, %rcx
	addq	%rdx, %rcx
	cmpl	%r12d, %ebx
	cmovle	%r9, %rax
	addq	%rdi, %rax
	addq	%r13, %rax
	cmpq	%rax, %rcx
	leaq	0(%r13,%r11), %rcx
	setbe	%al
	cmpq	%rcx, %r8
	setnb	%cl
	orb	%cl, %al
	je	.L11
	leal	-1(%r10), %eax
	cmpl	$2, %eax
	seta	%cl
	cmpl	%r12d, %ebx
	setg	%al
	testb	%al, %cl
	je	.L11
	cmpl	%r12d, %ebx
	movl	$1, %r9d
	leaq	-16(%r13,%r11), %rsi
	movq	%r8, %rcx
	cmovg	%r10d, %r9d
	leaq	-16(%rsi), %rax
	movl	%r9d, %edi
	shrl	$2, %edi
	leal	-1(%rdi), %r8d
	movq	%rax, %rdi
	salq	$4, %r8
	subq	%r8, %rdi
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L49:
	subq	$16, %rax
.L24:
	movdqu	(%rsi), %xmm0
	addq	$16, %rcx
	movq	%rax, %rsi
	pshufd	$27, %xmm0, %xmm0
	movups	%xmm0, -16(%rcx)
	cmpq	%rax, %rdi
	jne	.L49
	movl	%r9d, %ecx
	movl	%ebx, %eax
	andl	$-4, %ecx
	subl	%ecx, %eax
	addl	%ecx, %r14d
	cmpl	%ecx, %r9d
	je	.L12
	movslq	%eax, %rcx
	subl	$1, %eax
	movl	0(%r13,%rcx,4), %esi
	movslq	%r14d, %rcx
	movl	%esi, (%rdx,%rcx,4)
	leal	1(%r14), %ecx
	cmpl	%ecx, %ebx
	jl	.L12
	cltq
	movslq	%ecx, %rcx
	addl	$2, %r14d
	leaq	0(,%rax,4), %rsi
	movl	0(%r13,%rax,4), %eax
	movl	%eax, (%rdx,%rcx,4)
	cmpl	%r14d, %ebx
	jl	.L12
	movl	-4(%r13,%rsi), %eax
	movslq	%r14d, %r14
	movl	%eax, (%rdx,%r14,4)
.L12:
	cmpl	%ebx, %ebp
	jg	.L1
	movl	%ebx, %edx
	movslq	%ebp, %r8
	movslq	%ebx, %rcx
	subl	%ebp, %edx
	leaq	0(%r13,%r8,4), %rax
	addq	%r8, %rdx
	leaq	4(%r13,%rdx,4), %r9
	leaq	temp(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L28:
	movl	(%rdx,%r8,4), %edi
	movl	(%rdx,%rcx,4), %esi
	cmpl	%edi, %esi
	jl	.L26
.L50:
	movl	%edi, (%rax)
	addq	$4, %rax
	addl	$1, %ebp
	cmpq	%rax, %r9
	je	.L1
	movslq	%ebp, %r8
	movl	(%rdx,%rcx,4), %esi
	movl	(%rdx,%r8,4), %edi
	cmpl	%edi, %esi
	jge	.L50
.L26:
	movl	%esi, (%rax)
	addq	$4, %rax
	subl	$1, %ebx
	cmpq	%rax, %r9
	je	.L1
	movslq	%ebx, %rcx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L35:
	movl	0(%r13,%rax,4), %ecx
	movl	%ecx, (%rdx,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %r12d
	jge	.L35
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r13, %rdi
	call	MergeSort.part.0
	cmpl	%r12d, %ebp
	jle	.L3
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L1:
	addq	$8, %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
.L47:
	.cfi_restore_state
	movl	%r12d, %edx
	call	MergeSort.part.0
	cmpl	%r14d, %ebx
	jle	.L3
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r13, %rdi
	call	MergeSort.part.0
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	0(%r13,%rdi), %rcx
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rcx), %eax
	subq	$4, %rcx
	movl	%eax, (%rdx,%rsi,4)
	addq	$1, %rsi
	cmpl	%esi, %ebx
	jge	.L22
	jmp	.L12
	.cfi_endproc
.LFE25:
	.size	MergeSort.part.0, .-MergeSort.part.0
	.p2align 4
	.globl	MergeSort
	.type	MergeSort, @function
MergeSort:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edx, %esi
	jl	.L53
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	jmp	MergeSort.part.0
	.cfi_endproc
.LFE23:
	.size	MergeSort, .-MergeSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397352
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbx
	movq	%rbx, %rdi
	call	memset@PLT
	movq	%r13, %rdi
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	jle	.L55
	movq	%rbx, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r12
	cmpl	%ebp, %edi
	jg	.L56
.L55:
	leal	-1(%rdi), %edx
	testl	%edx, %edx
	jle	.L57
	movq	%rbx, %rdi
	xorl	%esi, %esi
	call	MergeSort.part.0
	movl	12(%rsp), %edi
.L57:
	movslq	%edi, %rax
	leaq	16(%rsp), %r9
	salq	$2, %rax
	leaq	-4(%rbx,%rax), %r11
	leaq	(%rbx,%rax), %r10
.L61:
	cmpl	$1, %edi
	jle	.L59
	movl	(%r11), %edx
	leal	-1(%rdi), %eax
	movq	%r10, %rcx
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L58:
	subq	$4, %rcx
	testl	%eax, %eax
	je	.L59
.L60:
	movl	%edx, %esi
	movslq	-8(%rcx), %rdx
	movslq	%eax, %r8
	subl	$1, %eax
	cmpl	%esi, %edx
	jne	.L58
	cltq
	movq	%rdx, (%r9)
	movl	$-2, 32(%rsp,%r8,4)
	movl	$-1, 32(%rsp,%rax,4)
.L59:
	addq	$8, %r9
	cmpq	%rbx, %r9
	jne	.L61
	movq	16(%rsp), %rdx
	imulq	24(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L70
	addq	$400056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L70:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	temp
	.bss
	.align 32
	.type	temp, @object
	.size	temp, 400000
temp:
	.zero	400000
	.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	MergeSort.part.0, @function
MergeSort.part.0:
.LFB25:
	.cfi_startproc
	leal	(%rsi,%rdx), %eax
	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
	movq	%rdi, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%eax, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	shrl	$31, %r12d
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	addl	%eax, %r12d
	movl	%edx, %ebx
	sarl	%r12d
	leal	1(%r12), %r14d
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	cmpl	%r12d, %esi
	jl	.L47
	cmpl	%r14d, %edx
	jg	.L48
	cmpl	%r12d, %esi
	jne	.L16
.L3:
	movslq	%ebp, %rax
	leaq	temp(%rip), %rdx
	movl	%r12d, %edi
	leaq	0(,%rax,4), %rcx
	subl	%ebp, %edi
	leaq	(%rdx,%rcx), %r8
	leaq	4(%r13,%rcx), %r9
	movq	%r8, %rsi
	subq	%r9, %rsi
	cmpq	$8, %rsi
	jbe	.L35
	cmpl	%r12d, %ebp
	setle	%r9b
	cmpl	$2, %edi
	seta	%sil
	testb	%sil, %r9b
	je	.L35
	addl	$1, %edi
	movl	$1, %eax
	cmpl	%r12d, %ebp
	cmovg	%eax, %edi
	addq	%r13, %rcx
	xorl	%eax, %eax
	movl	%edi, %esi
	shrl	$2, %esi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	movdqu	(%rcx,%rax), %xmm1
	movups	%xmm1, (%r8,%rax)
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L14
	movl	%edi, %ecx
	andl	$-4, %ecx
	leal	(%rcx,%rbp), %eax
	cmpl	%ecx, %edi
	je	.L16
	movslq	%eax, %rcx
	movl	0(%r13,%rcx,4), %esi
	movl	%esi, (%rdx,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %r12d
	jl	.L16
	movslq	%ecx, %rcx
	addl	$2, %eax
	movl	0(%r13,%rcx,4), %esi
	leaq	0(,%rcx,4), %rdi
	movl	%esi, (%rdx,%rcx,4)
	cmpl	%eax, %r12d
	jl	.L16
	movl	4(%r13,%rdi), %ecx
	cltq
	movl	%ecx, (%rdx,%rax,4)
.L16:
	cmpl	%r14d, %ebx
	jl	.L12
.L6:
	movl	%ebx, %r10d
	movslq	%ebx, %rcx
	movl	$4, %eax
	movslq	%r14d, %rsi
	subl	%r12d, %r10d
	leaq	4(,%rcx,4), %r11
	leaq	0(,%rcx,4), %rdi
	movq	%rax, %rcx
	movl	%r10d, %r9d
	leaq	0(,%rsi,4), %r15
	leaq	temp(%rip), %rdx
	salq	$2, %r9
	cmpl	%r12d, %ebx
	leaq	(%rdx,%r15), %r8
	cmovg	%r9, %rcx
	subq	%r9, %rax
	xorl	%r9d, %r9d
	addq	%r15, %rcx
	addq	%rdx, %rcx
	cmpl	%r12d, %ebx
	cmovle	%r9, %rax
	addq	%rdi, %rax
	addq	%r13, %rax
	cmpq	%rax, %rcx
	leaq	0(%r13,%r11), %rcx
	setbe	%al
	cmpq	%rcx, %r8
	setnb	%cl
	orb	%cl, %al
	je	.L11
	leal	-1(%r10), %eax
	cmpl	$2, %eax
	seta	%cl
	cmpl	%r12d, %ebx
	setg	%al
	testb	%al, %cl
	je	.L11
	cmpl	%r12d, %ebx
	movl	$1, %r9d
	leaq	-16(%r13,%r11), %rsi
	movq	%r8, %rcx
	cmovg	%r10d, %r9d
	leaq	-16(%rsi), %rax
	movl	%r9d, %edi
	shrl	$2, %edi
	leal	-1(%rdi), %r8d
	movq	%rax, %rdi
	salq	$4, %r8
	subq	%r8, %rdi
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L49:
	subq	$16, %rax
.L24:
	movdqu	(%rsi), %xmm0
	addq	$16, %rcx
	movq	%rax, %rsi
	pshufd	$27, %xmm0, %xmm0
	movups	%xmm0, -16(%rcx)
	cmpq	%rax, %rdi
	jne	.L49
	movl	%r9d, %ecx
	movl	%ebx, %eax
	andl	$-4, %ecx
	subl	%ecx, %eax
	addl	%ecx, %r14d
	cmpl	%ecx, %r9d
	je	.L12
	movslq	%eax, %rcx
	subl	$1, %eax
	movl	0(%r13,%rcx,4), %esi
	movslq	%r14d, %rcx
	movl	%esi, (%rdx,%rcx,4)
	leal	1(%r14), %ecx
	cmpl	%ecx, %ebx
	jl	.L12
	cltq
	movslq	%ecx, %rcx
	addl	$2, %r14d
	leaq	0(,%rax,4), %rsi
	movl	0(%r13,%rax,4), %eax
	movl	%eax, (%rdx,%rcx,4)
	cmpl	%r14d, %ebx
	jl	.L12
	movl	-4(%r13,%rsi), %eax
	movslq	%r14d, %r14
	movl	%eax, (%rdx,%r14,4)
.L12:
	cmpl	%ebx, %ebp
	jg	.L1
	movl	%ebx, %edx
	movslq	%ebp, %r8
	movslq	%ebx, %rcx
	subl	%ebp, %edx
	leaq	0(%r13,%r8,4), %rax
	addq	%r8, %rdx
	leaq	4(%r13,%rdx,4), %r9
	leaq	temp(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L28:
	movl	(%rdx,%r8,4), %edi
	movl	(%rdx,%rcx,4), %esi
	cmpl	%edi, %esi
	jl	.L26
.L50:
	movl	%edi, (%rax)
	addq	$4, %rax
	addl	$1, %ebp
	cmpq	%rax, %r9
	je	.L1
	movslq	%ebp, %r8
	movl	(%rdx,%rcx,4), %esi
	movl	(%rdx,%r8,4), %edi
	cmpl	%edi, %esi
	jge	.L50
.L26:
	movl	%esi, (%rax)
	addq	$4, %rax
	subl	$1, %ebx
	cmpq	%rax, %r9
	je	.L1
	movslq	%ebx, %rcx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L35:
	movl	0(%r13,%rax,4), %ecx
	movl	%ecx, (%rdx,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %r12d
	jge	.L35
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r13, %rdi
	call	MergeSort.part.0
	cmpl	%r12d, %ebp
	jle	.L3
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L1:
	addq	$8, %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
.L47:
	.cfi_restore_state
	movl	%r12d, %edx
	call	MergeSort.part.0
	cmpl	%r14d, %ebx
	jle	.L3
	movl	%ebx, %edx
	movl	%r14d, %esi
	movq	%r13, %rdi
	call	MergeSort.part.0
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	0(%r13,%rdi), %rcx
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rcx), %eax
	subq	$4, %rcx
	movl	%eax, (%rdx,%rsi,4)
	addq	$1, %rsi
	cmpl	%esi, %ebx
	jge	.L22
	jmp	.L12
	.cfi_endproc
.LFE25:
	.size	MergeSort.part.0, .-MergeSort.part.0
	.p2align 4
	.globl	MergeSort
	.type	MergeSort, @function
MergeSort:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edx, %esi
	jl	.L53
	ret
	.p2align 4,,10
	.p2align 3
.L53:
	jmp	MergeSort.part.0
	.cfi_endproc
.LFE23:
	.size	MergeSort, .-MergeSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397352
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2744, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 400040(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbx
	movq	%rbx, %rdi
	call	memset@PLT
	movq	%r13, %rdi
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	jle	.L55
	movq	%rbx, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r12
	cmpl	%ebp, %edi
	jg	.L56
.L55:
	leal	-1(%rdi), %edx
	testl	%edx, %edx
	jle	.L57
	movq	%rbx, %rdi
	xorl	%esi, %esi
	call	MergeSort.part.0
	movl	12(%rsp), %edi
.L57:
	movslq	%edi, %rax
	leaq	16(%rsp), %r9
	salq	$2, %rax
	leaq	-4(%rbx,%rax), %r11
	leaq	(%rbx,%rax), %r10
.L61:
	cmpl	$1, %edi
	jle	.L59
	movl	(%r11), %edx
	leal	-1(%rdi), %eax
	movq	%r10, %rcx
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L58:
	subq	$4, %rcx
	testl	%eax, %eax
	je	.L59
.L60:
	movl	%edx, %esi
	movslq	-8(%rcx), %rdx
	movslq	%eax, %r8
	subl	$1, %eax
	cmpl	%esi, %edx
	jne	.L58
	cltq
	movq	%rdx, (%r9)
	movl	$-2, 32(%rsp,%r8,4)
	movl	$-1, 32(%rsp,%rax,4)
.L59:
	addq	$8, %r9
	cmpq	%rbx, %r9
	jne	.L61
	movq	16(%rsp), %rdx
	imulq	24(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	400040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L70
	addq	$400056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L70:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	temp
	.bss
	.align 32
	.type	temp, @object
	.size	temp, 400000
temp:
	.zero	400000
	.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>

#define MAX_DATA 100000

int temp[MAX_DATA];    /* 最小でも配列と同じサイズの領域が必要 */

void MergeSort(int x[ ], int left, int right);

  /* 配列 x[ ] の left から right の要素のマージソートを行う */
void MergeSort(int x[ ], int left, int right)
{
    int mid, i, j, k;
	
    if (left >= right)              /* 配列の要素がひとつなら */
        return;                     /* 何もしないで戻る */

                                    /* ここでは分割しているだけ */
    mid = (left + right) / 2;       /* 中央の値より */
    MergeSort(x, left, mid);        /* 左を再帰呼び出し */
    MergeSort(x, mid + 1, right);   /* 右を再帰呼び出し */

      /* x[left] から x[mid] を作業領域にコピー */
    for (i = left; i <= mid; i++)
        temp[i] = x[i];

      /* x[mid + 1] から x[right] は逆順にコピー */
    for (i = mid + 1, j = right; i <= right; i++, j--)
        temp[i] = x[j];

    i = left;         /* i とj は作業領域のデーターを */
    j = right;        /* k は配列の要素を指している */

    for (k = left; k <= right; k++)    /* 小さい方から配列に戻す */
        if (temp[i] <= temp[j])        /* ここでソートされる */
            x[k] = temp[i++];
        else
            x[k] = temp[j--];
}

int main(void)
{
  int i,j;
      /* ソートされるデータ */
    int A[100000],N;
    long int eg[2];
    for(i=0;i<100000;i++){
      A[i]=0;
    }
    scanf("%d",&N);
    for(i=0;i<N;i++){
      scanf("%d",&A[i]);
    }
    MergeSort(A, 0, N - 1);
    for(j=0;j<2;j++){
      for(i=1;i<N;i++){
	if(A[N-i]==A[N-i-1]){
	  eg[j]=A[N-i];
	  A[N-i]=-2;A[N-i-1]=-1;
	  break;
	}
      }
    }
    printf("%ld\n",eg[0]*eg[1]);

    return 0;
}
10
3 3 3 3 4 4 2 5 5 5
 6
3 1 2 4 2 2
 6
3 2 2 4 2 2
 6
3 2 2 4 3 2
 10
3 3 6 3 4 4 1 6 5 5
 10
3 3 6 3 4 3 1 6 5 6
 6
3 4 2 3 4 3
 10
3 3 6 6 4 3 1 6 3 6
 10
3 2 8 6 4 0 1 8 3 10
 6
1 -1 1 7 8 7

20
 0
 4
 6
 30
 18
 12
 36
 24
 7

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>

#define MAX_DATA 100000

int temp[MAX_DATA];    /* 最小でも配列と同じサイズの領域が必要 */

void MergeSort(int x[ ], int left, int right);

  /* 配列 x[ ] の left から right の要素のマージソートを行う */
void MergeSort(int x[ ], int left, int right)
{
    int mid, i, j, k;
	
    if (left >= right)              /* 配列の要素がひとつなら */
        return;                     /* 何もしないで戻る */

                                    /* ここでは分割しているだけ */
    mid = (left + right) / 2;       /* 中央の値より */
    MergeSort(x, left, mid);        /* 左を再帰呼び出し */
    MergeSort(x, mid + 1, right);   /* 右を再帰呼び出し */

      /* x[left] から x[mid] を作業領域にコピー */
    for (i = left; i <= mid; i++)
        temp[i] = x[i];

      /* x[mid + 1] から x[right] は逆順にコピー */
    for (i = mid + 1, j = right; i <= right; i++, j--)
        temp[i] = x[j];

    i = left;         /* i とj は作業領域のデーターを */
    j = right;        /* k は配列の要素を指している */

    for (k = left; k <= right; k++)    /* 小さい方から配列に戻す */
        if (temp[i] <= temp[j])        /* ここでソートされる */
            x[k] = temp[i++];
        else
            x[k] = temp[j--];
}

int main(void)
{
  int i,j;
      /* ソートされるデータ */
    int A[100000],N;
    long int eg[2];
    for(i=0;i<100000;i++){
      A[i]=0;
    }
    scanf("%d",&N);
    for(i=0;i<N;i++){
      scanf("%d",&A[i]);
    }
    MergeSort(A, 0, N - 1);
    for(j=0;j<2;j++){
      for(i=1;i<N;i++){
	if(A[N-i]==A[N-i-1]){
	  eg[j]=A[N-i];
	  A[N-i]=-2;A[N-i-1]=-1;
	  break;
	}
      }
    }
    printf("%ld\n",eg[0]*eg[1]);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	temp
	.bss
	.align 32
	.type	temp, @object
	.size	temp, 400000
temp:
	.zero	400000
	.text
	.globl	MergeSort
	.type	MergeSort, @function
MergeSort:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L12
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	temp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	temp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
	subl	$1, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L7
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	temp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L10
.L9:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
.L10:
	addl	$1, -8(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MergeSort, .-MergeSort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400040(%rbp)
	jmp	.L14
.L15:
	movl	-400040(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	addl	$1, -400040(%rbp)
.L14:
	cmpl	$99999, -400040(%rbp)
	jle	.L15
	leaq	-400044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L16
.L17:
	leaq	-400016(%rbp), %rdx
	movl	-400040(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400040(%rbp)
.L16:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L17
	movl	-400044(%rbp), %eax
	leal	-1(%rax), %edx
	leaq	-400016(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	$0, -400036(%rbp)
	jmp	.L18
.L23:
	movl	$1, -400040(%rbp)
	jmp	.L19
.L22:
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-400036(%rbp), %eax
	cltq
	movq	%rdx, -400032(%rbp,%rax,8)
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	$-2, -400016(%rbp,%rax,4)
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	jmp	.L21
.L20:
	addl	$1, -400040(%rbp)
.L19:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L22
.L21:
	addl	$1, -400036(%rbp)
.L18:
	cmpl	$1, -400036(%rbp)
	jle	.L23
	movq	-400032(%rbp), %rdx
	movq	-400024(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	temp
	.bss
	.align 32
	.type	temp, @object
	.size	temp, 400000
temp:
	.zero	400000
	.text
	.globl	MergeSort
	.type	MergeSort, @function
MergeSort:
.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L12
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	temp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L4:
	movl	-16(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	temp(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
	subl	$1, -12(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L7
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	temp(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -16(%rbp)
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L10
.L9:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	temp(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, (%rdx)
.L10:
	addl	$1, -8(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MergeSort, .-MergeSort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400040(%rbp)
	jmp	.L14
.L15:
	movl	-400040(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	addl	$1, -400040(%rbp)
.L14:
	cmpl	$99999, -400040(%rbp)
	jle	.L15
	leaq	-400044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L16
.L17:
	leaq	-400016(%rbp), %rdx
	movl	-400040(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400040(%rbp)
.L16:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L17
	movl	-400044(%rbp), %eax
	leal	-1(%rax), %edx
	leaq	-400016(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	MergeSort
	movl	$0, -400036(%rbp)
	jmp	.L18
.L23:
	movl	$1, -400040(%rbp)
	jmp	.L19
.L22:
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L20
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-400036(%rbp), %eax
	cltq
	movq	%rdx, -400032(%rbp,%rax,8)
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	cltq
	movl	$-2, -400016(%rbp,%rax,4)
	movl	-400044(%rbp), %eax
	subl	-400040(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	jmp	.L21
.L20:
	addl	$1, -400040(%rbp)
.L19:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L22
.L21:
	addl	$1, -400036(%rbp)
.L18:
	cmpl	$1, -400036(%rbp)
	jle	.L23
	movq	-400032(%rbp), %rdx
	movq	-400024(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
