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

```c
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

typedef struct {
	int64_t A;
	int64_t B;
} pair;

int compare_f(const void *a, const void *b) {
	const int64_t aDiff = ((pair *)a)->A - ((pair *)a)->B;
	const int64_t bDiff = ((pair *)b)->A - ((pair *)b)->B;

	return aDiff > bDiff ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
	size_t result = 1;

	for (size_t i = 0; i < r; i++) {
		result *= n - i;
		result /= i + 1;
	}

	return result;
}

static uint64_t gcd(uint64_t m, uint64_t n)
{
	uint64_t temp;

	while (m%n != 0) {
		temp = n;
		n = m % n;
		m = temp;
	}

	return n;
}

static pair p[100000];

int main(void) {
	size_t N;
	int64_t sumA = 0;
	int64_t sumB = 0;
	int64_t shortageSum = 0;
	size_t shortageCount = 0;

	scanf("%zu\n", &N);
	for (size_t i = 0; i < N; i++) {
		scanf("%"PRId64, &(p[i].A));
		if (i < N - 1) {
			scanf(" ");
		}

		sumA += p[i].A;
	}
	scanf("\n");
	for (size_t i = 0; i < N; i++) {
		scanf("%"PRId64, &(p[i].B));
		if (i < N - 1) {
			scanf(" ");
		}

		sumB += p[i].B;
		if (p[i].A < p[i].B) {
			shortageSum += p[i].B - p[i].A;
			shortageCount++;
		}
	}

	size_t repCount = 0;

	if (sumA < sumB){
		printf("%d\n", -1);
	}
	else {
		qsort(p, N, sizeof(pair), compare_f);

		int64_t sum = 0;
		for (size_t i = 0; i < N; i++) {
			if (shortageSum <= sum) {
				repCount = i;
				break;
			}

			sum += p[i].A - p[i].B;
		}

		printf("%zu\n", shortageCount + repCount);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_f
	.type	compare_f, @function
compare_f:
.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), %rdx
	movq	-24(%rbp), %rax
	movq	8(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	8(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jle	.L2
	movl	$-1, %eax
	jmp	.L4
.L2:
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_f, .-compare_f
	.type	comb, @function
comb:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	$1, -16(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-16(%rbp), %rax
	movl	$0, %edx
	divq	%rcx
	movq	%rax, -16(%rbp)
	addq	$1, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jb	.L7
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comb, .-comb
	.type	gcd, @function
gcd:
.LFB8:
	.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)
	jmp	.L10
.L11:
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-32(%rbp)
	movq	%rdx, -32(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L10:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-32(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movq	-32(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gcd, .-gcd
	.local	p
	.comm	p,1600000,32
	.section	.rodata
.LC0:
	.string	"%zu\n"
.LC1:
	.string	"%ld"
.LC2:
	.string	" "
.LC3:
	.string	"\n"
.LC4:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -48(%rbp)
	jmp	.L14
.L16:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -48(%rbp)
	jnb	.L15
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L15:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -80(%rbp)
	addq	$1, -48(%rbp)
.L14:
	movq	-88(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	jb	.L16
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -40(%rbp)
	jmp	.L17
.L20:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -40(%rbp)
	jnb	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L18:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+p(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -72(%rbp)
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+p(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jge	.L19
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	p(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	addq	%rax, -64(%rbp)
	addq	$1, -56(%rbp)
.L19:
	addq	$1, -40(%rbp)
.L17:
	movq	-88(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jb	.L20
	movq	$0, -32(%rbp)
	movq	-80(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jge	.L21
	movl	$-1, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L21:
	movq	-88(%rbp), %rax
	leaq	compare_f(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	p(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L23
.L26:
	movq	-64(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jg	.L24
	movq	-16(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L25
.L24:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+p(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	addq	%rax, -24(%rbp)
	addq	$1, -16(%rbp)
.L23:
	movq	-88(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jb	.L26
.L25:
	movq	-56(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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_f
	.type	compare_f, @function
compare_f:
.LFB77:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	8(%rdi), %rax
	movq	%rax, %rdx
	movq	(%rsi), %rax
	subq	8(%rsi), %rax
	cmpq	%rax, %rdx
	setle	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.cfi_endproc
.LFE77:
	.size	compare_f, .-compare_f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%zu\n"
.LC1:
	.string	"%ld"
.LC2:
	.string	" "
.LC3:
	.string	"\n"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB80:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 16(%rsp)
	je	.L6
	leaq	p(%rip), %r13
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	leaq	-1(%rax), %rdx
	cmpq	%rbp, %rdx
	ja	.L29
	addq	$1, %rbp
	addq	0(%r13), %rbx
	addq	$16, %r13
	cmpq	%rbp, %rax
	ja	.L10
.L9:
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rsi
	testq	%rsi, %rsi
	je	.L22
.L20:
	leaq	8+p(%rip), %r14
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
	movq	$0, 8(%rsp)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	movq	(%r14), %rax
	movq	-8(%r14), %rdi
	addq	%rax, %rbp
	cmpq	%rdi, %rax
	jle	.L13
	addq	$1, 8(%rsp)
	subq	%rdi, %rax
	addq	%rax, %r13
.L13:
	addq	$1, %r15
	addq	$16, %r14
	cmpq	%rsi, %r15
	jnb	.L11
.L14:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rsi
	leaq	-1(%rsi), %rax
	cmpq	%r15, %rax
	jbe	.L12
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rsi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L29:
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	addq	$16, %r13
	call	__isoc99_scanf@PLT
	addq	-16(%r13), %rbx
	cmpq	%rbp, 16(%rsp)
	ja	.L10
	jmp	.L9
.L22:
	movq	$0, 8(%rsp)
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L11:
	cmpq	%rbp, %rbx
	jge	.L15
	orl	$-1, %edx
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %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
.L15:
	.cfi_restore_state
	leaq	p(%rip), %rbx
	leaq	compare_f(%rip), %rcx
	movl	$16, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	16(%rsp), %rcx
	testq	%rcx, %rcx
	je	.L24
	testq	%r13, %r13
	je	.L24
	movq	%rbx, %rdx
	xorl	%ebp, %ebp
	xorl	%eax, %eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$16, %rdx
	cmpq	%r13, %rax
	jge	.L17
.L18:
	addq	$1, %rbp
	addq	(%rdx), %rax
	subq	8(%rdx), %rax
	cmpq	%rbp, %rcx
	jne	.L19
.L24:
	xorl	%ebp, %ebp
.L17:
	movq	8(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	%rbp, %rdx
	call	__printf_chk@PLT
	jmp	.L16
.L6:
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rbp
	leaq	.LC1(%rip), %r12
	testq	%rbp, %rbp
	jne	.L20
	leaq	compare_f(%rip), %rcx
	movl	$16, %edx
	xorl	%esi, %esi
	leaq	p(%rip), %rdi
	call	qsort@PLT
	movq	$0, 8(%rsp)
	jmp	.L17
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE80:
	.size	main, .-main
	.local	p
	.comm	p,1600000,32
	.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_f
	.type	compare_f, @function
compare_f:
.LFB77:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	8(%rdi), %rax
	movq	%rax, %rdx
	movq	(%rsi), %rax
	subq	8(%rsi), %rax
	cmpq	%rax, %rdx
	setle	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.cfi_endproc
.LFE77:
	.size	compare_f, .-compare_f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%zu\n"
.LC1:
	.string	"%ld"
.LC2:
	.string	" "
.LC3:
	.string	"\n"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB80:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 16(%rsp)
	je	.L6
	leaq	p(%rip), %r13
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	leaq	-1(%rax), %rdx
	cmpq	%rbp, %rdx
	ja	.L29
	addq	$1, %rbp
	addq	0(%r13), %rbx
	addq	$16, %r13
	cmpq	%rbp, %rax
	ja	.L10
.L9:
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rsi
	testq	%rsi, %rsi
	je	.L22
.L20:
	leaq	8+p(%rip), %r14
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
	movq	$0, 8(%rsp)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	movq	(%r14), %rax
	movq	-8(%r14), %rdi
	addq	%rax, %rbp
	cmpq	%rdi, %rax
	jle	.L13
	addq	$1, 8(%rsp)
	subq	%rdi, %rax
	addq	%rax, %r13
.L13:
	addq	$1, %r15
	addq	$16, %r14
	cmpq	%rsi, %r15
	jnb	.L11
.L14:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rsi
	leaq	-1(%rsi), %rax
	cmpq	%r15, %rax
	jbe	.L12
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rsi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L29:
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	addq	$16, %r13
	call	__isoc99_scanf@PLT
	addq	-16(%r13), %rbx
	cmpq	%rbp, 16(%rsp)
	ja	.L10
	jmp	.L9
.L22:
	movq	$0, 8(%rsp)
	xorl	%r13d, %r13d
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L11:
	cmpq	%rbp, %rbx
	jge	.L15
	orl	$-1, %edx
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %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
.L15:
	.cfi_restore_state
	leaq	p(%rip), %rbx
	leaq	compare_f(%rip), %rcx
	movl	$16, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	16(%rsp), %rcx
	testq	%rcx, %rcx
	je	.L24
	testq	%r13, %r13
	je	.L24
	movq	%rbx, %rdx
	xorl	%ebp, %ebp
	xorl	%eax, %eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$16, %rdx
	cmpq	%r13, %rax
	jge	.L17
.L18:
	addq	$1, %rbp
	addq	(%rdx), %rax
	subq	8(%rdx), %rax
	cmpq	%rbp, %rcx
	jne	.L19
.L24:
	xorl	%ebp, %ebp
.L17:
	movq	8(%rsp), %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	%rbp, %rdx
	call	__printf_chk@PLT
	jmp	.L16
.L6:
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rbp
	leaq	.LC1(%rip), %r12
	testq	%rbp, %rbp
	jne	.L20
	leaq	compare_f(%rip), %rcx
	movl	$16, %edx
	xorl	%esi, %esi
	leaq	p(%rip), %rdi
	call	qsort@PLT
	movq	$0, 8(%rsp)
	jmp	.L17
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE80:
	.size	main, .-main
	.local	p
	.comm	p,1600000,32
	.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 <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

typedef struct {
	int64_t A;
	int64_t B;
} pair;

int compare_f(const void *a, const void *b) {
	const int64_t aDiff = ((pair *)a)->A - ((pair *)a)->B;
	const int64_t bDiff = ((pair *)b)->A - ((pair *)b)->B;

	return aDiff > bDiff ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
	size_t result = 1;

	for (size_t i = 0; i < r; i++) {
		result *= n - i;
		result /= i + 1;
	}

	return result;
}

static uint64_t gcd(uint64_t m, uint64_t n)
{
	uint64_t temp;

	while (m%n != 0) {
		temp = n;
		n = m % n;
		m = temp;
	}

	return n;
}

static pair p[100000];

int main(void) {
	size_t N;
	int64_t sumA = 0;
	int64_t sumB = 0;
	int64_t shortageSum = 0;
	size_t shortageCount = 0;

	scanf("%zu\n", &N);
	for (size_t i = 0; i < N; i++) {
		scanf("%"PRId64, &(p[i].A));
		if (i < N - 1) {
			scanf(" ");
		}

		sumA += p[i].A;
	}
	scanf("\n");
	for (size_t i = 0; i < N; i++) {
		scanf("%"PRId64, &(p[i].B));
		if (i < N - 1) {
			scanf(" ");
		}

		sumB += p[i].B;
		if (p[i].A < p[i].B) {
			shortageSum += p[i].B - p[i].A;
			shortageCount++;
		}
	}

	size_t repCount = 0;

	if (sumA < sumB){
		printf("%d\n", -1);
	}
	else {
		qsort(p, N, sizeof(pair), compare_f);

		int64_t sum = 0;
		for (size_t i = 0; i < N; i++) {
			if (shortageSum <= sum) {
				repCount = i;
				break;
			}

			sum += p[i].A - p[i].B;
		}

		printf("%zu\n", shortageCount + repCount);
	}

	return 0;
}
12
757232153 372327760 440075441 195848680 354974235 458054863 463477172 740174259 615762794 632963102 529866931 64991604
102338863 98239366 465611891 362739947 147060907 118867039 63189252 78303147 501410831 110823640 122948912 572905212
 3
2 3 5
3 7 1
 3
1 3 3
2 2 1
 3
1 6 5
0 1 3
 12
48863441 372327760 440075441 31969951 354974235 315231620 463477172 740174259 615762794 632963102 529866931 3620058
139572012 98239366 465611891 362739947 147060907 118867039 114119164 78303147 501410831 49230544 122948912 572905212
 12
48863441 372327760 440075441 40635764 354974235 315231620 463477172 1102766996 615762794 632963102 529866931 3620058
139572012 98239366 222622949 362739947 147060907 118867039 114119164 78303147 501410831 49230544 122948912 572905212
 3
1 -1 9
0 8 1
 12
48863441 372327760 755057774 40635764 156339565 315231620 182202208 742111057 13211473 458883009 529866931 3620058
139572012 98239366 125015454 362739947 147060907 118867039 114119164 78303147 501410831 57813398 122948912 572905212
 12
48863441 372327760 771553476 40635764 156339565 109554065 141758554 369087251 13211473 458883009 529866931 3620058
139572012 9487455 125015454 362739947 147060907 118867039 114119164 78303147 501410831 79768540 58647642 572905212
 12
48863441 372327760 771553476 40635764 156339565 109554065 141758554 369087251 13211473 458883009 529866931 3620058
197984360 9487455 125015454 362739947 147060907 118867039 114119164 78303147 501410831 79768540 58647642 572905212

5
 -1
 2
 0
 6
 4
 3
 7
 8
 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 <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

typedef struct {
	int64_t A;
	int64_t B;
} pair;

int compare_f(const void *a, const void *b) {
	const int64_t aDiff = ((pair *)a)->A - ((pair *)a)->B;
	const int64_t bDiff = ((pair *)b)->A - ((pair *)b)->B;

	return aDiff > bDiff ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
	size_t result = 1;

	for (size_t i = 0; i < r; i++) {
		result *= n - i;
		result /= i + 1;
	}

	return result;
}

static uint64_t gcd(uint64_t m, uint64_t n)
{
	uint64_t temp;

	while (m%n != 0) {
		temp = n;
		n = m % n;
		m = temp;
	}

	return n;
}

static pair p[100000];

int main(void) {
	size_t N;
	int64_t sumA = 0;
	int64_t sumB = 0;
	int64_t shortageSum = 0;
	size_t shortageCount = 0;

	scanf("%zu\n", &N);
	for (size_t i = 0; i < N; i++) {
		scanf("%"PRId64, &(p[i].A));
		if (i < N - 1) {
			scanf(" ");
		}

		sumA += p[i].A;
	}
	scanf("\n");
	for (size_t i = 0; i < N; i++) {
		scanf("%"PRId64, &(p[i].B));
		if (i < N - 1) {
			scanf(" ");
		}

		sumB += p[i].B;
		if (p[i].A < p[i].B) {
			shortageSum += p[i].B - p[i].A;
			shortageCount++;
		}
	}

	size_t repCount = 0;

	if (sumA < sumB){
		printf("%d\n", -1);
	}
	else {
		qsort(p, N, sizeof(pair), compare_f);

		int64_t sum = 0;
		for (size_t i = 0; i < N; i++) {
			if (shortageSum <= sum) {
				repCount = i;
				break;
			}

			sum += p[i].A - p[i].B;
		}

		printf("%zu\n", shortageCount + repCount);
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_f
	.type	compare_f, @function
compare_f:
.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), %rdx
	movq	-24(%rbp), %rax
	movq	8(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	8(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jle	.L2
	movl	$-1, %eax
	jmp	.L4
.L2:
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_f, .-compare_f
	.type	comb, @function
comb:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	$1, -16(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-16(%rbp), %rax
	movl	$0, %edx
	divq	%rcx
	movq	%rax, -16(%rbp)
	addq	$1, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jb	.L7
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comb, .-comb
	.type	gcd, @function
gcd:
.LFB8:
	.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)
	jmp	.L10
.L11:
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-32(%rbp)
	movq	%rdx, -32(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L10:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-32(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movq	-32(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gcd, .-gcd
	.local	p
	.comm	p,1600000,32
	.section	.rodata
.LC0:
	.string	"%zu\n"
.LC1:
	.string	"%ld"
.LC2:
	.string	" "
.LC3:
	.string	"\n"
.LC4:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -48(%rbp)
	jmp	.L14
.L16:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -48(%rbp)
	jnb	.L15
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L15:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -80(%rbp)
	addq	$1, -48(%rbp)
.L14:
	movq	-88(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	jb	.L16
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -40(%rbp)
	jmp	.L17
.L20:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -40(%rbp)
	jnb	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L18:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+p(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -72(%rbp)
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+p(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jge	.L19
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	p(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	addq	%rax, -64(%rbp)
	addq	$1, -56(%rbp)
.L19:
	addq	$1, -40(%rbp)
.L17:
	movq	-88(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jb	.L20
	movq	$0, -32(%rbp)
	movq	-80(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jge	.L21
	movl	$-1, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L21:
	movq	-88(%rbp), %rax
	leaq	compare_f(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	p(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L23
.L26:
	movq	-64(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jg	.L24
	movq	-16(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L25
.L24:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+p(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	addq	%rax, -24(%rbp)
	addq	$1, -16(%rbp)
.L23:
	movq	-88(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jb	.L26
.L25:
	movq	-56(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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_f
	.type	compare_f, @function
compare_f:
.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), %rdx
	movq	-24(%rbp), %rax
	movq	8(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	8(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jle	.L2
	movl	$-1, %eax
	jmp	.L4
.L2:
	movl	$1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_f, .-compare_f
	.type	comb, @function
comb:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	$1, -16(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L6
.L7:
	movq	-24(%rbp), %rax
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-8(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-16(%rbp), %rax
	movl	$0, %edx
	divq	%rcx
	movq	%rax, -16(%rbp)
	addq	$1, -8(%rbp)
.L6:
	movq	-8(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jb	.L7
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comb, .-comb
	.type	gcd, @function
gcd:
.LFB8:
	.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)
	jmp	.L10
.L11:
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-32(%rbp)
	movq	%rdx, -32(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L10:
	movq	-24(%rbp), %rax
	movl	$0, %edx
	divq	-32(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movq	-32(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gcd, .-gcd
	.local	p
	.comm	p,1600000,32
	.section	.rodata
.LC0:
	.string	"%zu\n"
.LC1:
	.string	"%ld"
.LC2:
	.string	" "
.LC3:
	.string	"\n"
.LC4:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -48(%rbp)
	jmp	.L14
.L16:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -48(%rbp)
	jnb	.L15
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L15:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -80(%rbp)
	addq	$1, -48(%rbp)
.L14:
	movq	-88(%rbp), %rax
	cmpq	%rax, -48(%rbp)
	jb	.L16
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -40(%rbp)
	jmp	.L17
.L20:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -40(%rbp)
	jnb	.L18
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
.L18:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+p(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -72(%rbp)
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+p(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jge	.L19
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-40(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	p(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	addq	%rax, -64(%rbp)
	addq	$1, -56(%rbp)
.L19:
	addq	$1, -40(%rbp)
.L17:
	movq	-88(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jb	.L20
	movq	$0, -32(%rbp)
	movq	-80(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jge	.L21
	movl	$-1, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L21:
	movq	-88(%rbp), %rax
	leaq	compare_f(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	p(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L23
.L26:
	movq	-64(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jg	.L24
	movq	-16(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L25
.L24:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	-16(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+p(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	addq	%rax, -24(%rbp)
	addq	$1, -16(%rbp)
.L23:
	movq	-88(%rbp), %rax
	cmpq	%rax, -16(%rbp)
	jb	.L26
.L25:
	movq	-56(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
