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

```c
#include<stdint.h>
#include<stdbool.h>
#include<limits.h>
#include<inttypes.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stdint.h>
#include<stdbool.h>

int compare(const void * a, const void * b){
	return *(int *)b - *(int *)a;
}
int main(){
  int n;
  scanf("%d\n", &n);
  int *a = (int *)calloc(n, sizeof(int));
  char buff[400] = {0};
  fgets(buff, 401, stdin);
  a[0] = atoi(strtok(buff, " "));
  for(int i =1; i < n; ++i)
	  a[i] = atoi(strtok(NULL, " "));
  qsort(a, n, sizeof(int),compare);
  int alice=0;int bob=0;
  for(int i = 0; i< n; ++i){
	  if(i%2)
		  bob += a[i];
	  else
		  alice += a[i];
  }
  printf("%d", alice - bob);
  free(a);
  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	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%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\n"
.LC1:
	.string	" "
.LC2:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$456, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-460(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-460(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -440(%rbp)
	movq	$0, -432(%rbp)
	movq	$0, -424(%rbp)
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$48, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	stdin(%rip), %rdx
	leaq	-432(%rbp), %rax
	movl	$401, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-432(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, %rdi
	call	atoi@PLT
	movq	-440(%rbp), %rdx
	movl	%eax, (%rdx)
	movl	$1, -456(%rbp)
	jmp	.L4
.L5:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %edi
	call	strtok@PLT
	movl	-456(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-440(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, (%rbx)
	addl	$1, -456(%rbp)
.L4:
	movl	-460(%rbp), %eax
	cmpl	%eax, -456(%rbp)
	jl	.L5
	movl	-460(%rbp), %eax
	movslq	%eax, %rsi
	movq	-440(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -452(%rbp)
	movl	$0, -448(%rbp)
	movl	$0, -444(%rbp)
	jmp	.L6
.L9:
	movl	-444(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-444(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -448(%rbp)
	jmp	.L8
.L7:
	movl	-444(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -452(%rbp)
.L8:
	addl	$1, -444(%rbp)
.L6:
	movl	-460(%rbp), %eax
	cmpl	%eax, -444(%rbp)
	jl	.L9
	movl	-452(%rbp), %eax
	subl	-448(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-440(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	" "
.LC5:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r13
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rdi
	movl	$4, %esi
	call	calloc@PLT
	leaq	32(%rsp), %rdi
	movl	$48, %ecx
	pxor	%xmm0, %xmm0
	movq	%rax, %rbp
	xorl	%eax, %eax
	movl	$401, %edx
	movl	$400, %esi
	rep stosq
	movq	stdin(%rip), %rcx
	movq	%r13, %rdi
	movaps	%xmm0, 16(%rsp)
	call	__fgets_chk@PLT
	movq	%r12, %rsi
	movq	%r13, %rdi
	call	strtok@PLT
	xorl	%esi, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	call	strtol@PLT
	movslq	12(%rsp), %rsi
	movl	%eax, 0(%rbp)
	cmpl	$1, %esi
	jle	.L4
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	xorl	%esi, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	call	strtol@PLT
	movslq	12(%rsp), %rsi
	movl	%eax, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L5
.L4:
	leaq	compare(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L20
	leal	-1(%rcx), %eax
	cmpl	$3, %eax
	jbe	.L7
	movl	%ecx, %edx
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC3(%rip), %xmm7
	shrl	$2, %edx
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm4
	movq	%rbp, %rax
	salq	$4, %rdx
	movdqa	.LC4(%rip), %xmm6
	addq	%rbp, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm3, %xmm0
	movdqu	(%rax), %xmm8
	addq	$16, %rax
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm4, %xmm0
	pcmpeqd	%xmm4, %xmm0
	movdqa	%xmm0, %xmm5
	pand	%xmm8, %xmm0
	pandn	%xmm8, %xmm5
	paddd	%xmm0, %xmm2
	paddd	%xmm5, %xmm1
	cmpq	%rax, %rdx
	jne	.L8
	movdqa	%xmm2, %xmm0
	movl	%ecx, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %cl
	je	.L6
	movslq	%esi, %r8
	leaq	0(,%r8,4), %rdi
	movl	0(%rbp,%r8,4), %r8d
.L18:
	addl	%r8d, %edx
	leal	1(%rsi), %r8d
	cmpl	%ecx, %r8d
	jge	.L6
	andb	$1, %r8b
	movl	4(%rbp,%rdi), %r9d
	jne	.L25
	addl	%r9d, %edx
.L12:
	leal	2(%rsi), %r8d
	cmpl	%ecx, %r8d
	jge	.L6
	addl	$3, %esi
	addl	8(%rbp,%rdi), %edx
	cmpl	%esi, %ecx
	jle	.L6
	andb	$1, %sil
	movl	12(%rbp,%rdi), %ecx
	jne	.L15
	addl	%ecx, %edx
.L6:
	subl	%eax, %edx
	movl	$1, %edi
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$440, %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
.L25:
	.cfi_restore_state
	addl	%r9d, %eax
	jmp	.L12
.L15:
	addl	%ecx, %eax
	jmp	.L6
.L20:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L6
.L7:
	movl	0(%rbp), %r8d
	xorl	%esi, %esi
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%edi, %edi
	jmp	.L18
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1
	.long	1
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
.LC2:
	.string	" "
.LC5:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r13
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rdi
	movl	$4, %esi
	call	calloc@PLT
	leaq	32(%rsp), %rdi
	movl	$48, %ecx
	pxor	%xmm0, %xmm0
	movq	%rax, %rbp
	xorl	%eax, %eax
	movl	$401, %edx
	movl	$400, %esi
	rep stosq
	movq	stdin(%rip), %rcx
	movq	%r13, %rdi
	movaps	%xmm0, 16(%rsp)
	call	__fgets_chk@PLT
	movq	%r12, %rsi
	movq	%r13, %rdi
	call	strtok@PLT
	xorl	%esi, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	call	strtol@PLT
	movslq	12(%rsp), %rsi
	movl	%eax, 0(%rbp)
	cmpl	$1, %esi
	jle	.L4
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	xorl	%edi, %edi
	call	strtok@PLT
	xorl	%esi, %esi
	movl	$10, %edx
	movq	%rax, %rdi
	call	strtol@PLT
	movslq	12(%rsp), %rsi
	movl	%eax, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L5
.L4:
	leaq	compare(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L20
	leal	-1(%rcx), %eax
	cmpl	$3, %eax
	jbe	.L7
	movl	%ecx, %edx
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC3(%rip), %xmm7
	shrl	$2, %edx
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm4
	movq	%rbp, %rax
	salq	$4, %rdx
	movdqa	.LC4(%rip), %xmm6
	addq	%rbp, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm3, %xmm0
	movdqu	(%rax), %xmm8
	addq	$16, %rax
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm4, %xmm0
	pcmpeqd	%xmm4, %xmm0
	movdqa	%xmm0, %xmm5
	pand	%xmm8, %xmm0
	pandn	%xmm8, %xmm5
	paddd	%xmm0, %xmm2
	paddd	%xmm5, %xmm1
	cmpq	%rax, %rdx
	jne	.L8
	movdqa	%xmm2, %xmm0
	movl	%ecx, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %cl
	je	.L6
	movslq	%esi, %r8
	leaq	0(,%r8,4), %rdi
	movl	0(%rbp,%r8,4), %r8d
.L18:
	addl	%r8d, %edx
	leal	1(%rsi), %r8d
	cmpl	%ecx, %r8d
	jge	.L6
	andb	$1, %r8b
	movl	4(%rbp,%rdi), %r9d
	jne	.L25
	addl	%r9d, %edx
.L12:
	leal	2(%rsi), %r8d
	cmpl	%ecx, %r8d
	jge	.L6
	addl	$3, %esi
	addl	8(%rbp,%rdi), %edx
	cmpl	%esi, %ecx
	jle	.L6
	andb	$1, %sil
	movl	12(%rbp,%rdi), %ecx
	jne	.L15
	addl	%ecx, %edx
.L6:
	subl	%eax, %edx
	movl	$1, %edi
	leaq	.LC5(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbp, %rdi
	call	free@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$440, %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
.L25:
	.cfi_restore_state
	addl	%r9d, %eax
	jmp	.L12
.L15:
	addl	%ecx, %eax
	jmp	.L6
.L20:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L6
.L7:
	movl	0(%rbp), %r8d
	xorl	%esi, %esi
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%edi, %edi
	jmp	.L18
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1
	.long	1
	.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<stdint.h>
#include<stdbool.h>
#include<limits.h>
#include<inttypes.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stdint.h>
#include<stdbool.h>

int compare(const void * a, const void * b){
	return *(int *)b - *(int *)a;
}
int main(){
  int n;
  scanf("%d\n", &n);
  int *a = (int *)calloc(n, sizeof(int));
  char buff[400] = {0};
  fgets(buff, 401, stdin);
  a[0] = atoi(strtok(buff, " "));
  for(int i =1; i < n; ++i)
	  a[i] = atoi(strtok(NULL, " "));
  qsort(a, n, sizeof(int),compare);
  int alice=0;int bob=0;
  for(int i = 0; i< n; ++i){
	  if(i%2)
		  bob += a[i];
	  else
		  alice += a[i];
  }
  printf("%d", alice - bob);
  free(a);
  return 0;
}

4
20 18 2 12
 2
2 1
 3
3 7 4
 4
20 1 2 12
 2
2 0
 3
3 9 4
 4
20 1 4 12
 2
2 -1
 2
4 -1
 4
20 2 0 12

12 1 6 9 2 8 11 3 5 10
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdint.h>
#include<stdbool.h>
#include<limits.h>
#include<inttypes.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stdint.h>
#include<stdbool.h>

int compare(const void * a, const void * b){
	return *(int *)b - *(int *)a;
}
int main(){
  int n;
  scanf("%d\n", &n);
  int *a = (int *)calloc(n, sizeof(int));
  char buff[400] = {0};
  fgets(buff, 401, stdin);
  a[0] = atoi(strtok(buff, " "));
  for(int i =1; i < n; ++i)
	  a[i] = atoi(strtok(NULL, " "));
  qsort(a, n, sizeof(int),compare);
  int alice=0;int bob=0;
  for(int i = 0; i< n; ++i){
	  if(i%2)
		  bob += a[i];
	  else
		  alice += a[i];
  }
  printf("%d", alice - bob);
  free(a);
  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	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%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\n"
.LC1:
	.string	" "
.LC2:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$456, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-460(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-460(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -440(%rbp)
	movq	$0, -432(%rbp)
	movq	$0, -424(%rbp)
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$48, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	stdin(%rip), %rdx
	leaq	-432(%rbp), %rax
	movl	$401, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-432(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, %rdi
	call	atoi@PLT
	movq	-440(%rbp), %rdx
	movl	%eax, (%rdx)
	movl	$1, -456(%rbp)
	jmp	.L4
.L5:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %edi
	call	strtok@PLT
	movl	-456(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-440(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, (%rbx)
	addl	$1, -456(%rbp)
.L4:
	movl	-460(%rbp), %eax
	cmpl	%eax, -456(%rbp)
	jl	.L5
	movl	-460(%rbp), %eax
	movslq	%eax, %rsi
	movq	-440(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -452(%rbp)
	movl	$0, -448(%rbp)
	movl	$0, -444(%rbp)
	jmp	.L6
.L9:
	movl	-444(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-444(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -448(%rbp)
	jmp	.L8
.L7:
	movl	-444(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -452(%rbp)
.L8:
	addl	$1, -444(%rbp)
.L6:
	movl	-460(%rbp), %eax
	cmpl	%eax, -444(%rbp)
	jl	.L9
	movl	-452(%rbp), %eax
	subl	-448(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-440(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%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\n"
.LC1:
	.string	" "
.LC2:
	.string	"%d"
	.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
	pushq	%rbx
	subq	$456, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-460(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-460(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -440(%rbp)
	movq	$0, -432(%rbp)
	movq	$0, -424(%rbp)
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$48, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	stdin(%rip), %rdx
	leaq	-432(%rbp), %rax
	movl	$401, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	-432(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, %rdi
	call	atoi@PLT
	movq	-440(%rbp), %rdx
	movl	%eax, (%rdx)
	movl	$1, -456(%rbp)
	jmp	.L4
.L5:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rsi
	movl	$0, %edi
	call	strtok@PLT
	movl	-456(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-440(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, (%rbx)
	addl	$1, -456(%rbp)
.L4:
	movl	-460(%rbp), %eax
	cmpl	%eax, -456(%rbp)
	jl	.L5
	movl	-460(%rbp), %eax
	movslq	%eax, %rsi
	movq	-440(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -452(%rbp)
	movl	$0, -448(%rbp)
	movl	$0, -444(%rbp)
	jmp	.L6
.L9:
	movl	-444(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L7
	movl	-444(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -448(%rbp)
	jmp	.L8
.L7:
	movl	-444(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-440(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -452(%rbp)
.L8:
	addl	$1, -444(%rbp)
.L6:
	movl	-460(%rbp), %eax
	cmpl	%eax, -444(%rbp)
	jl	.L9
	movl	-452(%rbp), %eax
	subl	-448(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-440(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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:
