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

#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)>(b))?(b):(a))
#define abs(a)   (((a)<(0))?(-(a)):(a))

typedef long long ll;
typedef unsigned long long ull;

typedef struct s
{
	char* str;
	int i;
	int l;
} s_;

int cmp(const void* a,const void* b) {
	char* p1 = *(char**)a;
	char* p2 = *(char**)b;
	for (; *p1 == *p2; p1++, p2++) {
		if (*p1 == '\0') return ((s_*)b)->i - ((s_*)a)->i;
	}
	return *p1 - *p2;
}

int main(void)
{
	int n;
	scanf("%d", &n);
	s_* ss = malloc(n * sizeof(s_));
	for (size_t i = 0; i < n; i++)
	{
		ss[i].str = malloc(11 * sizeof(char));
		scanf("%s %d", ss[i].str, &ss[i].i);
		ss[i].l = i + 1;
	}
	qsort(ss, n, sizeof(s_), cmp);

	for (size_t i = 0; i < n; i++)
	{
		printf("%d\n", ss[i].l);
	}
}
```

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
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L5:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L3
	movq	-32(%rbp), %rax
	movl	8(%rax), %edx
	movq	-24(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L3:
	addq	$1, -16(%rbp)
	addq	$1, -8(%rbp)
.L2:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d"
.LC2:
	.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
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L7
.L8:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	$11, %edi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	leal	1(%rax), %edx
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, 12(%rax)
	addq	$1, -48(%rbp)
.L7:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -48(%rbp)
	jb	.L8
	movl	-52(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -40(%rbp)
	jmp	.L9
.L10:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	12(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -40(%rbp)
.L9:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jb	.L10
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	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	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %r8
	movq	(%rsi), %r9
	movzbl	(%r8), %edx
	movsbl	(%r9), %ecx
	cmpb	%dl, %cl
	jne	.L2
	movl	$1, %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movzbl	(%r8,%rax), %edx
	addq	$1, %rax
	movsbl	-1(%r9,%rax), %ecx
	cmpb	%cl, %dl
	jne	.L2
.L5:
	testb	%dl, %dl
	jne	.L3
	movl	8(%rsi), %eax
	subl	8(%rdi), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	movsbl	%dl, %eax
	subl	%ecx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %r14
	movq	%r14, %rdi
	salq	$4, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testq	%r14, %r14
	je	.L9
	leaq	8(%rax), %rbx
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$11, %edi
	call	malloc@PLT
	movq	%rbx, %rdx
	movq	%r13, %rdi
	addq	$16, %rbx
	movq	%rax, -24(%rbx)
	movq	%rax, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %r14
	leal	1(%rbp), %eax
	addq	$1, %rbp
	movl	%eax, -12(%rbx)
	cmpq	%rbp, %r14
	ja	.L10
.L9:
	leaq	cmp(%rip), %rcx
	movl	$16, %edx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L11
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbx, %rax
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	salq	$4, %rax
	movl	12(%r12,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	4(%rsp), %rax
	cmpq	%rbx, %rax
	ja	.L12
.L11:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %r8
	movq	(%rsi), %r9
	movzbl	(%r8), %edx
	movsbl	(%r9), %ecx
	cmpb	%dl, %cl
	jne	.L2
	movl	$1, %eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	movzbl	(%r8,%rax), %edx
	addq	$1, %rax
	movsbl	-1(%r9,%rax), %ecx
	cmpb	%cl, %dl
	jne	.L2
.L5:
	testb	%dl, %dl
	jne	.L3
	movl	8(%rsi), %eax
	subl	8(%rdi), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	movsbl	%dl, %eax
	subl	%ecx, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %r14
	movq	%r14, %rdi
	salq	$4, %rdi
	call	malloc@PLT
	movq	%rax, %r12
	testq	%r14, %r14
	je	.L9
	leaq	8(%rax), %rbx
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movl	$11, %edi
	call	malloc@PLT
	movq	%rbx, %rdx
	movq	%r13, %rdi
	addq	$16, %rbx
	movq	%rax, -24(%rbx)
	movq	%rax, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %r14
	leal	1(%rbp), %eax
	addq	$1, %rbp
	movl	%eax, -12(%rbx)
	cmpq	%rbp, %r14
	ja	.L10
.L9:
	leaq	cmp(%rip), %rcx
	movl	$16, %edx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	je	.L11
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbx, %rax
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	salq	$4, %rax
	movl	12(%r12,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	4(%rsp), %rax
	cmpq	%rbx, %rax
	ja	.L12
.L11:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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<assert.h>

#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)>(b))?(b):(a))
#define abs(a)   (((a)<(0))?(-(a)):(a))

typedef long long ll;
typedef unsigned long long ull;

typedef struct s
{
	char* str;
	int i;
	int l;
} s_;

int cmp(const void* a,const void* b) {
	char* p1 = *(char**)a;
	char* p2 = *(char**)b;
	for (; *p1 == *p2; p1++, p2++) {
		if (*p1 == '\0') return ((s_*)b)->i - ((s_*)a)->i;
	}
	return *p1 - *p2;
}

int main(void)
{
	int n;
	scanf("%d", &n);
	s_* ss = malloc(n * sizeof(s_));
	for (size_t i = 0; i < n; i++)
	{
		ss[i].str = malloc(11 * sizeof(char));
		scanf("%s %d", ss[i].str, &ss[i].i);
		ss[i].l = i + 1;
	}
	qsort(ss, n, sizeof(s_), cmp);

	for (size_t i = 0; i < n; i++)
	{
		printf("%d\n", ss[i].l);
	}
}

6
khabarovsk 20
moscow 10
kazan 50
kazan 35
moscow 20
khabarovsk 40
 10
yakutsk 10
yakutsk 20
yakutsk 30
yakutsk 40
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 10
yakutsk 10
yakutsk 20
yakutsk 30
yakutsk 2
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 6
khabarovsk 20
moscow 18
kazan 50
kazan 35
moscow 14
khabarovsk 40
 10
yakutsk 10
yakutsl 20
yakutsk 30
yakutsk 2
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 6
khabarovsk 20
moscow 18
kazan 50
kazan 10
wocsom 14
khabarovsk 2
 10
yakutsk 10
yakutsl 28
yakutsk 30
y`kutsk 0
yakutsk 50
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 6
khabarovsk 20
moscow 18
kazan 50
kaz`n 10
wocsom 14
khabarovsk 2
 10
yakutsk 10
yakutsl 28
yakutsk 30
y`kutsk 0
yakutsk 18
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100
 10
yakutsk 10
yakutsl 28
yakutsk 30
y`kutsk 0
yakvtsk 18
yakutsk 60
yakutsk 70
yakktsu 80
yakutsk 90
yakutsk 100

3
4
6
1
5
2
 8
10
9
7
6
5
4
3
2
1
 8
10
9
7
6
5
3
2
1
4
 3
4
6
1
2
5
 8
10
9
7
6
5
3
1
4
2
 3
4
1
6
2
5
 4
8
10
9
7
6
5
3
1
2
 4
3
1
6
2
5
 4
8
10
9
7
6
3
5
1
2
 4
8
10
9
7
6
3
1
2
5

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

#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)>(b))?(b):(a))
#define abs(a)   (((a)<(0))?(-(a)):(a))

typedef long long ll;
typedef unsigned long long ull;

typedef struct s
{
	char* str;
	int i;
	int l;
} s_;

int cmp(const void* a,const void* b) {
	char* p1 = *(char**)a;
	char* p2 = *(char**)b;
	for (; *p1 == *p2; p1++, p2++) {
		if (*p1 == '\0') return ((s_*)b)->i - ((s_*)a)->i;
	}
	return *p1 - *p2;
}

int main(void)
{
	int n;
	scanf("%d", &n);
	s_* ss = malloc(n * sizeof(s_));
	for (size_t i = 0; i < n; i++)
	{
		ss[i].str = malloc(11 * sizeof(char));
		scanf("%s %d", ss[i].str, &ss[i].i);
		ss[i].l = i + 1;
	}
	qsort(ss, n, sizeof(s_), cmp);

	for (size_t i = 0; i < n; i++)
	{
		printf("%d\n", ss[i].l);
	}
}
```

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
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L5:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L3
	movq	-32(%rbp), %rax
	movl	8(%rax), %edx
	movq	-24(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L3:
	addq	$1, -16(%rbp)
	addq	$1, -8(%rbp)
.L2:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d"
.LC2:
	.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
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L7
.L8:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	$11, %edi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	leal	1(%rax), %edx
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, 12(%rax)
	addq	$1, -48(%rbp)
.L7:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -48(%rbp)
	jb	.L8
	movl	-52(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -40(%rbp)
	jmp	.L9
.L10:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	12(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -40(%rbp)
.L9:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jb	.L10
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	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	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
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	jmp	.L2
.L5:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L3
	movq	-32(%rbp), %rax
	movl	8(%rax), %edx
	movq	-24(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L3:
	addq	$1, -16(%rbp)
	addq	$1, -8(%rbp)
.L2:
	movq	-16(%rbp), %rax
	movzbl	(%rax), %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L5
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d"
.LC2:
	.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
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L7
.L8:
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	$11, %edi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rdx
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	leal	1(%rax), %edx
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, 12(%rax)
	addq	$1, -48(%rbp)
.L7:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -48(%rbp)
	jb	.L8
	movl	-52(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -40(%rbp)
	jmp	.L9
.L10:
	movq	-40(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	12(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addq	$1, -40(%rbp)
.L9:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jb	.L10
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	movq	-8(%rbp), %rbx
	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:
