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>

int compare(const void *a, const void *b){
	long long int *A = (long long int *)a;
	long long int *B = (long long int *)b;
	if (*A > *B) return 1;
	if (*A < *B) return -1;
	return 0;
}

long long ab(long long x){
	if(x<0)return -x;
	return x;
}

int main(){
	int N,i;
	scanf("%d",&N);
	long long A[N],B[N],C[N];
	long long ans=0,tmp=0;
	for(i=0;i<N;i++)scanf("%lld",&A[i]);
	qsort(A,N,sizeof(long long),compare);
	B[N/2]=A[0];
	int min=1;
	int max=N-1;
	for(i=1;i<=(N+1)/2-1;i++){
		if(i%2==1){
			B[N/2-i]=A[max--];
			B[N/2+i]=A[max--];
		}else{
			B[N/2-i]=A[min++];
			B[N/2+i]=A[min++];
		}
	}
	if(N%2==0)B[0]=A[N/2];
	for(i=0;i<N-1;i++)ans+=ab(B[i]-B[i+1]);
	
	C[N/2]=A[N-1];
	min=0;
	max=N-2;
	for(i=1;i<=(N+1)/2-1;i++){
		if(i%2==1){
			C[N/2-i]=A[min++];
			C[N/2+i]=A[min++];
		}else{
			C[N/2-i]=A[max--];
			C[N/2+i]=A[max--];
		}
	}
	if(N%2==0)C[0]=A[N/2];
	for(i=0;i<N-1;i++)tmp+=ab(C[i]-C[i+1]);
	if(tmp>ans)ans=tmp;
	
	printf("%lld\n",ans);
	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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.globl	ab
	.type	ab, @function
ab:
.LFB7:
	.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)
	cmpq	$0, -8(%rbp)
	jns	.L6
	movq	-8(%rbp), %rax
	negq	%rax
	jmp	.L7
.L6:
	movq	-8(%rbp), %rax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	ab, .-ab
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %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	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -96(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-136(%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,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L18
.L19:
	movl	-132(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -132(%rbp)
.L18:
	movl	-136(%rbp), %eax
	cmpl	%eax, -132(%rbp)
	jl	.L19
	movl	-136(%rbp), %eax
	movslq	%eax, %rsi
	movq	-96(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	$1, -128(%rbp)
	movl	-136(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -124(%rbp)
	movl	$1, -132(%rbp)
	jmp	.L20
.L23:
	movl	-132(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L21
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L22
.L21:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L22:
	addl	$1, -132(%rbp)
.L20:
	movl	-136(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -132(%rbp)
	jl	.L23
	movl	-136(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L24
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, (%rax)
.L24:
	movl	$0, -132(%rbp)
	jmp	.L25
.L26:
	movq	-80(%rbp), %rax
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-132(%rbp), %eax
	leal	1(%rax), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	ab
	addq	%rax, -120(%rbp)
	addl	$1, -132(%rbp)
.L25:
	movl	-136(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -132(%rbp)
	jl	.L26
	movl	-136(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-136(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %esi
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	$0, -128(%rbp)
	movl	-136(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -124(%rbp)
	movl	$1, -132(%rbp)
	jmp	.L27
.L30:
	movl	-132(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L28
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L29
.L28:
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L29:
	addl	$1, -132(%rbp)
.L27:
	movl	-136(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -132(%rbp)
	jl	.L30
	movl	-136(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L31
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-64(%rbp), %rax
	movq	%rdx, (%rax)
.L31:
	movl	$0, -132(%rbp)
	jmp	.L32
.L33:
	movq	-64(%rbp), %rax
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-132(%rbp), %eax
	leal	1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	ab
	addq	%rax, -112(%rbp)
	addl	$1, -132(%rbp)
.L32:
	movl	-136(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -132(%rbp)
	jl	.L33
	movq	-112(%rbp), %rax
	cmpq	-120(%rbp), %rax
	jle	.L34
	movq	-112(%rbp), %rax
	movq	%rax, -120(%rbp)
.L34:
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%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	.L36
	call	__stack_chk_fail@PLT
.L36:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.p2align 4
	.globl	ab
	.type	ab, @function
ab:
.LFB40:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	negq	%rax
	cmovs	%rdi, %rax
	ret
	.cfi_endproc
.LFE40:
	.size	ab, .-ab
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	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
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	15(,%rsi,8), %rdx
	movq	%rsi, %rax
	movq	%rdx, %r8
	movq	%rdx, %rcx
	andq	$-4096, %r8
	andq	$-16, %rcx
	subq	%r8, %rdi
	cmpq	%rdi, %rsp
	je	.L8
.L58:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L58
.L8:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L59
.L9:
	leaq	7(%rsp), %rbx
	movq	%rdx, %r8
	movq	%rsp, %rdi
	movq	%rbx, %rcx
	andq	$-4096, %r8
	andq	$-8, %rbx
	shrq	$3, %rcx
	subq	%r8, %rdi
	movq	%rcx, -72(%rbp)
	movq	%rdx, %rcx
	andq	$-16, %rcx
.L10:
	cmpq	%rdi, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L59:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L9
.L11:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L60
.L12:
	leaq	7(%rsp), %r12
	movq	%rsp, %rdi
	movq	%r12, %rcx
	andq	$-8, %r12
	shrq	$3, %rcx
	movq	%rcx, -88(%rbp)
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	andq	$-16, %rcx
	subq	%rdx, %rdi
.L13:
	cmpq	%rdi, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L60:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L12
.L14:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L15
	orq	$0, -8(%rsp,%rcx)
.L15:
	leaq	7(%rsp), %r13
	movq	%r13, %rcx
	andq	$-8, %r13
	shrq	$3, %rcx
	movq	%rcx, -96(%rbp)
	testl	%eax, %eax
	jle	.L16
	movq	%rbx, %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$8, %r15
	cmpl	%r14d, %eax
	jg	.L17
	movslq	%eax, %rsi
.L16:
	leaq	compare(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	-60(%rbp), %r11d
	movq	-72(%rbp), %rcx
	movl	%r11d, %eax
	movq	0(,%rcx,8), %rdx
	leal	-1(%r11), %ecx
	shrl	$31, %eax
	movl	%ecx, -72(%rbp)
	addl	%r11d, %eax
	sarl	%eax
	movslq	%eax, %rsi
	movq	%rdx, (%r12,%rsi,8)
	leal	1(%r11), %edx
	movl	%edx, %r9d
	movq	%rsi, -80(%rbp)
	shrl	$31, %r9d
	addl	%edx, %r9d
	sarl	%r9d
	cmpl	$2, %r11d
	jle	.L24
	movl	%ecx, %r10d
	leal	-1(%rax), %esi
	leal	1(%rax), %ecx
	movl	$1, %edi
	movl	$1, %edx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%edi, %r15
	leal	1(%rdi), %r8d
	movslq	%esi, %r14
	addl	$1, %edx
	movq	(%rbx,%r15,8), %r15
	movslq	%r8d, %r8
	addl	$2, %edi
	subl	$1, %esi
	movq	%r15, (%r12,%r14,8)
	movq	(%rbx,%r8,8), %r8
	movslq	%ecx, %r14
	addl	$1, %ecx
	movq	%r8, (%r12,%r14,8)
	cmpl	%r9d, %edx
	jge	.L24
.L23:
	testb	$1, %dl
	je	.L21
	movslq	%r10d, %r15
	leal	-1(%r10), %r8d
	movslq	%esi, %r14
	addl	$1, %edx
	movq	(%rbx,%r15,8), %r15
	movslq	%r8d, %r8
	subl	$2, %r10d
	subl	$1, %esi
	movq	%r15, (%r12,%r14,8)
	movq	(%rbx,%r8,8), %r8
	movslq	%ecx, %r14
	addl	$1, %ecx
	movq	%r8, (%r12,%r14,8)
	cmpl	%r9d, %edx
	jl	.L23
.L24:
	movl	%r11d, %r15d
	andl	$1, %r15d
	jne	.L20
	movq	-80(%rbp), %rsi
	movq	-88(%rbp), %rcx
	movq	(%rbx,%rsi,8), %rdx
	movq	%rdx, 0(,%rcx,8)
.L20:
	movl	-72(%rbp), %edx
	testl	%edx, %edx
	jle	.L41
	movq	-88(%rbp), %rcx
	leal	-2(%r11), %edx
	xorl	%r8d, %r8d
	movq	%rdx, %r10
	movq	0(,%rcx,8), %rsi
	leaq	8(%r12), %rcx
	leaq	16(%r12,%rdx,8), %r12
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$8, %rcx
	addq	%rdi, %r8
	cmpq	%r12, %rcx
	je	.L25
.L27:
	movq	%rdx, %rsi
.L28:
	movq	(%rcx), %rdx
	movq	%rsi, %rdi
	subq	%rdx, %rdi
	jns	.L26
	movq	%rdx, %rdi
	addq	$8, %rcx
	subq	%rsi, %rdi
	addq	%rdi, %r8
	cmpq	%rcx, %r12
	jne	.L27
.L25:
	movslq	-72(%rbp), %rdx
	movq	-80(%rbp), %rsi
	movq	(%rbx,%rdx,8), %rdx
	movq	%rdx, 0(%r13,%rsi,8)
	movl	%r10d, %esi
	cmpl	$2, %r11d
	jle	.L35
	leal	-1(%rax), %ecx
	xorl	%r11d, %r11d
	addl	$1, %eax
	movl	$1, %edx
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L32:
	movslq	%esi, %r14
	leal	-1(%rsi), %edi
	movslq	%ecx, %r12
	addl	$1, %edx
	movq	(%rbx,%r14,8), %r14
	movslq	%edi, %rdi
	subl	$2, %esi
	subl	$1, %ecx
	movq	%r14, 0(%r13,%r12,8)
	movq	(%rbx,%rdi,8), %rdi
	movslq	%eax, %r12
	addl	$1, %eax
	movq	%rdi, 0(%r13,%r12,8)
	cmpl	%r9d, %edx
	jge	.L35
.L34:
	testb	$1, %dl
	je	.L32
	movslq	%r11d, %r14
	leal	1(%r11), %edi
	movslq	%ecx, %r12
	addl	$1, %edx
	movq	(%rbx,%r14,8), %r14
	movslq	%edi, %rdi
	addl	$2, %r11d
	subl	$1, %ecx
	movq	%r14, 0(%r13,%r12,8)
	movq	(%rbx,%rdi,8), %rdi
	movslq	%eax, %r12
	addl	$1, %eax
	movq	%rdi, 0(%r13,%r12,8)
	cmpl	%r9d, %edx
	jl	.L34
.L35:
	testl	%r15d, %r15d
	jne	.L31
	movq	-80(%rbp), %rax
	movq	(%rbx,%rax,8), %rax
	movq	-96(%rbp), %rbx
	movq	%rax, 0(,%rbx,8)
.L31:
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jle	.L42
	movq	-96(%rbp), %rax
	leaq	8(%r13), %rcx
	leaq	16(%r13,%r10,8), %r9
	xorl	%edx, %edx
	movq	0(,%rax,8), %rsi
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L37:
	addq	$8, %rcx
	addq	%rdi, %rdx
	cmpq	%r9, %rcx
	je	.L36
.L38:
	movq	%rax, %rsi
.L39:
	movq	(%rcx), %rax
	movq	%rsi, %rdi
	subq	%rax, %rdi
	jns	.L37
	movq	%rax, %rdi
	addq	$8, %rcx
	subq	%rsi, %rdi
	addq	%rdi, %rdx
	cmpq	%r9, %rcx
	jne	.L38
.L36:
	cmpq	%r8, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	cmovl	%r8, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L61
	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
.L42:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L36
.L41:
	xorl	%r8d, %r8d
	leal	-2(%r11), %r10d
	jmp	.L25
.L61:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.p2align 4
	.globl	ab
	.type	ab, @function
ab:
.LFB40:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	negq	%rax
	cmovs	%rdi, %rax
	ret
	.cfi_endproc
.LFE40:
	.size	ab, .-ab
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	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
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	15(,%rsi,8), %rdx
	movq	%rsi, %rax
	movq	%rdx, %r8
	movq	%rdx, %rcx
	andq	$-4096, %r8
	andq	$-16, %rcx
	subq	%r8, %rdi
	cmpq	%rdi, %rsp
	je	.L8
.L58:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L58
.L8:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L59
.L9:
	leaq	7(%rsp), %rbx
	movq	%rdx, %r8
	movq	%rsp, %rdi
	movq	%rbx, %rcx
	andq	$-4096, %r8
	andq	$-8, %rbx
	shrq	$3, %rcx
	subq	%r8, %rdi
	movq	%rcx, -72(%rbp)
	movq	%rdx, %rcx
	andq	$-16, %rcx
.L10:
	cmpq	%rdi, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L59:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L9
.L11:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L60
.L12:
	leaq	7(%rsp), %r12
	movq	%rsp, %rdi
	movq	%r12, %rcx
	andq	$-8, %r12
	shrq	$3, %rcx
	movq	%rcx, -88(%rbp)
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	andq	$-16, %rcx
	subq	%rdx, %rdi
.L13:
	cmpq	%rdi, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L60:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L12
.L14:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L15
	orq	$0, -8(%rsp,%rcx)
.L15:
	leaq	7(%rsp), %r13
	movq	%r13, %rcx
	andq	$-8, %r13
	shrq	$3, %rcx
	movq	%rcx, -96(%rbp)
	testl	%eax, %eax
	jle	.L16
	movq	%rbx, %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$8, %r15
	cmpl	%r14d, %eax
	jg	.L17
	movslq	%eax, %rsi
.L16:
	leaq	compare(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	-60(%rbp), %r11d
	movq	-72(%rbp), %rcx
	movl	%r11d, %eax
	movq	0(,%rcx,8), %rdx
	leal	-1(%r11), %ecx
	shrl	$31, %eax
	movl	%ecx, -72(%rbp)
	addl	%r11d, %eax
	sarl	%eax
	movslq	%eax, %rsi
	movq	%rdx, (%r12,%rsi,8)
	leal	1(%r11), %edx
	movl	%edx, %r9d
	movq	%rsi, -80(%rbp)
	shrl	$31, %r9d
	addl	%edx, %r9d
	sarl	%r9d
	cmpl	$2, %r11d
	jle	.L24
	movl	%ecx, %r10d
	leal	-1(%rax), %esi
	leal	1(%rax), %ecx
	movl	$1, %edi
	movl	$1, %edx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%edi, %r15
	leal	1(%rdi), %r8d
	movslq	%esi, %r14
	addl	$1, %edx
	movq	(%rbx,%r15,8), %r15
	movslq	%r8d, %r8
	addl	$2, %edi
	subl	$1, %esi
	movq	%r15, (%r12,%r14,8)
	movq	(%rbx,%r8,8), %r8
	movslq	%ecx, %r14
	addl	$1, %ecx
	movq	%r8, (%r12,%r14,8)
	cmpl	%r9d, %edx
	jge	.L24
.L23:
	testb	$1, %dl
	je	.L21
	movslq	%r10d, %r15
	leal	-1(%r10), %r8d
	movslq	%esi, %r14
	addl	$1, %edx
	movq	(%rbx,%r15,8), %r15
	movslq	%r8d, %r8
	subl	$2, %r10d
	subl	$1, %esi
	movq	%r15, (%r12,%r14,8)
	movq	(%rbx,%r8,8), %r8
	movslq	%ecx, %r14
	addl	$1, %ecx
	movq	%r8, (%r12,%r14,8)
	cmpl	%r9d, %edx
	jl	.L23
.L24:
	movl	%r11d, %r15d
	andl	$1, %r15d
	jne	.L20
	movq	-80(%rbp), %rsi
	movq	-88(%rbp), %rcx
	movq	(%rbx,%rsi,8), %rdx
	movq	%rdx, 0(,%rcx,8)
.L20:
	movl	-72(%rbp), %edx
	testl	%edx, %edx
	jle	.L41
	movq	-88(%rbp), %rcx
	leal	-2(%r11), %edx
	xorl	%r8d, %r8d
	movq	%rdx, %r10
	movq	0(,%rcx,8), %rsi
	leaq	8(%r12), %rcx
	leaq	16(%r12,%rdx,8), %r12
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L26:
	addq	$8, %rcx
	addq	%rdi, %r8
	cmpq	%r12, %rcx
	je	.L25
.L27:
	movq	%rdx, %rsi
.L28:
	movq	(%rcx), %rdx
	movq	%rsi, %rdi
	subq	%rdx, %rdi
	jns	.L26
	movq	%rdx, %rdi
	addq	$8, %rcx
	subq	%rsi, %rdi
	addq	%rdi, %r8
	cmpq	%rcx, %r12
	jne	.L27
.L25:
	movslq	-72(%rbp), %rdx
	movq	-80(%rbp), %rsi
	movq	(%rbx,%rdx,8), %rdx
	movq	%rdx, 0(%r13,%rsi,8)
	movl	%r10d, %esi
	cmpl	$2, %r11d
	jle	.L35
	leal	-1(%rax), %ecx
	xorl	%r11d, %r11d
	addl	$1, %eax
	movl	$1, %edx
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L32:
	movslq	%esi, %r14
	leal	-1(%rsi), %edi
	movslq	%ecx, %r12
	addl	$1, %edx
	movq	(%rbx,%r14,8), %r14
	movslq	%edi, %rdi
	subl	$2, %esi
	subl	$1, %ecx
	movq	%r14, 0(%r13,%r12,8)
	movq	(%rbx,%rdi,8), %rdi
	movslq	%eax, %r12
	addl	$1, %eax
	movq	%rdi, 0(%r13,%r12,8)
	cmpl	%r9d, %edx
	jge	.L35
.L34:
	testb	$1, %dl
	je	.L32
	movslq	%r11d, %r14
	leal	1(%r11), %edi
	movslq	%ecx, %r12
	addl	$1, %edx
	movq	(%rbx,%r14,8), %r14
	movslq	%edi, %rdi
	addl	$2, %r11d
	subl	$1, %ecx
	movq	%r14, 0(%r13,%r12,8)
	movq	(%rbx,%rdi,8), %rdi
	movslq	%eax, %r12
	addl	$1, %eax
	movq	%rdi, 0(%r13,%r12,8)
	cmpl	%r9d, %edx
	jl	.L34
.L35:
	testl	%r15d, %r15d
	jne	.L31
	movq	-80(%rbp), %rax
	movq	(%rbx,%rax,8), %rax
	movq	-96(%rbp), %rbx
	movq	%rax, 0(,%rbx,8)
.L31:
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jle	.L42
	movq	-96(%rbp), %rax
	leaq	8(%r13), %rcx
	leaq	16(%r13,%r10,8), %r9
	xorl	%edx, %edx
	movq	0(,%rax,8), %rsi
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L37:
	addq	$8, %rcx
	addq	%rdi, %rdx
	cmpq	%r9, %rcx
	je	.L36
.L38:
	movq	%rax, %rsi
.L39:
	movq	(%rcx), %rax
	movq	%rsi, %rdi
	subq	%rax, %rdi
	jns	.L37
	movq	%rax, %rdi
	addq	$8, %rcx
	subq	%rsi, %rdi
	addq	%rdi, %rdx
	cmpq	%r9, %rcx
	jne	.L38
.L36:
	cmpq	%r8, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	cmovl	%r8, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L61
	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
.L42:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L36
.L41:
	xorl	%r8d, %r8d
	leal	-2(%r11), %r10d
	jmp	.L25
.L61:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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:

#include<stdio.h>
#include<stdlib.h>

int compare(const void *a, const void *b){
	long long int *A = (long long int *)a;
	long long int *B = (long long int *)b;
	if (*A > *B) return 1;
	if (*A < *B) return -1;
	return 0;
}

long long ab(long long x){
	if(x<0)return -x;
	return x;
}

int main(){
	int N,i;
	scanf("%d",&N);
	long long A[N],B[N],C[N];
	long long ans=0,tmp=0;
	for(i=0;i<N;i++)scanf("%lld",&A[i]);
	qsort(A,N,sizeof(long long),compare);
	B[N/2]=A[0];
	int min=1;
	int max=N-1;
	for(i=1;i<=(N+1)/2-1;i++){
		if(i%2==1){
			B[N/2-i]=A[max--];
			B[N/2+i]=A[max--];
		}else{
			B[N/2-i]=A[min++];
			B[N/2+i]=A[min++];
		}
	}
	if(N%2==0)B[0]=A[N/2];
	for(i=0;i<N-1;i++)ans+=ab(B[i]-B[i+1]);
	
	C[N/2]=A[N-1];
	min=0;
	max=N-2;
	for(i=1;i<=(N+1)/2-1;i++){
		if(i%2==1){
			C[N/2-i]=A[min++];
			C[N/2+i]=A[min++];
		}else{
			C[N/2-i]=A[max--];
			C[N/2+i]=A[max--];
		}
	}
	if(N%2==0)C[0]=A[N/2];
	for(i=0;i<N-1;i++)tmp+=ab(C[i]-C[i+1]);
	if(tmp>ans)ans=tmp;
	
	printf("%lld\n",ans);
	return 0;
}
3
5
6
1
 6
6
1
4
1
5
9
 5
6
8
1
1
3
 3
5
3
1
 6
6
1
4
1
1
9
 5
6
4
1
1
3
 3
0
3
1
 6
6
1
7
1
1
9
 5
6
4
1
2
3
 3
0
0
1

9
 27
 22
 6
 29
 15
 5
 33
 13
 2

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>

int compare(const void *a, const void *b){
	long long int *A = (long long int *)a;
	long long int *B = (long long int *)b;
	if (*A > *B) return 1;
	if (*A < *B) return -1;
	return 0;
}

long long ab(long long x){
	if(x<0)return -x;
	return x;
}

int main(){
	int N,i;
	scanf("%d",&N);
	long long A[N],B[N],C[N];
	long long ans=0,tmp=0;
	for(i=0;i<N;i++)scanf("%lld",&A[i]);
	qsort(A,N,sizeof(long long),compare);
	B[N/2]=A[0];
	int min=1;
	int max=N-1;
	for(i=1;i<=(N+1)/2-1;i++){
		if(i%2==1){
			B[N/2-i]=A[max--];
			B[N/2+i]=A[max--];
		}else{
			B[N/2-i]=A[min++];
			B[N/2+i]=A[min++];
		}
	}
	if(N%2==0)B[0]=A[N/2];
	for(i=0;i<N-1;i++)ans+=ab(B[i]-B[i+1]);
	
	C[N/2]=A[N-1];
	min=0;
	max=N-2;
	for(i=1;i<=(N+1)/2-1;i++){
		if(i%2==1){
			C[N/2-i]=A[min++];
			C[N/2+i]=A[min++];
		}else{
			C[N/2-i]=A[max--];
			C[N/2+i]=A[max--];
		}
	}
	if(N%2==0)C[0]=A[N/2];
	for(i=0;i<N-1;i++)tmp+=ab(C[i]-C[i+1]);
	if(tmp>ans)ans=tmp;
	
	printf("%lld\n",ans);
	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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.globl	ab
	.type	ab, @function
ab:
.LFB7:
	.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)
	cmpq	$0, -8(%rbp)
	jns	.L6
	movq	-8(%rbp), %rax
	negq	%rax
	jmp	.L7
.L6:
	movq	-8(%rbp), %rax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	ab, .-ab
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %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	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -96(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-136(%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,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L18
.L19:
	movl	-132(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -132(%rbp)
.L18:
	movl	-136(%rbp), %eax
	cmpl	%eax, -132(%rbp)
	jl	.L19
	movl	-136(%rbp), %eax
	movslq	%eax, %rsi
	movq	-96(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	$1, -128(%rbp)
	movl	-136(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -124(%rbp)
	movl	$1, -132(%rbp)
	jmp	.L20
.L23:
	movl	-132(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L21
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L22
.L21:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L22:
	addl	$1, -132(%rbp)
.L20:
	movl	-136(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -132(%rbp)
	jl	.L23
	movl	-136(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L24
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, (%rax)
.L24:
	movl	$0, -132(%rbp)
	jmp	.L25
.L26:
	movq	-80(%rbp), %rax
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-132(%rbp), %eax
	leal	1(%rax), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	ab
	addq	%rax, -120(%rbp)
	addl	$1, -132(%rbp)
.L25:
	movl	-136(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -132(%rbp)
	jl	.L26
	movl	-136(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-136(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %esi
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	$0, -128(%rbp)
	movl	-136(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -124(%rbp)
	movl	$1, -132(%rbp)
	jmp	.L27
.L30:
	movl	-132(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L28
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L29
.L28:
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L29:
	addl	$1, -132(%rbp)
.L27:
	movl	-136(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -132(%rbp)
	jl	.L30
	movl	-136(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L31
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-64(%rbp), %rax
	movq	%rdx, (%rax)
.L31:
	movl	$0, -132(%rbp)
	jmp	.L32
.L33:
	movq	-64(%rbp), %rax
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-132(%rbp), %eax
	leal	1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	ab
	addq	%rax, -112(%rbp)
	addl	$1, -132(%rbp)
.L32:
	movl	-136(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -132(%rbp)
	jl	.L33
	movq	-112(%rbp), %rax
	cmpq	-120(%rbp), %rax
	jle	.L34
	movq	-112(%rbp), %rax
	movq	%rax, -120(%rbp)
.L34:
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%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	.L36
	call	__stack_chk_fail@PLT
.L36:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.globl	ab
	.type	ab, @function
ab:
.LFB7:
	.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)
	cmpq	$0, -8(%rbp)
	jns	.L6
	movq	-8(%rbp), %rax
	negq	%rax
	jmp	.L7
.L6:
	movq	-8(%rbp), %rax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	ab, .-ab
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %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	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -96(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-136(%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,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -120(%rbp)
	movq	$0, -112(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L18
.L19:
	movl	-132(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -132(%rbp)
.L18:
	movl	-136(%rbp), %eax
	cmpl	%eax, -132(%rbp)
	jl	.L19
	movl	-136(%rbp), %eax
	movslq	%eax, %rsi
	movq	-96(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	$1, -128(%rbp)
	movl	-136(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -124(%rbp)
	movl	$1, -132(%rbp)
	jmp	.L20
.L23:
	movl	-132(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L21
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L22
.L21:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-80(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L22:
	addl	$1, -132(%rbp)
.L20:
	movl	-136(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -132(%rbp)
	jl	.L23
	movl	-136(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L24
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-80(%rbp), %rax
	movq	%rdx, (%rax)
.L24:
	movl	$0, -132(%rbp)
	jmp	.L25
.L26:
	movq	-80(%rbp), %rax
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-132(%rbp), %eax
	leal	1(%rax), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	ab
	addq	%rax, -120(%rbp)
	addl	$1, -132(%rbp)
.L25:
	movl	-136(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -132(%rbp)
	jl	.L26
	movl	-136(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-136(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	movl	%eax, %esi
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	$0, -128(%rbp)
	movl	-136(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -124(%rbp)
	movl	$1, -132(%rbp)
	jmp	.L27
.L30:
	movl	-132(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L28
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -128(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L29
.L28:
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %esi
	subl	-132(%rbp), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	movl	-124(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -124(%rbp)
	movl	-136(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	-132(%rbp), %edx
	leal	(%rcx,%rdx), %esi
	movq	-96(%rbp), %rdx
	cltq
	movq	(%rdx,%rax,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L29:
	addl	$1, -132(%rbp)
.L27:
	movl	-136(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -132(%rbp)
	jl	.L30
	movl	-136(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L31
	movl	-136(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-96(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-64(%rbp), %rax
	movq	%rdx, (%rax)
.L31:
	movl	$0, -132(%rbp)
	jmp	.L32
.L33:
	movq	-64(%rbp), %rax
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-132(%rbp), %eax
	leal	1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	ab
	addq	%rax, -112(%rbp)
	addl	$1, -132(%rbp)
.L32:
	movl	-136(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -132(%rbp)
	jl	.L33
	movq	-112(%rbp), %rax
	cmpq	-120(%rbp), %rax
	jle	.L34
	movq	-112(%rbp), %rax
	movq	%rax, -120(%rbp)
.L34:
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%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	.L36
	call	__stack_chk_fail@PLT
.L36:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
