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

```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int D,N,M,m,d,k,i,S[100009],r;

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

int sch()
{
	int i=S[N/2]<d?N/2:0;
	int e=i+N/2+1;
	int r=1000000000;
	for(;i<=e;i++)
		r=r>abs(S[i]-d)?abs(S[i]-d):r;
	return r;
}

int main()
{
	for(;scanf("%d",&D),D;)
	{
		r=0;
		scanf("%d%d",&N,&M);
		memset(S,0,sizeof(S));
		for(i=1;i<N;i++)
			scanf("%d",&S[i]);
		S[N]=D;
		qsort(S,N+1,4,cmp);

		for(i=0;i<M;i++)
		{
			scanf("%d",&d);
			r+=sch();
		}
		printf("%d\n",r);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	D
	.bss
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	N
	.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	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400036
S:
	.zero	400036
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.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	sch
	.type	sch, @function
sch:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	d(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L5
.L4:
	movl	$0, %eax
.L5:
	movl	%eax, -12(%rbp)
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	$1000000000, -8(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	d(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	-8(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L7
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sch, .-sch
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L10
.L15:
	movl	$0, r(%rip)
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$400036, %edx
	movl	$0, %esi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, i(%rip)
	jmp	.L11
.L12:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	N(%rip), %edx
	movl	D(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	N(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, i(%rip)
	jmp	.L13
.L14:
	leaq	d(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	sch
	movl	r(%rip), %edx
	addl	%edx, %eax
	movl	%eax, r(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L13:
	movl	i(%rip), %edx
	movl	M(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	r(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	D(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.p2align 4
	.globl	sch
	.type	sch, @function
sch:
.LFB52:
	.cfi_startproc
	endbr64
	movl	N(%rip), %eax
	leaq	S(%rip), %r9
	movl	d(%rip), %r8d
	xorl	%esi, %esi
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	movslq	%edi, %rax
	cmpl	%r8d, (%r9,%rax,4)
	jge	.L4
	movl	%edi, %esi
	addl	%edi, %edi
.L4:
	leal	1(%rdi), %eax
	cmpl	%eax, %esi
	jg	.L11
	movl	%edi, %eax
	subl	%esi, %eax
	leal	2(%rax), %r10d
	addl	$1, %eax
	cmpl	$2, %eax
	jbe	.L12
	movslq	%esi, %rax
	movd	%r8d, %xmm4
	movdqa	.LC0(%rip), %xmm1
	leaq	(%r9,%rax,4), %rdx
	movl	%r10d, %eax
	pshufd	$0, %xmm4, %xmm3
	shrl	$2, %eax
	leal	-1(%rax), %ecx
	leaq	16(%rdx), %rax
	salq	$4, %rcx
	addq	%rax, %rcx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$16, %rax
.L7:
	movdqu	(%rdx), %xmm0
	movq	%rax, %rdx
	psubd	%xmm3, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rcx, %rax
	jne	.L15
	movdqa	%xmm1, %xmm2
	movl	%r10d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm0
	addl	%edx, %esi
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edx, %r10d
	je	.L16
.L6:
	movslq	%esi, %rdx
	leal	1(%rsi), %r10d
	movl	(%r9,%rdx,4), %edx
	subl	%r8d, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	cmpl	%esi, %edi
	jl	.L3
	movslq	%r10d, %rdx
	movl	(%r9,%rdx,4), %edx
	subl	%r8d, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	2(%rsi), %edx
	cmpl	%edi, %r10d
	jg	.L3
	movslq	%edx, %rdx
	movl	(%r9,%rdx,4), %edx
	subl	%r8d, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$1000000000, %eax
.L3:
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	ret
.L12:
	movl	$1000000000, %eax
	jmp	.L6
	.cfi_endproc
.LFE52:
	.size	sch, .-sch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	M(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	D(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	D(%rip), %eax
	testl	%eax, %eax
	je	.L39
	movq	%r15, %rdx
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	S(%rip), %r13
	movl	$0, r(%rip)
	call	__isoc99_scanf@PLT
	movl	$400036, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
	movl	N(%rip), %edx
	movl	$1, i(%rip)
	cmpl	$1, %edx
	jle	.L19
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	cltq
	movq	%rbx, %rdi
	leaq	0(%r13,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	N(%rip), %edx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L20
.L19:
	movl	D(%rip), %ecx
	movslq	%edx, %rax
	addl	$1, %edx
	movq	%r13, %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	movl	%ecx, 0(%r13,%rax,4)
	leaq	cmp(%rip), %rcx
	call	qsort@PLT
	movl	M(%rip), %edx
	movl	$0, i(%rip)
	testl	%edx, %edx
	jle	.L21
	leaq	d(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	movl	d(%rip), %edi
	xorl	%ecx, %ecx
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	movslq	%esi, %rax
	cmpl	%edi, 0(%r13,%rax,4)
	jge	.L22
	movl	%esi, %ecx
	addl	%esi, %esi
.L22:
	leal	1(%rsi), %eax
	cmpl	%eax, %ecx
	jg	.L32
	movl	%esi, %eax
	subl	%ecx, %eax
	leal	2(%rax), %r10d
	addl	$1, %eax
	cmpl	$2, %eax
	jbe	.L33
	movslq	%ecx, %rax
	movd	%edi, %xmm4
	movdqa	.LC0(%rip), %xmm1
	leaq	0(%r13,%rax,4), %rdx
	movl	%r10d, %eax
	pshufd	$0, %xmm4, %xmm3
	shrl	$2, %eax
	leal	-1(%rax), %r9d
	leaq	16(%rdx), %rax
	salq	$4, %r9
	addq	%rax, %r9
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L40:
	addq	$16, %rax
.L25:
	movdqu	(%rdx), %xmm0
	movq	%rax, %rdx
	psubd	%xmm3, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%r9, %rax
	jne	.L40
	movdqa	%xmm1, %xmm2
	movl	%r10d, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm0
	addl	%eax, %ecx
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%r10d, %eax
	je	.L23
.L24:
	movslq	%ecx, %rax
	movl	0(%r13,%rax,4), %eax
	subl	%edi, %eax
	movl	%eax, %r9d
	negl	%r9d
	cmovns	%r9d, %eax
	leal	1(%rcx), %r9d
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	cmpl	%esi, %ecx
	jg	.L23
	movslq	%r9d, %rax
	movl	0(%r13,%rax,4), %eax
	subl	%edi, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovns	%r10d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	leal	2(%rcx), %eax
	cmpl	%esi, %r9d
	jg	.L23
	cltq
	movl	0(%r13,%rax,4), %eax
	subl	%edi, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L23:
	movl	i(%rip), %eax
	addl	r(%rip), %edx
	movl	%edx, r(%rip)
	addl	$1, %eax
	cmpl	M(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L28
.L29:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L32:
	movl	$1000000000, %edx
	jmp	.L23
.L33:
	movl	$1000000000, %edx
	jmp	.L24
.L39:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movl	r(%rip), %edx
	jmp	.L29
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	r
	.bss
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400036
S:
	.zero	400036
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.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
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1000000000
	.long	1000000000
	.long	1000000000
	.long	1000000000
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.p2align 4
	.globl	sch
	.type	sch, @function
sch:
.LFB52:
	.cfi_startproc
	endbr64
	movl	N(%rip), %eax
	leaq	S(%rip), %r9
	movl	d(%rip), %r8d
	xorl	%esi, %esi
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	movslq	%edi, %rax
	cmpl	%r8d, (%r9,%rax,4)
	jge	.L4
	movl	%edi, %esi
	addl	%edi, %edi
.L4:
	leal	1(%rdi), %eax
	cmpl	%eax, %esi
	jg	.L11
	movl	%edi, %eax
	subl	%esi, %eax
	leal	2(%rax), %r10d
	addl	$1, %eax
	cmpl	$2, %eax
	jbe	.L12
	movslq	%esi, %rax
	movd	%r8d, %xmm4
	movdqa	.LC0(%rip), %xmm1
	leaq	(%r9,%rax,4), %rdx
	movl	%r10d, %eax
	pshufd	$0, %xmm4, %xmm3
	shrl	$2, %eax
	leal	-1(%rax), %ecx
	leaq	16(%rdx), %rax
	salq	$4, %rcx
	addq	%rax, %rcx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$16, %rax
.L7:
	movdqu	(%rdx), %xmm0
	movq	%rax, %rdx
	psubd	%xmm3, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rcx, %rax
	jne	.L15
	movdqa	%xmm1, %xmm2
	movl	%r10d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm0
	addl	%edx, %esi
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edx, %r10d
	je	.L16
.L6:
	movslq	%esi, %rdx
	leal	1(%rsi), %r10d
	movl	(%r9,%rdx,4), %edx
	subl	%r8d, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	cmpl	%esi, %edi
	jl	.L3
	movslq	%r10d, %rdx
	movl	(%r9,%rdx,4), %edx
	subl	%r8d, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	2(%rsi), %edx
	cmpl	%edi, %r10d
	jg	.L3
	movslq	%edx, %rdx
	movl	(%r9,%rdx,4), %edx
	subl	%r8d, %edx
	movl	%edx, %ecx
	negl	%ecx
	cmovns	%ecx, %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$1000000000, %eax
.L3:
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	ret
.L12:
	movl	$1000000000, %eax
	jmp	.L6
	.cfi_endproc
.LFE52:
	.size	sch, .-sch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	M(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	D(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	D(%rip), %eax
	testl	%eax, %eax
	je	.L39
	movq	%r15, %rdx
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	S(%rip), %r13
	movl	$0, r(%rip)
	call	__isoc99_scanf@PLT
	movl	$400036, %edx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
	movl	N(%rip), %edx
	movl	$1, i(%rip)
	cmpl	$1, %edx
	jle	.L19
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	cltq
	movq	%rbx, %rdi
	leaq	0(%r13,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	N(%rip), %edx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L20
.L19:
	movl	D(%rip), %ecx
	movslq	%edx, %rax
	addl	$1, %edx
	movq	%r13, %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	movl	%ecx, 0(%r13,%rax,4)
	leaq	cmp(%rip), %rcx
	call	qsort@PLT
	movl	M(%rip), %edx
	movl	$0, i(%rip)
	testl	%edx, %edx
	jle	.L21
	leaq	d(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	movl	d(%rip), %edi
	xorl	%ecx, %ecx
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	movslq	%esi, %rax
	cmpl	%edi, 0(%r13,%rax,4)
	jge	.L22
	movl	%esi, %ecx
	addl	%esi, %esi
.L22:
	leal	1(%rsi), %eax
	cmpl	%eax, %ecx
	jg	.L32
	movl	%esi, %eax
	subl	%ecx, %eax
	leal	2(%rax), %r10d
	addl	$1, %eax
	cmpl	$2, %eax
	jbe	.L33
	movslq	%ecx, %rax
	movd	%edi, %xmm4
	movdqa	.LC0(%rip), %xmm1
	leaq	0(%r13,%rax,4), %rdx
	movl	%r10d, %eax
	pshufd	$0, %xmm4, %xmm3
	shrl	$2, %eax
	leal	-1(%rax), %r9d
	leaq	16(%rdx), %rax
	salq	$4, %r9
	addq	%rax, %r9
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L40:
	addq	$16, %rax
.L25:
	movdqu	(%rdx), %xmm0
	movq	%rax, %rdx
	psubd	%xmm3, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%r9, %rax
	jne	.L40
	movdqa	%xmm1, %xmm2
	movl	%r10d, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm0
	addl	%eax, %ecx
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%r10d, %eax
	je	.L23
.L24:
	movslq	%ecx, %rax
	movl	0(%r13,%rax,4), %eax
	subl	%edi, %eax
	movl	%eax, %r9d
	negl	%r9d
	cmovns	%r9d, %eax
	leal	1(%rcx), %r9d
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	cmpl	%esi, %ecx
	jg	.L23
	movslq	%r9d, %rax
	movl	0(%r13,%rax,4), %eax
	subl	%edi, %eax
	movl	%eax, %r10d
	negl	%r10d
	cmovns	%r10d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	leal	2(%rcx), %eax
	cmpl	%esi, %r9d
	jg	.L23
	cltq
	movl	0(%r13,%rax,4), %eax
	subl	%edi, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L23:
	movl	i(%rip), %eax
	addl	r(%rip), %edx
	movl	%edx, r(%rip)
	addl	$1, %eax
	cmpl	M(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L28
.L29:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L32:
	movl	$1000000000, %edx
	jmp	.L23
.L33:
	movl	$1000000000, %edx
	jmp	.L24
.L39:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movl	r(%rip), %edx
	jmp	.L29
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	r
	.bss
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400036
S:
	.zero	400036
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.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
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1000000000
	.long	1000000000
	.long	1000000000
	.long	1000000000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int D,N,M,m,d,k,i,S[100009],r;

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

int sch()
{
	int i=S[N/2]<d?N/2:0;
	int e=i+N/2+1;
	int r=1000000000;
	for(;i<=e;i++)
		r=r>abs(S[i]-d)?abs(S[i]-d):r;
	return r;
}

int main()
{
	for(;scanf("%d",&D),D;)
	{
		r=0;
		scanf("%d%d",&N,&M);
		memset(S,0,sizeof(S));
		for(i=1;i<N;i++)
			scanf("%d",&S[i]);
		S[N]=D;
		qsort(S,N+1,4,cmp);

		for(i=0;i<M;i++)
		{
			scanf("%d",&d);
			r+=sch();
		}
		printf("%d\n",r);
	}
	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
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int D,N,M,m,d,k,i,S[100009],r;

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

int sch()
{
	int i=S[N/2]<d?N/2:0;
	int e=i+N/2+1;
	int r=1000000000;
	for(;i<=e;i++)
		r=r>abs(S[i]-d)?abs(S[i]-d):r;
	return r;
}

int main()
{
	for(;scanf("%d",&D),D;)
	{
		r=0;
		scanf("%d%d",&N,&M);
		memset(S,0,sizeof(S));
		for(i=1;i<N;i++)
			scanf("%d",&S[i]);
		S[N]=D;
		qsort(S,N+1,4,cmp);

		for(i=0;i<M;i++)
		{
			scanf("%d",&d);
			r+=sch();
		}
		printf("%d\n",r);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	D
	.bss
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	N
	.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	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400036
S:
	.zero	400036
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.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	sch
	.type	sch, @function
sch:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	d(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L5
.L4:
	movl	$0, %eax
.L5:
	movl	%eax, -12(%rbp)
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	$1000000000, -8(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	d(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	-8(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L7
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sch, .-sch
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L10
.L15:
	movl	$0, r(%rip)
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$400036, %edx
	movl	$0, %esi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, i(%rip)
	jmp	.L11
.L12:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	N(%rip), %edx
	movl	D(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	N(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, i(%rip)
	jmp	.L13
.L14:
	leaq	d(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	sch
	movl	r(%rip), %edx
	addl	%edx, %eax
	movl	%eax, r(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L13:
	movl	i(%rip), %edx
	movl	M(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	r(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	D(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	D
	.bss
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	N
	.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	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400036
S:
	.zero	400036
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.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	sch
	.type	sch, @function
sch:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	d(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jmp	.L5
.L4:
	movl	$0, %eax
.L5:
	movl	%eax, -12(%rbp)
	movl	N(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	$1000000000, -8(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	d(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	-8(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L6:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L7
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sch, .-sch
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L10
.L15:
	movl	$0, r(%rip)
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$400036, %edx
	movl	$0, %esi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, i(%rip)
	jmp	.L11
.L12:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	S(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L12
	movl	N(%rip), %edx
	movl	D(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	S(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	N(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	S(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, i(%rip)
	jmp	.L13
.L14:
	leaq	d(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	call	sch
	movl	r(%rip), %edx
	addl	%edx, %eax
	movl	%eax, r(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L13:
	movl	i(%rip), %edx
	movl	M(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	r(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	D(%rip), %eax
	testl	%eax, %eax
	jne	.L15
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
