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<stdint.h>
#include<inttypes.h>
#include<string.h>

typedef int32_t i32;

int cmp (const void *a, const void *b) {
  i32 d = *(i32 *)a - *(i32 *)b;
  return d == 0 ? 0 : d < 0 ? -1 : 1;
}

void run (void) {
  i32 n, k;
  scanf ("%" SCNi32 "%" SCNi32, &n, &k);
  i32 *a = (i32 *) calloc (n, sizeof (i32));
  for (i32 i = 0; i < n; ++i) {
    scanf ("%" SCNi32, a + i);
  }
  qsort (a, n, sizeof (i32), cmp);
  const i32 bit_num = 8 * sizeof (uint64_t);
  i32 len = (k + bit_num - 1) / bit_num;
  uint64_t *dp = (uint64_t *) calloc (len + 1, sizeof (uint64_t));
  i32 l = -1;
  i32 r = n;
  while (r - l > 1) {
    i32 m = (l + r) / 2;
    memset (dp, 0, sizeof (uint64_t) * len);
    dp[0] = 1;
    for (i32 i = 0; i < n; ++i) {
      if (i == m) continue;
      i32 p = a[i] / bit_num;
      i32 q = a[i] % bit_num;
      if (q == 0) {
        for (i32 i = len - 1 - p; i >= 0; --i) {
          dp[i + p] |= dp[i];
        }
        continue;
      }
      for (i32 i = len - 1 - p; i >= 0; --i) {
        uint64_t x = dp[i];
        dp[i + p] |= x << q;
        dp[i + p + 1] |= x >> (bit_num - q);
      }
    }
    i32 i = k - 1;
    for (; !(1 & (dp[i / bit_num] >> (i % bit_num))); --i);
    if (i + a[m] >= k) {
      r = m;
    } else {
      l = m;
    }
  }
  printf ("%" PRIi32 "\n", r);
}

int main (void) {
  run();
  return 0;
}
```

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), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L2
	cmpl	$0, -4(%rbp)
	jns	.L3
	movl	$-1, %eax
	jmp	.L6
.L3:
	movl	$1, %eax
	jmp	.L6
.L2:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i"
.LC2:
	.string	"%i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-84(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L8:
	movl	-88(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L9
	movl	-88(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$64, -52(%rbp)
	movl	-84(%rbp), %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltd
	idivl	-52(%rbp)
	movl	%eax, -48(%rbp)
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	$-1, -76(%rbp)
	movl	-88(%rbp), %eax
	movl	%eax, -72(%rbp)
	jmp	.L10
.L23:
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	-24(%rbp), %rax
	movq	$1, (%rax)
	movl	$0, -68(%rbp)
	jmp	.L11
.L19:
	movl	-68(%rbp), %eax
	cmpl	-44(%rbp), %eax
	je	.L25
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltd
	idivl	-52(%rbp)
	movl	%eax, -40(%rbp)
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltd
	idivl	-52(%rbp)
	movl	%edx, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L14
	movl	-48(%rbp), %eax
	subl	$1, %eax
	subl	-40(%rbp), %eax
	movl	%eax, -64(%rbp)
	jmp	.L15
.L16:
	movl	-64(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %esi
	movl	-40(%rbp), %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	orq	%rcx, %rdx
	movq	%rdx, (%rax)
	subl	$1, -64(%rbp)
.L15:
	cmpl	$0, -64(%rbp)
	jns	.L16
	jmp	.L13
.L14:
	movl	-48(%rbp), %eax
	subl	$1, %eax
	subl	-40(%rbp), %eax
	movl	%eax, -60(%rbp)
	jmp	.L17
.L18:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-36(%rbp), %eax
	movq	-16(%rbp), %rdx
	movl	%eax, %ecx
	salq	%cl, %rdx
	movq	%rdx, %rcx
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	orq	%rcx, %rsi
	movq	%rsi, %rdx
	movq	%rdx, (%rax)
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-52(%rbp), %eax
	subl	-36(%rbp), %eax
	movq	-16(%rbp), %rdx
	movl	%eax, %ecx
	shrq	%cl, %rdx
	movq	%rdx, %rcx
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	orq	%rcx, %rsi
	movq	%rsi, %rdx
	movq	%rdx, (%rax)
	subl	$1, -60(%rbp)
.L17:
	cmpl	$0, -60(%rbp)
	jns	.L18
	jmp	.L13
.L25:
	nop
.L13:
	addl	$1, -68(%rbp)
.L11:
	movl	-88(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L19
	movl	-84(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -56(%rbp)
	jmp	.L20
.L21:
	subl	$1, -56(%rbp)
.L20:
	movl	-56(%rbp), %eax
	cltd
	idivl	-52(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-56(%rbp), %eax
	cltd
	idivl	-52(%rbp)
	movl	%edx, %eax
	movl	%eax, %ecx
	shrq	%cl, %rsi
	movq	%rsi, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L21
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-56(%rbp), %eax
	addl	%eax, %edx
	movl	-84(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L22
	movl	-44(%rbp), %eax
	movl	%eax, -72(%rbp)
	jmp	.L10
.L22:
	movl	-44(%rbp), %eax
	movl	%eax, -76(%rbp)
.L10:
	movl	-72(%rbp), %eax
	subl	-76(%rbp), %eax
	cmpl	$1, %eax
	jg	.L23
	movl	-72(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	run, .-run
	.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
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	je	.L1
	sarl	$31, %eax
	orl	$1, %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i"
.LC2:
	.string	"%i\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	100(%rsp), %rdx
	leaq	96(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	96(%rsp), %rbp
	movl	$4, %esi
	movq	%rbp, %rdi
	call	calloc@PLT
	movq	%rax, %r14
	testl	%ebp, %ebp
	jle	.L9
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	96(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L10
	movslq	%eax, %rbp
.L9:
	movl	$4, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	qsort@PLT
	movl	100(%rsp), %ebx
	movl	$8, %esi
	movl	%ebx, %eax
	leal	126(%rbx), %r12d
	movl	%ebx, 56(%rsp)
	addl	$63, %eax
	cmovns	%eax, %r12d
	sarl	$6, %r12d
	leal	1(%r12), %edi
	movslq	%edi, %rdi
	call	calloc@PLT
	movl	96(%rsp), %edx
	movq	%rax, %rdi
	testl	%edx, %edx
	jle	.L37
	movslq	%r12d, %rax
	movslq	%edx, %r13
	movl	$-1, 24(%rsp)
	movq	%r14, %r15
	leaq	0(,%rax,8), %rsi
	movq	%rax, 8(%rsp)
	leal	62(%rbx), %eax
	subl	$1, %ebx
	cmovns	%ebx, %eax
	movl	%ebx, %ecx
	movq	%rsi, 32(%rsp)
	leaq	-8(%rdi,%rsi), %rbp
	movl	%r13d, 20(%rsp)
	movq	%r13, %r14
	sarl	$6, %eax
	movl	%ebx, 60(%rsp)
	leaq	-16(%rdi,%rsi), %rbx
	cltq
	leaq	(%rdi,%rax,8), %rax
	movq	%rax, 40(%rsp)
	movl	$1, %eax
	salq	%cl, %rax
	movq	%rax, 48(%rsp)
	leaq	(%rdi,%rsi), %rax
	movq	%rax, 64(%rsp)
	leal	-1(%r12), %eax
	movl	%eax, 16(%rsp)
	leaq	-8(%rdi), %rax
	movq	%rax, 88(%rsp)
	.p2align 4,,10
	.p2align 3
.L35:
	movl	24(%rsp), %edx
	addl	20(%rsp), %edx
	xorl	%esi, %esi
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	movq	32(%rsp), %rdx
	sarl	%eax
	movl	%eax, %r13d
	call	memset@PLT
	movq	$1, (%rax)
	movq	%rax, %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	%eax, %r13d
	je	.L16
	movl	(%r15,%rax,4), %esi
	movl	16(%rsp), %r11d
	testl	%esi, %esi
	leal	63(%rsi), %ecx
	movl	%esi, %edx
	cmovns	%esi, %ecx
	sarl	$6, %ecx
	subl	%ecx, %r11d
	andl	$63, %edx
	je	.L64
	testl	%r11d, %r11d
	js	.L16
	movl	%esi, %r9d
	sarl	$31, %r9d
	shrl	$26, %r9d
	leal	(%rsi,%r9), %r8d
	movl	$64, %esi
	andl	$63, %r8d
	subl	%r9d, %r8d
	subl	%r8d, %esi
	movslq	%ecx, %r8
	leaq	16(,%r8,8), %r9
	cmpq	$8, %r9
	jbe	.L23
	testl	%r11d, %r11d
	je	.L23
	movq	8(%rsp), %r9
	leal	1(%r11), %r10d
	movd	%edx, %xmm4
	movd	%esi, %xmm3
	subq	%r8, %r9
	xorl	%r8d, %r8d
	leaq	-16(%rdi,%r9,8), %r12
	movl	%r10d, %r9d
	shrl	%r9d
	negq	%r9
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L24:
	movdqu	(%r12,%r8), %xmm1
	movdqu	(%rbx,%r8), %xmm0
	shufpd	$1, %xmm1, %xmm1
	movdqa	%xmm1, %xmm2
	shufpd	$1, %xmm0, %xmm0
	psrlq	%xmm3, %xmm1
	psllq	%xmm4, %xmm2
	por	%xmm2, %xmm0
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, (%rbx,%r8)
	movdqu	0(%rbp,%r8), %xmm0
	shufpd	$1, %xmm0, %xmm0
	por	%xmm1, %xmm0
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, 0(%rbp,%r8)
	subq	$16, %r8
	cmpq	%r8, %r9
	jne	.L24
	movl	%r10d, %r8d
	andl	$-2, %r8d
	subl	%r8d, %r11d
	cmpl	%r8d, %r10d
	je	.L16
	movslq	%r11d, %r8
	leal	(%rcx,%r11), %r9d
	movl	%edx, %ecx
	movq	(%rdi,%r8,8), %r8
	movslq	%r9d, %r9
	salq	$3, %r9
	movq	%r8, %r10
	salq	%cl, %r10
	movl	%esi, %ecx
	orq	%r10, (%rdi,%r9)
	shrq	%cl, %r8
	orq	%r8, 8(%rdi,%r9)
.L16:
	addq	$1, %rax
	cmpq	%rax, %r14
	jne	.L13
	movq	40(%rsp), %rsi
	movq	48(%rsp), %rax
	movl	60(%rsp), %edx
	andq	(%rsi), %rax
	jne	.L31
	.p2align 4,,10
	.p2align 3
.L32:
	subl	$1, %edx
	leal	63(%rdx), %eax
	cmovns	%edx, %eax
	sarl	$6, %eax
	cltq
	movq	(%rdi,%rax,8), %rax
	btq	%rdx, %rax
	jnc	.L32
.L31:
	movslq	%r13d, %rax
	addl	(%r15,%rax,4), %edx
	cmpl	%edx, 56(%rsp)
	jg	.L33
	movl	%r13d, %eax
	subl	24(%rsp), %eax
	cmpl	$1, %eax
	jle	.L65
	movl	%r13d, 20(%rsp)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L64:
	testl	%r11d, %r11d
	js	.L16
	movslq	%ecx, %rsi
	leaq	8(,%rsi,8), %rdx
	testq	%rdx, %rdx
	je	.L17
	cmpl	$1, %r11d
	jbe	.L17
	movq	8(%rsp), %rdx
	leal	1(%r11), %r8d
	subq	%rsi, %rdx
	movl	%r8d, %esi
	shrl	%esi
	leaq	-16(%rdi,%rdx,8), %r9
	xorl	%edx, %edx
	negq	%rsi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L18:
	movdqu	(%r9,%rdx), %xmm0
	movdqu	(%rbx,%rdx), %xmm1
	shufpd	$1, %xmm0, %xmm0
	shufpd	$1, %xmm1, %xmm1
	por	%xmm1, %xmm0
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, (%rbx,%rdx)
	subq	$16, %rdx
	cmpq	%rdx, %rsi
	jne	.L18
	movl	%r8d, %edx
	andl	$-2, %edx
	subl	%edx, %r11d
	cmpl	%r8d, %edx
	je	.L16
	addl	%r11d, %ecx
	movslq	%r11d, %r11
	movslq	%ecx, %rcx
	movq	(%rdi,%r11,8), %rdx
	orq	%rdx, (%rdi,%rcx,8)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	$1, %r11d
	jle	.L27
	movq	64(%rsp), %rcx
	movq	%r8, %r12
	movq	%rax, 80(%rsp)
	negq	%r12
	movq	%r15, 72(%rsp)
	movq	(%rcx), %r9
	movslq	%r11d, %rcx
	salq	$3, %r12
	addq	%r8, %rcx
	leaq	(%rdi,%rcx,8), %r10
	leal	-2(%r11), %ecx
	andl	$1, %r11d
	movl	%r11d, 28(%rsp)
	movl	%ecx, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L66:
	subl	$2, %eax
.L28:
	movq	(%r10,%r12), %r11
	movl	%edx, %ecx
	subq	$16, %r10
	movq	%r11, %r15
	salq	%cl, %r15
	movl	%esi, %ecx
	orq	16(%r10), %r15
	shrq	%cl, %r11
	movq	%r15, 16(%r10)
	movl	%edx, %ecx
	orq	%r9, %r11
	movq	%r11, 24(%r10)
	movq	8(%r10,%r12), %r11
	movq	%r11, %r9
	salq	%cl, %r9
	movl	%esi, %ecx
	orq	8(%r10), %r9
	shrq	%cl, %r11
	movq	%r9, 8(%r10)
	orq	%r15, %r11
	movq	%r11, 16(%r10)
	movl	%eax, %r11d
	cmpl	%eax, 28(%rsp)
	jne	.L66
	movq	72(%rsp), %r15
	movq	80(%rsp), %rax
.L27:
	movslq	%r11d, %rcx
	addq	%r8, %rcx
	negq	%r8
	leaq	(%rdi,%rcx,8), %r9
	leaq	0(,%r8,8), %r10
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%r9,%r10), %r8
	movl	%edx, %ecx
	subl	$1, %r11d
	movq	%r8, %r12
	salq	%cl, %r12
	movl	%esi, %ecx
	orq	%r12, (%r9)
	shrq	%cl, %r8
	orq	%r8, 8(%r9)
	subq	$8, %r9
	cmpl	$-1, %r11d
	jne	.L29
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L33:
	movl	20(%rsp), %eax
	subl	%r13d, %eax
	cmpl	$1, %eax
	jle	.L11
	movl	%r13d, 24(%rsp)
	jmp	.L35
.L17:
	movslq	%r11d, %r11
	movq	88(%rsp), %r10
	leaq	(%r11,%rsi), %rcx
	salq	$3, %r11
	negq	%rsi
	salq	$3, %rcx
	leaq	(%r10,%rcx), %r8
	leaq	(%rdi,%rcx), %rdx
	subq	%r11, %r8
	leaq	0(,%rsi,8), %rcx
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rdx,%rcx), %rsi
	orq	%rsi, (%rdx)
	subq	$8, %rdx
	cmpq	%rdx, %r8
	jne	.L21
	jmp	.L16
.L65:
	movl	%r13d, 20(%rsp)
.L11:
	movl	20(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	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
.L37:
	.cfi_restore_state
	movl	%edx, 20(%rsp)
	jmp	.L11
.L67:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	je	.L1
	sarl	$31, %eax
	orl	$1, %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i"
.LC2:
	.string	"%i\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	100(%rsp), %rdx
	leaq	96(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	96(%rsp), %rbp
	movl	$4, %esi
	movq	%rbp, %rdi
	call	calloc@PLT
	movq	%rax, %r14
	testl	%ebp, %ebp
	jle	.L9
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	96(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L10
	movslq	%eax, %rbp
.L9:
	movl	$4, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	qsort@PLT
	movl	100(%rsp), %ebx
	movl	$8, %esi
	movl	%ebx, %eax
	leal	126(%rbx), %r12d
	movl	%ebx, 56(%rsp)
	addl	$63, %eax
	cmovns	%eax, %r12d
	sarl	$6, %r12d
	leal	1(%r12), %edi
	movslq	%edi, %rdi
	call	calloc@PLT
	movl	96(%rsp), %edx
	movq	%rax, %rdi
	testl	%edx, %edx
	jle	.L37
	movslq	%r12d, %rax
	movslq	%edx, %r13
	movl	$-1, 24(%rsp)
	movq	%r14, %r15
	leaq	0(,%rax,8), %rsi
	movq	%rax, 8(%rsp)
	leal	62(%rbx), %eax
	subl	$1, %ebx
	cmovns	%ebx, %eax
	movl	%ebx, %ecx
	movq	%rsi, 32(%rsp)
	leaq	-8(%rdi,%rsi), %rbp
	movl	%r13d, 20(%rsp)
	movq	%r13, %r14
	sarl	$6, %eax
	movl	%ebx, 60(%rsp)
	leaq	-16(%rdi,%rsi), %rbx
	cltq
	leaq	(%rdi,%rax,8), %rax
	movq	%rax, 40(%rsp)
	movl	$1, %eax
	salq	%cl, %rax
	movq	%rax, 48(%rsp)
	leaq	(%rdi,%rsi), %rax
	movq	%rax, 64(%rsp)
	leal	-1(%r12), %eax
	movl	%eax, 16(%rsp)
	leaq	-8(%rdi), %rax
	movq	%rax, 88(%rsp)
	.p2align 4,,10
	.p2align 3
.L35:
	movl	24(%rsp), %edx
	addl	20(%rsp), %edx
	xorl	%esi, %esi
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	movq	32(%rsp), %rdx
	sarl	%eax
	movl	%eax, %r13d
	call	memset@PLT
	movq	$1, (%rax)
	movq	%rax, %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	%eax, %r13d
	je	.L16
	movl	(%r15,%rax,4), %esi
	movl	16(%rsp), %r11d
	testl	%esi, %esi
	leal	63(%rsi), %ecx
	movl	%esi, %edx
	cmovns	%esi, %ecx
	sarl	$6, %ecx
	subl	%ecx, %r11d
	andl	$63, %edx
	je	.L64
	testl	%r11d, %r11d
	js	.L16
	movl	%esi, %r9d
	sarl	$31, %r9d
	shrl	$26, %r9d
	leal	(%rsi,%r9), %r8d
	movl	$64, %esi
	andl	$63, %r8d
	subl	%r9d, %r8d
	subl	%r8d, %esi
	movslq	%ecx, %r8
	leaq	16(,%r8,8), %r9
	cmpq	$8, %r9
	jbe	.L23
	testl	%r11d, %r11d
	je	.L23
	movq	8(%rsp), %r9
	leal	1(%r11), %r10d
	movd	%edx, %xmm4
	movd	%esi, %xmm3
	subq	%r8, %r9
	xorl	%r8d, %r8d
	leaq	-16(%rdi,%r9,8), %r12
	movl	%r10d, %r9d
	shrl	%r9d
	negq	%r9
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L24:
	movdqu	(%r12,%r8), %xmm1
	movdqu	(%rbx,%r8), %xmm0
	shufpd	$1, %xmm1, %xmm1
	movdqa	%xmm1, %xmm2
	shufpd	$1, %xmm0, %xmm0
	psrlq	%xmm3, %xmm1
	psllq	%xmm4, %xmm2
	por	%xmm2, %xmm0
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, (%rbx,%r8)
	movdqu	0(%rbp,%r8), %xmm0
	shufpd	$1, %xmm0, %xmm0
	por	%xmm1, %xmm0
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, 0(%rbp,%r8)
	subq	$16, %r8
	cmpq	%r8, %r9
	jne	.L24
	movl	%r10d, %r8d
	andl	$-2, %r8d
	subl	%r8d, %r11d
	cmpl	%r8d, %r10d
	je	.L16
	movslq	%r11d, %r8
	leal	(%rcx,%r11), %r9d
	movl	%edx, %ecx
	movq	(%rdi,%r8,8), %r8
	movslq	%r9d, %r9
	salq	$3, %r9
	movq	%r8, %r10
	salq	%cl, %r10
	movl	%esi, %ecx
	orq	%r10, (%rdi,%r9)
	shrq	%cl, %r8
	orq	%r8, 8(%rdi,%r9)
.L16:
	addq	$1, %rax
	cmpq	%rax, %r14
	jne	.L13
	movq	40(%rsp), %rsi
	movq	48(%rsp), %rax
	movl	60(%rsp), %edx
	andq	(%rsi), %rax
	jne	.L31
	.p2align 4,,10
	.p2align 3
.L32:
	subl	$1, %edx
	leal	63(%rdx), %eax
	cmovns	%edx, %eax
	sarl	$6, %eax
	cltq
	movq	(%rdi,%rax,8), %rax
	btq	%rdx, %rax
	jnc	.L32
.L31:
	movslq	%r13d, %rax
	addl	(%r15,%rax,4), %edx
	cmpl	%edx, 56(%rsp)
	jg	.L33
	movl	%r13d, %eax
	subl	24(%rsp), %eax
	cmpl	$1, %eax
	jle	.L65
	movl	%r13d, 20(%rsp)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L64:
	testl	%r11d, %r11d
	js	.L16
	movslq	%ecx, %rsi
	leaq	8(,%rsi,8), %rdx
	testq	%rdx, %rdx
	je	.L17
	cmpl	$1, %r11d
	jbe	.L17
	movq	8(%rsp), %rdx
	leal	1(%r11), %r8d
	subq	%rsi, %rdx
	movl	%r8d, %esi
	shrl	%esi
	leaq	-16(%rdi,%rdx,8), %r9
	xorl	%edx, %edx
	negq	%rsi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L18:
	movdqu	(%r9,%rdx), %xmm0
	movdqu	(%rbx,%rdx), %xmm1
	shufpd	$1, %xmm0, %xmm0
	shufpd	$1, %xmm1, %xmm1
	por	%xmm1, %xmm0
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, (%rbx,%rdx)
	subq	$16, %rdx
	cmpq	%rdx, %rsi
	jne	.L18
	movl	%r8d, %edx
	andl	$-2, %edx
	subl	%edx, %r11d
	cmpl	%r8d, %edx
	je	.L16
	addl	%r11d, %ecx
	movslq	%r11d, %r11
	movslq	%ecx, %rcx
	movq	(%rdi,%r11,8), %rdx
	orq	%rdx, (%rdi,%rcx,8)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L23:
	cmpl	$1, %r11d
	jle	.L27
	movq	64(%rsp), %rcx
	movq	%r8, %r12
	movq	%rax, 80(%rsp)
	negq	%r12
	movq	%r15, 72(%rsp)
	movq	(%rcx), %r9
	movslq	%r11d, %rcx
	salq	$3, %r12
	addq	%r8, %rcx
	leaq	(%rdi,%rcx,8), %r10
	leal	-2(%r11), %ecx
	andl	$1, %r11d
	movl	%r11d, 28(%rsp)
	movl	%ecx, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L66:
	subl	$2, %eax
.L28:
	movq	(%r10,%r12), %r11
	movl	%edx, %ecx
	subq	$16, %r10
	movq	%r11, %r15
	salq	%cl, %r15
	movl	%esi, %ecx
	orq	16(%r10), %r15
	shrq	%cl, %r11
	movq	%r15, 16(%r10)
	movl	%edx, %ecx
	orq	%r9, %r11
	movq	%r11, 24(%r10)
	movq	8(%r10,%r12), %r11
	movq	%r11, %r9
	salq	%cl, %r9
	movl	%esi, %ecx
	orq	8(%r10), %r9
	shrq	%cl, %r11
	movq	%r9, 8(%r10)
	orq	%r15, %r11
	movq	%r11, 16(%r10)
	movl	%eax, %r11d
	cmpl	%eax, 28(%rsp)
	jne	.L66
	movq	72(%rsp), %r15
	movq	80(%rsp), %rax
.L27:
	movslq	%r11d, %rcx
	addq	%r8, %rcx
	negq	%r8
	leaq	(%rdi,%rcx,8), %r9
	leaq	0(,%r8,8), %r10
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%r9,%r10), %r8
	movl	%edx, %ecx
	subl	$1, %r11d
	movq	%r8, %r12
	salq	%cl, %r12
	movl	%esi, %ecx
	orq	%r12, (%r9)
	shrq	%cl, %r8
	orq	%r8, 8(%r9)
	subq	$8, %r9
	cmpl	$-1, %r11d
	jne	.L29
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L33:
	movl	20(%rsp), %eax
	subl	%r13d, %eax
	cmpl	$1, %eax
	jle	.L11
	movl	%r13d, 24(%rsp)
	jmp	.L35
.L17:
	movslq	%r11d, %r11
	movq	88(%rsp), %r10
	leaq	(%r11,%rsi), %rcx
	salq	$3, %r11
	negq	%rsi
	salq	$3, %rcx
	leaq	(%r10,%rcx), %r8
	leaq	(%rdi,%rcx), %rdx
	subq	%r11, %r8
	leaq	0(,%rsi,8), %rcx
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rdx,%rcx), %rsi
	orq	%rsi, (%rdx)
	subq	$8, %rdx
	cmpq	%rdx, %r8
	jne	.L21
	jmp	.L16
.L65:
	movl	%r13d, 20(%rsp)
.L11:
	movl	20(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L67
	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
.L37:
	.cfi_restore_state
	movl	%edx, 20(%rsp)
	jmp	.L11
.L67:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>

typedef int32_t i32;

int cmp (const void *a, const void *b) {
  i32 d = *(i32 *)a - *(i32 *)b;
  return d == 0 ? 0 : d < 0 ? -1 : 1;
}

void run (void) {
  i32 n, k;
  scanf ("%" SCNi32 "%" SCNi32, &n, &k);
  i32 *a = (i32 *) calloc (n, sizeof (i32));
  for (i32 i = 0; i < n; ++i) {
    scanf ("%" SCNi32, a + i);
  }
  qsort (a, n, sizeof (i32), cmp);
  const i32 bit_num = 8 * sizeof (uint64_t);
  i32 len = (k + bit_num - 1) / bit_num;
  uint64_t *dp = (uint64_t *) calloc (len + 1, sizeof (uint64_t));
  i32 l = -1;
  i32 r = n;
  while (r - l > 1) {
    i32 m = (l + r) / 2;
    memset (dp, 0, sizeof (uint64_t) * len);
    dp[0] = 1;
    for (i32 i = 0; i < n; ++i) {
      if (i == m) continue;
      i32 p = a[i] / bit_num;
      i32 q = a[i] % bit_num;
      if (q == 0) {
        for (i32 i = len - 1 - p; i >= 0; --i) {
          dp[i + p] |= dp[i];
        }
        continue;
      }
      for (i32 i = len - 1 - p; i >= 0; --i) {
        uint64_t x = dp[i];
        dp[i + p] |= x << q;
        dp[i + p + 1] |= x >> (bit_num - q);
      }
    }
    i32 i = k - 1;
    for (; !(1 & (dp[i / bit_num] >> (i % bit_num))); --i);
    if (i + a[m] >= k) {
      r = m;
    } else {
      l = m;
    }
  }
  printf ("%" PRIi32 "\n", r);
}

int main (void) {
  run();
  return 0;
}

3 6
1 4 3

1

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<stdint.h>
#include<inttypes.h>
#include<string.h>

typedef int32_t i32;

int cmp (const void *a, const void *b) {
  i32 d = *(i32 *)a - *(i32 *)b;
  return d == 0 ? 0 : d < 0 ? -1 : 1;
}

void run (void) {
  i32 n, k;
  scanf ("%" SCNi32 "%" SCNi32, &n, &k);
  i32 *a = (i32 *) calloc (n, sizeof (i32));
  for (i32 i = 0; i < n; ++i) {
    scanf ("%" SCNi32, a + i);
  }
  qsort (a, n, sizeof (i32), cmp);
  const i32 bit_num = 8 * sizeof (uint64_t);
  i32 len = (k + bit_num - 1) / bit_num;
  uint64_t *dp = (uint64_t *) calloc (len + 1, sizeof (uint64_t));
  i32 l = -1;
  i32 r = n;
  while (r - l > 1) {
    i32 m = (l + r) / 2;
    memset (dp, 0, sizeof (uint64_t) * len);
    dp[0] = 1;
    for (i32 i = 0; i < n; ++i) {
      if (i == m) continue;
      i32 p = a[i] / bit_num;
      i32 q = a[i] % bit_num;
      if (q == 0) {
        for (i32 i = len - 1 - p; i >= 0; --i) {
          dp[i + p] |= dp[i];
        }
        continue;
      }
      for (i32 i = len - 1 - p; i >= 0; --i) {
        uint64_t x = dp[i];
        dp[i + p] |= x << q;
        dp[i + p + 1] |= x >> (bit_num - q);
      }
    }
    i32 i = k - 1;
    for (; !(1 & (dp[i / bit_num] >> (i % bit_num))); --i);
    if (i + a[m] >= k) {
      r = m;
    } else {
      l = m;
    }
  }
  printf ("%" PRIi32 "\n", r);
}

int main (void) {
  run();
  return 0;
}
```

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), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L2
	cmpl	$0, -4(%rbp)
	jns	.L3
	movl	$-1, %eax
	jmp	.L6
.L3:
	movl	$1, %eax
	jmp	.L6
.L2:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i"
.LC2:
	.string	"%i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-84(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L8:
	movl	-88(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L9
	movl	-88(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$64, -52(%rbp)
	movl	-84(%rbp), %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltd
	idivl	-52(%rbp)
	movl	%eax, -48(%rbp)
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	$-1, -76(%rbp)
	movl	-88(%rbp), %eax
	movl	%eax, -72(%rbp)
	jmp	.L10
.L23:
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	-24(%rbp), %rax
	movq	$1, (%rax)
	movl	$0, -68(%rbp)
	jmp	.L11
.L19:
	movl	-68(%rbp), %eax
	cmpl	-44(%rbp), %eax
	je	.L25
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltd
	idivl	-52(%rbp)
	movl	%eax, -40(%rbp)
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltd
	idivl	-52(%rbp)
	movl	%edx, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L14
	movl	-48(%rbp), %eax
	subl	$1, %eax
	subl	-40(%rbp), %eax
	movl	%eax, -64(%rbp)
	jmp	.L15
.L16:
	movl	-64(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %esi
	movl	-40(%rbp), %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	orq	%rcx, %rdx
	movq	%rdx, (%rax)
	subl	$1, -64(%rbp)
.L15:
	cmpl	$0, -64(%rbp)
	jns	.L16
	jmp	.L13
.L14:
	movl	-48(%rbp), %eax
	subl	$1, %eax
	subl	-40(%rbp), %eax
	movl	%eax, -60(%rbp)
	jmp	.L17
.L18:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-36(%rbp), %eax
	movq	-16(%rbp), %rdx
	movl	%eax, %ecx
	salq	%cl, %rdx
	movq	%rdx, %rcx
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	orq	%rcx, %rsi
	movq	%rsi, %rdx
	movq	%rdx, (%rax)
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-52(%rbp), %eax
	subl	-36(%rbp), %eax
	movq	-16(%rbp), %rdx
	movl	%eax, %ecx
	shrq	%cl, %rdx
	movq	%rdx, %rcx
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	orq	%rcx, %rsi
	movq	%rsi, %rdx
	movq	%rdx, (%rax)
	subl	$1, -60(%rbp)
.L17:
	cmpl	$0, -60(%rbp)
	jns	.L18
	jmp	.L13
.L25:
	nop
.L13:
	addl	$1, -68(%rbp)
.L11:
	movl	-88(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L19
	movl	-84(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -56(%rbp)
	jmp	.L20
.L21:
	subl	$1, -56(%rbp)
.L20:
	movl	-56(%rbp), %eax
	cltd
	idivl	-52(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-56(%rbp), %eax
	cltd
	idivl	-52(%rbp)
	movl	%edx, %eax
	movl	%eax, %ecx
	shrq	%cl, %rsi
	movq	%rsi, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L21
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-56(%rbp), %eax
	addl	%eax, %edx
	movl	-84(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L22
	movl	-44(%rbp), %eax
	movl	%eax, -72(%rbp)
	jmp	.L10
.L22:
	movl	-44(%rbp), %eax
	movl	%eax, -76(%rbp)
.L10:
	movl	-72(%rbp), %eax
	subl	-76(%rbp), %eax
	cmpl	$1, %eax
	jg	.L23
	movl	-72(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	run, .-run
	.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
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	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), %edx
	movq	-32(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L2
	cmpl	$0, -4(%rbp)
	jns	.L3
	movl	$-1, %eax
	jmp	.L6
.L3:
	movl	$1, %eax
	jmp	.L6
.L2:
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i"
.LC2:
	.string	"%i\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-84(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L8:
	movl	-88(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L9
	movl	-88(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$64, -52(%rbp)
	movl	-84(%rbp), %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	cltd
	idivl	-52(%rbp)
	movl	%eax, -48(%rbp)
	movl	-48(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	$-1, -76(%rbp)
	movl	-88(%rbp), %eax
	movl	%eax, -72(%rbp)
	jmp	.L10
.L23:
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -44(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	-24(%rbp), %rax
	movq	$1, (%rax)
	movl	$0, -68(%rbp)
	jmp	.L11
.L19:
	movl	-68(%rbp), %eax
	cmpl	-44(%rbp), %eax
	je	.L25
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltd
	idivl	-52(%rbp)
	movl	%eax, -40(%rbp)
	movl	-68(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltd
	idivl	-52(%rbp)
	movl	%edx, -36(%rbp)
	cmpl	$0, -36(%rbp)
	jne	.L14
	movl	-48(%rbp), %eax
	subl	$1, %eax
	subl	-40(%rbp), %eax
	movl	%eax, -64(%rbp)
	jmp	.L15
.L16:
	movl	-64(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %esi
	movl	-40(%rbp), %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	orq	%rcx, %rdx
	movq	%rdx, (%rax)
	subl	$1, -64(%rbp)
.L15:
	cmpl	$0, -64(%rbp)
	jns	.L16
	jmp	.L13
.L14:
	movl	-48(%rbp), %eax
	subl	$1, %eax
	subl	-40(%rbp), %eax
	movl	%eax, -60(%rbp)
	jmp	.L17
.L18:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-36(%rbp), %eax
	movq	-16(%rbp), %rdx
	movl	%eax, %ecx
	salq	%cl, %rdx
	movq	%rdx, %rcx
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	orq	%rcx, %rsi
	movq	%rsi, %rdx
	movq	%rdx, (%rax)
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-52(%rbp), %eax
	subl	-36(%rbp), %eax
	movq	-16(%rbp), %rdx
	movl	%eax, %ecx
	shrq	%cl, %rdx
	movq	%rdx, %rcx
	movl	-60(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	orq	%rcx, %rsi
	movq	%rsi, %rdx
	movq	%rdx, (%rax)
	subl	$1, -60(%rbp)
.L17:
	cmpl	$0, -60(%rbp)
	jns	.L18
	jmp	.L13
.L25:
	nop
.L13:
	addl	$1, -68(%rbp)
.L11:
	movl	-88(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L19
	movl	-84(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -56(%rbp)
	jmp	.L20
.L21:
	subl	$1, -56(%rbp)
.L20:
	movl	-56(%rbp), %eax
	cltd
	idivl	-52(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rsi
	movl	-56(%rbp), %eax
	cltd
	idivl	-52(%rbp)
	movl	%edx, %eax
	movl	%eax, %ecx
	shrq	%cl, %rsi
	movq	%rsi, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L21
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-56(%rbp), %eax
	addl	%eax, %edx
	movl	-84(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L22
	movl	-44(%rbp), %eax
	movl	%eax, -72(%rbp)
	jmp	.L10
.L22:
	movl	-44(%rbp), %eax
	movl	%eax, -76(%rbp)
.L10:
	movl	-72(%rbp), %eax
	subl	-76(%rbp), %eax
	cmpl	$1, %eax
	jg	.L23
	movl	-72(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	run, .-run
	.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
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
