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

```c
/* Coached by Dukkha */
#include <stdio.h>
#include <stdlib.h>

#define N 100000

int compare(const void *a, const void *b) {
	int ia = *(int *) a;
	int ib = *(int *) b;

	return ia - ib;
}

int main() {
	static int aa[N], bb[N], cc[N];
	static long long pp[N];
	int n, i, j;
	long long ans;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d", &aa[i]);
	for (i = 0; i < n; i++)
		scanf("%d", &bb[i]);
	for (i = 0; i < n; i++)
		scanf("%d", &cc[i]);
	qsort(aa, n, sizeof *aa, compare);
	qsort(bb, n, sizeof *bb, compare);
	qsort(cc, n, sizeof *cc, compare);
	for (i = j = 0; j < n; j++) {
		while (i < n && aa[i] < bb[j])
			i++;
		pp[j] = i;
	}
	for (i = 1; i < n; i++)
		pp[i] += pp[i - 1];
	ans = 0;
	for (i = j = 0; j < n; j++) {
		while (i < n && bb[i] < cc[j])
			i++;
		if (i > 0)
			ans += pp[i - 1];
	}
	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
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L4
.L5:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	aa.3(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L5
	movl	$0, -24(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bb.2(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L6:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	$0, -24(%rbp)
	jmp	.L8
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cc.1(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L9
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	aa.3(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	bb.2(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	cc.1(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L10
.L13:
	addl	$1, -24(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L12
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	aa.3(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	bb.2(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L13
.L12:
	movl	-24(%rbp), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	pp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L10:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$1, -24(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L16
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L17
.L20:
	addl	$1, -24(%rbp)
.L18:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L19
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bb.2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	cc.1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L20
.L19:
	cmpl	$0, -24(%rbp)
	jle	.L21
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
.L21:
	addl	$1, -20(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L18
	movq	-16(%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	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	aa.3
	.comm	aa.3,400000,32
	.local	bb.2
	.comm	bb.2,400000,32
	.local	cc.1
	.comm	cc.1,400000,32
	.local	pp.0
	.comm	pp.0,800000,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:
```

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
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB2:
	.section	.text.startup,"ax",@progbits
.LHOTB2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	leaq	aa.3(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %r13
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L67
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r13
	cmpl	%ebx, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L4
	leaq	bb.2(%rip), %rbx
	xorl	%r13d, %r13d
	movq	%rbx, %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r14
	cmpl	%r13d, %eax
	jg	.L6
	leaq	cc.1(%rip), %r13
	testl	%eax, %eax
	jle	.L7
	movq	%r13, %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L8
.L7:
	leaq	compare(%rip), %r12
	movslq	%eax, %rsi
	movl	$4, %edx
	movq	%rbp, %rdi
	movq	%r12, %rcx
	call	qsort@PLT
	movslq	4(%rsp), %rsi
	movq	%r12, %rcx
	movq	%rbx, %rdi
	movl	$4, %edx
	call	qsort@PLT
	movslq	4(%rsp), %rsi
	movq	%r12, %rcx
	movq	%r13, %rdi
	movl	$4, %edx
	call	qsort@PLT
	movl	4(%rsp), %ecx
	xorl	%r10d, %r10d
	testl	%ecx, %ecx
	jle	.L10
	movslq	%ecx, %r8
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	leaq	-4+bb.2(%rip), %r10
	leaq	-8+pp.0(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%r10,%rdi,4), %esi
	leaq	0(%rbp,%rdx,4), %rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%ecx, %eax
	je	.L11
.L17:
	cmpl	%esi, (%rdx)
	jl	.L12
	movslq	%eax, %rdx
	movq	%rdx, (%r9,%rdi,8)
	cmpq	%r8, %rdi
	je	.L37
	addq	$1, %rdi
	cmpl	%eax, %ecx
	jg	.L34
.L35:
	movq	%rdx, (%r9,%rdi,8)
	movl	%edi, %r9d
	cmpq	%rdi, %r8
	je	.L37
	movl	%ecx, %esi
	subl	%edi, %esi
	cmpl	%ecx, %edi
	movl	$1, %edi
	cmovl	%esi, %edi
	subl	$1, %esi
	cmpl	$2, %esi
	ja	.L60
	leaq	pp.0(%rip), %rsi
.L38:
	movslq	%r9d, %rax
	movq	%rdx, (%rsi,%rax,8)
	leal	1(%r9), %eax
	cmpl	%ecx, %eax
	jl	.L59
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%eax, %rdx
	movq	%rdx, (%r9,%rdi,8)
	cmpq	%r8, %rdi
	jne	.L68
.L37:
	cmpl	$1, %ecx
	je	.L18
	leaq	pp.0(%rip), %rsi
.L33:
	movq	pp.0(%rip), %rdx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L19:
	addq	(%rsi,%rax,8), %rdx
	movq	%rdx, (%rsi,%rax,8)
	addq	$1, %rax
	cmpl	%eax, %ecx
	jg	.L19
.L18:
	xorl	%r8d, %r8d
	movl	$1, %r9d
	xorl	%r10d, %r10d
	leaq	-4+cc.1(%rip), %rbp
	leaq	pp.0(%rip), %r11
	movl	%r8d, %eax
	leal	-1(%r8), %esi
	cmpl	%r8d, %ecx
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L70:
	movslq	%r8d, %rax
	movl	0(%rbp,%r9,4), %edi
	movl	%r8d, %esi
	leaq	(%rbx,%rax,4), %rax
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L21:
	leal	1(%rsi), %edx
	addq	$4, %rax
	cmpl	%ecx, %edx
	je	.L43
	movl	%edx, %esi
.L30:
	cmpl	%edi, (%rax)
	jl	.L21
	testl	%esi, %esi
	jne	.L69
	cmpl	%r9d, %ecx
	jle	.L10
	addq	$1, %r9
	xorl	%eax, %eax
.L31:
	movl	%eax, %r8d
	leal	-1(%r8), %esi
	movl	%r8d, %eax
	cmpl	%r8d, %ecx
	jg	.L70
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	%esi, %rsi
	movq	(%r11,%rsi,8), %rdx
	movl	%r9d, %esi
	addq	%r10, %rdx
	movq	%rdx, %r10
	cmpl	%r9d, %ecx
	jle	.L10
	addq	$1, %r9
	cmpl	%r8d, %ecx
	jle	.L24
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%ecx, %eax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%r10, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L71
	addq	$24, %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
.L69:
	.cfi_restore_state
	movl	%esi, %eax
	subl	$1, %esi
	jmp	.L20
.L68:
	addq	$1, %rdi
	jmp	.L35
.L67:
	movl	4(%rsp), %eax
.L4:
	leaq	bb.2(%rip), %rbx
	leaq	cc.1(%rip), %r13
	jmp	.L7
.L71:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB40:
.L24:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%ecx, %edi
	subl	%esi, %edi
	cmpl	%ecx, %esi
	movl	$1, %ecx
	cmovl	%edi, %ecx
	subl	$1, %edi
	je	.L72
	subl	$1, %eax
	movl	%ecx, %edi
	pxor	%xmm0, %xmm0
	movslq	%eax, %rsi
	shrl	%edi
	movq	(%r11,%rsi,8), %xmm1
	xorl	%esi, %esi
	punpcklqdq	%xmm1, %xmm1
.L27:
	addl	$1, %esi
	paddq	%xmm1, %xmm0
	cmpl	%esi, %edi
	jne	.L27
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddq	%xmm1, %xmm0
	movq	%xmm0, %r10
	addq	%rdx, %r10
	andb	$1, %cl
	je	.L10
.L26:
	cltq
	addq	(%r11,%rax,8), %r10
	jmp	.L10
.L60:
	movd	%eax, %xmm3
	pxor	%xmm1, %xmm1
	movl	%edi, %r10d
	movslq	%r9d, %rax
	pshufd	$0, %xmm3, %xmm0
	leaq	pp.0(%rip), %rsi
	shrl	$2, %r10d
	xorl	%r8d, %r8d
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm2
	leaq	(%rsi,%rax,8), %rax
	punpckldq	%xmm1, %xmm2
	punpckhdq	%xmm1, %xmm0
.L14:
	addl	$1, %r8d
	movups	%xmm2, (%rax)
	addq	$32, %rax
	movups	%xmm0, -16(%rax)
	cmpl	%r8d, %r10d
	jne	.L14
	movl	%edi, %eax
	andl	$-4, %eax
	addl	%eax, %r9d
	cmpl	%eax, %edi
	je	.L37
	jmp	.L38
.L59:
	cltq
	addl	$2, %r9d
	movq	%rdx, (%rsi,%rax,8)
	cmpl	%r9d, %ecx
	jle	.L33
	movslq	%r9d, %r9
	movq	%rdx, (%rsi,%r9,8)
	jmp	.L33
.L72:
	subl	$1, %eax
	jmp	.L26
	.cfi_endproc
.LFE40:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE2:
	.section	.text.startup
.LHOTE2:
	.local	pp.0
	.comm	pp.0,800000,32
	.local	cc.1
	.comm	cc.1,400000,32
	.local	bb.2
	.comm	bb.2,400000,32
	.local	aa.3
	.comm	aa.3,400000,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
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB2:
	.section	.text.startup,"ax",@progbits
.LHOTB2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	leaq	aa.3(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %r13
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L67
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r13
	cmpl	%ebx, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L4
	leaq	bb.2(%rip), %rbx
	xorl	%r13d, %r13d
	movq	%rbx, %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r14
	cmpl	%r13d, %eax
	jg	.L6
	leaq	cc.1(%rip), %r13
	testl	%eax, %eax
	jle	.L7
	movq	%r13, %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L8
.L7:
	leaq	compare(%rip), %r12
	movslq	%eax, %rsi
	movl	$4, %edx
	movq	%rbp, %rdi
	movq	%r12, %rcx
	call	qsort@PLT
	movslq	4(%rsp), %rsi
	movq	%r12, %rcx
	movq	%rbx, %rdi
	movl	$4, %edx
	call	qsort@PLT
	movslq	4(%rsp), %rsi
	movq	%r12, %rcx
	movq	%r13, %rdi
	movl	$4, %edx
	call	qsort@PLT
	movl	4(%rsp), %ecx
	xorl	%r10d, %r10d
	testl	%ecx, %ecx
	jle	.L10
	movslq	%ecx, %r8
	movl	$1, %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	leaq	-4+bb.2(%rip), %r10
	leaq	-8+pp.0(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%r10,%rdi,4), %esi
	leaq	0(%rbp,%rdx,4), %rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%ecx, %eax
	je	.L11
.L17:
	cmpl	%esi, (%rdx)
	jl	.L12
	movslq	%eax, %rdx
	movq	%rdx, (%r9,%rdi,8)
	cmpq	%r8, %rdi
	je	.L37
	addq	$1, %rdi
	cmpl	%eax, %ecx
	jg	.L34
.L35:
	movq	%rdx, (%r9,%rdi,8)
	movl	%edi, %r9d
	cmpq	%rdi, %r8
	je	.L37
	movl	%ecx, %esi
	subl	%edi, %esi
	cmpl	%ecx, %edi
	movl	$1, %edi
	cmovl	%esi, %edi
	subl	$1, %esi
	cmpl	$2, %esi
	ja	.L60
	leaq	pp.0(%rip), %rsi
.L38:
	movslq	%r9d, %rax
	movq	%rdx, (%rsi,%rax,8)
	leal	1(%r9), %eax
	cmpl	%ecx, %eax
	jl	.L59
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%eax, %rdx
	movq	%rdx, (%r9,%rdi,8)
	cmpq	%r8, %rdi
	jne	.L68
.L37:
	cmpl	$1, %ecx
	je	.L18
	leaq	pp.0(%rip), %rsi
.L33:
	movq	pp.0(%rip), %rdx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L19:
	addq	(%rsi,%rax,8), %rdx
	movq	%rdx, (%rsi,%rax,8)
	addq	$1, %rax
	cmpl	%eax, %ecx
	jg	.L19
.L18:
	xorl	%r8d, %r8d
	movl	$1, %r9d
	xorl	%r10d, %r10d
	leaq	-4+cc.1(%rip), %rbp
	leaq	pp.0(%rip), %r11
	movl	%r8d, %eax
	leal	-1(%r8), %esi
	cmpl	%r8d, %ecx
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L70:
	movslq	%r8d, %rax
	movl	0(%rbp,%r9,4), %edi
	movl	%r8d, %esi
	leaq	(%rbx,%rax,4), %rax
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L21:
	leal	1(%rsi), %edx
	addq	$4, %rax
	cmpl	%ecx, %edx
	je	.L43
	movl	%edx, %esi
.L30:
	cmpl	%edi, (%rax)
	jl	.L21
	testl	%esi, %esi
	jne	.L69
	cmpl	%r9d, %ecx
	jle	.L10
	addq	$1, %r9
	xorl	%eax, %eax
.L31:
	movl	%eax, %r8d
	leal	-1(%r8), %esi
	movl	%r8d, %eax
	cmpl	%r8d, %ecx
	jg	.L70
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	%esi, %rsi
	movq	(%r11,%rsi,8), %rdx
	movl	%r9d, %esi
	addq	%r10, %rdx
	movq	%rdx, %r10
	cmpl	%r9d, %ecx
	jle	.L10
	addq	$1, %r9
	cmpl	%r8d, %ecx
	jle	.L24
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%ecx, %eax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%r10, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L71
	addq	$24, %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
.L69:
	.cfi_restore_state
	movl	%esi, %eax
	subl	$1, %esi
	jmp	.L20
.L68:
	addq	$1, %rdi
	jmp	.L35
.L67:
	movl	4(%rsp), %eax
.L4:
	leaq	bb.2(%rip), %rbx
	leaq	cc.1(%rip), %r13
	jmp	.L7
.L71:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB40:
.L24:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	%ecx, %edi
	subl	%esi, %edi
	cmpl	%ecx, %esi
	movl	$1, %ecx
	cmovl	%edi, %ecx
	subl	$1, %edi
	je	.L72
	subl	$1, %eax
	movl	%ecx, %edi
	pxor	%xmm0, %xmm0
	movslq	%eax, %rsi
	shrl	%edi
	movq	(%r11,%rsi,8), %xmm1
	xorl	%esi, %esi
	punpcklqdq	%xmm1, %xmm1
.L27:
	addl	$1, %esi
	paddq	%xmm1, %xmm0
	cmpl	%esi, %edi
	jne	.L27
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddq	%xmm1, %xmm0
	movq	%xmm0, %r10
	addq	%rdx, %r10
	andb	$1, %cl
	je	.L10
.L26:
	cltq
	addq	(%r11,%rax,8), %r10
	jmp	.L10
.L60:
	movd	%eax, %xmm3
	pxor	%xmm1, %xmm1
	movl	%edi, %r10d
	movslq	%r9d, %rax
	pshufd	$0, %xmm3, %xmm0
	leaq	pp.0(%rip), %rsi
	shrl	$2, %r10d
	xorl	%r8d, %r8d
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm2
	leaq	(%rsi,%rax,8), %rax
	punpckldq	%xmm1, %xmm2
	punpckhdq	%xmm1, %xmm0
.L14:
	addl	$1, %r8d
	movups	%xmm2, (%rax)
	addq	$32, %rax
	movups	%xmm0, -16(%rax)
	cmpl	%r8d, %r10d
	jne	.L14
	movl	%edi, %eax
	andl	$-4, %eax
	addl	%eax, %r9d
	cmpl	%eax, %edi
	je	.L37
	jmp	.L38
.L59:
	cltq
	addl	$2, %r9d
	movq	%rdx, (%rsi,%rax,8)
	cmpl	%r9d, %ecx
	jle	.L33
	movslq	%r9d, %r9
	movq	%rdx, (%rsi,%r9,8)
	jmp	.L33
.L72:
	subl	$1, %eax
	jmp	.L26
	.cfi_endproc
.LFE40:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE2:
	.section	.text.startup
.LHOTE2:
	.local	pp.0
	.comm	pp.0,800000,32
	.local	cc.1
	.comm	cc.1,400000,32
	.local	bb.2
	.comm	bb.2,400000,32
	.local	aa.3
	.comm	aa.3,400000,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:

/* Coached by Dukkha */
#include <stdio.h>
#include <stdlib.h>

#define N 100000

int compare(const void *a, const void *b) {
	int ia = *(int *) a;
	int ib = *(int *) b;

	return ia - ib;
}

int main() {
	static int aa[N], bb[N], cc[N];
	static long long pp[N];
	int n, i, j;
	long long ans;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d", &aa[i]);
	for (i = 0; i < n; i++)
		scanf("%d", &bb[i]);
	for (i = 0; i < n; i++)
		scanf("%d", &cc[i]);
	qsort(aa, n, sizeof *aa, compare);
	qsort(bb, n, sizeof *bb, compare);
	qsort(cc, n, sizeof *cc, compare);
	for (i = j = 0; j < n; j++) {
		while (i < n && aa[i] < bb[j])
			i++;
		pp[j] = i;
	}
	for (i = 1; i < n; i++)
		pp[i] += pp[i - 1];
	ans = 0;
	for (i = j = 0; j < n; j++) {
		while (i < n && bb[i] < cc[j])
			i++;
		if (i > 0)
			ans += pp[i - 1];
	}
	printf("%lld\n", ans);
	return 0;
}

2
1 5
2 4
3 6

3

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

```c
/* Coached by Dukkha */
#include <stdio.h>
#include <stdlib.h>

#define N 100000

int compare(const void *a, const void *b) {
	int ia = *(int *) a;
	int ib = *(int *) b;

	return ia - ib;
}

int main() {
	static int aa[N], bb[N], cc[N];
	static long long pp[N];
	int n, i, j;
	long long ans;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d", &aa[i]);
	for (i = 0; i < n; i++)
		scanf("%d", &bb[i]);
	for (i = 0; i < n; i++)
		scanf("%d", &cc[i]);
	qsort(aa, n, sizeof *aa, compare);
	qsort(bb, n, sizeof *bb, compare);
	qsort(cc, n, sizeof *cc, compare);
	for (i = j = 0; j < n; j++) {
		while (i < n && aa[i] < bb[j])
			i++;
		pp[j] = i;
	}
	for (i = 1; i < n; i++)
		pp[i] += pp[i - 1];
	ans = 0;
	for (i = j = 0; j < n; j++) {
		while (i < n && bb[i] < cc[j])
			i++;
		if (i > 0)
			ans += pp[i - 1];
	}
	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
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L4
.L5:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	aa.3(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L5
	movl	$0, -24(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bb.2(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L6:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	$0, -24(%rbp)
	jmp	.L8
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cc.1(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L9
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	aa.3(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	bb.2(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	cc.1(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L10
.L13:
	addl	$1, -24(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L12
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	aa.3(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	bb.2(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L13
.L12:
	movl	-24(%rbp), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	pp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L10:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$1, -24(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L16
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L17
.L20:
	addl	$1, -24(%rbp)
.L18:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L19
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bb.2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	cc.1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L20
.L19:
	cmpl	$0, -24(%rbp)
	jle	.L21
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
.L21:
	addl	$1, -20(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L18
	movq	-16(%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	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	aa.3
	.comm	aa.3,400000,32
	.local	bb.2
	.comm	bb.2,400000,32
	.local	cc.1
	.comm	cc.1,400000,32
	.local	pp.0
	.comm	pp.0,800000,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:
```

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
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L4
.L5:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	aa.3(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L5
	movl	$0, -24(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bb.2(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L6:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L7
	movl	$0, -24(%rbp)
	jmp	.L8
.L9:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cc.1(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L9
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	aa.3(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	bb.2(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	cc.1(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L10
.L13:
	addl	$1, -24(%rbp)
.L11:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L12
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	aa.3(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	bb.2(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L13
.L12:
	movl	-24(%rbp), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	pp.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L10:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$1, -24(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -24(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L16
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L17
.L20:
	addl	$1, -24(%rbp)
.L18:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L19
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	bb.2(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	cc.1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L20
.L19:
	cmpl	$0, -24(%rbp)
	jle	.L21
	movl	-24(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	pp.0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
.L21:
	addl	$1, -20(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L18
	movq	-16(%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	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.local	aa.3
	.comm	aa.3,400000,32
	.local	bb.2
	.comm	bb.2,400000,32
	.local	cc.1
	.comm	cc.1,400000,32
	.local	pp.0
	.comm	pp.0,800000,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:
