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 comp(const void *a, const void *b){ return *(int*)a-*(int*)b; }
int main(){
  int i, n, a[200000], b;
  long int ans=0;
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d", &a[i]);
    a[i] -= i+1;
  }
  qsort(a,n,sizeof(int),comp);
  b=a[n/2];
  for(i=0;i<n;i++) ans += abs(a[i] - b);
  printf("%ld\n", ans);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -800024(%rbp)
	leaq	-800036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800032(%rbp)
	jmp	.L4
.L5:
	leaq	-800016(%rbp), %rdx
	movl	-800032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800032(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	movl	-800032(%rbp), %edx
	leal	1(%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-800032(%rbp), %eax
	cltq
	movl	%edx, -800016(%rbp,%rax,4)
	addl	$1, -800032(%rbp)
.L4:
	movl	-800036(%rbp), %eax
	cmpl	%eax, -800032(%rbp)
	jl	.L5
	movl	-800036(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-800016(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-800036(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	movl	%eax, -800028(%rbp)
	movl	$0, -800032(%rbp)
	jmp	.L6
.L7:
	movl	-800032(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	subl	-800028(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	cltq
	addq	%rax, -800024(%rbp)
	addl	$1, -800032(%rbp)
.L6:
	movl	-800036(%rbp), %eax
	cmpl	%eax, -800032(%rbp)
	jl	.L7
	movq	-800024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %r13
	xorl	%ebp, %ebp
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r12
	movq	%r12, %rbx
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	testl	%esi, %esi
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	subl	%ebp, (%rbx)
	addq	$4, %rbx
	cmpl	%esi, %ebp
	jl	.L5
.L4:
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	12(%rsp), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	cltq
	movl	16(%rsp,%rax,4), %r8d
	testl	%ecx, %ecx
	jle	.L12
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L13
	movl	%ecx, %edx
	movd	%r8d, %xmm6
	pxor	%xmm1, %xmm1
	movq	%r12, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm6, %xmm5
	pxor	%xmm4, %xmm4
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	(%rax), %xmm0
	addq	$16, %rax
	psubd	%xmm5, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm4, %xmm2
	pcmpgtd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm0
	movl	%ecx, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rdx
	testb	$3, %cl
	je	.L6
.L7:
	movslq	%eax, %rsi
	movl	16(%rsp,%rsi,4), %edi
	subl	%r8d, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	movslq	%esi, %rsi
	addq	%rsi, %rdx
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L6
	movslq	%esi, %rsi
	movl	16(%rsp,%rsi,4), %edi
	subl	%r8d, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	addl	$2, %eax
	movslq	%esi, %rsi
	addq	%rsi, %rdx
	cmpl	%eax, %ecx
	jle	.L6
	cltq
	movl	16(%rsp,%rax,4), %ecx
	subl	%r8d, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovs	%ecx, %eax
	cltq
	addq	%rax, %rdx
.L6:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800040, %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
.L12:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L13:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L7
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %r13
	xorl	%ebp, %ebp
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r12
	movq	%r12, %rbx
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	testl	%esi, %esi
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	subl	%ebp, (%rbx)
	addq	$4, %rbx
	cmpl	%esi, %ebp
	jl	.L5
.L4:
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	12(%rsp), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	cltq
	movl	16(%rsp,%rax,4), %r8d
	testl	%ecx, %ecx
	jle	.L12
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L13
	movl	%ecx, %edx
	movd	%r8d, %xmm6
	pxor	%xmm1, %xmm1
	movq	%r12, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm6, %xmm5
	pxor	%xmm4, %xmm4
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	(%rax), %xmm0
	addq	$16, %rax
	psubd	%xmm5, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm4, %xmm2
	pcmpgtd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm0
	movl	%ecx, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rdx
	testb	$3, %cl
	je	.L6
.L7:
	movslq	%eax, %rsi
	movl	16(%rsp,%rsi,4), %edi
	subl	%r8d, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	movslq	%esi, %rsi
	addq	%rsi, %rdx
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L6
	movslq	%esi, %rsi
	movl	16(%rsp,%rsi,4), %edi
	subl	%r8d, %edi
	movl	%edi, %esi
	negl	%esi
	cmovs	%edi, %esi
	addl	$2, %eax
	movslq	%esi, %rsi
	addq	%rsi, %rdx
	cmpl	%eax, %ecx
	jle	.L6
	cltq
	movl	16(%rsp,%rax,4), %ecx
	subl	%r8d, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovs	%ecx, %eax
	cltq
	addq	%rax, %rdx
.L6:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800040, %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
.L12:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L13:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L7
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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 comp(const void *a, const void *b){ return *(int*)a-*(int*)b; }
int main(){
  int i, n, a[200000], b;
  long int ans=0;
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d", &a[i]);
    a[i] -= i+1;
  }
  qsort(a,n,sizeof(int),comp);
  b=a[n/2];
  for(i=0;i<n;i++) ans += abs(a[i] - b);
  printf("%ld\n", ans);
  return 0;
}
5
2 2 3 5 10
 7
1 2 1 1 2 3 4
 9
1 2 3 4 5 6 7 8 1
 6
6 0 4 3 2 1
 7
1 0 1 1 2 3 4
 9
1 2 3 4 5 4 7 8 1
 6
6 0 4 3 2 2
 9
1 2 3 4 5 2 7 8 1
 6
6 0 4 6 2 2
 7
1 0 1 1 0 1 4

6
 7
 8
 15
 5
 10
 14
 12
 17
 9

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 comp(const void *a, const void *b){ return *(int*)a-*(int*)b; }
int main(){
  int i, n, a[200000], b;
  long int ans=0;
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d", &a[i]);
    a[i] -= i+1;
  }
  qsort(a,n,sizeof(int),comp);
  b=a[n/2];
  for(i=0;i<n;i++) ans += abs(a[i] - b);
  printf("%ld\n", ans);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -800024(%rbp)
	leaq	-800036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800032(%rbp)
	jmp	.L4
.L5:
	leaq	-800016(%rbp), %rdx
	movl	-800032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800032(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	movl	-800032(%rbp), %edx
	leal	1(%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-800032(%rbp), %eax
	cltq
	movl	%edx, -800016(%rbp,%rax,4)
	addl	$1, -800032(%rbp)
.L4:
	movl	-800036(%rbp), %eax
	cmpl	%eax, -800032(%rbp)
	jl	.L5
	movl	-800036(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-800016(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-800036(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	movl	%eax, -800028(%rbp)
	movl	$0, -800032(%rbp)
	jmp	.L6
.L7:
	movl	-800032(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	subl	-800028(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	cltq
	addq	%rax, -800024(%rbp)
	addl	$1, -800032(%rbp)
.L6:
	movl	-800036(%rbp), %eax
	cmpl	%eax, -800032(%rbp)
	jl	.L7
	movq	-800024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -800024(%rbp)
	leaq	-800036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800032(%rbp)
	jmp	.L4
.L5:
	leaq	-800016(%rbp), %rdx
	movl	-800032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800032(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	movl	-800032(%rbp), %edx
	leal	1(%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-800032(%rbp), %eax
	cltq
	movl	%edx, -800016(%rbp,%rax,4)
	addl	$1, -800032(%rbp)
.L4:
	movl	-800036(%rbp), %eax
	cmpl	%eax, -800032(%rbp)
	jl	.L5
	movl	-800036(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-800016(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-800036(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	movl	%eax, -800028(%rbp)
	movl	$0, -800032(%rbp)
	jmp	.L6
.L7:
	movl	-800032(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	subl	-800028(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	cltq
	addq	%rax, -800024(%rbp)
	addl	$1, -800032(%rbp)
.L6:
	movl	-800036(%rbp), %eax
	cmpl	%eax, -800032(%rbp)
	jl	.L7
	movq	-800024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
