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 <string.h>
#include <stdlib.h>
typedef long long ll;

int	desc(const void *a, const void *b)
{
	long *A = (long *)a;
	long *B = (long *)b;
	if (*B > *A) return 1;
	if (*B < *A) return -1;
	return 0;
}

int asc(const void *a, const void *b) {
	long *A = (long *)a;
	long *B = (long *)b;
	if (*A > *B) return 1;
	if (*A < *B) return -1;
	return 0;
}


int main()
{
	int n,k;
	scanf("%d%d", &n,&k);
	long h[n];
	long d[n-1];
	long i = 0;
	while (i < n)
	{
		scanf("%ld", &h[i]);
		i++;
	}
	qsort(h, sizeof h / sizeof *h , sizeof *h, desc);
	long j;
	i = 0;
	long min = __LONG_MAX__;
	long sum;
	while (i <= n - k)
	{
		j = i;
		sum = 0;
		// printf("%ld\n", h[i]);
		while (j < (i + k) - 1)
		{
			sum += h[j] - h[j + 1];
			j++;
		}
		// printf("min = %ld\n", sum);
		if (sum <= min)
			min = sum;
		i++;
	}
	printf("%ld", min);


	// i = 0;
	// while (i < n- 1)
	// {
	// 	d[i] = h[i] - h[i+1];
	// 	i++;
	// }
	// qsort(d, sizeof d / sizeof *d , sizeof *d, asc);
	// long ans=0;
	// i = 0;
	// while (i < k - 1)
	// {
	// 	ans += d[i];
	// 	i++;
	// }
	// printf("%ld",ans);
	return (0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	desc
	.type	desc, @function
desc:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	desc, .-desc
	.globl	asc
	.type	asc, @function
asc:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L8
	movl	$-1, %eax
	jmp	.L7
.L8:
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	addq	$-128, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-108(%rbp), %rdx
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-112(%rbp), %ebx
	movslq	%ebx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ebx, %rax
	movq	%rax, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%ebx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	-112(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L16
.L17:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L16:
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jl	.L17
	movslq	%ebx, %rax
	salq	$3, %rax
	shrq	$3, %rax
	movq	%rax, %rsi
	movq	-64(%rbp), %rax
	leaq	desc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -104(%rbp)
	movabsq	$9223372036854775807, %rax
	movq	%rax, -88(%rbp)
	jmp	.L18
.L22:
	movq	-104(%rbp), %rax
	movq	%rax, -96(%rbp)
	movq	$0, -80(%rbp)
	jmp	.L19
.L20:
	movq	-64(%rbp), %rax
	movq	-96(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-96(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-64(%rbp), %rax
	movq	(%rax,%rcx,8), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	addq	%rax, -80(%rbp)
	addq	$1, -96(%rbp)
.L19:
	movl	-108(%rbp), %eax
	movslq	%eax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	subq	$1, %rax
	cmpq	%rax, -96(%rbp)
	jl	.L20
	movq	-80(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jg	.L21
	movq	-80(%rbp), %rax
	movq	%rax, -88(%rbp)
.L21:
	addq	$1, -104(%rbp)
.L18:
	movl	-112(%rbp), %eax
	movl	-108(%rbp), %edx
	subl	%edx, %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jle	.L22
	movq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	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	desc
	.type	desc, @function
desc:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rsi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	desc, .-desc
	.p2align 4
	.globl	asc
	.type	asc, @function
asc:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L5
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L5:
	ret
	.cfi_endproc
.LFE52:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %r15
	movq	%rsp, %rsi
	leaq	15(,%r15,8), %rax
	movq	%r15, %rcx
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L10
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L10:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L11:
	movq	%rsp, %rbx
	testl	%ecx, %ecx
	jle	.L33
	movq	%rbx, %r14
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jg	.L15
.L16:
	leaq	desc(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	movabsq	$2305843009213693951, %rsi
	andq	%r15, %rsi
	call	qsort@PLT
	movslq	-60(%rbp), %r13
	movl	-64(%rbp), %eax
	movabsq	$9223372036854775807, %r8
	subl	%r13d, %eax
	js	.L14
	leaq	-1(%r13), %r9
	cltq
	movq	%rbx, %r14
	xorl	%esi, %esi
	movq	%r9, %rdi
	movq	%r9, %r11
	leaq	1(%rax), %r10
	movabsq	$9223372036854775807, %r8
	shrq	%rdi
	andq	$-2, %r11
	salq	$4, %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	(%rsi,%r9), %rax
	cmpq	%rsi, %rax
	jle	.L34
	cmpq	$2, %r13
	je	.L24
	leaq	8(%r14), %rcx
	xorl	%eax, %eax
	pxor	%xmm0, %xmm0
	.p2align 4,,10
	.p2align 3
.L19:
	movdqu	(%r14,%rax), %xmm1
	movdqu	(%rcx,%rax), %xmm2
	addq	$16, %rax
	psubq	%xmm2, %xmm1
	paddq	%xmm1, %xmm0
	cmpq	%rax, %rdi
	jne	.L19
	movdqa	%xmm0, %xmm1
	leaq	(%r11,%rsi), %rdx
	psrldq	$8, %xmm1
	paddq	%xmm1, %xmm0
	movq	%xmm0, %rax
	cmpq	%r9, %r11
	je	.L22
.L18:
	addq	(%rbx,%rdx,8), %rax
	subq	8(%rbx,%rdx,8), %rax
.L22:
	cmpq	%rax, %r8
	movq	%rcx, %r14
	cmovg	%rax, %r8
	addq	$1, %rsi
	cmpq	%r10, %rsi
	jne	.L17
.L14:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L35
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	xorl	%eax, %eax
	leaq	8(%r14), %rcx
	jmp	.L22
.L24:
	movq	%rsi, %rdx
	xorl	%eax, %eax
	leaq	8(%r14), %rcx
	jmp	.L18
.L32:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L11
.L33:
	leaq	.LC1(%rip), %r12
	jmp	.L16
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	desc
	.type	desc, @function
desc:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rsi)
	jg	.L1
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	desc, .-desc
	.p2align 4
	.globl	asc
	.type	asc, @function
asc:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L5
	setl	%al
	movzbl	%al, %eax
	negl	%eax
.L5:
	ret
	.cfi_endproc
.LFE52:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %r15
	movq	%rsp, %rsi
	leaq	15(,%r15,8), %rax
	movq	%r15, %rcx
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L10
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L10:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L11:
	movq	%rsp, %rbx
	testl	%ecx, %ecx
	jle	.L33
	movq	%rbx, %r14
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jg	.L15
.L16:
	leaq	desc(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	movabsq	$2305843009213693951, %rsi
	andq	%r15, %rsi
	call	qsort@PLT
	movslq	-60(%rbp), %r13
	movl	-64(%rbp), %eax
	movabsq	$9223372036854775807, %r8
	subl	%r13d, %eax
	js	.L14
	leaq	-1(%r13), %r9
	cltq
	movq	%rbx, %r14
	xorl	%esi, %esi
	movq	%r9, %rdi
	movq	%r9, %r11
	leaq	1(%rax), %r10
	movabsq	$9223372036854775807, %r8
	shrq	%rdi
	andq	$-2, %r11
	salq	$4, %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	(%rsi,%r9), %rax
	cmpq	%rsi, %rax
	jle	.L34
	cmpq	$2, %r13
	je	.L24
	leaq	8(%r14), %rcx
	xorl	%eax, %eax
	pxor	%xmm0, %xmm0
	.p2align 4,,10
	.p2align 3
.L19:
	movdqu	(%r14,%rax), %xmm1
	movdqu	(%rcx,%rax), %xmm2
	addq	$16, %rax
	psubq	%xmm2, %xmm1
	paddq	%xmm1, %xmm0
	cmpq	%rax, %rdi
	jne	.L19
	movdqa	%xmm0, %xmm1
	leaq	(%r11,%rsi), %rdx
	psrldq	$8, %xmm1
	paddq	%xmm1, %xmm0
	movq	%xmm0, %rax
	cmpq	%r9, %r11
	je	.L22
.L18:
	addq	(%rbx,%rdx,8), %rax
	subq	8(%rbx,%rdx,8), %rax
.L22:
	cmpq	%rax, %r8
	movq	%rcx, %r14
	cmovg	%rax, %r8
	addq	$1, %rsi
	cmpq	%r10, %rsi
	jne	.L17
.L14:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L35
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	xorl	%eax, %eax
	leaq	8(%r14), %rcx
	jmp	.L22
.L24:
	movq	%rsi, %rdx
	xorl	%eax, %eax
	leaq	8(%r14), %rcx
	jmp	.L18
.L32:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L11
.L33:
	leaq	.LC1(%rip), %r12
	jmp	.L16
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef long long ll;

int	desc(const void *a, const void *b)
{
	long *A = (long *)a;
	long *B = (long *)b;
	if (*B > *A) return 1;
	if (*B < *A) return -1;
	return 0;
}

int asc(const void *a, const void *b) {
	long *A = (long *)a;
	long *B = (long *)b;
	if (*A > *B) return 1;
	if (*A < *B) return -1;
	return 0;
}


int main()
{
	int n,k;
	scanf("%d%d", &n,&k);
	long h[n];
	long d[n-1];
	long i = 0;
	while (i < n)
	{
		scanf("%ld", &h[i]);
		i++;
	}
	qsort(h, sizeof h / sizeof *h , sizeof *h, desc);
	long j;
	i = 0;
	long min = __LONG_MAX__;
	long sum;
	while (i <= n - k)
	{
		j = i;
		sum = 0;
		// printf("%ld\n", h[i]);
		while (j < (i + k) - 1)
		{
			sum += h[j] - h[j + 1];
			j++;
		}
		// printf("min = %ld\n", sum);
		if (sum <= min)
			min = sum;
		i++;
	}
	printf("%ld", min);


	// i = 0;
	// while (i < n- 1)
	// {
	// 	d[i] = h[i] - h[i+1];
	// 	i++;
	// }
	// qsort(d, sizeof d / sizeof *d , sizeof *d, asc);
	// long ans=0;
	// i = 0;
	// while (i < k - 1)
	// {
	// 	ans += d[i];
	// 	i++;
	// }
	// printf("%ld",ans);
	return (0);
}

5 3
5
7
10
7
7
 5 3
5
7
10
0
7
 5 3
8
7
10
0
7
 3 3
5
7
10
7
7
 5 3
0
15
11
15
12
 5 3
10
21
10
0
6
 3 3
10
7
1
1
5
 5 3
10
21
19
0
6
 4 3
10
21
19
0
6
 3 3
5
7
0
1
7

0 2 1 5 3 4 9 10 11 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 <string.h>
#include <stdlib.h>
typedef long long ll;

int	desc(const void *a, const void *b)
{
	long *A = (long *)a;
	long *B = (long *)b;
	if (*B > *A) return 1;
	if (*B < *A) return -1;
	return 0;
}

int asc(const void *a, const void *b) {
	long *A = (long *)a;
	long *B = (long *)b;
	if (*A > *B) return 1;
	if (*A < *B) return -1;
	return 0;
}


int main()
{
	int n,k;
	scanf("%d%d", &n,&k);
	long h[n];
	long d[n-1];
	long i = 0;
	while (i < n)
	{
		scanf("%ld", &h[i]);
		i++;
	}
	qsort(h, sizeof h / sizeof *h , sizeof *h, desc);
	long j;
	i = 0;
	long min = __LONG_MAX__;
	long sum;
	while (i <= n - k)
	{
		j = i;
		sum = 0;
		// printf("%ld\n", h[i]);
		while (j < (i + k) - 1)
		{
			sum += h[j] - h[j + 1];
			j++;
		}
		// printf("min = %ld\n", sum);
		if (sum <= min)
			min = sum;
		i++;
	}
	printf("%ld", min);


	// i = 0;
	// while (i < n- 1)
	// {
	// 	d[i] = h[i] - h[i+1];
	// 	i++;
	// }
	// qsort(d, sizeof d / sizeof *d , sizeof *d, asc);
	// long ans=0;
	// i = 0;
	// while (i < k - 1)
	// {
	// 	ans += d[i];
	// 	i++;
	// }
	// printf("%ld",ans);
	return (0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	desc
	.type	desc, @function
desc:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	desc, .-desc
	.globl	asc
	.type	asc, @function
asc:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L8
	movl	$-1, %eax
	jmp	.L7
.L8:
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	addq	$-128, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-108(%rbp), %rdx
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-112(%rbp), %ebx
	movslq	%ebx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ebx, %rax
	movq	%rax, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%ebx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	-112(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L16
.L17:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L16:
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jl	.L17
	movslq	%ebx, %rax
	salq	$3, %rax
	shrq	$3, %rax
	movq	%rax, %rsi
	movq	-64(%rbp), %rax
	leaq	desc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -104(%rbp)
	movabsq	$9223372036854775807, %rax
	movq	%rax, -88(%rbp)
	jmp	.L18
.L22:
	movq	-104(%rbp), %rax
	movq	%rax, -96(%rbp)
	movq	$0, -80(%rbp)
	jmp	.L19
.L20:
	movq	-64(%rbp), %rax
	movq	-96(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-96(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-64(%rbp), %rax
	movq	(%rax,%rcx,8), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	addq	%rax, -80(%rbp)
	addq	$1, -96(%rbp)
.L19:
	movl	-108(%rbp), %eax
	movslq	%eax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	subq	$1, %rax
	cmpq	%rax, -96(%rbp)
	jl	.L20
	movq	-80(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jg	.L21
	movq	-80(%rbp), %rax
	movq	%rax, -88(%rbp)
.L21:
	addq	$1, -104(%rbp)
.L18:
	movl	-112(%rbp), %eax
	movl	-108(%rbp), %edx
	subl	%edx, %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jle	.L22
	movq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	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	desc
	.type	desc, @function
desc:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	desc, .-desc
	.globl	asc
	.type	asc, @function
asc:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L8
	movl	$-1, %eax
	jmp	.L7
.L8:
	movl	$0, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	addq	$-128, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-108(%rbp), %rdx
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-112(%rbp), %ebx
	movslq	%ebx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ebx, %rax
	movq	%rax, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%ebx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%ebx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	-112(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L16
.L17:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L16:
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jl	.L17
	movslq	%ebx, %rax
	salq	$3, %rax
	shrq	$3, %rax
	movq	%rax, %rsi
	movq	-64(%rbp), %rax
	leaq	desc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -104(%rbp)
	movabsq	$9223372036854775807, %rax
	movq	%rax, -88(%rbp)
	jmp	.L18
.L22:
	movq	-104(%rbp), %rax
	movq	%rax, -96(%rbp)
	movq	$0, -80(%rbp)
	jmp	.L19
.L20:
	movq	-64(%rbp), %rax
	movq	-96(%rbp), %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	-96(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-64(%rbp), %rax
	movq	(%rax,%rcx,8), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	addq	%rax, -80(%rbp)
	addq	$1, -96(%rbp)
.L19:
	movl	-108(%rbp), %eax
	movslq	%eax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	subq	$1, %rax
	cmpq	%rax, -96(%rbp)
	jl	.L20
	movq	-80(%rbp), %rax
	cmpq	-88(%rbp), %rax
	jg	.L21
	movq	-80(%rbp), %rax
	movq	%rax, -88(%rbp)
.L21:
	addq	$1, -104(%rbp)
.L18:
	movl	-112(%rbp), %eax
	movl	-108(%rbp), %edx
	subl	%edx, %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jle	.L22
	movq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	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:
