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

```c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <limits.h>

int cmp(const void* p, const void* q) {
	return *(int*)q - *(int*)p;
}

int main(void) {
	int n, k;
	int a[200001] = { 0 };
	int cnt[200001] = { 0 };
	int ans = 0;
	int shurui = 0;

	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		cnt[a[i]]++;
	}
	qsort(cnt, n+1, sizeof(int), cmp);
	for (int i = 0; i < n ; i++) {
		if (cnt[i] != 0)shurui++;
	}
	for (int i = n - 1; i >= 0; i--) {
		if (shurui <= k) {
			printf("%d", ans);
			break;
		}
		else if (cnt[i] > 0)ans += cnt[i], shurui--;
	}
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2616, %rsp
	.cfi_def_cfa_offset 1600096
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 1600040(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	800032(%rsp), %rbp
	movq	%rbx, %rdi
	call	memset@PLT
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %esi
	testl	%esi, %esi
	jle	.L4
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movl	8(%rsp), %esi
	addq	$4, %rbx
	addl	$1, 800032(%rsp,%rax,4)
	cmpl	%r12d, %esi
	jg	.L5
.L4:
	addl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L6
	leal	-1(%rcx), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%ecx, %esi
	pxor	%xmm0, %xmm0
	movq	%rbp, %rax
	shrl	$2, %esi
	movdqa	%xmm0, %xmm2
	subl	$1, %esi
	salq	$4, %rsi
	leaq	800048(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rsi
	jne	.L8
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %cl
	je	.L9
.L7:
	movslq	%esi, %rdi
	cmpl	$1, 800032(%rsp,%rdi,4)
	leal	1(%rsi), %edi
	sbbl	$-1, %eax
	cmpl	%ecx, %edi
	jge	.L9
	movslq	%edi, %rdi
	cmpl	$0, 800032(%rsp,%rdi,4)
	jne	.L24
.L11:
	addl	$2, %esi
	cmpl	%esi, %ecx
	jle	.L9
	movslq	%esi, %rsi
	cmpl	$0, 800032(%rsp,%rsi,4)
	jne	.L25
.L9:
	movl	12(%rsp), %esi
	movslq	%edx, %rdx
	xorl	%r8d, %r8d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L14:
	movl	0(%rbp,%rdx,4), %ecx
	testl	%ecx, %ecx
	jle	.L15
	addl	%ecx, %r8d
	subl	$1, %eax
.L15:
	subq	$1, %rdx
	testl	%edx, %edx
	js	.L6
.L16:
	cmpl	%eax, %esi
	jl	.L14
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L6:
	movq	1600040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$1600056, %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
.L24:
	.cfi_restore_state
	addl	$1, %eax
	jmp	.L11
.L25:
	addl	$1, %eax
	jmp	.L9
.L18:
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2616, %rsp
	.cfi_def_cfa_offset 1600096
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 1600040(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	800032(%rsp), %rbp
	movq	%rbx, %rdi
	call	memset@PLT
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %esi
	testl	%esi, %esi
	jle	.L4
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movl	8(%rsp), %esi
	addq	$4, %rbx
	addl	$1, 800032(%rsp,%rax,4)
	cmpl	%r12d, %esi
	jg	.L5
.L4:
	addl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L6
	leal	-1(%rcx), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%ecx, %esi
	pxor	%xmm0, %xmm0
	movq	%rbp, %rax
	shrl	$2, %esi
	movdqa	%xmm0, %xmm2
	subl	$1, %esi
	salq	$4, %rsi
	leaq	800048(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rsi
	jne	.L8
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %cl
	je	.L9
.L7:
	movslq	%esi, %rdi
	cmpl	$1, 800032(%rsp,%rdi,4)
	leal	1(%rsi), %edi
	sbbl	$-1, %eax
	cmpl	%ecx, %edi
	jge	.L9
	movslq	%edi, %rdi
	cmpl	$0, 800032(%rsp,%rdi,4)
	jne	.L24
.L11:
	addl	$2, %esi
	cmpl	%esi, %ecx
	jle	.L9
	movslq	%esi, %rsi
	cmpl	$0, 800032(%rsp,%rsi,4)
	jne	.L25
.L9:
	movl	12(%rsp), %esi
	movslq	%edx, %rdx
	xorl	%r8d, %r8d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L14:
	movl	0(%rbp,%rdx,4), %ecx
	testl	%ecx, %ecx
	jle	.L15
	addl	%ecx, %r8d
	subl	$1, %eax
.L15:
	subq	$1, %rdx
	testl	%edx, %edx
	js	.L6
.L16:
	cmpl	%eax, %esi
	jl	.L14
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L6:
	movq	1600040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$1600056, %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
.L24:
	.cfi_restore_state
	addl	$1, %eax
	jmp	.L11
.L25:
	addl	$1, %eax
	jmp	.L9
.L18:
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2616, %rsp
	.cfi_def_cfa_offset 1600096
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 1600040(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	800032(%rsp), %rbp
	movq	%rbx, %rdi
	call	memset@PLT
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %esi
	testl	%esi, %esi
	jle	.L4
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movl	8(%rsp), %esi
	addq	$4, %rbx
	addl	$1, 800032(%rsp,%rax,4)
	cmpl	%r12d, %esi
	jg	.L5
.L4:
	addl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L6
	leal	-1(%rcx), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%ecx, %esi
	pxor	%xmm0, %xmm0
	movq	%rbp, %rax
	shrl	$2, %esi
	movdqa	%xmm0, %xmm2
	subl	$1, %esi
	salq	$4, %rsi
	leaq	800048(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rsi
	jne	.L8
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %cl
	je	.L9
.L7:
	movslq	%esi, %rdi
	cmpl	$1, 800032(%rsp,%rdi,4)
	leal	1(%rsi), %edi
	sbbl	$-1, %eax
	cmpl	%ecx, %edi
	jge	.L9
	movslq	%edi, %rdi
	cmpl	$0, 800032(%rsp,%rdi,4)
	jne	.L24
.L11:
	addl	$2, %esi
	cmpl	%esi, %ecx
	jle	.L9
	movslq	%esi, %rsi
	cmpl	$0, 800032(%rsp,%rsi,4)
	jne	.L25
.L9:
	movl	12(%rsp), %esi
	movslq	%edx, %rdx
	xorl	%r8d, %r8d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L14:
	movl	0(%rbp,%rdx,4), %ecx
	testl	%ecx, %ecx
	jle	.L15
	addl	%ecx, %r8d
	subl	$1, %eax
.L15:
	subq	$1, %rdx
	testl	%edx, %edx
	js	.L6
.L16:
	cmpl	%eax, %esi
	jl	.L14
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L6:
	movq	1600040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$1600056, %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
.L24:
	.cfi_restore_state
	addl	$1, %eax
	jmp	.L11
.L25:
	addl	$1, %eax
	jmp	.L9
.L18:
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```
```c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <limits.h>

int cmp(const void* p, const void* q) {
	return *(int*)q - *(int*)p;
}

int main(void) {
	int n, k;
	int a[200001] = { 0 };
	int cnt[200001] = { 0 };
	int ans = 0;
	int shurui = 0;

	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		cnt[a[i]]++;
	}
	qsort(cnt, n+1, sizeof(int), cmp);
	for (int i = 0; i < n ; i++) {
		if (cnt[i] != 0)shurui++;
	}
	for (int i = n - 1; i >= 0; i--) {
		if (shurui <= k) {
			printf("%d", ans);
			break;
		}
		else if (cnt[i] > 0)ans += cnt[i], shurui--;
	}
	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <limits.h>

int cmp(const void* p, const void* q) {
	return *(int*)q - *(int*)p;
}

int main(void) {
	int n, k;
	int a[200001] = { 0 };
	int cnt[200001] = { 0 };
	int ans = 0;
	int shurui = 0;

	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		cnt[a[i]]++;
	}
	qsort(cnt, n+1, sizeof(int), cmp);
	for (int i = 0; i < n ; i++) {
		if (cnt[i] != 0)shurui++;
	}
	for (int i = n - 1; i >= 0; i--) {
		if (shurui <= k) {
			printf("%d", ans);
			break;
		}
		else if (cnt[i] > 0)ans += cnt[i], shurui--;
	}
	return 0;
}
```

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.
Optimized Assembly Code:

4 4
0 1 2 2
 10 3
5 1 3 2 4 1 2 2 3 4
 10 3
5 1 3 4 8 1 2 2 3 4
 10 3
3 2 3 4 8 1 2 2 3 4
 5 2
2 1 4 2 1
 10 1
5 1 3 2 4 1 2 2 3 8
 10 1
5 2 3 2 4 1 2 2 3 8
 4 4
0 1 2 4
 4 4
-1 1 2 4
 4 4
-2 1 2 4

0 3 4 2 1 7 6 0 0 0
Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <limits.h>

int cmp(const void* p, const void* q) {
	return *(int*)q - *(int*)p;
}

int main(void) {
	int n, k;
	int a[200001] = { 0 };
	int cnt[200001] = { 0 };
	int ans = 0;
	int shurui = 0;

	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		cnt[a[i]]++;
	}
	qsort(cnt, n+1, sizeof(int), cmp);
	for (int i = 0; i < n ; i++) {
		if (cnt[i] != 0)shurui++;
	}
	for (int i = n - 1; i >= 0; i--) {
		if (shurui <= k) {
			printf("%d", ans);
			break;
		}
		else if (cnt[i] > 0)ans += cnt[i], shurui--;
	}
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2616, %rsp
	.cfi_def_cfa_offset 1600096
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 1600040(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	800032(%rsp), %rbp
	movq	%rbx, %rdi
	call	memset@PLT
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %esi
	testl	%esi, %esi
	jle	.L4
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movl	8(%rsp), %esi
	addq	$4, %rbx
	addl	$1, 800032(%rsp,%rax,4)
	cmpl	%r12d, %esi
	jg	.L5
.L4:
	addl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L6
	leal	-1(%rcx), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%ecx, %esi
	pxor	%xmm0, %xmm0
	movq	%rbp, %rax
	shrl	$2, %esi
	movdqa	%xmm0, %xmm2
	subl	$1, %esi
	salq	$4, %rsi
	leaq	800048(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rsi
	jne	.L8
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %cl
	je	.L9
.L7:
	movslq	%esi, %rdi
	cmpl	$1, 800032(%rsp,%rdi,4)
	leal	1(%rsi), %edi
	sbbl	$-1, %eax
	cmpl	%ecx, %edi
	jge	.L9
	movslq	%edi, %rdi
	cmpl	$0, 800032(%rsp,%rdi,4)
	jne	.L24
.L11:
	addl	$2, %esi
	cmpl	%esi, %ecx
	jle	.L9
	movslq	%esi, %rsi
	cmpl	$0, 800032(%rsp,%rsi,4)
	jne	.L25
.L9:
	movl	12(%rsp), %esi
	movslq	%edx, %rdx
	xorl	%r8d, %r8d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L14:
	movl	0(%rbp,%rdx,4), %ecx
	testl	%ecx, %ecx
	jle	.L15
	addl	%ecx, %r8d
	subl	$1, %eax
.L15:
	subq	$1, %rdx
	testl	%edx, %edx
	js	.L6
.L16:
	cmpl	%eax, %esi
	jl	.L14
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L6:
	movq	1600040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$1600056, %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
.L24:
	.cfi_restore_state
	addl	$1, %eax
	jmp	.L11
.L25:
	addl	$1, %eax
	jmp	.L9
.L18:
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597480
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2616, %rsp
	.cfi_def_cfa_offset 1600096
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 1600040(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	800032(%rsp), %rbp
	movq	%rbx, %rdi
	call	memset@PLT
	movl	$800004, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %esi
	testl	%esi, %esi
	jle	.L4
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movl	8(%rsp), %esi
	addq	$4, %rbx
	addl	$1, 800032(%rsp,%rax,4)
	cmpl	%r12d, %esi
	jg	.L5
.L4:
	addl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L6
	leal	-1(%rcx), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%ecx, %esi
	pxor	%xmm0, %xmm0
	movq	%rbp, %rax
	shrl	$2, %esi
	movdqa	%xmm0, %xmm2
	subl	$1, %esi
	salq	$4, %rsi
	leaq	800048(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rsi
	jne	.L8
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	testb	$3, %cl
	je	.L9
.L7:
	movslq	%esi, %rdi
	cmpl	$1, 800032(%rsp,%rdi,4)
	leal	1(%rsi), %edi
	sbbl	$-1, %eax
	cmpl	%ecx, %edi
	jge	.L9
	movslq	%edi, %rdi
	cmpl	$0, 800032(%rsp,%rdi,4)
	jne	.L24
.L11:
	addl	$2, %esi
	cmpl	%esi, %ecx
	jle	.L9
	movslq	%esi, %rsi
	cmpl	$0, 800032(%rsp,%rsi,4)
	jne	.L25
.L9:
	movl	12(%rsp), %esi
	movslq	%edx, %rdx
	xorl	%r8d, %r8d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L14:
	movl	0(%rbp,%rdx,4), %ecx
	testl	%ecx, %ecx
	jle	.L15
	addl	%ecx, %r8d
	subl	$1, %eax
.L15:
	subq	$1, %rdx
	testl	%edx, %edx
	js	.L6
.L16:
	cmpl	%eax, %esi
	jl	.L14
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L6:
	movq	1600040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$1600056, %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
.L24:
	.cfi_restore_state
	addl	$1, %eax
	jmp	.L11
.L25:
	addl	$1, %eax
	jmp	.L9
.L18:
	xorl	%esi, %esi
	xorl	%eax, %eax
	jmp	.L7
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```