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

```c


#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX_STRING 50

	char sInput[MAX_STRING+1]="";
	int anX[100000];
	int anY[100000];

	int compar(const int *val1, const int *val2);

int main() {
//	char* psInput;

	int i=0;
	int j=0;
	int nNumber=0;
	int nTargetNumber=0;
	int nLastTarget=0;
	int nFriends=0;
	int nNeedChanges=0;

	// read line 1
    scanf("%d", &nNumber);
	// read line 2
	for(i=0; i<nNumber; i++) {
        scanf("%d", &anX[i]);
	}
	// sort
    qsort(anX, nNumber, sizeof(int),
        (int (*)(const void *, const void *))compar
    );
	nTargetNumber=anX[0];
	nLastTarget=anX[nNumber-1];
	for (i=0;i<nNumber;i++){
		if (anX[i]==nTargetNumber){
			nFriends++;
		} else {
			// ここまでチェックした数について精算する
			if (nFriends<nTargetNumber){
				nNeedChanges=nNeedChanges+nFriends;
			} else if (nFriends>nTargetNumber){
				nNeedChanges=nNeedChanges+(nFriends-nTargetNumber);
			}
			// ターゲットを更新
			nTargetNumber=anX[i];
			nFriends=1;
		}
	}
	// 最終ターゲットの精算
	if (nFriends>0){
		if (nFriends<nTargetNumber){
			nNeedChanges=nNeedChanges+nFriends;
		} else if (nFriends>nTargetNumber){
			nNeedChanges=nNeedChanges+(nFriends-nTargetNumber);
		}
	}

	printf("%d\n",nNeedChanges);
	

    return 0;
}
int compar(const int *val1, const int *val2) {
    if ( *val1 < *val2 ) {
        return -1;
    } else if ( *val1 == * val2 ) {
        return 0;
    } else {
        return 1;
    }
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sInput
	.bss
	.align 32
	.type	sInput, @object
	.size	sInput, 51
sInput:
	.zero	51
	.globl	anX
	.align 32
	.type	anX, @object
	.size	anX, 400000
anX:
	.zero	400000
	.globl	anY
	.align 32
	.type	anY, @object
	.size	anY, 400000
anY:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -36(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	jmp	.L2
.L3:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -32(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	compar(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	anX(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	anX(%rip), %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L4
.L9:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L5
	addl	$1, -24(%rbp)
	jmp	.L6
.L5:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jge	.L7
	movl	-24(%rbp), %eax
	addl	%eax, -20(%rbp)
	jmp	.L8
.L7:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L8
	movl	-24(%rbp), %eax
	subl	-28(%rbp), %eax
	addl	%eax, -20(%rbp)
.L8:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	$1, -24(%rbp)
.L6:
	addl	$1, -32(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L9
	cmpl	$0, -24(%rbp)
	jle	.L10
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jge	.L11
	movl	-24(%rbp), %eax
	addl	%eax, -20(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L10
	movl	-24(%rbp), %eax
	subl	-28(%rbp), %eax
	addl	%eax, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	compar
	.type	compar, @function
compar:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L15
	movl	$-1, %eax
	jmp	.L16
.L15:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L17
	movl	$0, %eax
	jmp	.L16
.L17:
	movl	$1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compar, .-compar
	.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	compar
	.type	compar, @function
compar:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$-1, %eax
	cmpl	%edx, (%rdi)
	jl	.L1
	setne	%al
	movzbl	%al, %eax
.L1:
	ret
	.cfi_endproc
.LFE52:
	.size	compar, .-compar
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	anX(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movl	$0, 4(%rsp)
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L6
	movq	%r13, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L7
.L6:
	leaq	compar(%rip), %rcx
	movl	$4, %edx
	movq	%r13, %rdi
	call	qsort@PLT
	movl	4(%rsp), %ecx
	movl	anX(%rip), %edx
	testl	%ecx, %ecx
	jle	.L15
	leaq	anX(%rip), %rax
	leal	-1(%rcx), %esi
	xorl	%r8d, %r8d
	leaq	4(%rax), %rcx
	leaq	(%rcx,%rsi,4), %rdi
	xorl	%ecx, %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%ecx, %esi
	jg	.L21
	jge	.L16
	subl	%esi, %ecx
.L21:
	addl	%ecx, %r8d
	movl	$1, %ecx
.L10:
	addq	$4, %rax
	cmpq	%rax, %rdi
	je	.L23
.L12:
	movl	%edx, %esi
	movl	(%rax), %edx
	cmpl	%edx, %esi
	jne	.L9
	addq	$4, %rax
	addl	$1, %ecx
	cmpq	%rax, %rdi
	jne	.L12
.L23:
	cmpl	%ecx, %edx
	jle	.L13
.L22:
	addl	%ecx, %r8d
.L8:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$24, %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
.L16:
	.cfi_restore_state
	movl	$1, %ecx
	jmp	.L10
.L13:
	jge	.L8
	subl	%edx, %ecx
	jmp	.L22
.L15:
	xorl	%r8d, %r8d
	jmp	.L8
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	anY
	.bss
	.align 32
	.type	anY, @object
	.size	anY, 400000
anY:
	.zero	400000
	.globl	anX
	.align 32
	.type	anX, @object
	.size	anX, 400000
anX:
	.zero	400000
	.globl	sInput
	.align 32
	.type	sInput, @object
	.size	sInput, 51
sInput:
	.zero	51
	.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	compar
	.type	compar, @function
compar:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rsi), %edx
	movl	$-1, %eax
	cmpl	%edx, (%rdi)
	jl	.L1
	setne	%al
	movzbl	%al, %eax
.L1:
	ret
	.cfi_endproc
.LFE52:
	.size	compar, .-compar
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	anX(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movl	$0, 4(%rsp)
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L6
	movq	%r13, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L7
.L6:
	leaq	compar(%rip), %rcx
	movl	$4, %edx
	movq	%r13, %rdi
	call	qsort@PLT
	movl	4(%rsp), %ecx
	movl	anX(%rip), %edx
	testl	%ecx, %ecx
	jle	.L15
	leaq	anX(%rip), %rax
	leal	-1(%rcx), %esi
	xorl	%r8d, %r8d
	leaq	4(%rax), %rcx
	leaq	(%rcx,%rsi,4), %rdi
	xorl	%ecx, %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%ecx, %esi
	jg	.L21
	jge	.L16
	subl	%esi, %ecx
.L21:
	addl	%ecx, %r8d
	movl	$1, %ecx
.L10:
	addq	$4, %rax
	cmpq	%rax, %rdi
	je	.L23
.L12:
	movl	%edx, %esi
	movl	(%rax), %edx
	cmpl	%edx, %esi
	jne	.L9
	addq	$4, %rax
	addl	$1, %ecx
	cmpq	%rax, %rdi
	jne	.L12
.L23:
	cmpl	%ecx, %edx
	jle	.L13
.L22:
	addl	%ecx, %r8d
.L8:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$24, %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
.L16:
	.cfi_restore_state
	movl	$1, %ecx
	jmp	.L10
.L13:
	jge	.L8
	subl	%edx, %ecx
	jmp	.L22
.L15:
	xorl	%r8d, %r8d
	jmp	.L8
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	anY
	.bss
	.align 32
	.type	anY, @object
	.size	anY, 400000
anY:
	.zero	400000
	.globl	anX
	.align 32
	.type	anX, @object
	.size	anX, 400000
anX:
	.zero	400000
	.globl	sInput
	.align 32
	.type	sInput, @object
	.size	sInput, 51
sInput:
	.zero	51
	.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:



#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX_STRING 50

	char sInput[MAX_STRING+1]="";
	int anX[100000];
	int anY[100000];

	int compar(const int *val1, const int *val2);

int main() {
//	char* psInput;

	int i=0;
	int j=0;
	int nNumber=0;
	int nTargetNumber=0;
	int nLastTarget=0;
	int nFriends=0;
	int nNeedChanges=0;

	// read line 1
    scanf("%d", &nNumber);
	// read line 2
	for(i=0; i<nNumber; i++) {
        scanf("%d", &anX[i]);
	}
	// sort
    qsort(anX, nNumber, sizeof(int),
        (int (*)(const void *, const void *))compar
    );
	nTargetNumber=anX[0];
	nLastTarget=anX[nNumber-1];
	for (i=0;i<nNumber;i++){
		if (anX[i]==nTargetNumber){
			nFriends++;
		} else {
			// ここまでチェックした数について精算する
			if (nFriends<nTargetNumber){
				nNeedChanges=nNeedChanges+nFriends;
			} else if (nFriends>nTargetNumber){
				nNeedChanges=nNeedChanges+(nFriends-nTargetNumber);
			}
			// ターゲットを更新
			nTargetNumber=anX[i];
			nFriends=1;
		}
	}
	// 最終ターゲットの精算
	if (nFriends>0){
		if (nFriends<nTargetNumber){
			nNeedChanges=nNeedChanges+nFriends;
		} else if (nFriends>nTargetNumber){
			nNeedChanges=nNeedChanges+(nFriends-nTargetNumber);
		}
	}

	printf("%d\n",nNeedChanges);
	

    return 0;
}
int compar(const int *val1, const int *val2) {
    if ( *val1 < *val2 ) {
        return -1;
    } else if ( *val1 == * val2 ) {
        return 0;
    } else {
        return 1;
    }
}


8
2 7 1 8 2 8 1 15
 1
0000000000
 6
1 2 2 3 3 1
 5
2 4 1 4 1
 8
4 7 1 8 2 8 1 12
 5
1 4 2 4 2
 1
0000000001
 4
0 3 3 3
 8
2 7 1 8 2 8 1 12
 1
1000001000

5
 1
 3
 4
 7
 2
 0
 1
 5
 1

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

```c


#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX_STRING 50

	char sInput[MAX_STRING+1]="";
	int anX[100000];
	int anY[100000];

	int compar(const int *val1, const int *val2);

int main() {
//	char* psInput;

	int i=0;
	int j=0;
	int nNumber=0;
	int nTargetNumber=0;
	int nLastTarget=0;
	int nFriends=0;
	int nNeedChanges=0;

	// read line 1
    scanf("%d", &nNumber);
	// read line 2
	for(i=0; i<nNumber; i++) {
        scanf("%d", &anX[i]);
	}
	// sort
    qsort(anX, nNumber, sizeof(int),
        (int (*)(const void *, const void *))compar
    );
	nTargetNumber=anX[0];
	nLastTarget=anX[nNumber-1];
	for (i=0;i<nNumber;i++){
		if (anX[i]==nTargetNumber){
			nFriends++;
		} else {
			// ここまでチェックした数について精算する
			if (nFriends<nTargetNumber){
				nNeedChanges=nNeedChanges+nFriends;
			} else if (nFriends>nTargetNumber){
				nNeedChanges=nNeedChanges+(nFriends-nTargetNumber);
			}
			// ターゲットを更新
			nTargetNumber=anX[i];
			nFriends=1;
		}
	}
	// 最終ターゲットの精算
	if (nFriends>0){
		if (nFriends<nTargetNumber){
			nNeedChanges=nNeedChanges+nFriends;
		} else if (nFriends>nTargetNumber){
			nNeedChanges=nNeedChanges+(nFriends-nTargetNumber);
		}
	}

	printf("%d\n",nNeedChanges);
	

    return 0;
}
int compar(const int *val1, const int *val2) {
    if ( *val1 < *val2 ) {
        return -1;
    } else if ( *val1 == * val2 ) {
        return 0;
    } else {
        return 1;
    }
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	sInput
	.bss
	.align 32
	.type	sInput, @object
	.size	sInput, 51
sInput:
	.zero	51
	.globl	anX
	.align 32
	.type	anX, @object
	.size	anX, 400000
anX:
	.zero	400000
	.globl	anY
	.align 32
	.type	anY, @object
	.size	anY, 400000
anY:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -36(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	jmp	.L2
.L3:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -32(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	compar(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	anX(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	anX(%rip), %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L4
.L9:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L5
	addl	$1, -24(%rbp)
	jmp	.L6
.L5:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jge	.L7
	movl	-24(%rbp), %eax
	addl	%eax, -20(%rbp)
	jmp	.L8
.L7:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L8
	movl	-24(%rbp), %eax
	subl	-28(%rbp), %eax
	addl	%eax, -20(%rbp)
.L8:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	$1, -24(%rbp)
.L6:
	addl	$1, -32(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L9
	cmpl	$0, -24(%rbp)
	jle	.L10
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jge	.L11
	movl	-24(%rbp), %eax
	addl	%eax, -20(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L10
	movl	-24(%rbp), %eax
	subl	-28(%rbp), %eax
	addl	%eax, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	compar
	.type	compar, @function
compar:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L15
	movl	$-1, %eax
	jmp	.L16
.L15:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L17
	movl	$0, %eax
	jmp	.L16
.L17:
	movl	$1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compar, .-compar
	.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	sInput
	.bss
	.align 32
	.type	sInput, @object
	.size	sInput, 51
sInput:
	.zero	51
	.globl	anX
	.align 32
	.type	anX, @object
	.size	anX, 400000
anX:
	.zero	400000
	.globl	anY
	.align 32
	.type	anY, @object
	.size	anY, 400000
anY:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -36(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	jmp	.L2
.L3:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -32(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L3
	movl	-36(%rbp), %eax
	cltq
	leaq	compar(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	anX(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	anX(%rip), %eax
	movl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L4
.L9:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L5
	addl	$1, -24(%rbp)
	jmp	.L6
.L5:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jge	.L7
	movl	-24(%rbp), %eax
	addl	%eax, -20(%rbp)
	jmp	.L8
.L7:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L8
	movl	-24(%rbp), %eax
	subl	-28(%rbp), %eax
	addl	%eax, -20(%rbp)
.L8:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	anX(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	$1, -24(%rbp)
.L6:
	addl	$1, -32(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L9
	cmpl	$0, -24(%rbp)
	jle	.L10
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jge	.L11
	movl	-24(%rbp), %eax
	addl	%eax, -20(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L10
	movl	-24(%rbp), %eax
	subl	-28(%rbp), %eax
	addl	%eax, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	compar
	.type	compar, @function
compar:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L15
	movl	$-1, %eax
	jmp	.L16
.L15:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jne	.L17
	movl	$0, %eax
	jmp	.L16
.L17:
	movl	$1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compar, .-compar
	.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:
