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>

int compare(const void *a, const void *b){
  return *(int *)a-*(int *)b;
}

int main(void){
  int n,i,j,w=0,k=0,number;
  int num[10000];
  int ans[100];
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d",&num[i]);
  }

  qsort(num,n,sizeof(int),compare);

  if(n==3){
    printf("%d",num[1]);
    printf("%d\n",num[0]);
  }
  else{
    for(i=0;i<4;i++){
      for(j=0;j<4;j++){
        if(i!=j){
          int bas=1;
          number = num[j];
          while(number!=0){
            number = number / 10;
            ++k;
          }
          while(k!=0){
            bas *=10 ;
            --k;
          }
          ans[w]=num[i]*bas+num[j];
          w++;
        }
      }
    }
    qsort(ans,w-1,sizeof(int),compare);
    printf("%d\n",ans[2]);
  }

  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare
	.type	compare, @function
compare:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3584, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -40432(%rbp)
	movl	$0, -40428(%rbp)
	leaq	-40444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40440(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rdx
	movl	-40440(%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, -40440(%rbp)
.L4:
	movl	-40444(%rbp), %eax
	cmpl	%eax, -40440(%rbp)
	jl	.L5
	movl	-40444(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-40016(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-40444(%rbp), %eax
	cmpl	$3, %eax
	jne	.L6
	movl	-40012(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-40016(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	$0, -40440(%rbp)
	jmp	.L8
.L16:
	movl	$0, -40436(%rbp)
	jmp	.L9
.L15:
	movl	-40440(%rbp), %eax
	cmpl	-40436(%rbp), %eax
	je	.L10
	movl	$1, -40420(%rbp)
	movl	-40436(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -40424(%rbp)
	jmp	.L11
.L12:
	movl	-40424(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -40424(%rbp)
	addl	$1, -40428(%rbp)
.L11:
	cmpl	$0, -40424(%rbp)
	jne	.L12
	jmp	.L13
.L14:
	movl	-40420(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, -40420(%rbp)
	subl	$1, -40428(%rbp)
.L13:
	cmpl	$0, -40428(%rbp)
	jne	.L14
	movl	-40440(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	imull	-40420(%rbp), %eax
	movl	%eax, %edx
	movl	-40436(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-40432(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -40432(%rbp)
.L10:
	addl	$1, -40436(%rbp)
.L9:
	cmpl	$3, -40436(%rbp)
	jle	.L15
	addl	$1, -40440(%rbp)
.L8:
	cmpl	$3, -40440(%rbp)
	jle	.L16
	movl	-40432(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	leaq	-40416(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-40408(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.globl	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3576, %rsp
	.cfi_def_cfa_offset 40480
	leaq	.LC1(%rip), %r13
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	416(%rsp), %rbx
	movq	%rbx, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%r12d, %eax
	jg	.L5
.L4:
	leaq	compare(%rip), %r12
	movslq	%eax, %rsi
	movl	$4, %edx
	movq	%rbx, %rdi
	movq	%r12, %rcx
	call	qsort@PLT
	cmpl	$3, 12(%rsp)
	je	.L6
	movq	.LC0(%rip), %rbp
	movq	%rbx, %r9
	xorl	%edi, %edi
	xorl	%r8d, %r8d
.L7:
	xorl	%esi, %esi
.L15:
	cmpl	%esi, %r8d
	je	.L9
	movl	(%rbx,%rsi,4), %r10d
	testl	%r10d, %r10d
	je	.L18
	movl	%r10d, %ecx
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%ecx, %rax
	sarl	$31, %ecx
	addl	$1, %edx
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%eax, %ecx
	jne	.L11
	movl	%edx, %ecx
	cmpl	$1, %edx
	je	.L12
	shrl	%edx
	xorl	%eax, %eax
	movq	%rbp, %xmm0
	.p2align 4,,10
	.p2align 3
.L13:
	movdqa	%xmm0, %xmm1
	addl	$1, %eax
	pslld	$2, %xmm1
	paddd	%xmm1, %xmm0
	pslld	$1, %xmm0
	cmpl	%eax, %edx
	jne	.L13
	movd	%xmm0, %edx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	imull	%eax, %edx
	andl	$1, %ecx
	je	.L10
.L12:
	leal	(%rdx,%rdx,4), %edx
	addl	%edx, %edx
.L10:
	imull	(%r9), %edx
	movslq	%edi, %rax
	addl	$1, %edi
	addl	%r10d, %edx
	movl	%edx, 16(%rsp,%rax,4)
.L9:
	addq	$1, %rsi
	cmpq	$4, %rsi
	jne	.L15
	addl	$1, %r8d
	addq	$4, %r9
	cmpl	$4, %r8d
	jne	.L7
	leal	-1(%rdi), %esi
	movl	$4, %edx
	leaq	16(%rsp), %rdi
	movq	%r12, %rcx
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	24(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
.L8:
	movq	40424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$40440, %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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L10
.L6:
	movl	420(%rsp), %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	416(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L8
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3576, %rsp
	.cfi_def_cfa_offset 40480
	leaq	.LC1(%rip), %r13
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	416(%rsp), %rbx
	movq	%rbx, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%r12d, %eax
	jg	.L5
.L4:
	leaq	compare(%rip), %r12
	movslq	%eax, %rsi
	movl	$4, %edx
	movq	%rbx, %rdi
	movq	%r12, %rcx
	call	qsort@PLT
	cmpl	$3, 12(%rsp)
	je	.L6
	movq	.LC0(%rip), %rbp
	movq	%rbx, %r9
	xorl	%edi, %edi
	xorl	%r8d, %r8d
.L7:
	xorl	%esi, %esi
.L15:
	cmpl	%esi, %r8d
	je	.L9
	movl	(%rbx,%rsi,4), %r10d
	testl	%r10d, %r10d
	je	.L18
	movl	%r10d, %ecx
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%ecx, %rax
	sarl	$31, %ecx
	addl	$1, %edx
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%eax, %ecx
	jne	.L11
	movl	%edx, %ecx
	cmpl	$1, %edx
	je	.L12
	shrl	%edx
	xorl	%eax, %eax
	movq	%rbp, %xmm0
	.p2align 4,,10
	.p2align 3
.L13:
	movdqa	%xmm0, %xmm1
	addl	$1, %eax
	pslld	$2, %xmm1
	paddd	%xmm1, %xmm0
	pslld	$1, %xmm0
	cmpl	%eax, %edx
	jne	.L13
	movd	%xmm0, %edx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	imull	%eax, %edx
	andl	$1, %ecx
	je	.L10
.L12:
	leal	(%rdx,%rdx,4), %edx
	addl	%edx, %edx
.L10:
	imull	(%r9), %edx
	movslq	%edi, %rax
	addl	$1, %edi
	addl	%r10d, %edx
	movl	%edx, 16(%rsp,%rax,4)
.L9:
	addq	$1, %rsi
	cmpq	$4, %rsi
	jne	.L15
	addl	$1, %r8d
	addq	$4, %r9
	cmpl	$4, %r8d
	jne	.L7
	leal	-1(%rdi), %esi
	movl	$4, %edx
	leaq	16(%rsp), %rdi
	movq	%r12, %rcx
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	24(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
.L8:
	movq	40424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$40440, %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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L10
.L6:
	movl	420(%rsp), %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	416(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L8
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	1
	.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>

int compare(const void *a, const void *b){
  return *(int *)a-*(int *)b;
}

int main(void){
  int n,i,j,w=0,k=0,number;
  int num[10000];
  int ans[100];
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d",&num[i]);
  }

  qsort(num,n,sizeof(int),compare);

  if(n==3){
    printf("%d",num[1]);
    printf("%d\n",num[0]);
  }
  else{
    for(i=0;i<4;i++){
      for(j=0;j<4;j++){
        if(i!=j){
          int bas=1;
          number = num[j];
          while(number!=0){
            number = number / 10;
            ++k;
          }
          while(k!=0){
            bas *=10 ;
            --k;
          }
          ans[w]=num[i]*bas+num[j];
          w++;
        }
      }
    }
    qsort(ans,w-1,sizeof(int),compare);
    printf("%d\n",ans[2]);
  }

  return 0;
}


3
2
7
5

52

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>

int compare(const void *a, const void *b){
  return *(int *)a-*(int *)b;
}

int main(void){
  int n,i,j,w=0,k=0,number;
  int num[10000];
  int ans[100];
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d",&num[i]);
  }

  qsort(num,n,sizeof(int),compare);

  if(n==3){
    printf("%d",num[1]);
    printf("%d\n",num[0]);
  }
  else{
    for(i=0;i<4;i++){
      for(j=0;j<4;j++){
        if(i!=j){
          int bas=1;
          number = num[j];
          while(number!=0){
            number = number / 10;
            ++k;
          }
          while(k!=0){
            bas *=10 ;
            --k;
          }
          ans[w]=num[i]*bas+num[j];
          w++;
        }
      }
    }
    qsort(ans,w-1,sizeof(int),compare);
    printf("%d\n",ans[2]);
  }

  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare
	.type	compare, @function
compare:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3584, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -40432(%rbp)
	movl	$0, -40428(%rbp)
	leaq	-40444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40440(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rdx
	movl	-40440(%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, -40440(%rbp)
.L4:
	movl	-40444(%rbp), %eax
	cmpl	%eax, -40440(%rbp)
	jl	.L5
	movl	-40444(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-40016(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-40444(%rbp), %eax
	cmpl	$3, %eax
	jne	.L6
	movl	-40012(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-40016(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	$0, -40440(%rbp)
	jmp	.L8
.L16:
	movl	$0, -40436(%rbp)
	jmp	.L9
.L15:
	movl	-40440(%rbp), %eax
	cmpl	-40436(%rbp), %eax
	je	.L10
	movl	$1, -40420(%rbp)
	movl	-40436(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -40424(%rbp)
	jmp	.L11
.L12:
	movl	-40424(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -40424(%rbp)
	addl	$1, -40428(%rbp)
.L11:
	cmpl	$0, -40424(%rbp)
	jne	.L12
	jmp	.L13
.L14:
	movl	-40420(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, -40420(%rbp)
	subl	$1, -40428(%rbp)
.L13:
	cmpl	$0, -40428(%rbp)
	jne	.L14
	movl	-40440(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	imull	-40420(%rbp), %eax
	movl	%eax, %edx
	movl	-40436(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-40432(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -40432(%rbp)
.L10:
	addl	$1, -40436(%rbp)
.L9:
	cmpl	$3, -40436(%rbp)
	jle	.L15
	addl	$1, -40440(%rbp)
.L8:
	cmpl	$3, -40440(%rbp)
	jle	.L16
	movl	-40432(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	leaq	-40416(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-40408(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	compare
	.type	compare, @function
compare:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3584, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -40432(%rbp)
	movl	$0, -40428(%rbp)
	leaq	-40444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40440(%rbp)
	jmp	.L4
.L5:
	leaq	-40016(%rbp), %rdx
	movl	-40440(%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, -40440(%rbp)
.L4:
	movl	-40444(%rbp), %eax
	cmpl	%eax, -40440(%rbp)
	jl	.L5
	movl	-40444(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-40016(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-40444(%rbp), %eax
	cmpl	$3, %eax
	jne	.L6
	movl	-40012(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-40016(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	$0, -40440(%rbp)
	jmp	.L8
.L16:
	movl	$0, -40436(%rbp)
	jmp	.L9
.L15:
	movl	-40440(%rbp), %eax
	cmpl	-40436(%rbp), %eax
	je	.L10
	movl	$1, -40420(%rbp)
	movl	-40436(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	movl	%eax, -40424(%rbp)
	jmp	.L11
.L12:
	movl	-40424(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -40424(%rbp)
	addl	$1, -40428(%rbp)
.L11:
	cmpl	$0, -40424(%rbp)
	jne	.L12
	jmp	.L13
.L14:
	movl	-40420(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, -40420(%rbp)
	subl	$1, -40428(%rbp)
.L13:
	cmpl	$0, -40428(%rbp)
	jne	.L14
	movl	-40440(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	imull	-40420(%rbp), %eax
	movl	%eax, %edx
	movl	-40436(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-40432(%rbp), %eax
	cltq
	movl	%edx, -40416(%rbp,%rax,4)
	addl	$1, -40432(%rbp)
.L10:
	addl	$1, -40436(%rbp)
.L9:
	cmpl	$3, -40436(%rbp)
	jle	.L15
	addl	$1, -40440(%rbp)
.L8:
	cmpl	$3, -40440(%rbp)
	jle	.L16
	movl	-40432(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	leaq	-40416(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-40408(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
