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<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);
	}
}
```

Assembly Code:

```assembly
	.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:
```

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:
.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
```assembly
	.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:
```
```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);
	}
}
```
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<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);
	}
}
```

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:

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 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);
	}
}
```

Assembly Code:

```assembly
	.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:
```

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:
.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:
```