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>

#define MAX_N 100000

int n;
int a[MAX_N];

int int_sort( const void *c1, const void *c2 )
{
	int a1 = *(int *)c1;
	int a2 = *(int *)c2;
	
	if ( a1 > a2 ) return -1;
	if ( a1 < a2 ) return 1;
	return 0;
}

int main(void)
{
	long long ans;
	int i;
	
	scanf( "%d", &n );
	
	for( i=0; i<n; i++ ) {
		scanf( "%d", &a[i] );
	}
	
	qsort( (void *)a, n, sizeof(a[0]), int_sort );
	
	ans = 1;
	
	for( i=0; i<n-1; i++ ) {
		
		if ( a[i] == a[i+1] ) {
			ans *= a[i];
			i += 2;
			break;
		}
		
	}
	
	for( ; i<n-1; i++ ) {
		
		if ( a[i] == a[i+1] ) {
			ans *= a[i];
			break;
		}
		
	}
	
	if ( i == n-1 ) printf( "0\n" );
	else printf( "%lld\n", ans );
	
	return 0;
}```

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, 400000
a:
	.zero	400000
	.text
	.globl	int_sort
	.type	int_sort, @function
int_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	int_sort, .-int_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	n(%rip), %eax
	cltq
	leaq	int_sort(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$1, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$2, -12(%rbp)
	jmp	.L10
.L9:
	addl	$1, -12(%rbp)
.L8:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
.L10:
	jmp	.L12
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L14
.L13:
	addl	$1, -12(%rbp)
.L12:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
.L14:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jne	.L16
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L16:
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	int_sort
	.type	int_sort, @function
int_sort:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	movl	$-1, %edx
	setl	%al
	movzbl	%al, %eax
	cmovg	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	int_sort, .-int_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	leaq	a(%rip), %r12
	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
	movslq	n(%rip), %rsi
	testl	%esi, %esi
	jle	.L6
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rsi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L7
.L6:
	movl	$4, %edx
	leaq	int_sort(%rip), %rcx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	n(%rip), %eax
	movslq	a(%rip), %rdx
	leaq	4+a(%rip), %r8
	leal	-1(%rax), %esi
	xorl	%eax, %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r8,%rax,4), %ecx
	addq	$1, %rax
	cmpl	%edx, %ecx
	je	.L20
	movslq	%ecx, %rdx
.L8:
	movl	%eax, %edi
	cmpl	%eax, %esi
	jg	.L10
	movl	$1, %edx
.L11:
	cmpl	%edi, %esi
	jne	.L12
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L14
.L20:
	addl	$2, %edi
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %edi
	cmpl	%eax, %esi
	jle	.L11
	movslq	(%r12,%rax,4), %rcx
	addq	$1, %rax
	cmpl	(%r12,%rax,4), %ecx
	jne	.L9
	imulq	%rcx, %rdx
.L12:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L14:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.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	int_sort
	.type	int_sort, @function
int_sort:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	movl	$-1, %edx
	setl	%al
	movzbl	%al, %eax
	cmovg	%edx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	int_sort, .-int_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	leaq	a(%rip), %r12
	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
	movslq	n(%rip), %rsi
	testl	%esi, %esi
	jle	.L6
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rsi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L7
.L6:
	movl	$4, %edx
	leaq	int_sort(%rip), %rcx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	n(%rip), %eax
	movslq	a(%rip), %rdx
	leaq	4+a(%rip), %r8
	leal	-1(%rax), %esi
	xorl	%eax, %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r8,%rax,4), %ecx
	addq	$1, %rax
	cmpl	%edx, %ecx
	je	.L20
	movslq	%ecx, %rdx
.L8:
	movl	%eax, %edi
	cmpl	%eax, %esi
	jg	.L10
	movl	$1, %edx
.L11:
	cmpl	%edi, %esi
	jne	.L12
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L14
.L20:
	addl	$2, %edi
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %edi
	cmpl	%eax, %esi
	jle	.L11
	movslq	(%r12,%rax,4), %rcx
	addq	$1, %rax
	cmpl	(%r12,%rax,4), %ecx
	jne	.L9
	imulq	%rcx, %rdx
.L12:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L14:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.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>

#define MAX_N 100000

int n;
int a[MAX_N];

int int_sort( const void *c1, const void *c2 )
{
	int a1 = *(int *)c1;
	int a2 = *(int *)c2;
	
	if ( a1 > a2 ) return -1;
	if ( a1 < a2 ) return 1;
	return 0;
}

int main(void)
{
	long long ans;
	int i;
	
	scanf( "%d", &n );
	
	for( i=0; i<n; i++ ) {
		scanf( "%d", &a[i] );
	}
	
	qsort( (void *)a, n, sizeof(a[0]), int_sort );
	
	ans = 1;
	
	for( i=0; i<n-1; i++ ) {
		
		if ( a[i] == a[i+1] ) {
			ans *= a[i];
			i += 2;
			break;
		}
		
	}
	
	for( ; i<n-1; i++ ) {
		
		if ( a[i] == a[i+1] ) {
			ans *= a[i];
			break;
		}
		
	}
	
	if ( i == n-1 ) printf( "0\n" );
	else printf( "%lld\n", ans );
	
	return 0;
}
10
3 3 3 3 4 4 2 5 5 5
 6
3 1 2 4 2 2
 6
3 2 2 4 2 2
 6
3 2 2 4 3 2
 10
3 3 6 3 4 4 1 6 5 5
 10
3 3 6 3 4 3 1 6 5 6
 6
3 4 2 3 4 3
 10
3 3 6 6 4 3 1 6 3 6
 10
3 2 8 6 4 0 1 8 3 10
 6
1 -1 1 7 8 7

20
 0
 4
 6
 30
 18
 12
 36
 24
 7

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>

#define MAX_N 100000

int n;
int a[MAX_N];

int int_sort( const void *c1, const void *c2 )
{
	int a1 = *(int *)c1;
	int a2 = *(int *)c2;
	
	if ( a1 > a2 ) return -1;
	if ( a1 < a2 ) return 1;
	return 0;
}

int main(void)
{
	long long ans;
	int i;
	
	scanf( "%d", &n );
	
	for( i=0; i<n; i++ ) {
		scanf( "%d", &a[i] );
	}
	
	qsort( (void *)a, n, sizeof(a[0]), int_sort );
	
	ans = 1;
	
	for( i=0; i<n-1; i++ ) {
		
		if ( a[i] == a[i+1] ) {
			ans *= a[i];
			i += 2;
			break;
		}
		
	}
	
	for( ; i<n-1; i++ ) {
		
		if ( a[i] == a[i+1] ) {
			ans *= a[i];
			break;
		}
		
	}
	
	if ( i == n-1 ) printf( "0\n" );
	else printf( "%lld\n", ans );
	
	return 0;
}```

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, 400000
a:
	.zero	400000
	.text
	.globl	int_sort
	.type	int_sort, @function
int_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	int_sort, .-int_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	n(%rip), %eax
	cltq
	leaq	int_sort(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$1, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$2, -12(%rbp)
	jmp	.L10
.L9:
	addl	$1, -12(%rbp)
.L8:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
.L10:
	jmp	.L12
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L14
.L13:
	addl	$1, -12(%rbp)
.L12:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
.L14:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jne	.L16
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L16:
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.text
	.globl	int_sort
	.type	int_sort, @function
int_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movl	$0, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	int_sort, .-int_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L6
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	n(%rip), %eax
	cltq
	leaq	int_sort(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$1, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$2, -12(%rbp)
	jmp	.L10
.L9:
	addl	$1, -12(%rbp)
.L8:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L11
.L10:
	jmp	.L12
.L15:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
	jmp	.L14
.L13:
	addl	$1, -12(%rbp)
.L12:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
.L14:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jne	.L16
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L17
.L16:
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
