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<string.h>
typedef struct{
  char name[21];
  int sc;
  int input;
}score;
int cmp(const void *a,const void *b){
  int c=(*(score *)b).sc-(*(score *)a).sc;
  return c?c:(*(score *)a).input-(*(score *)b).input;
}
int main(){
  int i,n,win,lose,draw,fa;
  char name[21];
  score ss[10];
  fa=1;
  do{
    scanf("%d",&n);
    if(!n) break;
    if(!fa){
      printf("\n");
    }
    for(i=0;i<n;i++){
      scanf("%s %d %d %d",name,&win,&lose,&draw);
      strcpy(ss[i].name,name);
      ss[i].sc=win*3+draw;
      ss[i].input=i;
    }
    qsort(ss,n,sizeof(score),cmp);
    for(i=0;i<n;i++) printf("%s,%d\n",ss[i].name,ss[i].sc);
    fa=0;
  }while(1);
  return 0;
}```

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	-32(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L2
	movq	-24(%rbp), %rax
	movl	28(%rax), %edx
	movq	-32(%rbp), %rax
	movl	28(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L2:
	movl	-4(%rbp), %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 %d %d"
.LC2:
	.string	"%s,%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	$384, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -356(%rbp)
.L13:
	leaq	-376(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-376(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	cmpl	$0, -356(%rbp)
	jne	.L8
	movl	$10, %edi
	call	putchar@PLT
.L8:
	movl	$0, -360(%rbp)
	jmp	.L9
.L10:
	leaq	-364(%rbp), %rsi
	leaq	-368(%rbp), %rcx
	leaq	-372(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-352(%rbp), %rdx
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rax, %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movl	-372(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-364(%rbp), %eax
	addl	%eax, %edx
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	subq	$328, %rax
	movl	%edx, (%rax)
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	leaq	-324(%rax), %rdx
	movl	-360(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -360(%rbp)
.L9:
	movl	-376(%rbp), %eax
	cmpl	%eax, -360(%rbp)
	jl	.L10
	movl	-376(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-352(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$32, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -360(%rbp)
	jmp	.L11
.L12:
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	subq	$328, %rax
	movl	(%rax), %eax
	leaq	-352(%rbp), %rcx
	movl	-360(%rbp), %edx
	movslq	%edx, %rdx
	salq	$5, %rdx
	addq	%rdx, %rcx
	movl	%eax, %edx
	movq	%rcx, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -360(%rbp)
.L11:
	movl	-376(%rbp), %eax
	cmpl	%eax, -360(%rbp)
	jl	.L12
	movl	$0, -356(%rbp)
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	24(%rsi), %eax
	subl	24(%rdi), %eax
	jne	.L1
	movl	28(%rdi), %eax
	subl	28(%rsi), %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d %d %d"
.LC2:
	.string	"%s,%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	movl	$1, %ebx
	subq	$392, %rsp
	.cfi_def_cfa_offset 448
	movq	%fs:40, %rax
	movq	%rax, 376(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rsi
	testl	%esi, %esi
	je	.L5
	testl	%ebx, %ebx
	je	.L20
.L6:
	testl	%esi, %esi
	jle	.L7
	movq	(%rsp), %r13
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	20(%rsp), %rbp
	leaq	352(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %r8
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	movq	%r13, %rdi
	movl	$21, %edx
	call	__strcpy_chk@PLT
	movl	20(%rsp), %eax
	movd	%r14d, %xmm1
	movslq	16(%rsp), %rsi
	addl	$1, %r14d
	addq	$32, %r13
	leal	(%rax,%rax,2), %eax
	addl	28(%rsp), %eax
	movd	%eax, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -8(%r13)
	cmpl	%r14d, %esi
	jg	.L8
.L7:
	movq	(%rsp), %rbx
	leaq	cmp(%rip), %rcx
	movl	$32, %edx
	xorl	%ebp, %ebp
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	24(%rbx), %ecx
	movq	%rbx, %rdx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addl	$1, %ebp
	addq	$32, %rbx
	call	__printf_chk@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L11
.L12:
	xorl	%ebx, %ebx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	movl	$10, %edi
	call	putchar@PLT
	movslq	16(%rsp), %rsi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	376(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$392, %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
.L21:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	24(%rsi), %eax
	subl	24(%rdi), %eax
	jne	.L1
	movl	28(%rdi), %eax
	subl	28(%rsi), %eax
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d %d %d"
.LC2:
	.string	"%s,%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	movl	$1, %ebx
	subq	$392, %rsp
	.cfi_def_cfa_offset 448
	movq	%fs:40, %rax
	movq	%rax, 376(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rsi
	testl	%esi, %esi
	je	.L5
	testl	%ebx, %ebx
	je	.L20
.L6:
	testl	%esi, %esi
	jle	.L7
	movq	(%rsp), %r13
	xorl	%r14d, %r14d
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r12
	leaq	20(%rsp), %rbp
	leaq	352(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r15, %r8
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	movq	%r13, %rdi
	movl	$21, %edx
	call	__strcpy_chk@PLT
	movl	20(%rsp), %eax
	movd	%r14d, %xmm1
	movslq	16(%rsp), %rsi
	addl	$1, %r14d
	addq	$32, %r13
	leal	(%rax,%rax,2), %eax
	addl	28(%rsp), %eax
	movd	%eax, %xmm0
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -8(%r13)
	cmpl	%r14d, %esi
	jg	.L8
.L7:
	movq	(%rsp), %rbx
	leaq	cmp(%rip), %rcx
	movl	$32, %edx
	xorl	%ebp, %ebp
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	24(%rbx), %ecx
	movq	%rbx, %rdx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addl	$1, %ebp
	addq	$32, %rbx
	call	__printf_chk@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L11
.L12:
	xorl	%ebx, %ebx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	movl	$10, %edi
	call	putchar@PLT
	movslq	16(%rsp), %rsi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	376(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$392, %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
.L21:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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<string.h>
typedef struct{
  char name[21];
  int sc;
  int input;
}score;
int cmp(const void *a,const void *b){
  int c=(*(score *)b).sc-(*(score *)a).sc;
  return c?c:(*(score *)a).input-(*(score *)b).input;
}
int main(){
  int i,n,win,lose,draw,fa;
  char name[21];
  score ss[10];
  fa=1;
  do{
    scanf("%d",&n);
    if(!n) break;
    if(!fa){
      printf("\n");
    }
    for(i=0;i<n;i++){
      scanf("%s %d %d %d",name,&win,&lose,&draw);
      strcpy(ss[i].name,name);
      ss[i].sc=win*3+draw;
      ss[i].input=i;
    }
    qsort(ss,n,sizeof(score),cmp);
    for(i=0;i<n;i++) printf("%s,%d\n",ss[i].name,ss[i].sc);
    fa=0;
  }while(1);
  return 0;
}
4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 2 0 1
3
India 0 2 0
Poland 1 0 1
Italy 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 2 0 1
3
India 0 2 0
Poland 1 0 1
Italx 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
niapS 2 0 1
3
India 0 2 0
Poland 1 0 1
Italy 1 1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 2 0 1
3
India -1 2 0
Poland 1 0 1
Italx 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Caaadn 0 2 1
niapS 2 0 1
3
India 0 2 0
Poland 1 0 1
Italy 1 1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 2 0 1
3
Jndia -1 2 0
Poland 1 0 1
Italx 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Caaadn 0 2 1
niapS 2 0 1
3
Iodia 0 2 0
Poland 1 0 1
Italy 1 1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 1 0 1
3
Jndia -1 2 0
Poland 1 0 1
Italx 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Caaadn 0 2 1
niapS 2 0 1
3
Ioida 0 2 0
Poland 1 0 1
Italy 1 1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Caaadn 0 2 1
nibpS 2 0 1
3
Ioida 0 2 0
Poland 1 0 1
Italy 1 1 1
0

Spain,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italy,4
India,0
 Spain,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italx,4
India,0
 niapS,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italy,4
India,0
 Spain,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italx,4
India,-3
 niapS,7
Japan,5
Egypt,3
Caaadn,1

Poland,4
Italy,4
India,0
 Spain,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italx,4
Jndia,-3
 niapS,7
Japan,5
Egypt,3
Caaadn,1

Poland,4
Italy,4
Iodia,0
 Japan,5
Spain,4
Egypt,3
Canada,1

Poland,4
Italx,4
Jndia,-3
 niapS,7
Japan,5
Egypt,3
Caaadn,1

Poland,4
Italy,4
Ioida,0
 nibpS,7
Japan,5
Egypt,3
Caaadn,1

Poland,4
Italy,4
Ioida,0

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<string.h>
typedef struct{
  char name[21];
  int sc;
  int input;
}score;
int cmp(const void *a,const void *b){
  int c=(*(score *)b).sc-(*(score *)a).sc;
  return c?c:(*(score *)a).input-(*(score *)b).input;
}
int main(){
  int i,n,win,lose,draw,fa;
  char name[21];
  score ss[10];
  fa=1;
  do{
    scanf("%d",&n);
    if(!n) break;
    if(!fa){
      printf("\n");
    }
    for(i=0;i<n;i++){
      scanf("%s %d %d %d",name,&win,&lose,&draw);
      strcpy(ss[i].name,name);
      ss[i].sc=win*3+draw;
      ss[i].input=i;
    }
    qsort(ss,n,sizeof(score),cmp);
    for(i=0;i<n;i++) printf("%s,%d\n",ss[i].name,ss[i].sc);
    fa=0;
  }while(1);
  return 0;
}```

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	-32(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L2
	movq	-24(%rbp), %rax
	movl	28(%rax), %edx
	movq	-32(%rbp), %rax
	movl	28(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L2:
	movl	-4(%rbp), %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 %d %d"
.LC2:
	.string	"%s,%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	$384, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -356(%rbp)
.L13:
	leaq	-376(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-376(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	cmpl	$0, -356(%rbp)
	jne	.L8
	movl	$10, %edi
	call	putchar@PLT
.L8:
	movl	$0, -360(%rbp)
	jmp	.L9
.L10:
	leaq	-364(%rbp), %rsi
	leaq	-368(%rbp), %rcx
	leaq	-372(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-352(%rbp), %rdx
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rax, %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movl	-372(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-364(%rbp), %eax
	addl	%eax, %edx
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	subq	$328, %rax
	movl	%edx, (%rax)
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	leaq	-324(%rax), %rdx
	movl	-360(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -360(%rbp)
.L9:
	movl	-376(%rbp), %eax
	cmpl	%eax, -360(%rbp)
	jl	.L10
	movl	-376(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-352(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$32, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -360(%rbp)
	jmp	.L11
.L12:
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	subq	$328, %rax
	movl	(%rax), %eax
	leaq	-352(%rbp), %rcx
	movl	-360(%rbp), %edx
	movslq	%edx, %rdx
	salq	$5, %rdx
	addq	%rdx, %rcx
	movl	%eax, %edx
	movq	%rcx, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -360(%rbp)
.L11:
	movl	-376(%rbp), %eax
	cmpl	%eax, -360(%rbp)
	jl	.L12
	movl	$0, -356(%rbp)
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	-32(%rbp), %rax
	movl	24(%rax), %edx
	movq	-24(%rbp), %rax
	movl	24(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L2
	movq	-24(%rbp), %rax
	movl	28(%rax), %edx
	movq	-32(%rbp), %rax
	movl	28(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L2:
	movl	-4(%rbp), %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 %d %d"
.LC2:
	.string	"%s,%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	$384, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -356(%rbp)
.L13:
	leaq	-376(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-376(%rbp), %eax
	testl	%eax, %eax
	je	.L17
	cmpl	$0, -356(%rbp)
	jne	.L8
	movl	$10, %edi
	call	putchar@PLT
.L8:
	movl	$0, -360(%rbp)
	jmp	.L9
.L10:
	leaq	-364(%rbp), %rsi
	leaq	-368(%rbp), %rcx
	leaq	-372(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-352(%rbp), %rdx
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rax, %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movl	-372(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-364(%rbp), %eax
	addl	%eax, %edx
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	subq	$328, %rax
	movl	%edx, (%rax)
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	leaq	-324(%rax), %rdx
	movl	-360(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -360(%rbp)
.L9:
	movl	-376(%rbp), %eax
	cmpl	%eax, -360(%rbp)
	jl	.L10
	movl	-376(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-352(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$32, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -360(%rbp)
	jmp	.L11
.L12:
	movl	-360(%rbp), %eax
	cltq
	salq	$5, %rax
	addq	%rbp, %rax
	subq	$328, %rax
	movl	(%rax), %eax
	leaq	-352(%rbp), %rcx
	movl	-360(%rbp), %edx
	movslq	%edx, %rdx
	salq	$5, %rdx
	addq	%rdx, %rcx
	movl	%eax, %edx
	movq	%rcx, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -360(%rbp)
.L11:
	movl	-376(%rbp), %eax
	cmpl	%eax, -360(%rbp)
	jl	.L12
	movl	$0, -356(%rbp)
	jmp	.L13
.L17:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
