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 N 10
#define INT(X) \
  ( *( (const int *)(X) ) )

int comparator (
  const void  * a,
  const void  * b
  )
{
  return ( INT( b ) - INT( a ) );
}

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int k_operafan = 0;
  int i;

  for ( ; ; )
  {
    int n;
    struct tagD
    {
      int   pt;
      char  name[ 32 ];
    } d[ N ];

    scanf ( "%d", &n );
    if ( !( n ) ) break ;

    if ( k_operafan ) puts ( "" );
    else
    {
      k_operafan = 1;
    }

    for ( i = 0; i < n; ++i )
    {
      int w, l, e;

      scanf ( "%s %d %d %d", d[ i ].name, &w, &l, &e );
      d[ i ].pt = w * 3 + e;
    }

    qsort ( d, n, sizeof ( struct tagD ), comparator );

    for ( i = 0; i < n; ++i )
    {
      printf ( "%s,%d\n", d[ i ].name, d[ i ].pt );
    }
  }

  return ( 0 );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comparator
	.type	comparator, @function
comparator:
.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	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comparator, .-comparator
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	""
.LC2:
	.string	"%s %d %d %d"
.LC3:
	.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	$416, %rsp
	movl	%edi, -404(%rbp)
	movq	%rsi, -416(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -376(%rbp)
.L12:
	leaq	-392(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-392(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	jmp	.L14
.L4:
	cmpl	$0, -376(%rbp)
	je	.L6
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L6:
	movl	$1, -376(%rbp)
.L7:
	movl	$0, -372(%rbp)
	jmp	.L8
.L9:
	leaq	-368(%rbp), %rcx
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	4(%rax), %rsi
	leaq	-380(%rbp), %rcx
	leaq	-384(%rbp), %rdx
	leaq	-388(%rbp), %rax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-388(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-380(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$368, %rax
	movl	%ecx, (%rax)
	addl	$1, -372(%rbp)
.L8:
	movl	-392(%rbp), %eax
	cmpl	%eax, -372(%rbp)
	jl	.L9
	movl	-392(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-368(%rbp), %rax
	leaq	comparator(%rip), %rdx
	movq	%rdx, %rcx
	movl	$36, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -372(%rbp)
	jmp	.L10
.L11:
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$368, %rax
	movl	(%rax), %edx
	leaq	-368(%rbp), %rsi
	movl	-372(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -372(%rbp)
.L10:
	movl	-392(%rbp), %eax
	cmpl	%eax, -372(%rbp)
	jl	.L11
	jmp	.L12
.L14:
	call	__stack_chk_fail@PLT
.L13:
	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	comparator
	.type	comparator, @function
comparator:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comparator, .-comparator
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	""
.LC2:
	.string	"%s %d %d %d"
.LC3:
	.string	"%s,%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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC2(%rip), %r13
	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
	xorl	%ebx, %ebx
	subq	$408, %rsp
	.cfi_def_cfa_offset 464
	movq	%fs:40, %rax
	movq	%rax, 392(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L9:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rsi
	testl	%esi, %esi
	je	.L4
	testl	%ebx, %ebx
	jne	.L21
.L5:
	testl	%esi, %esi
	jle	.L6
	leaq	36(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%rbp, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	addq	$36, %rbx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movslq	16(%rsp), %rsi
	leal	(%rax,%rax,2), %eax
	addl	28(%rsp), %eax
	movl	%eax, -40(%rbx)
	cmpl	%r12d, %esi
	jg	.L7
.L6:
	leaq	32(%rsp), %rdi
	leaq	comparator(%rip), %rcx
	movl	$36, %edx
	xorl	%ebp, %ebp
	call	qsort@PLT
	movl	16(%rsp), %eax
	leaq	36(%rsp), %rbx
	testl	%eax, %eax
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movl	-4(%rbx), %ecx
	movq	%rbx, %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addl	$1, %ebp
	addq	$36, %rbx
	call	__printf_chk@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L10
.L11:
	movl	$1, %ebx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movslq	16(%rsp), %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$408, %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
.L22:
	.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	comparator
	.type	comparator, @function
comparator:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comparator, .-comparator
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	""
.LC2:
	.string	"%s %d %d %d"
.LC3:
	.string	"%s,%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
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC2(%rip), %r13
	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
	xorl	%ebx, %ebx
	subq	$408, %rsp
	.cfi_def_cfa_offset 464
	movq	%fs:40, %rax
	movq	%rax, 392(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L9:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rsi
	testl	%esi, %esi
	je	.L4
	testl	%ebx, %ebx
	jne	.L21
.L5:
	testl	%esi, %esi
	jle	.L6
	leaq	36(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%rbp, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	addq	$36, %rbx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movslq	16(%rsp), %rsi
	leal	(%rax,%rax,2), %eax
	addl	28(%rsp), %eax
	movl	%eax, -40(%rbx)
	cmpl	%r12d, %esi
	jg	.L7
.L6:
	leaq	32(%rsp), %rdi
	leaq	comparator(%rip), %rcx
	movl	$36, %edx
	xorl	%ebp, %ebp
	call	qsort@PLT
	movl	16(%rsp), %eax
	leaq	36(%rsp), %rbx
	testl	%eax, %eax
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movl	-4(%rbx), %ecx
	movq	%rbx, %rdx
	leaq	.LC3(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addl	$1, %ebp
	addq	$36, %rbx
	call	__printf_chk@PLT
	cmpl	%ebp, 16(%rsp)
	jg	.L10
.L11:
	movl	$1, %ebx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movslq	16(%rsp), %rsi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	392(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$408, %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
.L22:
	.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>

#define N 10
#define INT(X) \
  ( *( (const int *)(X) ) )

int comparator (
  const void  * a,
  const void  * b
  )
{
  return ( INT( b ) - INT( a ) );
}

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int k_operafan = 0;
  int i;

  for ( ; ; )
  {
    int n;
    struct tagD
    {
      int   pt;
      char  name[ 32 ];
    } d[ N ];

    scanf ( "%d", &n );
    if ( !( n ) ) break ;

    if ( k_operafan ) puts ( "" );
    else
    {
      k_operafan = 1;
    }

    for ( i = 0; i < n; ++i )
    {
      int w, l, e;

      scanf ( "%s %d %d %d", d[ i ].name, &w, &l, &e );
      d[ i ].pt = w * 3 + e;
    }

    qsort ( d, n, sizeof ( struct tagD ), comparator );

    for ( i = 0; i < n; ++i )
    {
      printf ( "%s,%d\n", d[ i ].name, d[ i ].pt );
    }
  }

  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>

#define N 10
#define INT(X) \
  ( *( (const int *)(X) ) )

int comparator (
  const void  * a,
  const void  * b
  )
{
  return ( INT( b ) - INT( a ) );
}

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int k_operafan = 0;
  int i;

  for ( ; ; )
  {
    int n;
    struct tagD
    {
      int   pt;
      char  name[ 32 ];
    } d[ N ];

    scanf ( "%d", &n );
    if ( !( n ) ) break ;

    if ( k_operafan ) puts ( "" );
    else
    {
      k_operafan = 1;
    }

    for ( i = 0; i < n; ++i )
    {
      int w, l, e;

      scanf ( "%s %d %d %d", d[ i ].name, &w, &l, &e );
      d[ i ].pt = w * 3 + e;
    }

    qsort ( d, n, sizeof ( struct tagD ), comparator );

    for ( i = 0; i < n; ++i )
    {
      printf ( "%s,%d\n", d[ i ].name, d[ i ].pt );
    }
  }

  return ( 0 );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comparator
	.type	comparator, @function
comparator:
.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	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comparator, .-comparator
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	""
.LC2:
	.string	"%s %d %d %d"
.LC3:
	.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	$416, %rsp
	movl	%edi, -404(%rbp)
	movq	%rsi, -416(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -376(%rbp)
.L12:
	leaq	-392(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-392(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	jmp	.L14
.L4:
	cmpl	$0, -376(%rbp)
	je	.L6
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L6:
	movl	$1, -376(%rbp)
.L7:
	movl	$0, -372(%rbp)
	jmp	.L8
.L9:
	leaq	-368(%rbp), %rcx
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	4(%rax), %rsi
	leaq	-380(%rbp), %rcx
	leaq	-384(%rbp), %rdx
	leaq	-388(%rbp), %rax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-388(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-380(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$368, %rax
	movl	%ecx, (%rax)
	addl	$1, -372(%rbp)
.L8:
	movl	-392(%rbp), %eax
	cmpl	%eax, -372(%rbp)
	jl	.L9
	movl	-392(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-368(%rbp), %rax
	leaq	comparator(%rip), %rdx
	movq	%rdx, %rcx
	movl	$36, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -372(%rbp)
	jmp	.L10
.L11:
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$368, %rax
	movl	(%rax), %edx
	leaq	-368(%rbp), %rsi
	movl	-372(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -372(%rbp)
.L10:
	movl	-392(%rbp), %eax
	cmpl	%eax, -372(%rbp)
	jl	.L11
	jmp	.L12
.L14:
	call	__stack_chk_fail@PLT
.L13:
	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	comparator
	.type	comparator, @function
comparator:
.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	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comparator, .-comparator
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	""
.LC2:
	.string	"%s %d %d %d"
.LC3:
	.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	$416, %rsp
	movl	%edi, -404(%rbp)
	movq	%rsi, -416(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -376(%rbp)
.L12:
	leaq	-392(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-392(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	jmp	.L14
.L4:
	cmpl	$0, -376(%rbp)
	je	.L6
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L6:
	movl	$1, -376(%rbp)
.L7:
	movl	$0, -372(%rbp)
	jmp	.L8
.L9:
	leaq	-368(%rbp), %rcx
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	4(%rax), %rsi
	leaq	-380(%rbp), %rcx
	leaq	-384(%rbp), %rdx
	leaq	-388(%rbp), %rax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movq	%rax, %rdx
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-388(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-380(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$368, %rax
	movl	%ecx, (%rax)
	addl	$1, -372(%rbp)
.L8:
	movl	-392(%rbp), %eax
	cmpl	%eax, -372(%rbp)
	jl	.L9
	movl	-392(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-368(%rbp), %rax
	leaq	comparator(%rip), %rdx
	movq	%rdx, %rcx
	movl	$36, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -372(%rbp)
	jmp	.L10
.L11:
	movl	-372(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$368, %rax
	movl	(%rax), %edx
	leaq	-368(%rbp), %rsi
	movl	-372(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -372(%rbp)
.L10:
	movl	-392(%rbp), %eax
	cmpl	%eax, -372(%rbp)
	jl	.L11
	jmp	.L12
.L14:
	call	__stack_chk_fail@PLT
.L13:
	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:
