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 <math.h>

typedef struct vector{
	int x;
	int y;
} vector;

int comp(const void *a,const void *b){
	return (*((vector**)a))->x - (*((vector**)b))->x;
}

int main(void){
	int n;
	vector *a;
	vector **p;
	int i;
	int res = 0;
	scanf("%d",&n);
	a = calloc(sizeof(vector),n);
	p = calloc(sizeof(vector*),n);
	for(i = 0;i < n;i++){
		scanf("%d",&a[i].x);
		p[i] = &a[i];
	}
	qsort(p,n,sizeof(vector*),comp);
	for(i = 0;i < n;i++){
		p[i]->y = i;
	}
	for(i = 0;i < n;i+=2){
		if(a[i].y % 2){
			res++;
		}
	}
	printf("%d\n", res);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -28(%rbp)
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -32(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L5
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movq	-16(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -32(%rbp)
	jmp	.L6
.L7:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	-32(%rbp), %edx
	movl	%edx, 4(%rax)
	addl	$1, -32(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L10:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L9
	addl	$1, -28(%rbp)
.L9:
	addl	$2, -32(%rbp)
.L8:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L10
	movl	-28(%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	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	(%rsi), %rdx
	movl	(%rax), %eax
	subl	(%rdx), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rbp
	movl	$8, %edi
	movq	%rbp, %rsi
	call	calloc@PLT
	movq	%rbp, %rsi
	movl	$8, %edi
	movq	%rax, %r12
	call	calloc@PLT
	movq	%rax, %r13
	testl	%ebp, %ebp
	jle	.L4
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r14d
	movq	%rbp, 0(%r13,%rbx,8)
	addq	$1, %rbx
	addq	$8, %rbp
	cmpl	%ebx, %r14d
	jg	.L5
	movslq	%r14d, %rbp
.L4:
	movq	%r13, %rdi
	leaq	comp(%rip), %rcx
	movl	$8, %edx
	movq	%rbp, %rsi
	call	qsort@PLT
	movl	4(%rsp), %edi
	testl	%edi, %edi
	jle	.L18
	leal	-1(%rdi), %ecx
	movl	%edi, %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	movq	0(%r13,%rax,8), %rdx
	movl	%eax, 4(%rdx)
	addq	$1, %rax
	cmpq	%rsi, %rax
	jne	.L7
	cmpl	$7, %ecx
	jbe	.L19
	shrl	$3, %ecx
	pxor	%xmm1, %xmm1
	leaq	4(%r12), %rax
	movdqa	.LC1(%rip), %xmm4
	leal	-1(%rcx), %edx
	movdqa	%xmm1, %xmm3
	salq	$6, %rdx
	leaq	68(%r12,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm0
	movdqu	16(%rax), %xmm5
	addq	$64, %rax
	movdqu	-32(%rax), %xmm2
	movdqu	-16(%rax), %xmm6
	shufps	$136, %xmm5, %xmm0
	shufps	$136, %xmm6, %xmm2
	shufps	$136, %xmm2, %xmm0
	pand	%xmm4, %xmm0
	pcmpeqd	%xmm3, %xmm0
	pcmpeqd	%xmm3, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L9
	movdqa	%xmm1, %xmm0
	leal	0(,%rcx,8), %eax
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
.L8:
	movslq	%eax, %rcx
	salq	$3, %rcx
	movl	4(%r12,%rcx), %esi
	andl	$1, %esi
	cmpl	$1, %esi
	leal	2(%rax), %esi
	sbbl	$-1, %edx
	cmpl	%esi, %edi
	jle	.L6
	movl	20(%r12,%rcx), %esi
	andl	$1, %esi
	cmpl	$1, %esi
	leal	4(%rax), %esi
	sbbl	$-1, %edx
	cmpl	%edi, %esi
	jge	.L6
	movl	36(%r12,%rcx), %esi
	andl	$1, %esi
	cmpl	$1, %esi
	sbbl	$-1, %edx
	addl	$6, %eax
	cmpl	%edi, %eax
	jge	.L6
	movl	52(%r12,%rcx), %eax
	andl	$1, %eax
	cmpl	$1, %eax
	sbbl	$-1, %edx
.L6:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L19:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	(%rsi), %rdx
	movl	(%rax), %eax
	subl	(%rdx), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rbp
	movl	$8, %edi
	movq	%rbp, %rsi
	call	calloc@PLT
	movq	%rbp, %rsi
	movl	$8, %edi
	movq	%rax, %r12
	call	calloc@PLT
	movq	%rax, %r13
	testl	%ebp, %ebp
	jle	.L4
	movq	%r12, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r14d
	movq	%rbp, 0(%r13,%rbx,8)
	addq	$1, %rbx
	addq	$8, %rbp
	cmpl	%ebx, %r14d
	jg	.L5
	movslq	%r14d, %rbp
.L4:
	movq	%r13, %rdi
	leaq	comp(%rip), %rcx
	movl	$8, %edx
	movq	%rbp, %rsi
	call	qsort@PLT
	movl	4(%rsp), %edi
	testl	%edi, %edi
	jle	.L18
	leal	-1(%rdi), %ecx
	movl	%edi, %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	movq	0(%r13,%rax,8), %rdx
	movl	%eax, 4(%rdx)
	addq	$1, %rax
	cmpq	%rsi, %rax
	jne	.L7
	cmpl	$7, %ecx
	jbe	.L19
	shrl	$3, %ecx
	pxor	%xmm1, %xmm1
	leaq	4(%r12), %rax
	movdqa	.LC1(%rip), %xmm4
	leal	-1(%rcx), %edx
	movdqa	%xmm1, %xmm3
	salq	$6, %rdx
	leaq	68(%r12,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm0
	movdqu	16(%rax), %xmm5
	addq	$64, %rax
	movdqu	-32(%rax), %xmm2
	movdqu	-16(%rax), %xmm6
	shufps	$136, %xmm5, %xmm0
	shufps	$136, %xmm6, %xmm2
	shufps	$136, %xmm2, %xmm0
	pand	%xmm4, %xmm0
	pcmpeqd	%xmm3, %xmm0
	pcmpeqd	%xmm3, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L9
	movdqa	%xmm1, %xmm0
	leal	0(,%rcx,8), %eax
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
.L8:
	movslq	%eax, %rcx
	salq	$3, %rcx
	movl	4(%r12,%rcx), %esi
	andl	$1, %esi
	cmpl	$1, %esi
	leal	2(%rax), %esi
	sbbl	$-1, %edx
	cmpl	%esi, %edi
	jle	.L6
	movl	20(%r12,%rcx), %esi
	andl	$1, %esi
	cmpl	$1, %esi
	leal	4(%rax), %esi
	sbbl	$-1, %edx
	cmpl	%edi, %esi
	jge	.L6
	movl	36(%r12,%rcx), %esi
	andl	$1, %esi
	cmpl	$1, %esi
	sbbl	$-1, %edx
	addl	$6, %eax
	cmpl	%edi, %eax
	jge	.L6
	movl	52(%r12,%rcx), %eax
	andl	$1, %eax
	cmpl	$1, %eax
	sbbl	$-1, %edx
.L6:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L6
.L19:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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 <math.h>

typedef struct vector{
	int x;
	int y;
} vector;

int comp(const void *a,const void *b){
	return (*((vector**)a))->x - (*((vector**)b))->x;
}

int main(void){
	int n;
	vector *a;
	vector **p;
	int i;
	int res = 0;
	scanf("%d",&n);
	a = calloc(sizeof(vector),n);
	p = calloc(sizeof(vector*),n);
	for(i = 0;i < n;i++){
		scanf("%d",&a[i].x);
		p[i] = &a[i];
	}
	qsort(p,n,sizeof(vector*),comp);
	for(i = 0;i < n;i++){
		p[i]->y = i;
	}
	for(i = 0;i < n;i+=2){
		if(a[i].y % 2){
			res++;
		}
	}
	printf("%d\n", res);
	return 0;
}

4
2
4
2
1
 4
2
4
6
1
 4
0
13
10
1
 4
2
4
2
0
 4
2
4
8
1
 4
2
4
10
1
 4
2
4
13
1
 5
10
8
5
6
2
 4
2
4
11
1
 4
2
5
10
1

1
 2
 0
 1
 2
 2
 2
 1
 2
 2

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 <math.h>

typedef struct vector{
	int x;
	int y;
} vector;

int comp(const void *a,const void *b){
	return (*((vector**)a))->x - (*((vector**)b))->x;
}

int main(void){
	int n;
	vector *a;
	vector **p;
	int i;
	int res = 0;
	scanf("%d",&n);
	a = calloc(sizeof(vector),n);
	p = calloc(sizeof(vector*),n);
	for(i = 0;i < n;i++){
		scanf("%d",&a[i].x);
		p[i] = &a[i];
	}
	qsort(p,n,sizeof(vector*),comp);
	for(i = 0;i < n;i++){
		p[i]->y = i;
	}
	for(i = 0;i < n;i+=2){
		if(a[i].y % 2){
			res++;
		}
	}
	printf("%d\n", res);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -28(%rbp)
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -32(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L5
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movq	-16(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -32(%rbp)
	jmp	.L6
.L7:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	-32(%rbp), %edx
	movl	%edx, 4(%rax)
	addl	$1, -32(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L10:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L9
	addl	$1, -28(%rbp)
.L9:
	addl	$2, -32(%rbp)
.L8:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L10
	movl	-28(%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	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	comp
	.type	comp, @function
comp:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -28(%rbp)
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -24(%rbp)
	movl	-36(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -32(%rbp)
.L4:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L5
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movq	-16(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -32(%rbp)
	jmp	.L6
.L7:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	-32(%rbp), %edx
	movl	%edx, 4(%rax)
	addl	$1, -32(%rbp)
.L6:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L10:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L9
	addl	$1, -28(%rbp)
.L9:
	addl	$2, -32(%rbp)
.L8:
	movl	-36(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L10
	movl	-28(%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	.L12
	call	__stack_chk_fail@PLT
.L12:
	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:
