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 c(const void* t, const void* u) {
	int v = *(const int*)t;
	int w = *(const int*)u;
	if (v > w) return 1;
	if (v < w) return -1;
	return 0;
}

int n;
int a[1000];

int main(void) {
	int i;
	int r;
	while (scanf("%d", &n) == 1 && n > 0) {
		for (i = 0; i < n; i++) {
			if (scanf("%d", &a[i]) != 1) return 1;
		}
		qsort(a, n, sizeof(*a), c);
		r = a[1] - a[0];
		for (i = 2; i < n; i++) {
			if (a[i] - a[i - 1] < r) r = a[i] - a[i - 1];
		}
		printf("%d\n", r);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c
	.type	c, @function
c:
.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
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	c, .-c
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 4000
a:
	.zero	4000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L6
.L15:
	movl	$0, -8(%rbp)
	jmp	.L7
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L10
	movl	n(%rip), %eax
	cltq
	leaq	c(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	4+a(%rip), %eax
	movl	a(%rip), %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$2, -8(%rbp)
	jmp	.L11
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
.L12:
	addl	$1, -8(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L13
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L14
	movl	n(%rip), %eax
	testl	%eax, %eax
	jg	.L15
.L14:
	movl	$0, %eax
.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	c
	.type	c, @function
c:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$1, %eax
	cmpl	%edx, (%rdi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	c, .-c
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	n(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
.L6:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%eax, %r12d
	cmpl	$1, %eax
	jne	.L18
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L18
	leaq	a(%rip), %r14
	xorl	%r15d, %r15d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L30:
	movslq	n(%rip), %rsi
	addl	$1, %r15d
	addq	$4, %r14
	cmpl	%r15d, %esi
	jle	.L29
.L8:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L30
.L5:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	movl	$4, %edx
	leaq	c(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	n(%rip), %esi
	movl	4+a(%rip), %edx
	subl	0(%rbp), %edx
	cmpl	$2, %esi
	jle	.L9
	leal	-3(%rsi), %eax
	leal	-2(%rsi), %ecx
	cmpl	$2, %eax
	jbe	.L16
	movd	%edx, %xmm4
	movl	%ecx, %edx
	leaq	4+a(%rip), %rax
	shrl	$2, %edx
	leaq	16(%rax), %rdi
	pshufd	$0, %xmm4, %xmm0
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	4(%rax), %xmm2
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	psubd	%xmm3, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm0, %xmm2
	movl	%ecx, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm1
	leal	2(%rdi), %eax
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%edi, %ecx
	je	.L9
.L10:
	movslq	%eax, %rcx
	leal	-1(%rsi), %r8d
	leal	1(%rax), %edi
	movq	%rcx, %r9
	leaq	-4(%rbp,%rcx,4), %r10
	cmpl	%edi, %r8d
	jle	.L14
	cmpl	%esi, %eax
	jge	.L14
	movl	(%r10), %edi
.L15:
	movl	0(%rbp,%rcx,4), %r10d
	leaq	4+a(%rip), %rax
	movl	%r10d, %r9d
	subl	%edi, %r9d
	movl	(%rax,%rcx,4), %edi
	movl	%edi, %eax
	subl	%r10d, %eax
	cmpl	%r9d, %eax
	cmovg	%r9d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	leal	2(%rcx), %eax
	addq	$2, %rcx
	leal	1(%rcx), %r9d
	cmpl	%r9d, %r8d
	jg	.L15
	movslq	%eax, %r9
	leal	1(%rax), %edi
.L14:
	movl	0(%rbp,%r9,4), %r8d
	leal	-1(%rax), %ecx
	movslq	%ecx, %rcx
	movl	%r8d, %r11d
	subl	0(%rbp,%rcx,4), %r11d
	cmpl	%r11d, %edx
	cmovg	%r11d, %edx
	cmpl	%edi, %esi
	jle	.L9
	movslq	%edi, %rdi
	movl	0(%rbp,%rdi,4), %ecx
	movl	%ecx, %edi
	subl	%r8d, %edi
	cmpl	%edi, %edx
	cmovg	%edi, %edx
	addl	$2, %eax
	cmpl	%eax, %esi
	jle	.L9
	cltq
	movl	0(%rbp,%rax,4), %eax
	subl	%ecx, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L9:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
.L18:
	xorl	%r12d, %r12d
	jmp	.L5
.L16:
	movl	$2, %eax
	jmp	.L10
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 4000
a:
	.zero	4000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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	c
	.type	c, @function
c:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$1, %eax
	cmpl	%edx, (%rdi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	c, .-c
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	n(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
.L6:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%eax, %r12d
	cmpl	$1, %eax
	jne	.L18
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L18
	leaq	a(%rip), %r14
	xorl	%r15d, %r15d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L30:
	movslq	n(%rip), %rsi
	addl	$1, %r15d
	addq	$4, %r14
	cmpl	%r15d, %esi
	jle	.L29
.L8:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L30
.L5:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	movl	$4, %edx
	leaq	c(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	n(%rip), %esi
	movl	4+a(%rip), %edx
	subl	0(%rbp), %edx
	cmpl	$2, %esi
	jle	.L9
	leal	-3(%rsi), %eax
	leal	-2(%rsi), %ecx
	cmpl	$2, %eax
	jbe	.L16
	movd	%edx, %xmm4
	movl	%ecx, %edx
	leaq	4+a(%rip), %rax
	shrl	$2, %edx
	leaq	16(%rax), %rdi
	pshufd	$0, %xmm4, %xmm0
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	4(%rax), %xmm2
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	psubd	%xmm3, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm0, %xmm2
	movl	%ecx, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm1
	leal	2(%rdi), %eax
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%edi, %ecx
	je	.L9
.L10:
	movslq	%eax, %rcx
	leal	-1(%rsi), %r8d
	leal	1(%rax), %edi
	movq	%rcx, %r9
	leaq	-4(%rbp,%rcx,4), %r10
	cmpl	%edi, %r8d
	jle	.L14
	cmpl	%esi, %eax
	jge	.L14
	movl	(%r10), %edi
.L15:
	movl	0(%rbp,%rcx,4), %r10d
	leaq	4+a(%rip), %rax
	movl	%r10d, %r9d
	subl	%edi, %r9d
	movl	(%rax,%rcx,4), %edi
	movl	%edi, %eax
	subl	%r10d, %eax
	cmpl	%r9d, %eax
	cmovg	%r9d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	leal	2(%rcx), %eax
	addq	$2, %rcx
	leal	1(%rcx), %r9d
	cmpl	%r9d, %r8d
	jg	.L15
	movslq	%eax, %r9
	leal	1(%rax), %edi
.L14:
	movl	0(%rbp,%r9,4), %r8d
	leal	-1(%rax), %ecx
	movslq	%ecx, %rcx
	movl	%r8d, %r11d
	subl	0(%rbp,%rcx,4), %r11d
	cmpl	%r11d, %edx
	cmovg	%r11d, %edx
	cmpl	%edi, %esi
	jle	.L9
	movslq	%edi, %rdi
	movl	0(%rbp,%rdi,4), %ecx
	movl	%ecx, %edi
	subl	%r8d, %edi
	cmpl	%edi, %edx
	cmovg	%edi, %edx
	addl	$2, %eax
	cmpl	%eax, %esi
	jle	.L9
	cltq
	movl	0(%rbp,%rax,4), %eax
	subl	%ecx, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L9:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
.L18:
	xorl	%r12d, %r12d
	jmp	.L5
.L16:
	movl	$2, %eax
	jmp	.L10
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 4000
a:
	.zero	4000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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 c(const void* t, const void* u) {
	int v = *(const int*)t;
	int w = *(const int*)u;
	if (v > w) return 1;
	if (v < w) return -1;
	return 0;
}

int n;
int a[1000];

int main(void) {
	int i;
	int r;
	while (scanf("%d", &n) == 1 && n > 0) {
		for (i = 0; i < n; i++) {
			if (scanf("%d", &a[i]) != 1) return 1;
		}
		qsort(a, n, sizeof(*a), c);
		r = a[1] - a[0];
		for (i = 2; i < n; i++) {
			if (a[i] - a[i - 1] < r) r = a[i] - a[i - 1];
		}
		printf("%d\n", r);
	}
	return 0;
}
5
10 10 1 10 10
5
1 5 8 9 11
7
11 34 83 47 59 29 70
0
 5
10 10 1 10 10
5
1 5 8 9 11
7
11 34 83 47 59 29 48
0
 5
10 10 1 10 10
5
1 5 8 5 11
7
11 34 83 47 59 29 48
0
 5
10 10 1 10 10
5
1 5 8 5 11
7
11 34 83 47 54 29 2
0
 5
10 10 10 10 10
5
1 5 8 9 11
7
11 34 83 47 44 29 70
0
 5
10 10 1 10 10
5
1 5 8 5 11
0
11 34 83 47 54 29 2
0
 5
10 10 1 10 10
5
1 5 8 9 8
7
11 34 83 48 59 29 48
0
 5
10 10 10 1 10
5
1 5 8 13 11
7
11 34 83 47 44 29 70
0
 5
10 -1 1 10 10
5
1 5 8 9 11
7
11 34 83 47 59 29 85
0
 5
10 10 10 1 10
5
1 5 8 13 11
0
11 34 83 47 44 50 70
0

0
1
5
 0
1
1
 0
0
1
 0
0
5
 0
1
3
 0
0
 0
0
0
 0
2
3
 0
1
2
 0
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 c(const void* t, const void* u) {
	int v = *(const int*)t;
	int w = *(const int*)u;
	if (v > w) return 1;
	if (v < w) return -1;
	return 0;
}

int n;
int a[1000];

int main(void) {
	int i;
	int r;
	while (scanf("%d", &n) == 1 && n > 0) {
		for (i = 0; i < n; i++) {
			if (scanf("%d", &a[i]) != 1) return 1;
		}
		qsort(a, n, sizeof(*a), c);
		r = a[1] - a[0];
		for (i = 2; i < n; i++) {
			if (a[i] - a[i - 1] < r) r = a[i] - a[i - 1];
		}
		printf("%d\n", r);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c
	.type	c, @function
c:
.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
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	c, .-c
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 4000
a:
	.zero	4000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L6
.L15:
	movl	$0, -8(%rbp)
	jmp	.L7
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L10
	movl	n(%rip), %eax
	cltq
	leaq	c(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	4+a(%rip), %eax
	movl	a(%rip), %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$2, -8(%rbp)
	jmp	.L11
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
.L12:
	addl	$1, -8(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L13
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L14
	movl	n(%rip), %eax
	testl	%eax, %eax
	jg	.L15
.L14:
	movl	$0, %eax
.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	c
	.type	c, @function
c:
.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
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	c, .-c
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 4000
a:
	.zero	4000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L6
.L15:
	movl	$0, -8(%rbp)
	jmp	.L7
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L8
	movl	$1, %eax
	jmp	.L9
.L8:
	addl	$1, -8(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L10
	movl	n(%rip), %eax
	cltq
	leaq	c(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	4+a(%rip), %eax
	movl	a(%rip), %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$2, -8(%rbp)
	jmp	.L11
.L13:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-8(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
.L12:
	addl	$1, -8(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L13
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L14
	movl	n(%rip), %eax
	testl	%eax, %eax
	jg	.L15
.L14:
	movl	$0, %eax
.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:
