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

```c
// AOJ 0617 Ball
// 2018.3.31 bal4u

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

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0, c = getchar_unlocked();
	do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

#define INF 0x50505050
int N, M, K;
int d1[100004], d2[100004], d[100004];
int  p[100004];
int dp[200004];

int binarySearch(int x, int n)
{
	int m, l = 0, r = n;

    while (l < r) {
        m = (l + r) >> 1;
        if (d2[m] < x) l = m + 1; else r = m;
    }
	return l;
}

int check(int k)
{
	int i, m, t;
	long long s;

	for (i = 0; i < N; i++) dp[i] = 1;
	for (i = 0; i < M; i++) {
		m = p[i], dp[m] = 0;
		if (d1[i] < k) dp[m] = INF;
	}
	m = N-1; for (i = 1; i <= m; i+=3) {
		s = t = dp[i-1];
		if (t < dp[i  ]) t = dp[i];
		if (t < dp[i+1]) t = dp[i+1];
		s += dp[i]+dp[i+1]-t;
		if (s > INF) s = INF;
		dp[++m] = (int)s;
	}
	return K-binarySearch(k, K) >= dp[m];
}
 
int cmp(int *a, int *b) { return *a - *b; }

int main()
{
	int i, m, lo, hi, mi;
	N = in(), M = in(), K = N-M;
	for (i = 0; i < M; i++) d[i] = d1[i] = in(), p[i] = in()-1;
	m = 0; for (; i < N; i++) d[i] = d2[m++] = in();
	qsort(d , N, sizeof(int), cmp);
	qsort(d2, K, sizeof(int), cmp);

	lo = 0, hi = N;
	while (lo + 1 < hi) {
		mi = (lo + hi) >> 1;
		if (check(d[mi])) lo = mi; else hi = mi;
	}
	printf("%d\n", d[lo]);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%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	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	d1
	.align 32
	.type	d1, @object
	.size	d1, 400016
d1:
	.zero	400016
	.globl	d2
	.align 32
	.type	d2, @object
	.size	d2, 400016
d2:
	.zero	400016
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400016
d:
	.zero	400016
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400016
p:
	.zero	400016
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 800016
dp:
	.zero	800016
	.text
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB7:
	.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	$0, -12(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L7:
	movl	-12(%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	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L6
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L5:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L7
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	binarySearch, .-binarySearch
	.globl	check
	.type	check, @function
check:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -44(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L10
.L11:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L11
	movl	$0, -28(%rbp)
	jmp	.L12
.L14:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L13
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1347440720, (%rdx,%rax)
.L13:
	addl	$1, -28(%rbp)
.L12:
	movl	M(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L14
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L15
.L19:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, -16(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L16
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L16:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L17
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	subl	-20(%rbp), %eax
	cltq
	addq	%rax, -16(%rbp)
	cmpq	$1347440720, -16(%rbp)
	jle	.L18
	movq	$1347440720, -16(%rbp)
.L18:
	addl	$1, -24(%rbp)
	movq	-16(%rbp), %rax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$3, -28(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	K(%rip), %ebx
	movl	K(%rip), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	binarySearch
	subl	%eax, %ebx
	movl	%ebx, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	setge	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	check, .-check
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB9:
	.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
.LFE9:
	.size	cmp, .-cmp
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, M(%rip)
	movl	N(%rip), %eax
	movl	M(%rip), %edx
	subl	%edx, %eax
	movl	%eax, K(%rip)
	movl	$0, -36(%rbp)
	jmp	.L24
.L25:
	movl	$0, %eax
	call	in
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	leal	-1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L24:
	movl	M(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L25
	movl	$0, -32(%rbp)
	jmp	.L26
.L27:
	movl	-32(%rbp), %ebx
	leal	1(%rbx), %eax
	movl	%eax, -32(%rbp)
	movl	$0, %eax
	call	in
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movslq	%ebx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L26:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L27
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	d(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	K(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	d2(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -28(%rbp)
	movl	N(%rip), %eax
	movl	%eax, -24(%rbp)
	jmp	.L28
.L30:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	check
	testl	%eax, %eax
	je	.L29
	movl	-20(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L28
.L29:
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L28:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -24(%rbp)
	jg	.L30
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	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:
.LFB54:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE54:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB51:
	.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
	cmpq	%rcx, %rax
	jnb	.L12
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L5:
	xorl	%r12d, %r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L3
.L7:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L9:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L6
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L3
	movq	stdin(%rip), %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L5
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.p2align 4
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB52:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	leaq	d2(%rip), %rcx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	leal	(%rsi,%r8), %eax
	sarl	%eax
	movslq	%eax, %rdx
	cmpl	%edi, (%rcx,%rdx,4)
	jl	.L18
	movl	%eax, %esi
.L15:
	cmpl	%r8d, %esi
	jg	.L16
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	leal	1(%rax), %r8d
	jmp	.L15
	.cfi_endproc
.LFE52:
	.size	binarySearch, .-binarySearch
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB53:
	.cfi_startproc
	endbr64
	movl	N(%rip), %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leal	-1(%rcx), %ebx
	testl	%ecx, %ecx
	jle	.L46
	cmpl	$2, %ebx
	jbe	.L38
	movl	%ecx, %edx
	leaq	dp(%rip), %r8
	movdqa	.LC0(%rip), %xmm0
	shrl	$2, %edx
	leaq	16(%r8), %rsi
	movq	%r8, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L24:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L24
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L26
.L23:
	movslq	%eax, %rdx
	movl	$1, (%r8,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L26
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	$1, (%r8,%rdx,4)
	cmpl	%ecx, %eax
	jge	.L26
	cltq
	movl	$1, (%r8,%rax,4)
.L26:
	movslq	M(%rip), %r9
	xorl	%eax, %eax
	leaq	p(%rip), %rsi
	leaq	d1(%rip), %rcx
	testl	%r9d, %r9d
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L32:
	movslq	(%rsi,%rax,4), %rdx
	cmpl	(%rcx,%rax,4), %edi
	jle	.L30
	addq	$1, %rax
	movl	$1347440720, (%r8,%rdx,4)
	cmpq	%r9, %rax
	jne	.L32
.L22:
	leaq	dp(%rip), %rcx
	movslq	%ebx, %rsi
	movl	$1, %r10d
	leaq	4(%rcx), %r11
	testl	%ebx, %ebx
	jle	.L47
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	(%rcx), %rbx
	movl	4(%rcx), %edx
	movl	8(%rcx), %r8d
	cmpl	%ebx, %edx
	leal	(%rdx,%r8), %eax
	cmovl	%ebx, %edx
	cmpl	%r8d, %edx
	cmovl	%r8d, %edx
	subl	%edx, %eax
	movl	$1347440720, %edx
	cltq
	addq	%rbx, %rax
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	addl	$3, %r10d
	addq	$12, %rcx
	movl	%eax, (%r11,%rsi,4)
	addq	$1, %rsi
	movl	%eax, %r9d
	cmpl	%esi, %r10d
	jle	.L33
.L34:
	movl	K(%rip), %r10d
	xorl	%ecx, %ecx
	leaq	d2(%rip), %r8
	movl	%r10d, %edx
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L37:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpl	(%r8,%rsi,4), %edi
	jg	.L48
	movl	%eax, %edx
.L36:
	cmpl	%ecx, %edx
	jg	.L37
	subl	%ecx, %r10d
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	cmpl	%r9d, %r10d
	setge	%al
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	addq	$1, %rax
	movl	$0, (%r8,%rdx,4)
	cmpq	%rax, %r9
	jne	.L32
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L48:
	leal	1(%rax), %ecx
	jmp	.L36
.L46:
	leaq	dp(%rip), %r8
	jmp	.L26
.L47:
	movl	(%r8,%rsi,4), %r9d
	jmp	.L34
.L38:
	xorl	%eax, %eax
	leaq	dp(%rip), %r8
	jmp	.L23
	.cfi_endproc
.LFE53:
	.size	check, .-check
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	in
	movl	%eax, N(%rip)
	xorl	%eax, %eax
	call	in
	movl	%eax, %edx
	movl	%eax, M(%rip)
	movl	N(%rip), %eax
	movl	%eax, %ecx
	subl	%edx, %ecx
	movl	%ecx, K(%rip)
	testl	%edx, %edx
	jle	.L76
	xorl	%r13d, %r13d
	leaq	d1(%rip), %r12
	leaq	d(%rip), %rbx
	leaq	p(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L63:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L85
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L52:
	xorl	%r14d, %r14d
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L53:
	leaq	1(%rdx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L55
.L54:
	movq	%rsi, %rdx
.L56:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rcx, %rdx
	jb	.L53
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L54
	.p2align 4,,10
	.p2align 3
.L55:
	movl	%r14d, (%r12,%r13,4)
	movl	%r14d, (%rbx,%r13,4)
	cmpq	%rsi, %rcx
	jbe	.L86
	leaq	1(%rsi), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rsi), %eax
.L58:
	xorl	%r14d, %r14d
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L59:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L61
.L60:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L62:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rcx, %rdx
	jb	.L59
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L61
	movq	stdin(%rip), %rdi
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L61:
	subl	$1, %r14d
	movl	%r14d, 0(%rbp,%r13,4)
	leal	1(%r13), %r14d
	addq	$1, %r13
	cmpl	%r13d, M(%rip)
	jg	.L63
	movl	N(%rip), %eax
.L50:
	leaq	d2(%rip), %r12
	cmpl	%eax, %r14d
	jge	.L64
	movslq	%r14d, %r14
	movq	%r14, %rax
	negq	%rax
	leaq	(%r12,%rax,4), %rbp
	.p2align 4,,10
	.p2align 3
.L71:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L87
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L66:
	xorl	%r13d, %r13d
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L67:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L69
.L68:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L70:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L67
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L69
	movq	stdin(%rip), %rdi
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L69:
	movl	N(%rip), %eax
	movl	%r13d, 0(%rbp,%r14,4)
	movl	%r13d, (%rbx,%r14,4)
	addq	$1, %r14
	cmpl	%r14d, %eax
	jg	.L71
.L64:
	leaq	cmp(%rip), %r13
	movslq	%eax, %rsi
	movl	$4, %edx
	movq	%rbx, %rdi
	movq	%r13, %rcx
	call	qsort@PLT
	movq	%r13, %rcx
	movq	%r12, %rdi
	movl	$4, %edx
	movslq	K(%rip), %rsi
	xorl	%r12d, %r12d
	call	qsort@PLT
	movl	N(%rip), %r13d
	cmpl	$1, %r13d
	jle	.L72
	.p2align 4,,10
	.p2align 3
.L75:
	leal	(%r12,%r13), %ebp
	sarl	%ebp
	movslq	%ebp, %rax
	movl	(%rbx,%rax,4), %edi
	call	check
	testl	%eax, %eax
	je	.L73
	leal	1(%rbp), %eax
	movslq	%ebp, %r12
	cmpl	%eax, %r13d
	jg	.L75
.L72:
	movl	(%rbx,%r12,4), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L73:
	.cfi_restore_state
	leal	1(%r12), %eax
	cmpl	%ebp, %eax
	jge	.L72
	movl	%ebp, %r13d
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L87:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L86:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L85:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L52
.L76:
	xorl	%r14d, %r14d
	leaq	d(%rip), %rbx
	jmp	.L50
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 800016
dp:
	.zero	800016
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400016
p:
	.zero	400016
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400016
d:
	.zero	400016
	.globl	d2
	.align 32
	.type	d2, @object
	.size	d2, 400016
d2:
	.zero	400016
	.globl	d1
	.align 32
	.type	d1, @object
	.size	d1, 400016
d1:
	.zero	400016
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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:
.LFB54:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE54:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB51:
	.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
	cmpq	%rcx, %rax
	jnb	.L12
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L5:
	xorl	%r12d, %r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L3
.L7:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L9:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L6
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L3
	movq	stdin(%rip), %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L5
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.p2align 4
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB52:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	leaq	d2(%rip), %rcx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	leal	(%rsi,%r8), %eax
	sarl	%eax
	movslq	%eax, %rdx
	cmpl	%edi, (%rcx,%rdx,4)
	jl	.L18
	movl	%eax, %esi
.L15:
	cmpl	%r8d, %esi
	jg	.L16
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	leal	1(%rax), %r8d
	jmp	.L15
	.cfi_endproc
.LFE52:
	.size	binarySearch, .-binarySearch
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB53:
	.cfi_startproc
	endbr64
	movl	N(%rip), %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leal	-1(%rcx), %ebx
	testl	%ecx, %ecx
	jle	.L46
	cmpl	$2, %ebx
	jbe	.L38
	movl	%ecx, %edx
	leaq	dp(%rip), %r8
	movdqa	.LC0(%rip), %xmm0
	shrl	$2, %edx
	leaq	16(%r8), %rsi
	movq	%r8, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L24:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L24
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L26
.L23:
	movslq	%eax, %rdx
	movl	$1, (%r8,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L26
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	$1, (%r8,%rdx,4)
	cmpl	%ecx, %eax
	jge	.L26
	cltq
	movl	$1, (%r8,%rax,4)
.L26:
	movslq	M(%rip), %r9
	xorl	%eax, %eax
	leaq	p(%rip), %rsi
	leaq	d1(%rip), %rcx
	testl	%r9d, %r9d
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L32:
	movslq	(%rsi,%rax,4), %rdx
	cmpl	(%rcx,%rax,4), %edi
	jle	.L30
	addq	$1, %rax
	movl	$1347440720, (%r8,%rdx,4)
	cmpq	%r9, %rax
	jne	.L32
.L22:
	leaq	dp(%rip), %rcx
	movslq	%ebx, %rsi
	movl	$1, %r10d
	leaq	4(%rcx), %r11
	testl	%ebx, %ebx
	jle	.L47
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	(%rcx), %rbx
	movl	4(%rcx), %edx
	movl	8(%rcx), %r8d
	cmpl	%ebx, %edx
	leal	(%rdx,%r8), %eax
	cmovl	%ebx, %edx
	cmpl	%r8d, %edx
	cmovl	%r8d, %edx
	subl	%edx, %eax
	movl	$1347440720, %edx
	cltq
	addq	%rbx, %rax
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	addl	$3, %r10d
	addq	$12, %rcx
	movl	%eax, (%r11,%rsi,4)
	addq	$1, %rsi
	movl	%eax, %r9d
	cmpl	%esi, %r10d
	jle	.L33
.L34:
	movl	K(%rip), %r10d
	xorl	%ecx, %ecx
	leaq	d2(%rip), %r8
	movl	%r10d, %edx
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L37:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpl	(%r8,%rsi,4), %edi
	jg	.L48
	movl	%eax, %edx
.L36:
	cmpl	%ecx, %edx
	jg	.L37
	subl	%ecx, %r10d
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	cmpl	%r9d, %r10d
	setge	%al
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	addq	$1, %rax
	movl	$0, (%r8,%rdx,4)
	cmpq	%rax, %r9
	jne	.L32
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L48:
	leal	1(%rax), %ecx
	jmp	.L36
.L46:
	leaq	dp(%rip), %r8
	jmp	.L26
.L47:
	movl	(%r8,%rsi,4), %r9d
	jmp	.L34
.L38:
	xorl	%eax, %eax
	leaq	dp(%rip), %r8
	jmp	.L23
	.cfi_endproc
.LFE53:
	.size	check, .-check
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	in
	movl	%eax, N(%rip)
	xorl	%eax, %eax
	call	in
	movl	%eax, %edx
	movl	%eax, M(%rip)
	movl	N(%rip), %eax
	movl	%eax, %ecx
	subl	%edx, %ecx
	movl	%ecx, K(%rip)
	testl	%edx, %edx
	jle	.L76
	xorl	%r13d, %r13d
	leaq	d1(%rip), %r12
	leaq	d(%rip), %rbx
	leaq	p(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L63:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L85
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L52:
	xorl	%r14d, %r14d
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L53:
	leaq	1(%rdx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L55
.L54:
	movq	%rsi, %rdx
.L56:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rcx, %rdx
	jb	.L53
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L54
	.p2align 4,,10
	.p2align 3
.L55:
	movl	%r14d, (%r12,%r13,4)
	movl	%r14d, (%rbx,%r13,4)
	cmpq	%rsi, %rcx
	jbe	.L86
	leaq	1(%rsi), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rsi), %eax
.L58:
	xorl	%r14d, %r14d
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L59:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L61
.L60:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L62:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rcx, %rdx
	jb	.L59
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L61
	movq	stdin(%rip), %rdi
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L61:
	subl	$1, %r14d
	movl	%r14d, 0(%rbp,%r13,4)
	leal	1(%r13), %r14d
	addq	$1, %r13
	cmpl	%r13d, M(%rip)
	jg	.L63
	movl	N(%rip), %eax
.L50:
	leaq	d2(%rip), %r12
	cmpl	%eax, %r14d
	jge	.L64
	movslq	%r14d, %r14
	movq	%r14, %rax
	negq	%rax
	leaq	(%r12,%rax,4), %rbp
	.p2align 4,,10
	.p2align 3
.L71:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L87
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L66:
	xorl	%r13d, %r13d
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L67:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L69
.L68:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L70:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L67
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L69
	movq	stdin(%rip), %rdi
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L69:
	movl	N(%rip), %eax
	movl	%r13d, 0(%rbp,%r14,4)
	movl	%r13d, (%rbx,%r14,4)
	addq	$1, %r14
	cmpl	%r14d, %eax
	jg	.L71
.L64:
	leaq	cmp(%rip), %r13
	movslq	%eax, %rsi
	movl	$4, %edx
	movq	%rbx, %rdi
	movq	%r13, %rcx
	call	qsort@PLT
	movq	%r13, %rcx
	movq	%r12, %rdi
	movl	$4, %edx
	movslq	K(%rip), %rsi
	xorl	%r12d, %r12d
	call	qsort@PLT
	movl	N(%rip), %r13d
	cmpl	$1, %r13d
	jle	.L72
	.p2align 4,,10
	.p2align 3
.L75:
	leal	(%r12,%r13), %ebp
	sarl	%ebp
	movslq	%ebp, %rax
	movl	(%rbx,%rax,4), %edi
	call	check
	testl	%eax, %eax
	je	.L73
	leal	1(%rbp), %eax
	movslq	%ebp, %r12
	cmpl	%eax, %r13d
	jg	.L75
.L72:
	movl	(%rbx,%r12,4), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
	.p2align 4,,10
	.p2align 3
.L73:
	.cfi_restore_state
	leal	1(%r12), %eax
	cmpl	%ebp, %eax
	jge	.L72
	movl	%ebp, %r13d
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L87:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L66
	.p2align 4,,10
	.p2align 3
.L86:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L85:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L52
.L76:
	xorl	%r14d, %r14d
	leaq	d(%rip), %rbx
	jmp	.L50
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	dp
	.bss
	.align 32
	.type	dp, @object
	.size	dp, 800016
dp:
	.zero	800016
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400016
p:
	.zero	400016
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400016
d:
	.zero	400016
	.globl	d2
	.align 32
	.type	d2, @object
	.size	d2, 400016
d2:
	.zero	400016
	.globl	d1
	.align 32
	.type	d1, @object
	.size	d1, 400016
d1:
	.zero	400016
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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 0617 Ball
// 2018.3.31 bal4u

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

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0, c = getchar_unlocked();
	do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

#define INF 0x50505050
int N, M, K;
int d1[100004], d2[100004], d[100004];
int  p[100004];
int dp[200004];

int binarySearch(int x, int n)
{
	int m, l = 0, r = n;

    while (l < r) {
        m = (l + r) >> 1;
        if (d2[m] < x) l = m + 1; else r = m;
    }
	return l;
}

int check(int k)
{
	int i, m, t;
	long long s;

	for (i = 0; i < N; i++) dp[i] = 1;
	for (i = 0; i < M; i++) {
		m = p[i], dp[m] = 0;
		if (d1[i] < k) dp[m] = INF;
	}
	m = N-1; for (i = 1; i <= m; i+=3) {
		s = t = dp[i-1];
		if (t < dp[i  ]) t = dp[i];
		if (t < dp[i+1]) t = dp[i+1];
		s += dp[i]+dp[i+1]-t;
		if (s > INF) s = INF;
		dp[++m] = (int)s;
	}
	return K-binarySearch(k, K) >= dp[m];
}
 
int cmp(int *a, int *b) { return *a - *b; }

int main()
{
	int i, m, lo, hi, mi;
	N = in(), M = in(), K = N-M;
	for (i = 0; i < M; i++) d[i] = d1[i] = in(), p[i] = in()-1;
	m = 0; for (; i < N; i++) d[i] = d2[m++] = in();
	qsort(d , N, sizeof(int), cmp);
	qsort(d2, K, sizeof(int), cmp);

	lo = 0, hi = N;
	while (lo + 1 < hi) {
		mi = (lo + hi) >> 1;
		if (check(d[mi])) lo = mi; else hi = mi;
	}
	printf("%d\n", d[lo]);
	return 0;
}

7 3
5 2
5 5
4 6
6
2
8
9
 7 3
5 2
5 5
8 6
1
2
8
9
 7 2
3 2
5 5
8 6
1
7
8
9
 7 3
3 2
5 5
11 6
1
13
8
9
 7 3
2 1
5 5
11 6
1
13
8
10
 7 3
-1 3
1 2
8 11
1
0
15
9
 7 3
3 2
3 3
13 6
0
2
8
0
 7 3
0 2
5 5
8 6
1
3
2
9
 7 2
3 2
3 3
0 6
0
12
4
0
 7 3
3 2
6 3
43 6
1
12
14
0

6
 8
 7
 9
 10
 9
 3
 5
 4
 12

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

```c
// AOJ 0617 Ball
// 2018.3.31 bal4u

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

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0, c = getchar_unlocked();
	do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

#define INF 0x50505050
int N, M, K;
int d1[100004], d2[100004], d[100004];
int  p[100004];
int dp[200004];

int binarySearch(int x, int n)
{
	int m, l = 0, r = n;

    while (l < r) {
        m = (l + r) >> 1;
        if (d2[m] < x) l = m + 1; else r = m;
    }
	return l;
}

int check(int k)
{
	int i, m, t;
	long long s;

	for (i = 0; i < N; i++) dp[i] = 1;
	for (i = 0; i < M; i++) {
		m = p[i], dp[m] = 0;
		if (d1[i] < k) dp[m] = INF;
	}
	m = N-1; for (i = 1; i <= m; i+=3) {
		s = t = dp[i-1];
		if (t < dp[i  ]) t = dp[i];
		if (t < dp[i+1]) t = dp[i+1];
		s += dp[i]+dp[i+1]-t;
		if (s > INF) s = INF;
		dp[++m] = (int)s;
	}
	return K-binarySearch(k, K) >= dp[m];
}
 
int cmp(int *a, int *b) { return *a - *b; }

int main()
{
	int i, m, lo, hi, mi;
	N = in(), M = in(), K = N-M;
	for (i = 0; i < M; i++) d[i] = d1[i] = in(), p[i] = in()-1;
	m = 0; for (; i < N; i++) d[i] = d2[m++] = in();
	qsort(d , N, sizeof(int), cmp);
	qsort(d2, K, sizeof(int), cmp);

	lo = 0, hi = N;
	while (lo + 1 < hi) {
		mi = (lo + hi) >> 1;
		if (check(d[mi])) lo = mi; else hi = mi;
	}
	printf("%d\n", d[lo]);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%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	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	d1
	.align 32
	.type	d1, @object
	.size	d1, 400016
d1:
	.zero	400016
	.globl	d2
	.align 32
	.type	d2, @object
	.size	d2, 400016
d2:
	.zero	400016
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400016
d:
	.zero	400016
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400016
p:
	.zero	400016
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 800016
dp:
	.zero	800016
	.text
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB7:
	.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	$0, -12(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L7:
	movl	-12(%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	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L6
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L5:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L7
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	binarySearch, .-binarySearch
	.globl	check
	.type	check, @function
check:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -44(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L10
.L11:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L11
	movl	$0, -28(%rbp)
	jmp	.L12
.L14:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L13
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1347440720, (%rdx,%rax)
.L13:
	addl	$1, -28(%rbp)
.L12:
	movl	M(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L14
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L15
.L19:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, -16(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L16
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L16:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L17
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	subl	-20(%rbp), %eax
	cltq
	addq	%rax, -16(%rbp)
	cmpq	$1347440720, -16(%rbp)
	jle	.L18
	movq	$1347440720, -16(%rbp)
.L18:
	addl	$1, -24(%rbp)
	movq	-16(%rbp), %rax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$3, -28(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	K(%rip), %ebx
	movl	K(%rip), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	binarySearch
	subl	%eax, %ebx
	movl	%ebx, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	setge	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	check, .-check
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB9:
	.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
.LFE9:
	.size	cmp, .-cmp
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, M(%rip)
	movl	N(%rip), %eax
	movl	M(%rip), %edx
	subl	%edx, %eax
	movl	%eax, K(%rip)
	movl	$0, -36(%rbp)
	jmp	.L24
.L25:
	movl	$0, %eax
	call	in
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	leal	-1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L24:
	movl	M(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L25
	movl	$0, -32(%rbp)
	jmp	.L26
.L27:
	movl	-32(%rbp), %ebx
	leal	1(%rbx), %eax
	movl	%eax, -32(%rbp)
	movl	$0, %eax
	call	in
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movslq	%ebx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L26:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L27
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	d(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	K(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	d2(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -28(%rbp)
	movl	N(%rip), %eax
	movl	%eax, -24(%rbp)
	jmp	.L28
.L30:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	check
	testl	%eax, %eax
	je	.L29
	movl	-20(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L28
.L29:
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L28:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -24(%rbp)
	jg	.L30
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	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	in
	.type	in, @function
in:
.LFB6:
	.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%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	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	K
	.align 4
	.type	K, @object
	.size	K, 4
K:
	.zero	4
	.globl	d1
	.align 32
	.type	d1, @object
	.size	d1, 400016
d1:
	.zero	400016
	.globl	d2
	.align 32
	.type	d2, @object
	.size	d2, 400016
d2:
	.zero	400016
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400016
d:
	.zero	400016
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400016
p:
	.zero	400016
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 800016
dp:
	.zero	800016
	.text
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB7:
	.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	$0, -12(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L7:
	movl	-12(%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	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L6
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L5:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L7
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	binarySearch, .-binarySearch
	.globl	check
	.type	check, @function
check:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -44(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L10
.L11:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -28(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L11
	movl	$0, -28(%rbp)
	jmp	.L12
.L14:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L13
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	$1347440720, (%rdx,%rax)
.L13:
	addl	$1, -28(%rbp)
.L12:
	movl	M(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L14
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L15
.L19:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, -16(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L16
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L16:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L17
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	subl	-20(%rbp), %eax
	cltq
	addq	%rax, -16(%rbp)
	cmpq	$1347440720, -16(%rbp)
	jle	.L18
	movq	$1347440720, -16(%rbp)
.L18:
	addl	$1, -24(%rbp)
	movq	-16(%rbp), %rax
	movl	%eax, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$3, -28(%rbp)
.L15:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	K(%rip), %ebx
	movl	K(%rip), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	binarySearch
	subl	%eax, %ebx
	movl	%ebx, %ecx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dp(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	setge	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	check, .-check
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB9:
	.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
.LFE9:
	.size	cmp, .-cmp
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, %eax
	call	in
	movl	%eax, N(%rip)
	movl	$0, %eax
	call	in
	movl	%eax, M(%rip)
	movl	N(%rip), %eax
	movl	M(%rip), %edx
	subl	%edx, %eax
	movl	%eax, K(%rip)
	movl	$0, -36(%rbp)
	jmp	.L24
.L25:
	movl	$0, %eax
	call	in
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d1(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	leal	-1(%rax), %ecx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -36(%rbp)
.L24:
	movl	M(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L25
	movl	$0, -32(%rbp)
	jmp	.L26
.L27:
	movl	-32(%rbp), %ebx
	leal	1(%rbx), %eax
	movl	%eax, -32(%rbp)
	movl	$0, %eax
	call	in
	movslq	%ebx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movslq	%ebx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	d(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -36(%rbp)
.L26:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L27
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	d(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	K(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	d2(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -28(%rbp)
	movl	N(%rip), %eax
	movl	%eax, -24(%rbp)
	jmp	.L28
.L30:
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	check
	testl	%eax, %eax
	je	.L29
	movl	-20(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L28
.L29:
	movl	-20(%rbp), %eax
	movl	%eax, -24(%rbp)
.L28:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -24(%rbp)
	jg	.L30
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	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:
