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

```c
// AOJ 0539: Pizza
// 2017.9.1 bal4u@uu
// 2018.1.5

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

//#define getchar_unlocked()  getchar()

int N;
int d[100002];
int k[10002];

int cmp(int *a, int *b) { return *a - *b; }

int in()
{
	int n, c;

	while ((c = getchar_unlocked()) < '0');
	n = 0;
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int bsrch(int l, int x)
{
	int m, r = N;
    while (l < r) {
        m = (l + r) >> 1;
        if (d[m] < x) l = m + 1; else r = m;
    }
	return l;
}

#define THRESHOLD 10
#define STACKSIZE 35		// 2^32 for int
void quicksort(int *a, int n)
{
	int i, j, l, r, m, p;
	int lsp[STACKSIZE], rsp[STACKSIZE];
	int t;
	
	l = 0, r = n-1, p = 0;
	while (1) {
		if (r-l <= THRESHOLD) {
			if (!p--) break;
			l = lsp[p], r = rsp[p];
		}
		m = a[(l+r)>>1];
		i = l, j = r;
		while (1) {
			while (a[i] < m) i++;
			while (m < a[j]) j--;
			if (i >= j) break;
			t = a[i], a[i] = a[j], a[j] = t;
			i++, j--;
		}
		if (i-l > r-j) {
			if (i-l > THRESHOLD) {
				lsp[p] = l;
				rsp[p] = i-1;
				p++;
			}
			l = j+1;
		} else {
			if (r-j > THRESHOLD) {
				lsp[p] = j+1;
				rsp[p] = r;
				p++;
			}
			r = i-1;
		}
	}
	
	// insert sorting
	for (i = 1; i < n; i++) {
		m = a[i];
		for (j = i-1; j >= 0 && a[j] > m; j--) a[j+1] = a[j];
		a[j+1] = m;
	}
}

int main()
{
	int D, M, i, j, t, ans;

	while (D = in()) {
		N = in();
		M = in();

		d[0] = 0; for (i = 1; i < N; i++) d[i] = in();
#if 0
		qsort(d, N, sizeof(int), cmp);
#else
		quicksort(d, N);
#endif
		d[N] = D;

		for (i = 0; i < M; i++) k[i] = in();
#if 0
		qsort(k, M, sizeof(int), cmp);
#else
		quicksort(k, M);
#endif
		k[M] = -1;

		ans = 0, j = 0;
		i = 0; while (!k[i]) i++; 
		while (i < M) {
			if (d[j] < k[i]) j = bsrch(j, k[i]);
			if (k[i] != d[j]) {
				t = k[i]-d[j-1];
				if (d[j]-k[i] < t) t= d[j]-k[i];
				ans += t;
			}
			i++;
		}
		printf("%d\n", ans);
	}
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400008
d:
	.zero	400008
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 40008
k:
	.zero	40008
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.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	cmp, .-cmp
	.globl	in
	.type	in, @function
in:
.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
	nop
.L4:
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jle	.L4
	movl	$0, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L5
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	in, .-in
	.globl	bsrch
	.type	bsrch, @function
bsrch:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	N(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L10:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L10
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	bsrch, .-bsrch
	.globl	quicksort
	.type	quicksort, @function
quicksort:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$352, %rsp
	movq	%rdi, -344(%rbp)
	movl	%esi, -348(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -324(%rbp)
	movl	-348(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -320(%rbp)
	movl	$0, -316(%rbp)
.L27:
	movl	-320(%rbp), %eax
	subl	-324(%rbp), %eax
	cmpl	$10, %eax
	jg	.L13
	movl	-316(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -316(%rbp)
	testl	%eax, %eax
	je	.L36
	movl	-316(%rbp), %eax
	cltq
	movl	-304(%rbp,%rax,4), %eax
	movl	%eax, -324(%rbp)
	movl	-316(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	movl	%eax, -320(%rbp)
.L13:
	movl	-324(%rbp), %edx
	movl	-320(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -312(%rbp)
	movl	-324(%rbp), %eax
	movl	%eax, -332(%rbp)
	movl	-320(%rbp), %eax
	movl	%eax, -328(%rbp)
	jmp	.L16
.L17:
	addl	$1, -332(%rbp)
.L16:
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jg	.L17
	jmp	.L18
.L19:
	subl	$1, -328(%rbp)
.L18:
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jl	.L19
	movl	-332(%rbp), %eax
	cmpl	-328(%rbp), %eax
	jge	.L37
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -308(%rbp)
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	-332(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-344(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rax, %rdx
	movl	-308(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -332(%rbp)
	subl	$1, -328(%rbp)
	jmp	.L16
.L37:
	nop
	movl	-332(%rbp), %eax
	subl	-324(%rbp), %eax
	movl	%eax, %edx
	movl	-320(%rbp), %eax
	subl	-328(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-332(%rbp), %eax
	subl	-324(%rbp), %eax
	cmpl	$10, %eax
	jle	.L24
	movl	-316(%rbp), %eax
	cltq
	movl	-324(%rbp), %edx
	movl	%edx, -304(%rbp,%rax,4)
	movl	-332(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-316(%rbp), %eax
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L24:
	movl	-328(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -324(%rbp)
	jmp	.L27
.L23:
	movl	-320(%rbp), %eax
	subl	-328(%rbp), %eax
	cmpl	$10, %eax
	jle	.L26
	movl	-328(%rbp), %eax
	leal	1(%rax), %edx
	movl	-316(%rbp), %eax
	cltq
	movl	%edx, -304(%rbp,%rax,4)
	movl	-316(%rbp), %eax
	cltq
	movl	-320(%rbp), %edx
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L26:
	movl	-332(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -320(%rbp)
	jmp	.L27
.L36:
	nop
	movl	$1, -332(%rbp)
	jmp	.L28
.L32:
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -312(%rbp)
	movl	-332(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -328(%rbp)
	jmp	.L29
.L31:
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	-328(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-344(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -328(%rbp)
.L29:
	cmpl	$0, -328(%rbp)
	js	.L30
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jl	.L31
.L30:
	movl	-328(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rax, %rdx
	movl	-312(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -332(%rbp)
.L28:
	movl	-332(%rbp), %eax
	cmpl	-348(%rbp), %eax
	jl	.L32
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	quicksort, .-quicksort
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
	jmp	.L39
.L51:
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	$0, d(%rip)
	movl	$1, -24(%rbp)
	jmp	.L40
.L41:
	movl	$0, %eax
	call	in
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L40:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L41
	movl	N(%rip), %eax
	movl	%eax, %esi
	leaq	d(%rip), %rax
	movq	%rax, %rdi
	call	quicksort
	movl	N(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -24(%rbp)
	jmp	.L42
.L43:
	movl	$0, %eax
	call	in
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L42:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L43
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	quicksort
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -12(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L44
.L45:
	addl	$1, -24(%rbp)
.L44:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L45
	jmp	.L46
.L50:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	k(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L47
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	bsrch
	movl	%eax, -20(%rbp)
.L47:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L48
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -16(%rbp)
	jle	.L49
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
.L49:
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
.L48:
	addl	$1, -24(%rbp)
.L46:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L50
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L39:
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L51
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB40:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L6
.L5:
	movq	%rdx, %rax
.L7:
	cmpq	%rcx, %rax
	jb	.L4
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r12d, %r12d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L3
.L9:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L11:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L8
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L3
	movq	stdin(%rip), %rdi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	in, .-in
	.p2align 4
	.globl	bsrch
	.type	bsrch, @function
bsrch:
.LFB41:
	.cfi_startproc
	endbr64
	movl	N(%rip), %ecx
	movl	%edi, %eax
	leaq	d(%rip), %r8
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	leal	(%rcx,%rax), %edx
	sarl	%edx
	movslq	%edx, %rdi
	cmpl	%esi, (%r8,%rdi,4)
	jl	.L19
	movl	%edx, %ecx
.L16:
	cmpl	%eax, %ecx
	jg	.L17
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	leal	1(%rdx), %eax
	jmp	.L16
	.cfi_endproc
.LFE41:
	.size	bsrch, .-bsrch
	.p2align 4
	.globl	quicksort
	.type	quicksort, @function
quicksort:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r11
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leal	-1(%rsi), %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%r13d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$304, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%ebp, %eax
	subl	%ebx, %eax
	cmpl	$10, %eax
	jg	.L22
	leal	-1(%r12), %eax
	testl	%r12d, %r12d
	je	.L45
	movslq	%eax, %rdx
	movl	%eax, %r12d
	movl	(%rsp,%rdx,4), %ebx
	movl	144(%rsp,%rdx,4), %ebp
.L22:
	leal	(%rbx,%rbp), %eax
	movl	%ebx, %r9d
	movl	%ebp, %edx
	sarl	%eax
	cltq
	movl	(%r11,%rax,4), %edi
	movslq	%ebx, %rax
	leaq	(%r11,%rax,4), %r8
	movslq	%ebp, %rax
	.p2align 4,,10
	.p2align 3
.L25:
	movl	(%r8), %r10d
	leaq	(%r11,%rax,4), %rsi
	movl	(%rsi), %ecx
	cmpl	%edi, %r10d
	jl	.L26
	cmpl	%ecx, %edi
	jge	.L27
	leaq	-4(%r11,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rax, %rsi
	movl	(%rax), %ecx
	subq	$4, %rax
	subl	$1, %edx
	cmpl	%edi, %ecx
	jg	.L28
.L27:
	cmpl	%edx, %r9d
	jge	.L29
	movl	%ecx, (%r8)
	subl	$1, %edx
	movl	%r10d, (%rsi)
	movslq	%edx, %rax
.L26:
	addq	$4, %r8
	addl	$1, %r9d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r9d, %ecx
	movl	%ebp, %eax
	subl	%ebx, %ecx
	subl	%edx, %eax
	cmpl	%eax, %ecx
	jle	.L30
	cmpl	$10, %ecx
	jle	.L31
	movslq	%r12d, %rax
	subl	$1, %r9d
	addl	$1, %r12d
	movl	%ebx, (%rsp,%rax,4)
	movl	%r9d, 144(%rsp,%rax,4)
.L31:
	leal	1(%rdx), %ebx
	jmp	.L21
.L30:
	cmpl	$10, %eax
	jle	.L33
	movslq	%r12d, %rax
	addl	$1, %edx
	addl	$1, %r12d
	movl	%edx, (%rsp,%rax,4)
	movl	%ebp, 144(%rsp,%rax,4)
.L33:
	leal	-1(%r9), %ebp
	jmp	.L21
.L45:
	xorl	%edi, %edi
	cmpl	$1, %r14d
	jle	.L20
.L37:
	movl	4(%r11,%rdi,4), %ecx
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%r11,%rax,4), %edx
	cmpl	%ecx, %edx
	jle	.L46
	movl	%edx, 4(%r11,%rax,4)
	subq	$1, %rax
	cmpl	$-1, %eax
	jne	.L34
	movq	%r11, %rax
.L35:
	addq	$1, %rdi
	movl	%ecx, (%rax)
	cmpq	%rdi, %r13
	jne	.L37
.L20:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$304, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L46:
	.cfi_restore_state
	leal	1(%rax), %eax
	cltq
	leaq	(%r11,%rax,4), %rax
	jmp	.L35
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	quicksort, .-quicksort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.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	k(%rip), %r13
	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
	leaq	d(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L49:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L99
	.p2align 4,,10
	.p2align 3
.L96:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L98
.L97:
	movq	%rdx, %rax
.L99:
	cmpq	%rcx, %rax
	jb	.L96
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jle	.L97
	.p2align 4,,10
	.p2align 3
.L98:
	xorl	%r12d, %r12d
	jmp	.L103
	.p2align 4,,10
	.p2align 3
.L100:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L102
.L101:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L103:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rdx, %rcx
	ja	.L100
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L102
	movq	stdin(%rip), %rdi
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L102:
	testl	%r12d, %r12d
	je	.L122
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L50:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L52
.L51:
	movq	%rdx, %rax
.L53:
	cmpq	%rcx, %rax
	jb	.L50
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jle	.L51
	.p2align 4,,10
	.p2align 3
.L52:
	xorl	%ebp, %ebp
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L54:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L56
.L55:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L57:
	leal	0(%rbp,%rbp,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebp
	cmpq	%rcx, %rdx
	jb	.L54
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	cmpl	$47, %eax
	jg	.L55
	.p2align 4,,10
	.p2align 3
.L56:
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	movl	%ebp, N(%rip)
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L58:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L60
.L59:
	movq	%rdx, %rax
.L61:
	cmpq	%rcx, %rax
	jb	.L58
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jle	.L59
	.p2align 4,,10
	.p2align 3
.L60:
	xorl	%ebp, %ebp
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L62:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L64
.L63:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L65:
	leal	0(%rbp,%rbp,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebp
	cmpq	%rcx, %rdx
	jb	.L62
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L64
	movq	stdin(%rip), %rdi
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L64:
	movl	$0, d(%rip)
	movl	N(%rip), %esi
	cmpl	$1, %esi
	jle	.L66
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L75:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rsi
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L67:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L69
.L68:
	movq	%rdx, %rax
.L70:
	cmpq	%rsi, %rax
	jb	.L67
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rsi
	cmpl	$47, %eax
	jle	.L68
	.p2align 4,,10
	.p2align 3
.L69:
	xorl	%r14d, %r14d
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L71:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L73
.L72:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rsi
.L74:
	leal	(%r14,%r14,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %r14d
	cmpq	%rsi, %rdx
	jb	.L71
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L73
	movq	stdin(%rip), %rdi
	jmp	.L72
	.p2align 4,,10
	.p2align 3
.L73:
	movl	N(%rip), %esi
	movl	%r14d, (%rbx,%r15,4)
	addq	$1, %r15
	cmpl	%r15d, %esi
	jg	.L75
.L66:
	movq	%rbx, %rdi
	call	quicksort
	movslq	N(%rip), %rax
	movl	%r12d, (%rbx,%rax,4)
	testl	%ebp, %ebp
	jle	.L76
	leaq	k(%rip), %r12
	leal	-1(%rbp), %eax
	leaq	4(%r12), %rdx
	leaq	(%rdx,%rax,4), %r15
	.p2align 4,,10
	.p2align 3
.L85:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rsi
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L77:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L79
.L78:
	movq	%rdx, %rax
.L80:
	cmpq	%rsi, %rax
	jb	.L77
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rsi
	cmpl	$47, %eax
	jle	.L78
	.p2align 4,,10
	.p2align 3
.L79:
	xorl	%r14d, %r14d
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L81:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L83
.L82:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rsi
.L84:
	leal	(%r14,%r14,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %r14d
	cmpq	%rsi, %rdx
	jb	.L81
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L83
	movq	stdin(%rip), %rdi
	jmp	.L82
	.p2align 4,,10
	.p2align 3
.L83:
	movl	%r14d, (%r12)
	addq	$4, %r12
	cmpq	%r12, %r15
	jne	.L85
	movl	%ebp, %esi
	movq	%r13, %rdi
	call	quicksort
	movslq	%ebp, %rax
	xorl	%r8d, %r8d
	movl	$-1, 0(%r13,%rax,4)
	movl	0(%r13), %edx
	testl	%edx, %edx
	jne	.L88
.L105:
	movl	$1, %eax
	leaq	-4+k(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L87:
	movslq	%eax, %r8
	addq	$1, %rax
	movl	(%rdx,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L87
	cmpl	%ebp, %r8d
	jge	.L106
.L88:
	movl	N(%rip), %r9d
	movl	(%rbx), %edx
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	jmp	.L95
	.p2align 4,,10
	.p2align 3
.L91:
	cmpl	%edx, %edi
	je	.L94
	leal	-1(%rcx), %eax
	movl	%edi, %esi
	cltq
	subl	(%rbx,%rax,4), %esi
	movl	%esi, %eax
	movl	%edx, %esi
	subl	%edi, %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	%eax, %r10d
.L94:
	addq	$1, %r8
	cmpl	%r8d, %ebp
	jle	.L89
.L95:
	movl	0(%r13,%r8,4), %edi
	cmpl	%edx, %edi
	jle	.L91
	movl	%r9d, %edx
	jmp	.L92
	.p2align 4,,10
	.p2align 3
.L93:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpl	(%rbx,%rsi,4), %edi
	jg	.L123
	movl	%eax, %edx
.L92:
	cmpl	%ecx, %edx
	jg	.L93
	movslq	%ecx, %rax
	movl	(%rbx,%rax,4), %edx
	jmp	.L91
	.p2align 4,,10
	.p2align 3
.L123:
	leal	1(%rax), %ecx
	jmp	.L92
.L76:
	movl	%ebp, %esi
	movq	%r13, %rdi
	call	quicksort
	movslq	%ebp, %rax
	movl	$-1, 0(%r13,%rax,4)
	movl	0(%r13), %eax
	testl	%eax, %eax
	je	.L105
.L106:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L89:
	movl	%r10d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L49
.L122:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.globl	k
	.bss
	.align 32
	.type	k, @object
	.size	k, 40008
k:
	.zero	40008
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400008
d:
	.zero	400008
	.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	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB40:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L6
.L5:
	movq	%rdx, %rax
.L7:
	cmpq	%rcx, %rax
	jb	.L4
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r12d, %r12d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L3
.L9:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L11:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L8
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L3
	movq	stdin(%rip), %rdi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.size	in, .-in
	.p2align 4
	.globl	bsrch
	.type	bsrch, @function
bsrch:
.LFB41:
	.cfi_startproc
	endbr64
	movl	N(%rip), %ecx
	movl	%edi, %eax
	leaq	d(%rip), %r8
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	leal	(%rcx,%rax), %edx
	sarl	%edx
	movslq	%edx, %rdi
	cmpl	%esi, (%r8,%rdi,4)
	jl	.L19
	movl	%edx, %ecx
.L16:
	cmpl	%eax, %ecx
	jg	.L17
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	leal	1(%rdx), %eax
	jmp	.L16
	.cfi_endproc
.LFE41:
	.size	bsrch, .-bsrch
	.p2align 4
	.globl	quicksort
	.type	quicksort, @function
quicksort:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rdi, %r11
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leal	-1(%rsi), %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movl	%r13d, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$304, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%ebp, %eax
	subl	%ebx, %eax
	cmpl	$10, %eax
	jg	.L22
	leal	-1(%r12), %eax
	testl	%r12d, %r12d
	je	.L45
	movslq	%eax, %rdx
	movl	%eax, %r12d
	movl	(%rsp,%rdx,4), %ebx
	movl	144(%rsp,%rdx,4), %ebp
.L22:
	leal	(%rbx,%rbp), %eax
	movl	%ebx, %r9d
	movl	%ebp, %edx
	sarl	%eax
	cltq
	movl	(%r11,%rax,4), %edi
	movslq	%ebx, %rax
	leaq	(%r11,%rax,4), %r8
	movslq	%ebp, %rax
	.p2align 4,,10
	.p2align 3
.L25:
	movl	(%r8), %r10d
	leaq	(%r11,%rax,4), %rsi
	movl	(%rsi), %ecx
	cmpl	%edi, %r10d
	jl	.L26
	cmpl	%ecx, %edi
	jge	.L27
	leaq	-4(%r11,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rax, %rsi
	movl	(%rax), %ecx
	subq	$4, %rax
	subl	$1, %edx
	cmpl	%edi, %ecx
	jg	.L28
.L27:
	cmpl	%edx, %r9d
	jge	.L29
	movl	%ecx, (%r8)
	subl	$1, %edx
	movl	%r10d, (%rsi)
	movslq	%edx, %rax
.L26:
	addq	$4, %r8
	addl	$1, %r9d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%r9d, %ecx
	movl	%ebp, %eax
	subl	%ebx, %ecx
	subl	%edx, %eax
	cmpl	%eax, %ecx
	jle	.L30
	cmpl	$10, %ecx
	jle	.L31
	movslq	%r12d, %rax
	subl	$1, %r9d
	addl	$1, %r12d
	movl	%ebx, (%rsp,%rax,4)
	movl	%r9d, 144(%rsp,%rax,4)
.L31:
	leal	1(%rdx), %ebx
	jmp	.L21
.L30:
	cmpl	$10, %eax
	jle	.L33
	movslq	%r12d, %rax
	addl	$1, %edx
	addl	$1, %r12d
	movl	%edx, (%rsp,%rax,4)
	movl	%ebp, 144(%rsp,%rax,4)
.L33:
	leal	-1(%r9), %ebp
	jmp	.L21
.L45:
	xorl	%edi, %edi
	cmpl	$1, %r14d
	jle	.L20
.L37:
	movl	4(%r11,%rdi,4), %ecx
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%r11,%rax,4), %edx
	cmpl	%ecx, %edx
	jle	.L46
	movl	%edx, 4(%r11,%rax,4)
	subq	$1, %rax
	cmpl	$-1, %eax
	jne	.L34
	movq	%r11, %rax
.L35:
	addq	$1, %rdi
	movl	%ecx, (%rax)
	cmpq	%rdi, %r13
	jne	.L37
.L20:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$304, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L46:
	.cfi_restore_state
	leal	1(%rax), %eax
	cltq
	leaq	(%r11,%rax,4), %rax
	jmp	.L35
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	quicksort, .-quicksort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB43:
	.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	k(%rip), %r13
	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
	leaq	d(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L49:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L99
	.p2align 4,,10
	.p2align 3
.L96:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L98
.L97:
	movq	%rdx, %rax
.L99:
	cmpq	%rcx, %rax
	jb	.L96
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jle	.L97
	.p2align 4,,10
	.p2align 3
.L98:
	xorl	%r12d, %r12d
	jmp	.L103
	.p2align 4,,10
	.p2align 3
.L100:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L102
.L101:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L103:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rdx, %rcx
	ja	.L100
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L102
	movq	stdin(%rip), %rdi
	jmp	.L101
	.p2align 4,,10
	.p2align 3
.L102:
	testl	%r12d, %r12d
	je	.L122
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L50:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L52
.L51:
	movq	%rdx, %rax
.L53:
	cmpq	%rcx, %rax
	jb	.L50
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jle	.L51
	.p2align 4,,10
	.p2align 3
.L52:
	xorl	%ebp, %ebp
	jmp	.L57
	.p2align 4,,10
	.p2align 3
.L54:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L56
.L55:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L57:
	leal	0(%rbp,%rbp,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebp
	cmpq	%rcx, %rdx
	jb	.L54
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	cmpl	$47, %eax
	jg	.L55
	.p2align 4,,10
	.p2align 3
.L56:
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	movl	%ebp, N(%rip)
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L58:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L60
.L59:
	movq	%rdx, %rax
.L61:
	cmpq	%rcx, %rax
	jb	.L58
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jle	.L59
	.p2align 4,,10
	.p2align 3
.L60:
	xorl	%ebp, %ebp
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L62:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L64
.L63:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L65:
	leal	0(%rbp,%rbp,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebp
	cmpq	%rcx, %rdx
	jb	.L62
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L64
	movq	stdin(%rip), %rdi
	jmp	.L63
	.p2align 4,,10
	.p2align 3
.L64:
	movl	$0, d(%rip)
	movl	N(%rip), %esi
	cmpl	$1, %esi
	jle	.L66
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L75:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rsi
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L67:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L69
.L68:
	movq	%rdx, %rax
.L70:
	cmpq	%rsi, %rax
	jb	.L67
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rsi
	cmpl	$47, %eax
	jle	.L68
	.p2align 4,,10
	.p2align 3
.L69:
	xorl	%r14d, %r14d
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L71:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L73
.L72:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rsi
.L74:
	leal	(%r14,%r14,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %r14d
	cmpq	%rsi, %rdx
	jb	.L71
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L73
	movq	stdin(%rip), %rdi
	jmp	.L72
	.p2align 4,,10
	.p2align 3
.L73:
	movl	N(%rip), %esi
	movl	%r14d, (%rbx,%r15,4)
	addq	$1, %r15
	cmpl	%r15d, %esi
	jg	.L75
.L66:
	movq	%rbx, %rdi
	call	quicksort
	movslq	N(%rip), %rax
	movl	%r12d, (%rbx,%rax,4)
	testl	%ebp, %ebp
	jle	.L76
	leaq	k(%rip), %r12
	leal	-1(%rbp), %eax
	leaq	4(%r12), %rdx
	leaq	(%rdx,%rax,4), %r15
	.p2align 4,,10
	.p2align 3
.L85:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rsi
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L77:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	cmpl	$47, %eax
	jg	.L79
.L78:
	movq	%rdx, %rax
.L80:
	cmpq	%rsi, %rax
	jb	.L77
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rsi
	cmpl	$47, %eax
	jle	.L78
	.p2align 4,,10
	.p2align 3
.L79:
	xorl	%r14d, %r14d
	jmp	.L84
	.p2align 4,,10
	.p2align 3
.L81:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L83
.L82:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rsi
.L84:
	leal	(%r14,%r14,4), %ecx
	andl	$15, %eax
	leal	(%rax,%rcx,2), %r14d
	cmpq	%rsi, %rdx
	jb	.L81
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L83
	movq	stdin(%rip), %rdi
	jmp	.L82
	.p2align 4,,10
	.p2align 3
.L83:
	movl	%r14d, (%r12)
	addq	$4, %r12
	cmpq	%r12, %r15
	jne	.L85
	movl	%ebp, %esi
	movq	%r13, %rdi
	call	quicksort
	movslq	%ebp, %rax
	xorl	%r8d, %r8d
	movl	$-1, 0(%r13,%rax,4)
	movl	0(%r13), %edx
	testl	%edx, %edx
	jne	.L88
.L105:
	movl	$1, %eax
	leaq	-4+k(%rip), %rdx
	.p2align 4,,10
	.p2align 3
.L87:
	movslq	%eax, %r8
	addq	$1, %rax
	movl	(%rdx,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L87
	cmpl	%ebp, %r8d
	jge	.L106
.L88:
	movl	N(%rip), %r9d
	movl	(%rbx), %edx
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	jmp	.L95
	.p2align 4,,10
	.p2align 3
.L91:
	cmpl	%edx, %edi
	je	.L94
	leal	-1(%rcx), %eax
	movl	%edi, %esi
	cltq
	subl	(%rbx,%rax,4), %esi
	movl	%esi, %eax
	movl	%edx, %esi
	subl	%edi, %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	%eax, %r10d
.L94:
	addq	$1, %r8
	cmpl	%r8d, %ebp
	jle	.L89
.L95:
	movl	0(%r13,%r8,4), %edi
	cmpl	%edx, %edi
	jle	.L91
	movl	%r9d, %edx
	jmp	.L92
	.p2align 4,,10
	.p2align 3
.L93:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpl	(%rbx,%rsi,4), %edi
	jg	.L123
	movl	%eax, %edx
.L92:
	cmpl	%ecx, %edx
	jg	.L93
	movslq	%ecx, %rax
	movl	(%rbx,%rax,4), %edx
	jmp	.L91
	.p2align 4,,10
	.p2align 3
.L123:
	leal	1(%rax), %ecx
	jmp	.L92
.L76:
	movl	%ebp, %esi
	movq	%r13, %rdi
	call	quicksort
	movslq	%ebp, %rax
	movl	$-1, 0(%r13,%rax,4)
	movl	0(%r13), %eax
	testl	%eax, %eax
	je	.L105
.L106:
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L89:
	movl	%r10d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L49
.L122:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE43:
	.size	main, .-main
	.globl	k
	.bss
	.align 32
	.type	k, @object
	.size	k, 40008
k:
	.zero	40008
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400008
d:
	.zero	400008
	.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:

// AOJ 0539: Pizza
// 2017.9.1 bal4u@uu
// 2018.1.5

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

//#define getchar_unlocked()  getchar()

int N;
int d[100002];
int k[10002];

int cmp(int *a, int *b) { return *a - *b; }

int in()
{
	int n, c;

	while ((c = getchar_unlocked()) < '0');
	n = 0;
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int bsrch(int l, int x)
{
	int m, r = N;
    while (l < r) {
        m = (l + r) >> 1;
        if (d[m] < x) l = m + 1; else r = m;
    }
	return l;
}

#define THRESHOLD 10
#define STACKSIZE 35		// 2^32 for int
void quicksort(int *a, int n)
{
	int i, j, l, r, m, p;
	int lsp[STACKSIZE], rsp[STACKSIZE];
	int t;
	
	l = 0, r = n-1, p = 0;
	while (1) {
		if (r-l <= THRESHOLD) {
			if (!p--) break;
			l = lsp[p], r = rsp[p];
		}
		m = a[(l+r)>>1];
		i = l, j = r;
		while (1) {
			while (a[i] < m) i++;
			while (m < a[j]) j--;
			if (i >= j) break;
			t = a[i], a[i] = a[j], a[j] = t;
			i++, j--;
		}
		if (i-l > r-j) {
			if (i-l > THRESHOLD) {
				lsp[p] = l;
				rsp[p] = i-1;
				p++;
			}
			l = j+1;
		} else {
			if (r-j > THRESHOLD) {
				lsp[p] = j+1;
				rsp[p] = r;
				p++;
			}
			r = i-1;
		}
	}
	
	// insert sorting
	for (i = 1; i < n; i++) {
		m = a[i];
		for (j = i-1; j >= 0 && a[j] > m; j--) a[j+1] = a[j];
		a[j+1] = m;
	}
}

int main()
{
	int D, M, i, j, t, ans;

	while (D = in()) {
		N = in();
		M = in();

		d[0] = 0; for (i = 1; i < N; i++) d[i] = in();
#if 0
		qsort(d, N, sizeof(int), cmp);
#else
		quicksort(d, N);
#endif
		d[N] = D;

		for (i = 0; i < M; i++) k[i] = in();
#if 0
		qsort(k, M, sizeof(int), cmp);
#else
		quicksort(k, M);
#endif
		k[M] = -1;

		ans = 0, j = 0;
		i = 0; while (!k[i]) i++; 
		while (i < M) {
			if (d[j] < k[i]) j = bsrch(j, k[i]);
			if (k[i] != d[j]) {
				t = k[i]-d[j-1];
				if (d[j]-k[i] < t) t= d[j]-k[i];
				ans += t;
			}
			i++;
		}
		printf("%d\n", ans);
	}
	return 0;
}


8
3
2
3
1
4
6
20
4
4
10
8
16
7
7
11
8
0
 8
3
2
3
1
4
6
20
4
4
12
8
16
7
7
4
8
0
 8
3
2
3
1
4
6
20
4
4
14
8
16
7
7
11
8
0
 8
3
2
3
1
7
7
12
4
4
12
8
16
7
7
4
8
0
 8
3
2
3
1
7
6
20
4
4
12
0
16
7
7
4
8
0
 8
3
2
3
1
7
6
12
4
4
12
8
16
4
7
4
8
0
 8
3
2
3
1
4
6
20
4
4
12
8
16
12
7
7
8
0
 8
3
2
3
0
4
6
20
4
4
14
14
23
7
7
11
8
0
 8
3
2
3
1
7
7
12
4
4
3
8
16
1
7
4
8
0
 8
3
2
3
1
4
6
20
4
4
1
8
16
11
7
4
8
0

3
3
 3
6
 3
5
 2
6
 3
18
 3
9
 3
2
 3
23
 2
3
 3
7

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

```c
// AOJ 0539: Pizza
// 2017.9.1 bal4u@uu
// 2018.1.5

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

//#define getchar_unlocked()  getchar()

int N;
int d[100002];
int k[10002];

int cmp(int *a, int *b) { return *a - *b; }

int in()
{
	int n, c;

	while ((c = getchar_unlocked()) < '0');
	n = 0;
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int bsrch(int l, int x)
{
	int m, r = N;
    while (l < r) {
        m = (l + r) >> 1;
        if (d[m] < x) l = m + 1; else r = m;
    }
	return l;
}

#define THRESHOLD 10
#define STACKSIZE 35		// 2^32 for int
void quicksort(int *a, int n)
{
	int i, j, l, r, m, p;
	int lsp[STACKSIZE], rsp[STACKSIZE];
	int t;
	
	l = 0, r = n-1, p = 0;
	while (1) {
		if (r-l <= THRESHOLD) {
			if (!p--) break;
			l = lsp[p], r = rsp[p];
		}
		m = a[(l+r)>>1];
		i = l, j = r;
		while (1) {
			while (a[i] < m) i++;
			while (m < a[j]) j--;
			if (i >= j) break;
			t = a[i], a[i] = a[j], a[j] = t;
			i++, j--;
		}
		if (i-l > r-j) {
			if (i-l > THRESHOLD) {
				lsp[p] = l;
				rsp[p] = i-1;
				p++;
			}
			l = j+1;
		} else {
			if (r-j > THRESHOLD) {
				lsp[p] = j+1;
				rsp[p] = r;
				p++;
			}
			r = i-1;
		}
	}
	
	// insert sorting
	for (i = 1; i < n; i++) {
		m = a[i];
		for (j = i-1; j >= 0 && a[j] > m; j--) a[j+1] = a[j];
		a[j+1] = m;
	}
}

int main()
{
	int D, M, i, j, t, ans;

	while (D = in()) {
		N = in();
		M = in();

		d[0] = 0; for (i = 1; i < N; i++) d[i] = in();
#if 0
		qsort(d, N, sizeof(int), cmp);
#else
		quicksort(d, N);
#endif
		d[N] = D;

		for (i = 0; i < M; i++) k[i] = in();
#if 0
		qsort(k, M, sizeof(int), cmp);
#else
		quicksort(k, M);
#endif
		k[M] = -1;

		ans = 0, j = 0;
		i = 0; while (!k[i]) i++; 
		while (i < M) {
			if (d[j] < k[i]) j = bsrch(j, k[i]);
			if (k[i] != d[j]) {
				t = k[i]-d[j-1];
				if (d[j]-k[i] < t) t= d[j]-k[i];
				ans += t;
			}
			i++;
		}
		printf("%d\n", ans);
	}
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400008
d:
	.zero	400008
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 40008
k:
	.zero	40008
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.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	cmp, .-cmp
	.globl	in
	.type	in, @function
in:
.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
	nop
.L4:
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jle	.L4
	movl	$0, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L5
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	in, .-in
	.globl	bsrch
	.type	bsrch, @function
bsrch:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	N(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L10:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L10
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	bsrch, .-bsrch
	.globl	quicksort
	.type	quicksort, @function
quicksort:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$352, %rsp
	movq	%rdi, -344(%rbp)
	movl	%esi, -348(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -324(%rbp)
	movl	-348(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -320(%rbp)
	movl	$0, -316(%rbp)
.L27:
	movl	-320(%rbp), %eax
	subl	-324(%rbp), %eax
	cmpl	$10, %eax
	jg	.L13
	movl	-316(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -316(%rbp)
	testl	%eax, %eax
	je	.L36
	movl	-316(%rbp), %eax
	cltq
	movl	-304(%rbp,%rax,4), %eax
	movl	%eax, -324(%rbp)
	movl	-316(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	movl	%eax, -320(%rbp)
.L13:
	movl	-324(%rbp), %edx
	movl	-320(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -312(%rbp)
	movl	-324(%rbp), %eax
	movl	%eax, -332(%rbp)
	movl	-320(%rbp), %eax
	movl	%eax, -328(%rbp)
	jmp	.L16
.L17:
	addl	$1, -332(%rbp)
.L16:
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jg	.L17
	jmp	.L18
.L19:
	subl	$1, -328(%rbp)
.L18:
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jl	.L19
	movl	-332(%rbp), %eax
	cmpl	-328(%rbp), %eax
	jge	.L37
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -308(%rbp)
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	-332(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-344(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rax, %rdx
	movl	-308(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -332(%rbp)
	subl	$1, -328(%rbp)
	jmp	.L16
.L37:
	nop
	movl	-332(%rbp), %eax
	subl	-324(%rbp), %eax
	movl	%eax, %edx
	movl	-320(%rbp), %eax
	subl	-328(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-332(%rbp), %eax
	subl	-324(%rbp), %eax
	cmpl	$10, %eax
	jle	.L24
	movl	-316(%rbp), %eax
	cltq
	movl	-324(%rbp), %edx
	movl	%edx, -304(%rbp,%rax,4)
	movl	-332(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-316(%rbp), %eax
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L24:
	movl	-328(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -324(%rbp)
	jmp	.L27
.L23:
	movl	-320(%rbp), %eax
	subl	-328(%rbp), %eax
	cmpl	$10, %eax
	jle	.L26
	movl	-328(%rbp), %eax
	leal	1(%rax), %edx
	movl	-316(%rbp), %eax
	cltq
	movl	%edx, -304(%rbp,%rax,4)
	movl	-316(%rbp), %eax
	cltq
	movl	-320(%rbp), %edx
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L26:
	movl	-332(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -320(%rbp)
	jmp	.L27
.L36:
	nop
	movl	$1, -332(%rbp)
	jmp	.L28
.L32:
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -312(%rbp)
	movl	-332(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -328(%rbp)
	jmp	.L29
.L31:
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	-328(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-344(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -328(%rbp)
.L29:
	cmpl	$0, -328(%rbp)
	js	.L30
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jl	.L31
.L30:
	movl	-328(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rax, %rdx
	movl	-312(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -332(%rbp)
.L28:
	movl	-332(%rbp), %eax
	cmpl	-348(%rbp), %eax
	jl	.L32
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	quicksort, .-quicksort
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
	jmp	.L39
.L51:
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	$0, d(%rip)
	movl	$1, -24(%rbp)
	jmp	.L40
.L41:
	movl	$0, %eax
	call	in
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L40:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L41
	movl	N(%rip), %eax
	movl	%eax, %esi
	leaq	d(%rip), %rax
	movq	%rax, %rdi
	call	quicksort
	movl	N(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -24(%rbp)
	jmp	.L42
.L43:
	movl	$0, %eax
	call	in
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L42:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L43
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	quicksort
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -12(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L44
.L45:
	addl	$1, -24(%rbp)
.L44:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L45
	jmp	.L46
.L50:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	k(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L47
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	bsrch
	movl	%eax, -20(%rbp)
.L47:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L48
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -16(%rbp)
	jle	.L49
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
.L49:
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
.L48:
	addl	$1, -24(%rbp)
.L46:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L50
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L39:
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L51
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400008
d:
	.zero	400008
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 40008
k:
	.zero	40008
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.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	cmp, .-cmp
	.globl	in
	.type	in, @function
in:
.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
	nop
.L4:
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jle	.L4
	movl	$0, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L5
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	in, .-in
	.globl	bsrch
	.type	bsrch, @function
bsrch:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	N(%rip), %eax
	movl	%eax, -8(%rbp)
	jmp	.L8
.L10:
	movl	-20(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L9
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L10
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	bsrch, .-bsrch
	.globl	quicksort
	.type	quicksort, @function
quicksort:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$352, %rsp
	movq	%rdi, -344(%rbp)
	movl	%esi, -348(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -324(%rbp)
	movl	-348(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -320(%rbp)
	movl	$0, -316(%rbp)
.L27:
	movl	-320(%rbp), %eax
	subl	-324(%rbp), %eax
	cmpl	$10, %eax
	jg	.L13
	movl	-316(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -316(%rbp)
	testl	%eax, %eax
	je	.L36
	movl	-316(%rbp), %eax
	cltq
	movl	-304(%rbp,%rax,4), %eax
	movl	%eax, -324(%rbp)
	movl	-316(%rbp), %eax
	cltq
	movl	-160(%rbp,%rax,4), %eax
	movl	%eax, -320(%rbp)
.L13:
	movl	-324(%rbp), %edx
	movl	-320(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -312(%rbp)
	movl	-324(%rbp), %eax
	movl	%eax, -332(%rbp)
	movl	-320(%rbp), %eax
	movl	%eax, -328(%rbp)
	jmp	.L16
.L17:
	addl	$1, -332(%rbp)
.L16:
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jg	.L17
	jmp	.L18
.L19:
	subl	$1, -328(%rbp)
.L18:
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jl	.L19
	movl	-332(%rbp), %eax
	cmpl	-328(%rbp), %eax
	jge	.L37
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -308(%rbp)
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	-332(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-344(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rax, %rdx
	movl	-308(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -332(%rbp)
	subl	$1, -328(%rbp)
	jmp	.L16
.L37:
	nop
	movl	-332(%rbp), %eax
	subl	-324(%rbp), %eax
	movl	%eax, %edx
	movl	-320(%rbp), %eax
	subl	-328(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L23
	movl	-332(%rbp), %eax
	subl	-324(%rbp), %eax
	cmpl	$10, %eax
	jle	.L24
	movl	-316(%rbp), %eax
	cltq
	movl	-324(%rbp), %edx
	movl	%edx, -304(%rbp,%rax,4)
	movl	-332(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-316(%rbp), %eax
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L24:
	movl	-328(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -324(%rbp)
	jmp	.L27
.L23:
	movl	-320(%rbp), %eax
	subl	-328(%rbp), %eax
	cmpl	$10, %eax
	jle	.L26
	movl	-328(%rbp), %eax
	leal	1(%rax), %edx
	movl	-316(%rbp), %eax
	cltq
	movl	%edx, -304(%rbp,%rax,4)
	movl	-316(%rbp), %eax
	cltq
	movl	-320(%rbp), %edx
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -316(%rbp)
.L26:
	movl	-332(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -320(%rbp)
	jmp	.L27
.L36:
	nop
	movl	$1, -332(%rbp)
	jmp	.L28
.L32:
	movl	-332(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -312(%rbp)
	movl	-332(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -328(%rbp)
	jmp	.L29
.L31:
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	-328(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-344(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -328(%rbp)
.L29:
	cmpl	$0, -328(%rbp)
	js	.L30
	movl	-328(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -312(%rbp)
	jl	.L31
.L30:
	movl	-328(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-344(%rbp), %rax
	addq	%rax, %rdx
	movl	-312(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -332(%rbp)
.L28:
	movl	-332(%rbp), %eax
	cmpl	-348(%rbp), %eax
	jl	.L32
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	quicksort, .-quicksort
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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
	jmp	.L39
.L51:
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	$0, d(%rip)
	movl	$1, -24(%rbp)
	jmp	.L40
.L41:
	movl	$0, %eax
	call	in
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L40:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L41
	movl	N(%rip), %eax
	movl	%eax, %esi
	leaq	d(%rip), %rax
	movq	%rax, %rdi
	call	quicksort
	movl	N(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -24(%rbp)
	jmp	.L42
.L43:
	movl	$0, %eax
	call	in
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L42:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L43
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	k(%rip), %rax
	movq	%rax, %rdi
	call	quicksort
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	$-1, (%rdx,%rax)
	movl	$0, -12(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L44
.L45:
	addl	$1, -24(%rbp)
.L44:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L45
	jmp	.L46
.L50:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	k(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L47
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	bsrch
	movl	%eax, -20(%rbp)
.L47:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	d(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L48
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -16(%rbp)
	jle	.L49
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	k(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
.L49:
	movl	-16(%rbp), %eax
	addl	%eax, -12(%rbp)
.L48:
	addl	$1, -24(%rbp)
.L46:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L50
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L39:
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$0, -8(%rbp)
	jne	.L51
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
