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>
void sort(int n,int a[])
{
  int i,j,tmp;
  for(i=0; i<n; i++)
    for(j=i+1; j<n; j++)
      if(a[i]<a[j]){
        tmp=a[i];
        a[i]=a[j];
        a[j]=tmp;
      }
}
int find(int a[], int n)
{
  int i,A,B;
  A=B=0;
  for(i=0; i<n; i++)
    {
      if(i%2==0)
        A+=a[i];
      else
        B+=a[i];
    }
  A-=B;
  return A;
}
int main()
{
  int i,n,result;
  scanf("%d",&n);
  int a[n];
  for(i=0; i<n; i++)
    scanf("%d",&a[i]);
  sort(n,a);
  result=find(a,n);
  printf("%d\n",result);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sort
	.type	sort, @function
sort:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L4:
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sort, .-sort
	.globl	find
	.type	find, @function
find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L11:
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	jmp	.L10
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
.L10:
	addl	$1, -12(%rbp)
.L8:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L11
	movl	-4(%rbp), %eax
	subl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ecx
	movl	$0, %edx
	divq	%rcx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L17
.L18:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L17:
	movl	-84(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L18
	movl	-84(%rbp), %eax
	movq	-64(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	sort
	movl	-84(%rbp), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	jle	.L1
	movq	%rsi, %r8
	movslq	%edi, %r10
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r8), %edx
	movl	(%rsi,%rax,4), %ecx
	cmpl	%ecx, %edx
	jge	.L4
	movl	%ecx, (%r8)
	movl	%edx, (%rsi,%rax,4)
.L4:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L5
	addq	$1, %r9
	addq	$4, %r8
	cmpq	%r10, %r9
	jne	.L3
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	sort, .-sort
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB24:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L22
	leal	-1(%rsi), %eax
	cmpl	$3, %eax
	jbe	.L23
	movl	%esi, %edx
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC1(%rip), %xmm7
	shrl	$2, %edx
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	movq	%rdi, %rax
	subl	$1, %edx
	movdqa	.LC2(%rip), %xmm6
	salq	$4, %rdx
	leaq	16(%rdi,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqa	%xmm3, %xmm0
	movdqu	(%rax), %xmm4
	addq	$16, %rax
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	paddd	%xmm4, %xmm1
	movdqu	-16(%rax), %xmm4
	pandn	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %rdx
	jne	.L13
	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, %edx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %cl
	je	.L14
	movslq	%esi, %rdi
	salq	$2, %rdi
	leaq	(%r8,%rdi), %r9
.L12:
	addl	(%r9), %eax
	leal	1(%rsi), %r9d
	cmpl	%r9d, %ecx
	jle	.L14
	andl	$1, %r9d
	leaq	4(%r8,%rdi), %r10
	je	.L25
	addl	(%r10), %edx
.L16:
	leal	2(%rsi), %r9d
	cmpl	%ecx, %r9d
	jge	.L14
	leaq	8(%r8,%rdi), %r9
	addl	$3, %esi
	addl	(%r9), %eax
	cmpl	%esi, %ecx
	jle	.L14
	andl	$1, %esi
	leaq	12(%r8,%rdi), %rcx
	je	.L19
	addl	(%rcx), %edx
.L14:
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	addl	(%r10), %eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L19:
	addl	(%rcx), %eax
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	xorl	%eax, %eax
	ret
.L23:
	movq	%rdi, %r9
	xorl	%edx, %edx
	xorl	%eax, %eax
	xorl	%esi, %esi
	xorl	%edi, %edi
	jmp	.L12
	.cfi_endproc
.LFE24:
	.size	find, .-find
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%d"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC3(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L28
.L62:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L62
.L28:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L63
.L29:
	movq	%rsp, %rbx
	testl	%ecx, %ecx
	jle	.L30
	movq	%rbx, %r15
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %edi
	addq	$4, %r13
	cmpl	%r12d, %edi
	jg	.L31
	testl	%edi, %edi
	jle	.L30
	cmpl	$1, %edi
	je	.L32
	movslq	%edi, %r9
	movq	%rbx, %rsi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L35:
	movl	(%rsi), %edx
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %edx
	jge	.L34
	movl	%ecx, (%rsi)
	movl	%edx, (%rbx,%rax,4)
.L34:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L35
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r9, %r8
	jne	.L33
.L32:
	leal	-1(%rdi), %eax
	cmpl	$3, %eax
	jbe	.L49
	movl	%edi, %eax
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC1(%rip), %xmm7
	shrl	$2, %eax
	movdqa	.LC2(%rip), %xmm6
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	salq	$4, %rax
	addq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L38:
	movdqa	%xmm3, %xmm0
	movdqu	(%r15), %xmm4
	addq	$16, %r15
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	paddd	%xmm4, %xmm1
	movdqu	-16(%r15), %xmm4
	pandn	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%r15, %rax
	jne	.L38
	movdqa	%xmm2, %xmm0
	movl	%edi, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	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, %dil
	je	.L47
	movslq	%ecx, %rsi
	salq	$2, %rsi
	leaq	(%rbx,%rsi), %r8
.L37:
	addl	(%r8), %edx
	leal	1(%rcx), %r8d
	cmpl	%r8d, %edi
	jle	.L47
	andb	$1, %r8b
	leaq	4(%rbx,%rsi), %r9
	jne	.L40
	addl	(%r9), %edx
.L41:
	leal	2(%rcx), %r8d
	cmpl	%edi, %r8d
	jge	.L47
	leaq	8(%rbx,%rsi), %r8
	addl	$3, %ecx
	addl	(%r8), %edx
	cmpl	%ecx, %edi
	jle	.L47
	andb	$1, %cl
	leaq	12(%rbx,%rsi), %rsi
	je	.L44
	addl	(%rsi), %eax
.L47:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L64
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L40:
	.cfi_restore_state
	addl	(%r9), %eax
	jmp	.L41
.L44:
	addl	(%rsi), %edx
	jmp	.L47
.L63:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L29
.L30:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L47
.L49:
	movq	%rbx, %r8
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	jmp	.L37
.L64:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC2:
	.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	sort
	.type	sort, @function
sort:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$1, %edi
	jle	.L1
	movq	%rsi, %r8
	movslq	%edi, %r10
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r8), %edx
	movl	(%rsi,%rax,4), %ecx
	cmpl	%ecx, %edx
	jge	.L4
	movl	%ecx, (%r8)
	movl	%edx, (%rsi,%rax,4)
.L4:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L5
	addq	$1, %r9
	addq	$4, %r8
	cmpq	%r10, %r9
	jne	.L3
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	sort, .-sort
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB24:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L22
	leal	-1(%rsi), %eax
	cmpl	$3, %eax
	jbe	.L23
	movl	%esi, %edx
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC1(%rip), %xmm7
	shrl	$2, %edx
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	movq	%rdi, %rax
	subl	$1, %edx
	movdqa	.LC2(%rip), %xmm6
	salq	$4, %rdx
	leaq	16(%rdi,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L13:
	movdqa	%xmm3, %xmm0
	movdqu	(%rax), %xmm4
	addq	$16, %rax
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	paddd	%xmm4, %xmm1
	movdqu	-16(%rax), %xmm4
	pandn	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %rdx
	jne	.L13
	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, %edx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %cl
	je	.L14
	movslq	%esi, %rdi
	salq	$2, %rdi
	leaq	(%r8,%rdi), %r9
.L12:
	addl	(%r9), %eax
	leal	1(%rsi), %r9d
	cmpl	%r9d, %ecx
	jle	.L14
	andl	$1, %r9d
	leaq	4(%r8,%rdi), %r10
	je	.L25
	addl	(%r10), %edx
.L16:
	leal	2(%rsi), %r9d
	cmpl	%ecx, %r9d
	jge	.L14
	leaq	8(%r8,%rdi), %r9
	addl	$3, %esi
	addl	(%r9), %eax
	cmpl	%esi, %ecx
	jle	.L14
	andl	$1, %esi
	leaq	12(%r8,%rdi), %rcx
	je	.L19
	addl	(%rcx), %edx
.L14:
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	addl	(%r10), %eax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L19:
	addl	(%rcx), %eax
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	xorl	%eax, %eax
	ret
.L23:
	movq	%rdi, %r9
	xorl	%edx, %edx
	xorl	%eax, %eax
	xorl	%esi, %esi
	xorl	%edi, %edi
	jmp	.L12
	.cfi_endproc
.LFE24:
	.size	find, .-find
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%d"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC3(%rip), %r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L28
.L62:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L62
.L28:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L63
.L29:
	movq	%rsp, %rbx
	testl	%ecx, %ecx
	jle	.L30
	movq	%rbx, %r15
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %edi
	addq	$4, %r13
	cmpl	%r12d, %edi
	jg	.L31
	testl	%edi, %edi
	jle	.L30
	cmpl	$1, %edi
	je	.L32
	movslq	%edi, %r9
	movq	%rbx, %rsi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L35:
	movl	(%rsi), %edx
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %edx
	jge	.L34
	movl	%ecx, (%rsi)
	movl	%edx, (%rbx,%rax,4)
.L34:
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L35
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r9, %r8
	jne	.L33
.L32:
	leal	-1(%rdi), %eax
	cmpl	$3, %eax
	jbe	.L49
	movl	%edi, %eax
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC1(%rip), %xmm7
	shrl	$2, %eax
	movdqa	.LC2(%rip), %xmm6
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	salq	$4, %rax
	addq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L38:
	movdqa	%xmm3, %xmm0
	movdqu	(%r15), %xmm4
	addq	$16, %r15
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	paddd	%xmm4, %xmm1
	movdqu	-16(%r15), %xmm4
	pandn	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%r15, %rax
	jne	.L38
	movdqa	%xmm2, %xmm0
	movl	%edi, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	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, %dil
	je	.L47
	movslq	%ecx, %rsi
	salq	$2, %rsi
	leaq	(%rbx,%rsi), %r8
.L37:
	addl	(%r8), %edx
	leal	1(%rcx), %r8d
	cmpl	%r8d, %edi
	jle	.L47
	andb	$1, %r8b
	leaq	4(%rbx,%rsi), %r9
	jne	.L40
	addl	(%r9), %edx
.L41:
	leal	2(%rcx), %r8d
	cmpl	%edi, %r8d
	jge	.L47
	leaq	8(%rbx,%rsi), %r8
	addl	$3, %ecx
	addl	(%r8), %edx
	cmpl	%ecx, %edi
	jle	.L47
	andb	$1, %cl
	leaq	12(%rbx,%rsi), %rsi
	je	.L44
	addl	(%rsi), %eax
.L47:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L64
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L40:
	.cfi_restore_state
	addl	(%r9), %eax
	jmp	.L41
.L44:
	addl	(%rsi), %edx
	jmp	.L47
.L63:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L29
.L30:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L47
.L49:
	movq	%rbx, %r8
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	jmp	.L37
.L64:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC2:
	.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<stdio.h>
void sort(int n,int a[])
{
  int i,j,tmp;
  for(i=0; i<n; i++)
    for(j=i+1; j<n; j++)
      if(a[i]<a[j]){
        tmp=a[i];
        a[i]=a[j];
        a[j]=tmp;
      }
}
int find(int a[], int n)
{
  int i,A,B;
  A=B=0;
  for(i=0; i<n; i++)
    {
      if(i%2==0)
        A+=a[i];
      else
        B+=a[i];
    }
  A-=B;
  return A;
}
int main()
{
  int i,n,result;
  scanf("%d",&n);
  int a[n];
  for(i=0; i<n; i++)
    scanf("%d",&a[i]);
  sort(n,a);
  result=find(a,n);
  printf("%d\n",result);
  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<stdio.h>
void sort(int n,int a[])
{
  int i,j,tmp;
  for(i=0; i<n; i++)
    for(j=i+1; j<n; j++)
      if(a[i]<a[j]){
        tmp=a[i];
        a[i]=a[j];
        a[j]=tmp;
      }
}
int find(int a[], int n)
{
  int i,A,B;
  A=B=0;
  for(i=0; i<n; i++)
    {
      if(i%2==0)
        A+=a[i];
      else
        B+=a[i];
    }
  A-=B;
  return A;
}
int main()
{
  int i,n,result;
  scanf("%d",&n);
  int a[n];
  for(i=0; i<n; i++)
    scanf("%d",&a[i]);
  sort(n,a);
  result=find(a,n);
  printf("%d\n",result);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sort
	.type	sort, @function
sort:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L4:
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sort, .-sort
	.globl	find
	.type	find, @function
find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L11:
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	jmp	.L10
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
.L10:
	addl	$1, -12(%rbp)
.L8:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L11
	movl	-4(%rbp), %eax
	subl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ecx
	movl	$0, %edx
	divq	%rcx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L17
.L18:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L17:
	movl	-84(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L18
	movl	-84(%rbp), %eax
	movq	-64(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	sort
	movl	-84(%rbp), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	sort
	.type	sort, @function
sort:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L5:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L4:
	addl	$1, -8(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	sort, .-sort
	.globl	find
	.type	find, @function
find:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L11:
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -8(%rbp)
	jmp	.L10
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -4(%rbp)
.L10:
	addl	$1, -12(%rbp)
.L8:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L11
	movl	-4(%rbp), %eax
	subl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ecx
	movl	$0, %edx
	divq	%rcx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L17
.L18:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L17:
	movl	-84(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L18
	movl	-84(%rbp), %eax
	movq	-64(%rbp), %rdx
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	sort
	movl	-84(%rbp), %edx
	movq	-64(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	find
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
