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 <inttypes.h>

#ifdef GUCHOKU
int cmp(const void* x, const void* y) {
	int64_t a = *(const int64_t*)x, b = *(const int64_t*)y;
	return a < b ? -1 : a > b;
}

int N;
int64_t K;
int A[271828];

int count = 0;
int64_t hoge[3333333];

int main(void) {
	int i, j;
	if (scanf("%d%" SCNd64, &N, &K) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	if ((int64_t)N * (N - 1) / 2 > (int64_t)(sizeof(hoge) / sizeof(*hoge))) {
		puts("too big");
		return 2;
	}
	for (i = 0; i < N; i++) {
		for (j = i + 1; j < N; j++) {
			hoge[count++] = (int64_t)A[i] * A[j];
		}
	}
	qsort(hoge, count, sizeof(*hoge), cmp);
	printf("%" PRId64 "\n", hoge[K - 1]);
	return 0;
}
#else
int cmp(const void* x, const void* y) {
	int a = *(const int*)x, b = *(const int*)y;
	return a < b ? -1 : a > b;
}

int N;
int64_t K;
int A[271828];

int minus_max, plus_min;

int main(void) {
	int i;
	int64_t less, ge;
	int64_t neg, zero, pos, zeroika;
	if (scanf("%d%" SCNd64, &N, &K) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	qsort(A, N, sizeof(*A), cmp);
	minus_max = 0;
	plus_min = N;
	for (i = 0; i < N; i++) {
		if (A[i] < 0) minus_max = i + 1;
		if (plus_min >= N && A[i] > 0) plus_min = i;
	}
	neg = minus_max;
	zero = plus_min - minus_max;
	pos = N - plus_min;
	/* 0以下の数 = 負×正 + 負×0 + 正×0 + 0×0 */
	zeroika = neg * pos + neg * zero + pos * zero + zero * (zero - 1) / 2;

	ge = INT64_C(1000000000) * INT64_C(1000000000) + INT64_C(1);
	less = -ge;
	while (less + 1 < ge) {
		int64_t mid = less + (ge - less) / 2;
		int64_t count = 0; /* mid以下の積の数 */
		if (mid < 0) {
			/* 負×正のみがmid以下になりうる */
			for (i = 0; i < minus_max; i++) {
				/* A[i] * hoge <= mid (A[i] < 0) */
				/* hoge >= mid / A[i] ← 嘘 */
				int64_t target = mid / A[i] + (mid % A[i] != 0);
				int nyan_less = plus_min, nyan_ge = N - 1;
				if (A[nyan_ge] < target) {
					/* 該当なし →  NOP */
				} else if (A[nyan_less] >= target) {
					/* 全部 */
					count += pos;
				} else {
					while (nyan_less + 1 < nyan_ge) {
						int nyan_mid = nyan_less + (nyan_ge - nyan_less) / 2;
						if (A[nyan_mid] >= target) nyan_ge = nyan_mid; else nyan_less = nyan_mid;
					}
					count += N - nyan_ge;
				}
			}
		} else if (mid == 0) {
			/* 0以下 */
			count = zeroika;
		} else {
			/* 0以下 + 負×負 + 正×正 */
			count = zeroika;
			for (i = 0; i + 1 < minus_max; i++) {
				/* A[i] * hoge <= mid (A[i] < 0) */
				/* hoge >= mid / A[i] */
				int64_t target = mid / A[i];
				int nyan_less = i + 1, nyan_ge = minus_max - 1;
				if (A[nyan_ge] < target) {
					/* 該当なし →  NOP */
				} else if (A[nyan_less] >= target) {
					/* 全部 */
					count += minus_max - (i + 1);
				} else {
					while (nyan_less + 1 < nyan_ge) {
						int nyan_mid = nyan_less + (nyan_ge - nyan_less) / 2;
						if (A[nyan_mid] >= target) nyan_ge = nyan_mid; else nyan_less = nyan_mid;
					}
					count += minus_max - nyan_ge;
				}
			}
			for (i = plus_min; i + 1 < N; i++) {
				/* A[i] * hoge <= mid (A[i] > 0) */
				/* hoge <= mid / A[i] */
				int64_t target = mid / A[i];
				int nyan_le = i + 1, nyan_greater = N - 1;
				if (A[nyan_greater] <= target) {
					/* 全部 */
					count += N - (i + 1);
				} else if (A[nyan_le] > target) {
					/* 該当なし →  NOP */
				} else {
					while (nyan_le + 1 < nyan_greater) {
						int nyan_mid = nyan_le + (nyan_greater - nyan_le) / 2;
						if (A[nyan_mid] > target) nyan_greater = nyan_mid; else nyan_le = nyan_mid;
					}
					count += nyan_le - i;
				}
			}
		}
#if 0
		printf("%" PRId64" -> %" PRId64 "\n", mid, count);
#endif
		if (count >= K) ge = mid; else less = mid;
	}
	printf("%" PRId64 "\n", ge);
	return 0;
}
#endif
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	K
	.align 8
	.type	K, @object
	.size	K, 8
K:
	.zero	8
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1087312
A:
	.zero	1087312
	.globl	minus_max
	.align 4
	.type	minus_max, @object
	.size	minus_max, 4
minus_max:
	.zero	4
	.globl	plus_min
	.align 4
	.type	plus_min, @object
	.size	plus_min, 4
plus_min:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%ld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	leaq	K(%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
	cmpl	$2, %eax
	je	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, -128(%rbp)
	jmp	.L8
.L10:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L7
.L9:
	addl	$1, -128(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L10
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	A(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, minus_max(%rip)
	movl	N(%rip), %eax
	movl	%eax, plus_min(%rip)
	movl	$0, -128(%rbp)
	jmp	.L11
.L14:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L12
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, minus_max(%rip)
.L12:
	movl	plus_min(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L13
	movl	-128(%rbp), %eax
	movl	%eax, plus_min(%rip)
.L13:
	addl	$1, -128(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L14
	movl	minus_max(%rip), %eax
	cltq
	movq	%rax, -64(%rbp)
	movl	plus_min(%rip), %eax
	movl	minus_max(%rip), %edx
	subl	%edx, %eax
	cltq
	movq	%rax, -56(%rbp)
	movl	N(%rip), %eax
	movl	plus_min(%rip), %edx
	subl	%edx, %eax
	cltq
	movq	%rax, -48(%rbp)
	movq	-64(%rbp), %rax
	imulq	-48(%rbp), %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	imulq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-48(%rbp), %rax
	imulq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-56(%rbp), %rax
	subq	$1, %rax
	imulq	-56(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	addq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movabsq	$1000000000000000001, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	negq	%rax
	movq	%rax, -88(%rbp)
	jmp	.L15
.L41:
	movq	-80(%rbp), %rax
	subq	-88(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	$0, -72(%rbp)
	cmpq	$0, -32(%rbp)
	jns	.L16
	movl	$0, -128(%rbp)
	jmp	.L17
.L23:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	setne	%al
	movzbl	%al, %eax
	addq	%rsi, %rax
	movq	%rax, -8(%rbp)
	movl	plus_min(%rip), %eax
	movl	%eax, -124(%rbp)
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -120(%rbp)
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L18
	movl	-124(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L20
	movq	-48(%rbp), %rax
	addq	%rax, -72(%rbp)
	jmp	.L18
.L22:
	movl	-120(%rbp), %eax
	subl	-124(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -92(%rbp)
	movl	-92(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L21
	movl	-92(%rbp), %eax
	movl	%eax, -120(%rbp)
	jmp	.L20
.L21:
	movl	-92(%rbp), %eax
	movl	%eax, -124(%rbp)
.L20:
	movl	-124(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jg	.L22
	movl	N(%rip), %eax
	subl	-120(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L18:
	addl	$1, -128(%rbp)
.L17:
	movl	minus_max(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L23
	jmp	.L24
.L16:
	cmpq	$0, -32(%rbp)
	jne	.L25
	movq	-40(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L24
.L25:
	movq	-40(%rbp), %rax
	movq	%rax, -72(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L26
.L32:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -16(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -116(%rbp)
	movl	minus_max(%rip), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L27
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L29
	movl	minus_max(%rip), %eax
	movl	-128(%rbp), %edx
	addl	$1, %edx
	subl	%edx, %eax
	cltq
	addq	%rax, -72(%rbp)
	jmp	.L27
.L31:
	movl	-112(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-116(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -96(%rbp)
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L30
	movl	-96(%rbp), %eax
	movl	%eax, -112(%rbp)
	jmp	.L29
.L30:
	movl	-96(%rbp), %eax
	movl	%eax, -116(%rbp)
.L29:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -112(%rbp)
	jg	.L31
	movl	minus_max(%rip), %eax
	subl	-112(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L27:
	addl	$1, -128(%rbp)
.L26:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	minus_max(%rip), %eax
	cmpl	%eax, %edx
	jl	.L32
	movl	plus_min(%rip), %eax
	movl	%eax, -128(%rbp)
	jmp	.L33
.L39:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -24(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -108(%rbp)
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -104(%rbp)
	movl	-104(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jl	.L34
	movl	N(%rip), %eax
	movl	-128(%rbp), %edx
	addl	$1, %edx
	subl	%edx, %eax
	cltq
	addq	%rax, -72(%rbp)
	jmp	.L35
.L34:
	movl	-108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jl	.L35
	jmp	.L36
.L38:
	movl	-104(%rbp), %eax
	subl	-108(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-108(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -100(%rbp)
	movl	-100(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jge	.L37
	movl	-100(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L36
.L37:
	movl	-100(%rbp), %eax
	movl	%eax, -108(%rbp)
.L36:
	movl	-108(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -104(%rbp)
	jg	.L38
	movl	-108(%rbp), %eax
	subl	-128(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L35:
	addl	$1, -128(%rbp)
.L33:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L39
.L24:
	movq	K(%rip), %rax
	cmpq	%rax, -72(%rbp)
	jl	.L40
	movq	-32(%rbp), %rax
	movq	%rax, -80(%rbp)
	jmp	.L15
.L40:
	movq	-32(%rbp), %rax
	movq	%rax, -88(%rbp)
.L15:
	movq	-88(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -80(%rbp)
	jg	.L41
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%ld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	K(%rip), %rdx
	leaq	N(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L9
	movl	N(%rip), %eax
	leaq	A(%rip), %rbx
	testl	%eax, %eax
	jle	.L8
	movq	%rbx, %rbp
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L66:
	movl	N(%rip), %eax
	addl	$1, %r12d
	addq	$4, %rbp
	cmpl	%r12d, %eax
	jle	.L8
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L66
.L9:
	movl	$1, %eax
.L5:
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L8:
	.cfi_restore_state
	movslq	%eax, %rsi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	N(%rip), %r9d
	movl	$0, minus_max(%rip)
	movl	%r9d, plus_min(%rip)
	testl	%r9d, %r9d
	jle	.L12
	leaq	A(%rip), %rdx
	movl	%r9d, %edi
	xorl	%r10d, %r10d
	xorl	%r11d, %r11d
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L68:
	cmpl	%edi, %r9d
	setle	%cl
	testl	%esi, %esi
	setg	%sil
	andb	%sil, %cl
	cmovne	%ecx, %r10d
	cmovne	%r8d, %edi
	addq	$4, %rdx
	cmpl	%eax, %r9d
	je	.L67
.L14:
	movl	(%rdx), %esi
	movl	%eax, %r8d
	addl	$1, %eax
	testl	%esi, %esi
	jns	.L68
	movl	%eax, %r13d
	movl	$1, %r11d
	addq	$4, %rdx
	cmpl	%eax, %r9d
	jne	.L14
.L67:
	testb	%r10b, %r10b
	je	.L15
	movl	%edi, plus_min(%rip)
.L15:
	testb	%r11b, %r11b
	je	.L12
	movl	%r13d, minus_max(%rip)
.L12:
	movl	plus_min(%rip), %edi
	movl	%r9d, %ecx
	movslq	minus_max(%rip), %rax
	movabsq	$-1000000000000000001, %r11
	movl	%edi, %edx
	subl	%edi, %ecx
	movq	%rax, %r10
	movl	%eax, 12(%rsp)
	subl	%eax, %edx
	movslq	%ecx, %rsi
	movl	%edi, 72(%rsp)
	movslq	%edx, %rdx
	movq	%rsi, 48(%rsp)
	leaq	(%rdx,%rsi), %rcx
	imulq	%rax, %rcx
	movq	%rsi, %rax
	movl	$2, %esi
	imulq	%rdx, %rax
	addq	%rax, %rcx
	leaq	-1(%rdx), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rsi
	leal	-1(%r10), %edx
	movl	%edx, 60(%rsp)
	addq	%rcx, %rax
	movq	K(%rip), %rcx
	movq	%rax, 40(%rsp)
	leal	1(%rdi), %eax
	movl	%eax, 76(%rsp)
	cltq
	movq	%rax, 88(%rsp)
	imulq	$-4, %rax, %rax
	movq	%rcx, 24(%rsp)
	movslq	%edi, %rcx
	movq	%rcx, 32(%rsp)
	leaq	(%rax,%rcx,4), %rax
	movl	%r10d, %ecx
	movabsq	$1000000000000000001, %r10
	addq	%rbx, %rax
	movq	%rax, 80(%rsp)
	leaq	4+A(%rip), %rax
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 104(%rsp)
	leal	-1(%r9), %eax
	movl	%eax, 56(%rsp)
	leal	-2(%rcx), %eax
	addq	$2, %rax
	movq	%rax, 96(%rsp)
.L17:
	leaq	1(%r11), %rax
	movq	%rax, 16(%rsp)
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L19:
	cmpq	%r8, 24(%rsp)
	jg	.L69
.L49:
	movq	%rcx, %r10
.L37:
	cmpq	16(%rsp), %r10
	jle	.L70
	movq	%r10, %rax
	subq	%r11, %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	sarq	%rcx
	addq	%r11, %rcx
	js	.L71
	movq	40(%rsp), %r8
	je	.L19
	cmpl	$1, 12(%rsp)
	jle	.L25
	movslq	60(%rsp), %rax
	movl	%r9d, 64(%rsp)
	movl	$1, %edi
	leaq	-4+A(%rip), %r12
	movq	96(%rsp), %r9
	movslq	(%rbx,%rax,4), %r13
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L65:
	movl	12(%rsp), %eax
	subl	%esi, %eax
	cltq
	addq	%rax, %r8
.L26:
	addq	$1, %rdi
	cmpq	%rdi, %r9
	je	.L72
.L30:
	movq	%rcx, %rax
	movslq	(%r12,%rdi,4), %r14
	movl	%edi, %esi
	movl	%edi, %ebp
	cqto
	idivq	%r14
	cmpq	%rax, %r13
	jl	.L26
	movslq	(%rbx,%rdi,4), %rdx
	cmpq	%rax, %rdx
	jge	.L65
	movl	60(%rsp), %esi
.L27:
	leal	1(%rbp), %r14d
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L47:
	movl	%edx, %esi
.L28:
	cmpl	%r14d, %esi
	jle	.L65
	movl	%esi, %r15d
	subl	%ebp, %r15d
	movl	%r15d, %edx
	shrl	$31, %edx
	addl	%r15d, %edx
	sarl	%edx
	addl	%ebp, %edx
	movslq	%edx, %r15
	movslq	(%rbx,%r15,4), %r15
	cmpq	%rax, %r15
	jge	.L47
	movl	%edx, %ebp
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L72:
	movl	64(%rsp), %r9d
.L25:
	cmpl	76(%rsp), %r9d
	jle	.L19
	movslq	56(%rsp), %rax
	movq	88(%rsp), %rdi
	movq	%r11, 64(%rsp)
	movq	80(%rsp), %r12
	movslq	(%rbx,%rax,4), %r13
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%r9d, %eax
	subl	%edi, %eax
	cltq
	addq	%rax, %r8
.L32:
	addq	$1, %rdi
	cmpl	%edi, %r9d
	jle	.L73
.L36:
	movq	%rcx, %rax
	movslq	(%r12,%rdi,4), %rsi
	movl	%edi, %r11d
	leal	-1(%rdi), %ebp
	cqto
	idivq	%rsi
	cmpq	%rax, %r13
	jle	.L74
	movslq	(%rbx,%rdi,4), %rdx
	movl	56(%rsp), %esi
	cmpq	%rax, %rdx
	jg	.L32
.L33:
	leal	1(%r11), %r14d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%esi, %r15d
	subl	%r11d, %r15d
	movl	%r15d, %edx
	shrl	$31, %edx
	addl	%r15d, %edx
	sarl	%edx
	addl	%r11d, %edx
	movslq	%edx, %r15
	movslq	(%rbx,%r15,4), %r15
	cmpq	%rax, %r15
	jle	.L75
	movl	%edx, %esi
.L34:
	cmpl	%r14d, %esi
	jg	.L35
	subl	%ebp, %r11d
	addq	$1, %rdi
	movslq	%r11d, %r11
	addq	%r11, %r8
	cmpl	%edi, %r9d
	jg	.L36
	.p2align 4,,10
	.p2align 3
.L73:
	movq	64(%rsp), %r11
	cmpq	%r8, 24(%rsp)
	jle	.L49
.L69:
	movq	%rcx, %r11
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L75:
	movl	%edx, %r11d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L71:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L41
	movslq	56(%rsp), %rax
	movq	104(%rsp), %r12
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movslq	(%rbx,%rax,4), %rbp
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L76:
	addq	48(%rsp), %r8
.L20:
	addq	$4, %rdi
	cmpq	%rdi, %r12
	je	.L19
.L24:
	movq	%rcx, %rax
	movslq	(%rdi), %rsi
	cqto
	idivq	%rsi
	cmpq	$1, %rdx
	sbbq	$-1, %rax
	cmpq	%rax, %rbp
	jl	.L20
	movq	32(%rsp), %rsi
	movslq	(%rbx,%rsi,4), %rdx
	cmpq	%rax, %rdx
	jge	.L76
	movl	56(%rsp), %esi
	movl	72(%rsp), %r13d
.L21:
	leal	1(%r13), %r14d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%esi, %r15d
	subl	%r13d, %r15d
	movl	%r15d, %edx
	shrl	$31, %edx
	addl	%r15d, %edx
	sarl	%edx
	addl	%r13d, %edx
	movslq	%edx, %r15
	movslq	(%rbx,%r15,4), %r15
	cmpq	%rax, %r15
	jl	.L77
	movl	%edx, %esi
.L22:
	cmpl	%r14d, %esi
	jg	.L23
	movl	%r9d, %eax
	subl	%esi, %eax
	cltq
	addq	%rax, %r8
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L77:
	movl	%edx, %r13d
	jmp	.L21
.L70:
	movq	%r10, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L5
.L41:
	xorl	%r8d, %r8d
	jmp	.L19
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	plus_min
	.bss
	.align 4
	.type	plus_min, @object
	.size	plus_min, 4
plus_min:
	.zero	4
	.globl	minus_max
	.align 4
	.type	minus_max, @object
	.size	minus_max, 4
minus_max:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1087312
A:
	.zero	1087312
	.globl	K
	.align 8
	.type	K, @object
	.size	K, 8
K:
	.zero	8
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	movl	$-1, %edx
	setg	%al
	movzbl	%al, %eax
	cmovl	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%ld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	K(%rip), %rdx
	leaq	N(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$120, %rsp
	.cfi_def_cfa_offset 176
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L9
	movl	N(%rip), %eax
	leaq	A(%rip), %rbx
	testl	%eax, %eax
	jle	.L8
	movq	%rbx, %rbp
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L66:
	movl	N(%rip), %eax
	addl	$1, %r12d
	addq	$4, %rbp
	cmpl	%r12d, %eax
	jle	.L8
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L66
.L9:
	movl	$1, %eax
.L5:
	addq	$120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L8:
	.cfi_restore_state
	movslq	%eax, %rsi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	N(%rip), %r9d
	movl	$0, minus_max(%rip)
	movl	%r9d, plus_min(%rip)
	testl	%r9d, %r9d
	jle	.L12
	leaq	A(%rip), %rdx
	movl	%r9d, %edi
	xorl	%r10d, %r10d
	xorl	%r11d, %r11d
	xorl	%eax, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L68:
	cmpl	%edi, %r9d
	setle	%cl
	testl	%esi, %esi
	setg	%sil
	andb	%sil, %cl
	cmovne	%ecx, %r10d
	cmovne	%r8d, %edi
	addq	$4, %rdx
	cmpl	%eax, %r9d
	je	.L67
.L14:
	movl	(%rdx), %esi
	movl	%eax, %r8d
	addl	$1, %eax
	testl	%esi, %esi
	jns	.L68
	movl	%eax, %r13d
	movl	$1, %r11d
	addq	$4, %rdx
	cmpl	%eax, %r9d
	jne	.L14
.L67:
	testb	%r10b, %r10b
	je	.L15
	movl	%edi, plus_min(%rip)
.L15:
	testb	%r11b, %r11b
	je	.L12
	movl	%r13d, minus_max(%rip)
.L12:
	movl	plus_min(%rip), %edi
	movl	%r9d, %ecx
	movslq	minus_max(%rip), %rax
	movabsq	$-1000000000000000001, %r11
	movl	%edi, %edx
	subl	%edi, %ecx
	movq	%rax, %r10
	movl	%eax, 12(%rsp)
	subl	%eax, %edx
	movslq	%ecx, %rsi
	movl	%edi, 72(%rsp)
	movslq	%edx, %rdx
	movq	%rsi, 48(%rsp)
	leaq	(%rdx,%rsi), %rcx
	imulq	%rax, %rcx
	movq	%rsi, %rax
	movl	$2, %esi
	imulq	%rdx, %rax
	addq	%rax, %rcx
	leaq	-1(%rdx), %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rsi
	leal	-1(%r10), %edx
	movl	%edx, 60(%rsp)
	addq	%rcx, %rax
	movq	K(%rip), %rcx
	movq	%rax, 40(%rsp)
	leal	1(%rdi), %eax
	movl	%eax, 76(%rsp)
	cltq
	movq	%rax, 88(%rsp)
	imulq	$-4, %rax, %rax
	movq	%rcx, 24(%rsp)
	movslq	%edi, %rcx
	movq	%rcx, 32(%rsp)
	leaq	(%rax,%rcx,4), %rax
	movl	%r10d, %ecx
	movabsq	$1000000000000000001, %r10
	addq	%rbx, %rax
	movq	%rax, 80(%rsp)
	leaq	4+A(%rip), %rax
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 104(%rsp)
	leal	-1(%r9), %eax
	movl	%eax, 56(%rsp)
	leal	-2(%rcx), %eax
	addq	$2, %rax
	movq	%rax, 96(%rsp)
.L17:
	leaq	1(%r11), %rax
	movq	%rax, 16(%rsp)
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L19:
	cmpq	%r8, 24(%rsp)
	jg	.L69
.L49:
	movq	%rcx, %r10
.L37:
	cmpq	16(%rsp), %r10
	jle	.L70
	movq	%r10, %rax
	subq	%r11, %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rax, %rcx
	sarq	%rcx
	addq	%r11, %rcx
	js	.L71
	movq	40(%rsp), %r8
	je	.L19
	cmpl	$1, 12(%rsp)
	jle	.L25
	movslq	60(%rsp), %rax
	movl	%r9d, 64(%rsp)
	movl	$1, %edi
	leaq	-4+A(%rip), %r12
	movq	96(%rsp), %r9
	movslq	(%rbx,%rax,4), %r13
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L65:
	movl	12(%rsp), %eax
	subl	%esi, %eax
	cltq
	addq	%rax, %r8
.L26:
	addq	$1, %rdi
	cmpq	%rdi, %r9
	je	.L72
.L30:
	movq	%rcx, %rax
	movslq	(%r12,%rdi,4), %r14
	movl	%edi, %esi
	movl	%edi, %ebp
	cqto
	idivq	%r14
	cmpq	%rax, %r13
	jl	.L26
	movslq	(%rbx,%rdi,4), %rdx
	cmpq	%rax, %rdx
	jge	.L65
	movl	60(%rsp), %esi
.L27:
	leal	1(%rbp), %r14d
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L47:
	movl	%edx, %esi
.L28:
	cmpl	%r14d, %esi
	jle	.L65
	movl	%esi, %r15d
	subl	%ebp, %r15d
	movl	%r15d, %edx
	shrl	$31, %edx
	addl	%r15d, %edx
	sarl	%edx
	addl	%ebp, %edx
	movslq	%edx, %r15
	movslq	(%rbx,%r15,4), %r15
	cmpq	%rax, %r15
	jge	.L47
	movl	%edx, %ebp
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L72:
	movl	64(%rsp), %r9d
.L25:
	cmpl	76(%rsp), %r9d
	jle	.L19
	movslq	56(%rsp), %rax
	movq	88(%rsp), %rdi
	movq	%r11, 64(%rsp)
	movq	80(%rsp), %r12
	movslq	(%rbx,%rax,4), %r13
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%r9d, %eax
	subl	%edi, %eax
	cltq
	addq	%rax, %r8
.L32:
	addq	$1, %rdi
	cmpl	%edi, %r9d
	jle	.L73
.L36:
	movq	%rcx, %rax
	movslq	(%r12,%rdi,4), %rsi
	movl	%edi, %r11d
	leal	-1(%rdi), %ebp
	cqto
	idivq	%rsi
	cmpq	%rax, %r13
	jle	.L74
	movslq	(%rbx,%rdi,4), %rdx
	movl	56(%rsp), %esi
	cmpq	%rax, %rdx
	jg	.L32
.L33:
	leal	1(%r11), %r14d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%esi, %r15d
	subl	%r11d, %r15d
	movl	%r15d, %edx
	shrl	$31, %edx
	addl	%r15d, %edx
	sarl	%edx
	addl	%r11d, %edx
	movslq	%edx, %r15
	movslq	(%rbx,%r15,4), %r15
	cmpq	%rax, %r15
	jle	.L75
	movl	%edx, %esi
.L34:
	cmpl	%r14d, %esi
	jg	.L35
	subl	%ebp, %r11d
	addq	$1, %rdi
	movslq	%r11d, %r11
	addq	%r11, %r8
	cmpl	%edi, %r9d
	jg	.L36
	.p2align 4,,10
	.p2align 3
.L73:
	movq	64(%rsp), %r11
	cmpq	%r8, 24(%rsp)
	jle	.L49
.L69:
	movq	%rcx, %r11
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L75:
	movl	%edx, %r11d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L71:
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L41
	movslq	56(%rsp), %rax
	movq	104(%rsp), %r12
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	movslq	(%rbx,%rax,4), %rbp
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L76:
	addq	48(%rsp), %r8
.L20:
	addq	$4, %rdi
	cmpq	%rdi, %r12
	je	.L19
.L24:
	movq	%rcx, %rax
	movslq	(%rdi), %rsi
	cqto
	idivq	%rsi
	cmpq	$1, %rdx
	sbbq	$-1, %rax
	cmpq	%rax, %rbp
	jl	.L20
	movq	32(%rsp), %rsi
	movslq	(%rbx,%rsi,4), %rdx
	cmpq	%rax, %rdx
	jge	.L76
	movl	56(%rsp), %esi
	movl	72(%rsp), %r13d
.L21:
	leal	1(%r13), %r14d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%esi, %r15d
	subl	%r13d, %r15d
	movl	%r15d, %edx
	shrl	$31, %edx
	addl	%r15d, %edx
	sarl	%edx
	addl	%r13d, %edx
	movslq	%edx, %r15
	movslq	(%rbx,%r15,4), %r15
	cmpq	%rax, %r15
	jl	.L77
	movl	%edx, %esi
.L22:
	cmpl	%r14d, %esi
	jg	.L23
	movl	%r9d, %eax
	subl	%esi, %eax
	cltq
	addq	%rax, %r8
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L77:
	movl	%edx, %r13d
	jmp	.L21
.L70:
	movq	%r10, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L5
.L41:
	xorl	%r8d, %r8d
	jmp	.L19
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	plus_min
	.bss
	.align 4
	.type	plus_min, @object
	.size	plus_min, 4
plus_min:
	.zero	4
	.globl	minus_max
	.align 4
	.type	minus_max, @object
	.size	minus_max, 4
minus_max:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1087312
A:
	.zero	1087312
	.globl	K
	.align 8
	.type	K, @object
	.size	K, 8
K:
	.zero	8
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

#ifdef GUCHOKU
int cmp(const void* x, const void* y) {
	int64_t a = *(const int64_t*)x, b = *(const int64_t*)y;
	return a < b ? -1 : a > b;
}

int N;
int64_t K;
int A[271828];

int count = 0;
int64_t hoge[3333333];

int main(void) {
	int i, j;
	if (scanf("%d%" SCNd64, &N, &K) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	if ((int64_t)N * (N - 1) / 2 > (int64_t)(sizeof(hoge) / sizeof(*hoge))) {
		puts("too big");
		return 2;
	}
	for (i = 0; i < N; i++) {
		for (j = i + 1; j < N; j++) {
			hoge[count++] = (int64_t)A[i] * A[j];
		}
	}
	qsort(hoge, count, sizeof(*hoge), cmp);
	printf("%" PRId64 "\n", hoge[K - 1]);
	return 0;
}
#else
int cmp(const void* x, const void* y) {
	int a = *(const int*)x, b = *(const int*)y;
	return a < b ? -1 : a > b;
}

int N;
int64_t K;
int A[271828];

int minus_max, plus_min;

int main(void) {
	int i;
	int64_t less, ge;
	int64_t neg, zero, pos, zeroika;
	if (scanf("%d%" SCNd64, &N, &K) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	qsort(A, N, sizeof(*A), cmp);
	minus_max = 0;
	plus_min = N;
	for (i = 0; i < N; i++) {
		if (A[i] < 0) minus_max = i + 1;
		if (plus_min >= N && A[i] > 0) plus_min = i;
	}
	neg = minus_max;
	zero = plus_min - minus_max;
	pos = N - plus_min;
	/* 0以下の数 = 負×正 + 負×0 + 正×0 + 0×0 */
	zeroika = neg * pos + neg * zero + pos * zero + zero * (zero - 1) / 2;

	ge = INT64_C(1000000000) * INT64_C(1000000000) + INT64_C(1);
	less = -ge;
	while (less + 1 < ge) {
		int64_t mid = less + (ge - less) / 2;
		int64_t count = 0; /* mid以下の積の数 */
		if (mid < 0) {
			/* 負×正のみがmid以下になりうる */
			for (i = 0; i < minus_max; i++) {
				/* A[i] * hoge <= mid (A[i] < 0) */
				/* hoge >= mid / A[i] ← 嘘 */
				int64_t target = mid / A[i] + (mid % A[i] != 0);
				int nyan_less = plus_min, nyan_ge = N - 1;
				if (A[nyan_ge] < target) {
					/* 該当なし →  NOP */
				} else if (A[nyan_less] >= target) {
					/* 全部 */
					count += pos;
				} else {
					while (nyan_less + 1 < nyan_ge) {
						int nyan_mid = nyan_less + (nyan_ge - nyan_less) / 2;
						if (A[nyan_mid] >= target) nyan_ge = nyan_mid; else nyan_less = nyan_mid;
					}
					count += N - nyan_ge;
				}
			}
		} else if (mid == 0) {
			/* 0以下 */
			count = zeroika;
		} else {
			/* 0以下 + 負×負 + 正×正 */
			count = zeroika;
			for (i = 0; i + 1 < minus_max; i++) {
				/* A[i] * hoge <= mid (A[i] < 0) */
				/* hoge >= mid / A[i] */
				int64_t target = mid / A[i];
				int nyan_less = i + 1, nyan_ge = minus_max - 1;
				if (A[nyan_ge] < target) {
					/* 該当なし →  NOP */
				} else if (A[nyan_less] >= target) {
					/* 全部 */
					count += minus_max - (i + 1);
				} else {
					while (nyan_less + 1 < nyan_ge) {
						int nyan_mid = nyan_less + (nyan_ge - nyan_less) / 2;
						if (A[nyan_mid] >= target) nyan_ge = nyan_mid; else nyan_less = nyan_mid;
					}
					count += minus_max - nyan_ge;
				}
			}
			for (i = plus_min; i + 1 < N; i++) {
				/* A[i] * hoge <= mid (A[i] > 0) */
				/* hoge <= mid / A[i] */
				int64_t target = mid / A[i];
				int nyan_le = i + 1, nyan_greater = N - 1;
				if (A[nyan_greater] <= target) {
					/* 全部 */
					count += N - (i + 1);
				} else if (A[nyan_le] > target) {
					/* 該当なし →  NOP */
				} else {
					while (nyan_le + 1 < nyan_greater) {
						int nyan_mid = nyan_le + (nyan_greater - nyan_le) / 2;
						if (A[nyan_mid] > target) nyan_greater = nyan_mid; else nyan_le = nyan_mid;
					}
					count += nyan_le - i;
				}
			}
		}
#if 0
		printf("%" PRId64" -> %" PRId64 "\n", mid, count);
#endif
		if (count >= K) ge = mid; else less = mid;
	}
	printf("%" PRId64 "\n", ge);
	return 0;
}
#endif

10 40
5 4 3 2 -1 0 -1 0 0 0
 4 3
6 3 -4 -2
 30 413
-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -1273635706 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0
 10 27
5 4 3 2 -1 0 -1 0 0 0
 30 413
-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -1273635706 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 694477644 0 -425610555 110117526 663621752 0
 30 413
-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -159798510 -372334013 526800997 -972141167 798607104 -1273635706 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 694477644 0 -425610555 110117526 663621752 0
 30 413
-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -159798510 -372334013 526800997 -972141167 648738515 -1273635706 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 694477644 0 -425610555 110117526 663621752 0
 30 413
-170202098 -268409015 537203564 983211703 27025141 -443999067 -937727165 -159124657 -358352725 526800997 -972141167 648738515 -1273635706 -959948616 37909651 -1 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 694477644 0 -425610555 158912296 663621752 0
 10 40
5 1 3 2 -1 0 0 0 0 0
 30 413
-170202098 -268409015 256795389 983211703 21608710 -443999067 -937727165 -159798510 -372334013 526800997 -972141167 648738515 -1273635706 -959948616 37909651 -1 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 694477644 0 -425610555 158912296 663621752 0

6
 -12
 528184831018109492
 0
 476299476577366816
 517956905402467891
 474217893515068178
 467076274146861368
 2
 460870470836112288

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 <inttypes.h>

#ifdef GUCHOKU
int cmp(const void* x, const void* y) {
	int64_t a = *(const int64_t*)x, b = *(const int64_t*)y;
	return a < b ? -1 : a > b;
}

int N;
int64_t K;
int A[271828];

int count = 0;
int64_t hoge[3333333];

int main(void) {
	int i, j;
	if (scanf("%d%" SCNd64, &N, &K) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	if ((int64_t)N * (N - 1) / 2 > (int64_t)(sizeof(hoge) / sizeof(*hoge))) {
		puts("too big");
		return 2;
	}
	for (i = 0; i < N; i++) {
		for (j = i + 1; j < N; j++) {
			hoge[count++] = (int64_t)A[i] * A[j];
		}
	}
	qsort(hoge, count, sizeof(*hoge), cmp);
	printf("%" PRId64 "\n", hoge[K - 1]);
	return 0;
}
#else
int cmp(const void* x, const void* y) {
	int a = *(const int*)x, b = *(const int*)y;
	return a < b ? -1 : a > b;
}

int N;
int64_t K;
int A[271828];

int minus_max, plus_min;

int main(void) {
	int i;
	int64_t less, ge;
	int64_t neg, zero, pos, zeroika;
	if (scanf("%d%" SCNd64, &N, &K) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	qsort(A, N, sizeof(*A), cmp);
	minus_max = 0;
	plus_min = N;
	for (i = 0; i < N; i++) {
		if (A[i] < 0) minus_max = i + 1;
		if (plus_min >= N && A[i] > 0) plus_min = i;
	}
	neg = minus_max;
	zero = plus_min - minus_max;
	pos = N - plus_min;
	/* 0以下の数 = 負×正 + 負×0 + 正×0 + 0×0 */
	zeroika = neg * pos + neg * zero + pos * zero + zero * (zero - 1) / 2;

	ge = INT64_C(1000000000) * INT64_C(1000000000) + INT64_C(1);
	less = -ge;
	while (less + 1 < ge) {
		int64_t mid = less + (ge - less) / 2;
		int64_t count = 0; /* mid以下の積の数 */
		if (mid < 0) {
			/* 負×正のみがmid以下になりうる */
			for (i = 0; i < minus_max; i++) {
				/* A[i] * hoge <= mid (A[i] < 0) */
				/* hoge >= mid / A[i] ← 嘘 */
				int64_t target = mid / A[i] + (mid % A[i] != 0);
				int nyan_less = plus_min, nyan_ge = N - 1;
				if (A[nyan_ge] < target) {
					/* 該当なし →  NOP */
				} else if (A[nyan_less] >= target) {
					/* 全部 */
					count += pos;
				} else {
					while (nyan_less + 1 < nyan_ge) {
						int nyan_mid = nyan_less + (nyan_ge - nyan_less) / 2;
						if (A[nyan_mid] >= target) nyan_ge = nyan_mid; else nyan_less = nyan_mid;
					}
					count += N - nyan_ge;
				}
			}
		} else if (mid == 0) {
			/* 0以下 */
			count = zeroika;
		} else {
			/* 0以下 + 負×負 + 正×正 */
			count = zeroika;
			for (i = 0; i + 1 < minus_max; i++) {
				/* A[i] * hoge <= mid (A[i] < 0) */
				/* hoge >= mid / A[i] */
				int64_t target = mid / A[i];
				int nyan_less = i + 1, nyan_ge = minus_max - 1;
				if (A[nyan_ge] < target) {
					/* 該当なし →  NOP */
				} else if (A[nyan_less] >= target) {
					/* 全部 */
					count += minus_max - (i + 1);
				} else {
					while (nyan_less + 1 < nyan_ge) {
						int nyan_mid = nyan_less + (nyan_ge - nyan_less) / 2;
						if (A[nyan_mid] >= target) nyan_ge = nyan_mid; else nyan_less = nyan_mid;
					}
					count += minus_max - nyan_ge;
				}
			}
			for (i = plus_min; i + 1 < N; i++) {
				/* A[i] * hoge <= mid (A[i] > 0) */
				/* hoge <= mid / A[i] */
				int64_t target = mid / A[i];
				int nyan_le = i + 1, nyan_greater = N - 1;
				if (A[nyan_greater] <= target) {
					/* 全部 */
					count += N - (i + 1);
				} else if (A[nyan_le] > target) {
					/* 該当なし →  NOP */
				} else {
					while (nyan_le + 1 < nyan_greater) {
						int nyan_mid = nyan_le + (nyan_greater - nyan_le) / 2;
						if (A[nyan_mid] > target) nyan_greater = nyan_mid; else nyan_le = nyan_mid;
					}
					count += nyan_le - i;
				}
			}
		}
#if 0
		printf("%" PRId64" -> %" PRId64 "\n", mid, count);
#endif
		if (count >= K) ge = mid; else less = mid;
	}
	printf("%" PRId64 "\n", ge);
	return 0;
}
#endif
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	K
	.align 8
	.type	K, @object
	.size	K, 8
K:
	.zero	8
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1087312
A:
	.zero	1087312
	.globl	minus_max
	.align 4
	.type	minus_max, @object
	.size	minus_max, 4
minus_max:
	.zero	4
	.globl	plus_min
	.align 4
	.type	plus_min, @object
	.size	plus_min, 4
plus_min:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%ld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	leaq	K(%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
	cmpl	$2, %eax
	je	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, -128(%rbp)
	jmp	.L8
.L10:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L7
.L9:
	addl	$1, -128(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L10
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	A(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, minus_max(%rip)
	movl	N(%rip), %eax
	movl	%eax, plus_min(%rip)
	movl	$0, -128(%rbp)
	jmp	.L11
.L14:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L12
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, minus_max(%rip)
.L12:
	movl	plus_min(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L13
	movl	-128(%rbp), %eax
	movl	%eax, plus_min(%rip)
.L13:
	addl	$1, -128(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L14
	movl	minus_max(%rip), %eax
	cltq
	movq	%rax, -64(%rbp)
	movl	plus_min(%rip), %eax
	movl	minus_max(%rip), %edx
	subl	%edx, %eax
	cltq
	movq	%rax, -56(%rbp)
	movl	N(%rip), %eax
	movl	plus_min(%rip), %edx
	subl	%edx, %eax
	cltq
	movq	%rax, -48(%rbp)
	movq	-64(%rbp), %rax
	imulq	-48(%rbp), %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	imulq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-48(%rbp), %rax
	imulq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-56(%rbp), %rax
	subq	$1, %rax
	imulq	-56(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	addq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movabsq	$1000000000000000001, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	negq	%rax
	movq	%rax, -88(%rbp)
	jmp	.L15
.L41:
	movq	-80(%rbp), %rax
	subq	-88(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	$0, -72(%rbp)
	cmpq	$0, -32(%rbp)
	jns	.L16
	movl	$0, -128(%rbp)
	jmp	.L17
.L23:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	setne	%al
	movzbl	%al, %eax
	addq	%rsi, %rax
	movq	%rax, -8(%rbp)
	movl	plus_min(%rip), %eax
	movl	%eax, -124(%rbp)
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -120(%rbp)
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L18
	movl	-124(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L20
	movq	-48(%rbp), %rax
	addq	%rax, -72(%rbp)
	jmp	.L18
.L22:
	movl	-120(%rbp), %eax
	subl	-124(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -92(%rbp)
	movl	-92(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L21
	movl	-92(%rbp), %eax
	movl	%eax, -120(%rbp)
	jmp	.L20
.L21:
	movl	-92(%rbp), %eax
	movl	%eax, -124(%rbp)
.L20:
	movl	-124(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jg	.L22
	movl	N(%rip), %eax
	subl	-120(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L18:
	addl	$1, -128(%rbp)
.L17:
	movl	minus_max(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L23
	jmp	.L24
.L16:
	cmpq	$0, -32(%rbp)
	jne	.L25
	movq	-40(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L24
.L25:
	movq	-40(%rbp), %rax
	movq	%rax, -72(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L26
.L32:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -16(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -116(%rbp)
	movl	minus_max(%rip), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L27
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L29
	movl	minus_max(%rip), %eax
	movl	-128(%rbp), %edx
	addl	$1, %edx
	subl	%edx, %eax
	cltq
	addq	%rax, -72(%rbp)
	jmp	.L27
.L31:
	movl	-112(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-116(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -96(%rbp)
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L30
	movl	-96(%rbp), %eax
	movl	%eax, -112(%rbp)
	jmp	.L29
.L30:
	movl	-96(%rbp), %eax
	movl	%eax, -116(%rbp)
.L29:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -112(%rbp)
	jg	.L31
	movl	minus_max(%rip), %eax
	subl	-112(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L27:
	addl	$1, -128(%rbp)
.L26:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	minus_max(%rip), %eax
	cmpl	%eax, %edx
	jl	.L32
	movl	plus_min(%rip), %eax
	movl	%eax, -128(%rbp)
	jmp	.L33
.L39:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -24(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -108(%rbp)
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -104(%rbp)
	movl	-104(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jl	.L34
	movl	N(%rip), %eax
	movl	-128(%rbp), %edx
	addl	$1, %edx
	subl	%edx, %eax
	cltq
	addq	%rax, -72(%rbp)
	jmp	.L35
.L34:
	movl	-108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jl	.L35
	jmp	.L36
.L38:
	movl	-104(%rbp), %eax
	subl	-108(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-108(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -100(%rbp)
	movl	-100(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jge	.L37
	movl	-100(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L36
.L37:
	movl	-100(%rbp), %eax
	movl	%eax, -108(%rbp)
.L36:
	movl	-108(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -104(%rbp)
	jg	.L38
	movl	-108(%rbp), %eax
	subl	-128(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L35:
	addl	$1, -128(%rbp)
.L33:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L39
.L24:
	movq	K(%rip), %rax
	cmpq	%rax, -72(%rbp)
	jl	.L40
	movq	-32(%rbp), %rax
	movq	%rax, -80(%rbp)
	jmp	.L15
.L40:
	movq	-32(%rbp), %rax
	movq	%rax, -88(%rbp)
.L15:
	movq	-88(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -80(%rbp)
	jg	.L41
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	setg	%al
	movzbl	%al, %eax
	jmp	.L4
.L2:
	movl	$-1, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	K
	.align 8
	.type	K, @object
	.size	K, 8
K:
	.zero	8
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 1087312
A:
	.zero	1087312
	.globl	minus_max
	.align 4
	.type	minus_max, @object
	.size	minus_max, 4
minus_max:
	.zero	4
	.globl	plus_min
	.align 4
	.type	plus_min, @object
	.size	plus_min, 4
plus_min:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%ld"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	leaq	K(%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
	cmpl	$2, %eax
	je	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, -128(%rbp)
	jmp	.L8
.L10:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L7
.L9:
	addl	$1, -128(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L10
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	A(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, minus_max(%rip)
	movl	N(%rip), %eax
	movl	%eax, plus_min(%rip)
	movl	$0, -128(%rbp)
	jmp	.L11
.L14:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jns	.L12
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, minus_max(%rip)
.L12:
	movl	plus_min(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L13
	movl	-128(%rbp), %eax
	movl	%eax, plus_min(%rip)
.L13:
	addl	$1, -128(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L14
	movl	minus_max(%rip), %eax
	cltq
	movq	%rax, -64(%rbp)
	movl	plus_min(%rip), %eax
	movl	minus_max(%rip), %edx
	subl	%edx, %eax
	cltq
	movq	%rax, -56(%rbp)
	movl	N(%rip), %eax
	movl	plus_min(%rip), %edx
	subl	%edx, %eax
	cltq
	movq	%rax, -48(%rbp)
	movq	-64(%rbp), %rax
	imulq	-48(%rbp), %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	imulq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-48(%rbp), %rax
	imulq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-56(%rbp), %rax
	subq	$1, %rax
	imulq	-56(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	addq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movabsq	$1000000000000000001, %rax
	movq	%rax, -80(%rbp)
	movq	-80(%rbp), %rax
	negq	%rax
	movq	%rax, -88(%rbp)
	jmp	.L15
.L41:
	movq	-80(%rbp), %rax
	subq	-88(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	$0, -72(%rbp)
	cmpq	$0, -32(%rbp)
	jns	.L16
	movl	$0, -128(%rbp)
	jmp	.L17
.L23:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, %rsi
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	setne	%al
	movzbl	%al, %eax
	addq	%rsi, %rax
	movq	%rax, -8(%rbp)
	movl	plus_min(%rip), %eax
	movl	%eax, -124(%rbp)
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -120(%rbp)
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L18
	movl	-124(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L20
	movq	-48(%rbp), %rax
	addq	%rax, -72(%rbp)
	jmp	.L18
.L22:
	movl	-120(%rbp), %eax
	subl	-124(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-124(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -92(%rbp)
	movl	-92(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -8(%rbp)
	jg	.L21
	movl	-92(%rbp), %eax
	movl	%eax, -120(%rbp)
	jmp	.L20
.L21:
	movl	-92(%rbp), %eax
	movl	%eax, -124(%rbp)
.L20:
	movl	-124(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -120(%rbp)
	jg	.L22
	movl	N(%rip), %eax
	subl	-120(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L18:
	addl	$1, -128(%rbp)
.L17:
	movl	minus_max(%rip), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L23
	jmp	.L24
.L16:
	cmpq	$0, -32(%rbp)
	jne	.L25
	movq	-40(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L24
.L25:
	movq	-40(%rbp), %rax
	movq	%rax, -72(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L26
.L32:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -16(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -116(%rbp)
	movl	minus_max(%rip), %eax
	subl	$1, %eax
	movl	%eax, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L27
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L29
	movl	minus_max(%rip), %eax
	movl	-128(%rbp), %edx
	addl	$1, %edx
	subl	%edx, %eax
	cltq
	addq	%rax, -72(%rbp)
	jmp	.L27
.L31:
	movl	-112(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-116(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -96(%rbp)
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jg	.L30
	movl	-96(%rbp), %eax
	movl	%eax, -112(%rbp)
	jmp	.L29
.L30:
	movl	-96(%rbp), %eax
	movl	%eax, -116(%rbp)
.L29:
	movl	-116(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -112(%rbp)
	jg	.L31
	movl	minus_max(%rip), %eax
	subl	-112(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L27:
	addl	$1, -128(%rbp)
.L26:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	minus_max(%rip), %eax
	cmpl	%eax, %edx
	jl	.L32
	movl	plus_min(%rip), %eax
	movl	%eax, -128(%rbp)
	jmp	.L33
.L39:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	movq	%rax, -24(%rbp)
	movl	-128(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -108(%rbp)
	movl	N(%rip), %eax
	subl	$1, %eax
	movl	%eax, -104(%rbp)
	movl	-104(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jl	.L34
	movl	N(%rip), %eax
	movl	-128(%rbp), %edx
	addl	$1, %edx
	subl	%edx, %eax
	cltq
	addq	%rax, -72(%rbp)
	jmp	.L35
.L34:
	movl	-108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jl	.L35
	jmp	.L36
.L38:
	movl	-104(%rbp), %eax
	subl	-108(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-108(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -100(%rbp)
	movl	-100(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	cmpq	%rax, -24(%rbp)
	jge	.L37
	movl	-100(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L36
.L37:
	movl	-100(%rbp), %eax
	movl	%eax, -108(%rbp)
.L36:
	movl	-108(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -104(%rbp)
	jg	.L38
	movl	-108(%rbp), %eax
	subl	-128(%rbp), %eax
	cltq
	addq	%rax, -72(%rbp)
.L35:
	addl	$1, -128(%rbp)
.L33:
	movl	-128(%rbp), %eax
	leal	1(%rax), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L39
.L24:
	movq	K(%rip), %rax
	cmpq	%rax, -72(%rbp)
	jl	.L40
	movq	-32(%rbp), %rax
	movq	%rax, -80(%rbp)
	jmp	.L15
.L40:
	movq	-32(%rbp), %rax
	movq	%rax, -88(%rbp)
.L15:
	movq	-88(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -80(%rbp)
	jg	.L41
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
