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>

int n;
long long a[200000];
long long k;

int cmpfunc( const void *a, const void *b )
{
    long long r = *((long long *) a) - *((long long *) b);

    if( r < 0LL) return( -1 );
    else if( r == 0LL ) return( 0 );
    else return( 1 );
}

long long count( long long x )
{
    int i;
    long long tot = 0;

    for( i=0; i<n; i++ ) {
        if( a[i] < 0 ) {
            int l = -1;
            int r = n;
            while( l+1 < r ) {
                int c = (l+r) /2;
                if( a[c] * a[i] < x ) r=c;
                else                  l=c;
            }
            tot += n-r;
        } else {
            int l = -1;
            int r = n;
            while( l+1 < r ) {
                int c = (l+r) /2;
                if( a[c] * a[i] < x ) l=c;
                else                  r=c;
            }
            tot += r;
        }

        if( a[i] * a[i] < x ) tot--;
    }

    tot /= 2;

//printf( "k=%lld   x=%lld   tot=%lld\n", k, x, tot );

    return( tot );
}

int main( int argc, char *argv[] )
{
    int i;
    long long l = -((long long)1.0e18)-1;
    long long r =  ((long long)1.0e18)+1;

    if( scanf( "%d", &n ) != 1 ) {
        printf( "N read error!\n" );
        exit( -1 );
    }

    if( scanf( "%lld", &k ) != 1 ) {
        printf( "K read error!\n" );
        exit( -1 );
    }

    for( i=0; i<n; i++ ) {
        if( scanf( "%lld", &a[i] ) != 1 ) {
            printf( "A[%d] read error!\n", i );
            exit( -1 );
        }
    }

    qsort( a, n, sizeof(long long), cmpfunc );

    while( l+1 < r ) {

        long long x = (l + r) /2;

        if( count( x ) < k ) l = x;
        else                 r = x;
    }

    printf( "%lld\n", l );
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.globl	k
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.text
	.globl	cmpfunc
	.type	cmpfunc, @function
cmpfunc:
.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), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	cmpq	$0, -8(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmpfunc, .-cmpfunc
	.globl	count
	.type	count, @function
count:
.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, -56(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L6
.L16:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jns	.L7
	movl	$-1, -32(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -28(%rbp)
	jmp	.L8
.L10:
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L9
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L8:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -28(%rbp)
	jg	.L10
	movl	n(%rip), %eax
	subl	-28(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
	jmp	.L11
.L7:
	movl	$-1, -24(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -20(%rbp)
	jmp	.L12
.L14:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L13
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L12
.L13:
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
.L12:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L14
	movl	-20(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
.L11:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L15
	subq	$1, -8(%rbp)
.L15:
	addl	$1, -36(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L16
	movq	-8(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	count, .-count
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"N read error!"
.LC2:
	.string	"%lld"
.LC3:
	.string	"K read error!"
.LC4:
	.string	"A[%d] read error!\n"
.LC5:
	.string	"%lld\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
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movabsq	$-1000000000000000001, %rax
	movq	%rax, -24(%rbp)
	movabsq	$1000000000000000001, %rax
	movq	%rax, -16(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L19
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %edi
	call	exit@PLT
.L19:
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L20
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %edi
	call	exit@PLT
.L20:
	movl	$0, -28(%rbp)
	jmp	.L21
.L23:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L22
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$-1, %edi
	call	exit@PLT
.L22:
	addl	$1, -28(%rbp)
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L23
	movl	n(%rip), %eax
	cltq
	leaq	cmpfunc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	jmp	.L24
.L26:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	count
	movq	k(%rip), %rdx
	cmpq	%rdx, %rax
	jge	.L25
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L24
.L25:
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L24:
	movq	-24(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -16(%rbp)
	jg	.L26
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.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	cmpfunc
	.type	cmpfunc, @function
cmpfunc:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$-1, %eax
	cmpq	%rdx, (%rdi)
	js	.L1
	setne	%al
	movzbl	%al, %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	cmpfunc, .-cmpfunc
	.p2align 4
	.globl	count
	.type	count, @function
count:
.LFB40:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L16
	leaq	a(%rip), %r8
	leal	-1(%r11), %eax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%r9d, %r9d
	leaq	8(%r8), %rdx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r8, %r10
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	(%rdx,%rax,8), %rbx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%r10), %rsi
	testq	%rsi, %rsi
	js	.L17
	movslq	%r11d, %rcx
	movl	$-1, %edx
	xorl	%ebp, %ebp
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	leal	(%rcx,%rdx), %eax
	sarl	%eax
	movslq	%eax, %r12
	movq	(%r8,%r12,8), %r14
	imulq	%rsi, %r14
	cmpq	%rdi, %r14
	jge	.L25
	movl	%eax, %edx
	leal	1(%rax), %ebp
.L12:
	cmpl	%ebp, %ecx
	jg	.L13
	addq	%rcx, %r9
.L11:
	imulq	%rsi, %rsi
	xorl	%eax, %eax
	cmpq	%rdi, %rsi
	setl	%al
	addq	$8, %r10
	subq	%rax, %r9
	cmpq	%r10, %rbx
	jne	.L15
	movq	%r9, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	shrq	$63, %rax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	addq	%r9, %rax
	sarq	%rax
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movslq	%eax, %rcx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r11d, %edx
	movl	$-1, %ebp
.L7:
	leal	1(%rbp), %r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%rdx,%rbp), %eax
	sarl	%eax
	movslq	%eax, %rcx
	movq	(%r8,%rcx,8), %r14
	imulq	%rsi, %r14
	cmpq	%rdi, %r14
	jge	.L26
	movl	%eax, %edx
.L9:
	cmpl	%r12d, %edx
	jg	.L10
	movl	%r11d, %eax
	subl	%edx, %eax
	cltq
	addq	%rax, %r9
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%eax, %ebp
	jmp	.L7
.L16:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 14
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE40:
	.size	count, .-count
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"N read error!"
.LC2:
	.string	"%lld"
.LC3:
	.string	"K read error!"
.LC4:
	.string	"A[%d] read error!\n"
.LC5:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L41
	leaq	.LC2(%rip), %r13
	xorl	%eax, %eax
	leaq	k(%rip), %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L29
	movslq	n(%rip), %rsi
	leaq	a(%rip), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %rbx
	testl	%esi, %esi
	jle	.L31
	.p2align 4,,10
	.p2align 3
.L33:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L42
	movslq	n(%rip), %rsi
	addl	$1, %r12d
	addq	$8, %rbx
	cmpl	%r12d, %esi
	jg	.L33
.L31:
	movq	%rbp, %rdi
	movl	$8, %edx
	leaq	cmpfunc(%rip), %rcx
	movabsq	$1000000000000000001, %rbx
	call	qsort@PLT
	movabsq	$-1000000000000000001, %r13
	movq	k(%rip), %rbp
	movabsq	$-1000000000000000000, %r12
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L36:
	leaq	0(%r13,%rbx), %rax
	movq	%rax, %rdi
	shrq	$63, %rdi
	addq	%rax, %rdi
	sarq	%rdi
	call	count
	cmpq	%rbp, %rax
	jge	.L43
	movq	%rdi, %r13
	leaq	1(%rdi), %r12
.L35:
	cmpq	%rbx, %r12
	jl	.L36
	movq	%r13, %rdx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	.cfi_restore_state
	movq	%rdi, %rbx
	jmp	.L35
.L42:
	movl	$1, %edi
	movl	%r12d, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	exit@PLT
.L29:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	orl	$-1, %edi
	call	exit@PLT
.L41:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	orl	$-1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	k
	.bss
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.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	cmpfunc
	.type	cmpfunc, @function
cmpfunc:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$-1, %eax
	cmpq	%rdx, (%rdi)
	js	.L1
	setne	%al
	movzbl	%al, %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	cmpfunc, .-cmpfunc
	.p2align 4
	.globl	count
	.type	count, @function
count:
.LFB40:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L16
	leaq	a(%rip), %r8
	leal	-1(%r11), %eax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%r9d, %r9d
	leaq	8(%r8), %rdx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r8, %r10
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	(%rdx,%rax,8), %rbx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%r10), %rsi
	testq	%rsi, %rsi
	js	.L17
	movslq	%r11d, %rcx
	movl	$-1, %edx
	xorl	%ebp, %ebp
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	leal	(%rcx,%rdx), %eax
	sarl	%eax
	movslq	%eax, %r12
	movq	(%r8,%r12,8), %r14
	imulq	%rsi, %r14
	cmpq	%rdi, %r14
	jge	.L25
	movl	%eax, %edx
	leal	1(%rax), %ebp
.L12:
	cmpl	%ebp, %ecx
	jg	.L13
	addq	%rcx, %r9
.L11:
	imulq	%rsi, %rsi
	xorl	%eax, %eax
	cmpq	%rdi, %rsi
	setl	%al
	addq	$8, %r10
	subq	%rax, %r9
	cmpq	%r10, %rbx
	jne	.L15
	movq	%r9, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	shrq	$63, %rax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	addq	%r9, %rax
	sarq	%rax
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movslq	%eax, %rcx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r11d, %edx
	movl	$-1, %ebp
.L7:
	leal	1(%rbp), %r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%rdx,%rbp), %eax
	sarl	%eax
	movslq	%eax, %rcx
	movq	(%r8,%rcx,8), %r14
	imulq	%rsi, %r14
	cmpq	%rdi, %r14
	jge	.L26
	movl	%eax, %edx
.L9:
	cmpl	%r12d, %edx
	jg	.L10
	movl	%r11d, %eax
	subl	%edx, %eax
	cltq
	addq	%rax, %r9
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%eax, %ebp
	jmp	.L7
.L16:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 14
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE40:
	.size	count, .-count
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"N read error!"
.LC2:
	.string	"%lld"
.LC3:
	.string	"K read error!"
.LC4:
	.string	"A[%d] read error!\n"
.LC5:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L41
	leaq	.LC2(%rip), %r13
	xorl	%eax, %eax
	leaq	k(%rip), %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L29
	movslq	n(%rip), %rsi
	leaq	a(%rip), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %rbx
	testl	%esi, %esi
	jle	.L31
	.p2align 4,,10
	.p2align 3
.L33:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L42
	movslq	n(%rip), %rsi
	addl	$1, %r12d
	addq	$8, %rbx
	cmpl	%r12d, %esi
	jg	.L33
.L31:
	movq	%rbp, %rdi
	movl	$8, %edx
	leaq	cmpfunc(%rip), %rcx
	movabsq	$1000000000000000001, %rbx
	call	qsort@PLT
	movabsq	$-1000000000000000001, %r13
	movq	k(%rip), %rbp
	movabsq	$-1000000000000000000, %r12
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L36:
	leaq	0(%r13,%rbx), %rax
	movq	%rax, %rdi
	shrq	$63, %rdi
	addq	%rax, %rdi
	sarq	%rdi
	call	count
	cmpq	%rbp, %rax
	jge	.L43
	movq	%rdi, %r13
	leaq	1(%rdi), %r12
.L35:
	cmpq	%rbx, %r12
	jl	.L36
	movq	%r13, %rdx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	.cfi_restore_state
	movq	%rdi, %rbx
	jmp	.L35
.L42:
	movl	$1, %edi
	movl	%r12d, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	orl	$-1, %edi
	call	exit@PLT
.L29:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	orl	$-1, %edi
	call	exit@PLT
.L41:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	orl	$-1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	k
	.bss
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.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>

int n;
long long a[200000];
long long k;

int cmpfunc( const void *a, const void *b )
{
    long long r = *((long long *) a) - *((long long *) b);

    if( r < 0LL) return( -1 );
    else if( r == 0LL ) return( 0 );
    else return( 1 );
}

long long count( long long x )
{
    int i;
    long long tot = 0;

    for( i=0; i<n; i++ ) {
        if( a[i] < 0 ) {
            int l = -1;
            int r = n;
            while( l+1 < r ) {
                int c = (l+r) /2;
                if( a[c] * a[i] < x ) r=c;
                else                  l=c;
            }
            tot += n-r;
        } else {
            int l = -1;
            int r = n;
            while( l+1 < r ) {
                int c = (l+r) /2;
                if( a[c] * a[i] < x ) l=c;
                else                  r=c;
            }
            tot += r;
        }

        if( a[i] * a[i] < x ) tot--;
    }

    tot /= 2;

//printf( "k=%lld   x=%lld   tot=%lld\n", k, x, tot );

    return( tot );
}

int main( int argc, char *argv[] )
{
    int i;
    long long l = -((long long)1.0e18)-1;
    long long r =  ((long long)1.0e18)+1;

    if( scanf( "%d", &n ) != 1 ) {
        printf( "N read error!\n" );
        exit( -1 );
    }

    if( scanf( "%lld", &k ) != 1 ) {
        printf( "K read error!\n" );
        exit( -1 );
    }

    for( i=0; i<n; i++ ) {
        if( scanf( "%lld", &a[i] ) != 1 ) {
            printf( "A[%d] read error!\n", i );
            exit( -1 );
        }
    }

    qsort( a, n, sizeof(long long), cmpfunc );

    while( l+1 < r ) {

        long long x = (l + r) /2;

        if( count( x ) < k ) l = x;
        else                 r = x;
    }

    printf( "%lld\n", l );
}

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>

int n;
long long a[200000];
long long k;

int cmpfunc( const void *a, const void *b )
{
    long long r = *((long long *) a) - *((long long *) b);

    if( r < 0LL) return( -1 );
    else if( r == 0LL ) return( 0 );
    else return( 1 );
}

long long count( long long x )
{
    int i;
    long long tot = 0;

    for( i=0; i<n; i++ ) {
        if( a[i] < 0 ) {
            int l = -1;
            int r = n;
            while( l+1 < r ) {
                int c = (l+r) /2;
                if( a[c] * a[i] < x ) r=c;
                else                  l=c;
            }
            tot += n-r;
        } else {
            int l = -1;
            int r = n;
            while( l+1 < r ) {
                int c = (l+r) /2;
                if( a[c] * a[i] < x ) l=c;
                else                  r=c;
            }
            tot += r;
        }

        if( a[i] * a[i] < x ) tot--;
    }

    tot /= 2;

//printf( "k=%lld   x=%lld   tot=%lld\n", k, x, tot );

    return( tot );
}

int main( int argc, char *argv[] )
{
    int i;
    long long l = -((long long)1.0e18)-1;
    long long r =  ((long long)1.0e18)+1;

    if( scanf( "%d", &n ) != 1 ) {
        printf( "N read error!\n" );
        exit( -1 );
    }

    if( scanf( "%lld", &k ) != 1 ) {
        printf( "K read error!\n" );
        exit( -1 );
    }

    for( i=0; i<n; i++ ) {
        if( scanf( "%lld", &a[i] ) != 1 ) {
            printf( "A[%d] read error!\n", i );
            exit( -1 );
        }
    }

    qsort( a, n, sizeof(long long), cmpfunc );

    while( l+1 < r ) {

        long long x = (l + r) /2;

        if( count( x ) < k ) l = x;
        else                 r = x;
    }

    printf( "%lld\n", l );
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.globl	k
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.text
	.globl	cmpfunc
	.type	cmpfunc, @function
cmpfunc:
.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), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	cmpq	$0, -8(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmpfunc, .-cmpfunc
	.globl	count
	.type	count, @function
count:
.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, -56(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L6
.L16:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jns	.L7
	movl	$-1, -32(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -28(%rbp)
	jmp	.L8
.L10:
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L9
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L8:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -28(%rbp)
	jg	.L10
	movl	n(%rip), %eax
	subl	-28(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
	jmp	.L11
.L7:
	movl	$-1, -24(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -20(%rbp)
	jmp	.L12
.L14:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L13
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L12
.L13:
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
.L12:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L14
	movl	-20(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
.L11:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L15
	subq	$1, -8(%rbp)
.L15:
	addl	$1, -36(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L16
	movq	-8(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	count, .-count
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"N read error!"
.LC2:
	.string	"%lld"
.LC3:
	.string	"K read error!"
.LC4:
	.string	"A[%d] read error!\n"
.LC5:
	.string	"%lld\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
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movabsq	$-1000000000000000001, %rax
	movq	%rax, -24(%rbp)
	movabsq	$1000000000000000001, %rax
	movq	%rax, -16(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L19
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %edi
	call	exit@PLT
.L19:
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L20
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %edi
	call	exit@PLT
.L20:
	movl	$0, -28(%rbp)
	jmp	.L21
.L23:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L22
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$-1, %edi
	call	exit@PLT
.L22:
	addl	$1, -28(%rbp)
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L23
	movl	n(%rip), %eax
	cltq
	leaq	cmpfunc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	jmp	.L24
.L26:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	count
	movq	k(%rip), %rdx
	cmpq	%rdx, %rax
	jge	.L25
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L24
.L25:
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L24:
	movq	-24(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -16(%rbp)
	jg	.L26
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 1600000
a:
	.zero	1600000
	.globl	k
	.align 8
	.type	k, @object
	.size	k, 8
k:
	.zero	8
	.text
	.globl	cmpfunc
	.type	cmpfunc, @function
cmpfunc:
.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), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	cmpq	$0, -8(%rbp)
	jne	.L4
	movl	$0, %eax
	jmp	.L3
.L4:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmpfunc, .-cmpfunc
	.globl	count
	.type	count, @function
count:
.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, -56(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L6
.L16:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	jns	.L7
	movl	$-1, -32(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -28(%rbp)
	jmp	.L8
.L10:
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L9
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L8:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -28(%rbp)
	jg	.L10
	movl	n(%rip), %eax
	subl	-28(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
	jmp	.L11
.L7:
	movl	$-1, -24(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -20(%rbp)
	jmp	.L12
.L14:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L13
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L12
.L13:
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
.L12:
	movl	-24(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L14
	movl	-20(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
.L11:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -56(%rbp)
	jle	.L15
	subq	$1, -8(%rbp)
.L15:
	addl	$1, -36(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L16
	movq	-8(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	count, .-count
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"N read error!"
.LC2:
	.string	"%lld"
.LC3:
	.string	"K read error!"
.LC4:
	.string	"A[%d] read error!\n"
.LC5:
	.string	"%lld\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
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%rsi, -48(%rbp)
	movabsq	$-1000000000000000001, %rax
	movq	%rax, -24(%rbp)
	movabsq	$1000000000000000001, %rax
	movq	%rax, -16(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L19
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %edi
	call	exit@PLT
.L19:
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L20
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$-1, %edi
	call	exit@PLT
.L20:
	movl	$0, -28(%rbp)
	jmp	.L21
.L23:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L22
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$-1, %edi
	call	exit@PLT
.L22:
	addl	$1, -28(%rbp)
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L23
	movl	n(%rip), %eax
	cltq
	leaq	cmpfunc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	jmp	.L24
.L26:
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	count
	movq	k(%rip), %rdx
	cmpq	%rdx, %rax
	jge	.L25
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L24
.L25:
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L24:
	movq	-24(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -16(%rbp)
	jg	.L26
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.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:
