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<string.h>
#include<stdlib.h>
#define MAX 21

struct data{
  int num;
  int point;
};

int comp(const void *p1,const void *p2);


int main(void){
  char scorestr[128],*ch;
  int i,j,k,l;
  int score[MAX];
  int set,throw,frame;
  int id,sum;
  struct data *result;

  while(scanf("%d",&set)&&set!=0){
    result=(struct data *)calloc(set,sizeof(struct data));
    for(i=0;i<set;i++){
      scanf("%d%*c",&result[i].num);
      fgets(scorestr,sizeof(scorestr)/sizeof(char),stdin);
      for(j=0;(ch=strtok(j?NULL:scorestr," \n"))!=NULL;j++){
	score[j]=atoi(ch);
      }
      throw=j;
      sum=0;
      k=0;
      frame=1;
      for(j=0;j<throw;j++){
	sum+=score[j];
	if(frame<=9){
	  if(k==0 && score[j]==10){
	    sum+=score[j+1]+score[j+2];
	    frame++;
	    continue;
	  }else if(k==1 && score[j]+score[j-1]==10) sum+=score[j+1];
	  if(++k==2) frame++,k=0;
	}
      }
      result[i].point=sum;
    }
    qsort(result,set,sizeof(struct data),comp);
    for(j=0;j<set;j++){
      printf("%d %d\n",result[j].num,result[j].point);
    }
    free(result);
  }	
  return 0;
}
   
int comp(const void *p1,const void *p2){
  struct data *d1,*d2;
  d1=(struct data *)p1;
  d2=(struct data *)p2;
  if(d1->point==d2->point){
    return d1->num - d2->num;
  }else{
    return d2->point - d1->point;
  }
}   ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%*c"
.LC1:
	.string	" \n"
.LC2:
	.string	"%d %d\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L17:
	movl	-284(%rbp), %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -256(%rbp)
	movl	$0, -280(%rbp)
	jmp	.L3
.L13:
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$128, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -276(%rbp)
	jmp	.L4
.L7:
	movq	-248(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	-276(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -240(%rbp,%rdx,4)
	addl	$1, -276(%rbp)
.L4:
	cmpl	$0, -276(%rbp)
	jne	.L5
	leaq	-144(%rbp), %rax
	jmp	.L6
.L5:
	movl	$0, %eax
.L6:
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, -248(%rbp)
	cmpq	$0, -248(%rbp)
	jne	.L7
	movl	-276(%rbp), %eax
	movl	%eax, -260(%rbp)
	movl	$0, -264(%rbp)
	movl	$0, -272(%rbp)
	movl	$1, -268(%rbp)
	movl	$0, -276(%rbp)
	jmp	.L8
.L12:
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%eax, -264(%rbp)
	cmpl	$9, -268(%rbp)
	jg	.L9
	cmpl	$0, -272(%rbp)
	jne	.L10
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	cmpl	$10, %eax
	jne	.L10
	movl	-276(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %edx
	movl	-276(%rbp), %eax
	addl	$2, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%edx, %eax
	addl	%eax, -264(%rbp)
	addl	$1, -268(%rbp)
	jmp	.L9
.L10:
	cmpl	$1, -272(%rbp)
	jne	.L11
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %edx
	movl	-276(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%edx, %eax
	cmpl	$10, %eax
	jne	.L11
	movl	-276(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%eax, -264(%rbp)
.L11:
	addl	$1, -272(%rbp)
	cmpl	$2, -272(%rbp)
	jne	.L9
	addl	$1, -268(%rbp)
	movl	$0, -272(%rbp)
.L9:
	addl	$1, -276(%rbp)
.L8:
	movl	-276(%rbp), %eax
	cmpl	-260(%rbp), %eax
	jl	.L12
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rax, %rdx
	movl	-264(%rbp), %eax
	movl	%eax, 4(%rdx)
	addl	$1, -280(%rbp)
.L3:
	movl	-284(%rbp), %eax
	cmpl	%eax, -280(%rbp)
	jl	.L13
	movl	-284(%rbp), %eax
	movslq	%eax, %rsi
	movq	-256(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -276(%rbp)
	jmp	.L14
.L15:
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-256(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -276(%rbp)
.L14:
	movl	-284(%rbp), %eax
	cmpl	%eax, -276(%rbp)
	jl	.L15
	movq	-256(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	-284(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L16
	movl	-284(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
.L16:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	comp
	.type	comp, @function
comp:
.LFB7:
	.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, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jne	.L21
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L22
.L21:
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comp, .-comp
	.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:
.LFB52:
	.cfi_startproc
	endbr64
	movl	4(%rsi), %edx
	movl	4(%rdi), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%edx, %ecx
	je	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%*c"
.LC1:
	.string	" \n"
.LC2:
	.string	"%d %d\n"
.LC3:
	.string	"%d"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB4:
	.section	.text.startup,"ax",@progbits
.LHOTB4:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	subq	$296, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 280(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L7:
	movq	24(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L23
	movl	44(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L23
	movslq	%ebx, %rbp
	movl	$8, %esi
	movq	%rbp, %rdi
	call	calloc@PLT
	movq	%rax, %r15
	testl	%ebx, %ebx
	jle	.L8
	movq	%rax, 16(%rsp)
	movq	%rax, %r13
	leaq	144(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	movq	%r12, %rdi
	call	fgets@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L52:
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%rax, %rdi
	testq	%rax, %rax
	je	.L12
.L11:
	movl	$10, %edx
	xorl	%esi, %esi
	call	strtol@PLT
	movl	%eax, 48(%rsp,%r14,4)
	addq	$1, %r14
.L9:
	movl	%r14d, %ebx
	movl	%r14d, %r15d
	movq	%rbp, %rsi
	testq	%r14, %r14
	jne	.L52
	movq	%r12, %rdi
	call	strtok@PLT
	movq	%rax, %rdi
	testq	%rax, %rax
	jne	.L11
.L12:
	testl	%r15d, %r15d
	je	.L13
	leaq	48(%rsp), %r8
	xorl	%esi, %esi
	xorl	%eax, %eax
	movl	$1, %r9d
	movq	%r8, %rdi
	xorl	%r10d, %r10d
	addl	$1, %eax
	movl	(%rdi), %edx
	addl	%edx, %esi
	cmpl	$9, %r9d
	jg	.L14
.L55:
	testl	%r10d, %r10d
	je	.L53
	addl	-4(%rdi), %edx
	cmpl	$10, %edx
	jne	.L17
	addl	4(%rdi), %esi
.L17:
	addl	$1, %r9d
	xorl	%r10d, %r10d
.L16:
	cmpl	%eax, %r15d
	je	.L54
.L26:
	movl	4(%rdi), %edx
	addq	$4, %rdi
	addl	$1, %eax
	addl	%edx, %esi
	cmpl	$9, %r9d
	jle	.L55
.L14:
	cmpl	%eax, %r15d
	je	.L56
	subl	%eax, %ebx
	movl	$1, %ecx
	cmpl	%eax, %r15d
	cmovg	%ebx, %ecx
	subl	$1, %ebx
	cmpl	$2, %ebx
	jbe	.L28
	movslq	%eax, %rdi
	movl	%ecx, %r9d
	pxor	%xmm0, %xmm0
	leaq	(%r8,%rdi,4), %r8
	shrl	$2, %r9d
	xorl	%edi, %edi
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L53:
	cmpl	$10, %edx
	je	.L57
	movl	$1, %r10d
	cmpl	%eax, %r15d
	jne	.L26
.L54:
	movl	%esi, %r15d
.L13:
	addl	$1, 12(%rsp)
	movl	44(%rsp), %eax
	addq	$8, %r13
	movl	12(%rsp), %ecx
	movl	%r15d, -4(%r13)
	cmpl	%ecx, %eax
	jg	.L20
	movq	16(%rsp), %r15
	movslq	%eax, %rbp
.L8:
	movq	%rbp, %rsi
	leaq	comp(%rip), %rcx
	movq	%r15, %rdi
	xorl	%ebx, %ebx
	movl	$8, %edx
	leaq	.LC2(%rip), %rbp
	call	qsort@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L21:
	movl	4(%r15,%rbx,8), %ecx
	movl	(%r15,%rbx,8), %edx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 44(%rsp)
	jg	.L21
.L22:
	movq	%r15, %rdi
	call	free@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L57:
	movl	8(%rdi), %edx
	addl	4(%rdi), %edx
	addl	$1, %r9d
	addl	%edx, %esi
	jmp	.L16
.L23:
	movq	280(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$296, %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
.L56:
	.cfi_restore_state
	movl	%esi, %r15d
	jmp	.L13
.L58:
	call	__stack_chk_fail@PLT
.L28:
	movslq	%eax, %rcx
	addl	48(%rsp,%rcx,4), %esi
	movl	%esi, %ecx
	leal	1(%rax), %esi
	cmpl	%esi, %r15d
	jle	.L34
	jmp	.L47
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB51:
.L18:
	.cfi_def_cfa_offset 352
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movq	%rdi, %rdx
	addq	$1, %rdi
	salq	$4, %rdx
	movdqu	(%r8,%rdx), %xmm1
	paddd	%xmm1, %xmm0
	cmpl	%edi, %r9d
	ja	.L18
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edi
	addl	%edi, %esi
	movl	%ecx, %edi
	andl	$-4, %edi
	addl	%edi, %eax
	cmpl	%edi, %ecx
	jne	.L28
	movl	%esi, %r15d
	jmp	.L13
.L34:
	movl	%ecx, %r15d
	jmp	.L13
.L47:
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	48(%rsp,%rsi,4), %ecx
	cmpl	%eax, %r15d
	jle	.L35
	cltq
	addl	48(%rsp,%rax,4), %ecx
	movl	%ecx, %r15d
	jmp	.L13
.L35:
	movl	%ecx, %r15d
	jmp	.L13
	.cfi_endproc
.LFE51:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE4:
	.section	.text.startup
.LHOTE4:
	.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:
.LFB52:
	.cfi_startproc
	endbr64
	movl	4(%rsi), %edx
	movl	4(%rdi), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%edx, %ecx
	je	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%*c"
.LC1:
	.string	" \n"
.LC2:
	.string	"%d %d\n"
.LC3:
	.string	"%d"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB4:
	.section	.text.startup,"ax",@progbits
.LHOTB4:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	subq	$296, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 280(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L7:
	movq	24(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L23
	movl	44(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L23
	movslq	%ebx, %rbp
	movl	$8, %esi
	movq	%rbp, %rdi
	call	calloc@PLT
	movq	%rax, %r15
	testl	%ebx, %ebx
	jle	.L8
	movq	%rax, 16(%rsp)
	movq	%rax, %r13
	leaq	144(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r14d, %r14d
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	movq	%r12, %rdi
	call	fgets@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L52:
	xorl	%edi, %edi
	call	strtok@PLT
	movq	%rax, %rdi
	testq	%rax, %rax
	je	.L12
.L11:
	movl	$10, %edx
	xorl	%esi, %esi
	call	strtol@PLT
	movl	%eax, 48(%rsp,%r14,4)
	addq	$1, %r14
.L9:
	movl	%r14d, %ebx
	movl	%r14d, %r15d
	movq	%rbp, %rsi
	testq	%r14, %r14
	jne	.L52
	movq	%r12, %rdi
	call	strtok@PLT
	movq	%rax, %rdi
	testq	%rax, %rax
	jne	.L11
.L12:
	testl	%r15d, %r15d
	je	.L13
	leaq	48(%rsp), %r8
	xorl	%esi, %esi
	xorl	%eax, %eax
	movl	$1, %r9d
	movq	%r8, %rdi
	xorl	%r10d, %r10d
	addl	$1, %eax
	movl	(%rdi), %edx
	addl	%edx, %esi
	cmpl	$9, %r9d
	jg	.L14
.L55:
	testl	%r10d, %r10d
	je	.L53
	addl	-4(%rdi), %edx
	cmpl	$10, %edx
	jne	.L17
	addl	4(%rdi), %esi
.L17:
	addl	$1, %r9d
	xorl	%r10d, %r10d
.L16:
	cmpl	%eax, %r15d
	je	.L54
.L26:
	movl	4(%rdi), %edx
	addq	$4, %rdi
	addl	$1, %eax
	addl	%edx, %esi
	cmpl	$9, %r9d
	jle	.L55
.L14:
	cmpl	%eax, %r15d
	je	.L56
	subl	%eax, %ebx
	movl	$1, %ecx
	cmpl	%eax, %r15d
	cmovg	%ebx, %ecx
	subl	$1, %ebx
	cmpl	$2, %ebx
	jbe	.L28
	movslq	%eax, %rdi
	movl	%ecx, %r9d
	pxor	%xmm0, %xmm0
	leaq	(%r8,%rdi,4), %r8
	shrl	$2, %r9d
	xorl	%edi, %edi
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L53:
	cmpl	$10, %edx
	je	.L57
	movl	$1, %r10d
	cmpl	%eax, %r15d
	jne	.L26
.L54:
	movl	%esi, %r15d
.L13:
	addl	$1, 12(%rsp)
	movl	44(%rsp), %eax
	addq	$8, %r13
	movl	12(%rsp), %ecx
	movl	%r15d, -4(%r13)
	cmpl	%ecx, %eax
	jg	.L20
	movq	16(%rsp), %r15
	movslq	%eax, %rbp
.L8:
	movq	%rbp, %rsi
	leaq	comp(%rip), %rcx
	movq	%r15, %rdi
	xorl	%ebx, %ebx
	movl	$8, %edx
	leaq	.LC2(%rip), %rbp
	call	qsort@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L21:
	movl	4(%r15,%rbx,8), %ecx
	movl	(%r15,%rbx,8), %edx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 44(%rsp)
	jg	.L21
.L22:
	movq	%r15, %rdi
	call	free@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L57:
	movl	8(%rdi), %edx
	addl	4(%rdi), %edx
	addl	$1, %r9d
	addl	%edx, %esi
	jmp	.L16
.L23:
	movq	280(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$296, %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
.L56:
	.cfi_restore_state
	movl	%esi, %r15d
	jmp	.L13
.L58:
	call	__stack_chk_fail@PLT
.L28:
	movslq	%eax, %rcx
	addl	48(%rsp,%rcx,4), %esi
	movl	%esi, %ecx
	leal	1(%rax), %esi
	cmpl	%esi, %r15d
	jle	.L34
	jmp	.L47
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB51:
.L18:
	.cfi_def_cfa_offset 352
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movq	%rdi, %rdx
	addq	$1, %rdi
	salq	$4, %rdx
	movdqu	(%r8,%rdx), %xmm1
	paddd	%xmm1, %xmm0
	cmpl	%edi, %r9d
	ja	.L18
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edi
	addl	%edi, %esi
	movl	%ecx, %edi
	andl	$-4, %edi
	addl	%edi, %eax
	cmpl	%edi, %ecx
	jne	.L28
	movl	%esi, %r15d
	jmp	.L13
.L34:
	movl	%ecx, %r15d
	jmp	.L13
.L47:
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	48(%rsp,%rsi,4), %ecx
	cmpl	%eax, %r15d
	jle	.L35
	cltq
	addl	48(%rsp,%rax,4), %ecx
	movl	%ecx, %r15d
	jmp	.L13
.L35:
	movl	%ecx, %r15d
	jmp	.L13
	.cfi_endproc
.LFE51:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE4:
	.section	.text.startup
.LHOTE4:
	.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<string.h>
#include<stdlib.h>
#define MAX 21

struct data{
  int num;
  int point;
};

int comp(const void *p1,const void *p2);


int main(void){
  char scorestr[128],*ch;
  int i,j,k,l;
  int score[MAX];
  int set,throw,frame;
  int id,sum;
  struct data *result;

  while(scanf("%d",&set)&&set!=0){
    result=(struct data *)calloc(set,sizeof(struct data));
    for(i=0;i<set;i++){
      scanf("%d%*c",&result[i].num);
      fgets(scorestr,sizeof(scorestr)/sizeof(char),stdin);
      for(j=0;(ch=strtok(j?NULL:scorestr," \n"))!=NULL;j++){
	score[j]=atoi(ch);
      }
      throw=j;
      sum=0;
      k=0;
      frame=1;
      for(j=0;j<throw;j++){
	sum+=score[j];
	if(frame<=9){
	  if(k==0 && score[j]==10){
	    sum+=score[j+1]+score[j+2];
	    frame++;
	    continue;
	  }else if(k==1 && score[j]+score[j-1]==10) sum+=score[j+1];
	  if(++k==2) frame++,k=0;
	}
      }
      result[i].point=sum;
    }
    qsort(result,set,sizeof(struct data),comp);
    for(j=0;j<set;j++){
      printf("%d %d\n",result[j].num,result[j].point);
    }
    free(result);
  }	
  return 0;
}
   
int comp(const void *p1,const void *p2){
  struct data *d1,*d2;
  d1=(struct data *)p1;
  d2=(struct data *)p2;
  if(d1->point==d2->point){
    return d1->num - d2->num;
  }else{
    return d2->point - d1->point;
  }
}   
3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0
1200 5 3 9 1 7 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 0 4 8 2 8 2 9 1 7 3 6 4 8 2 9 1 7
0
 3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0
1200 5 3 9 1 7 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 6 4 8 2 8 2 9 0 7 3 6 4 8 2 9 1 7
0
 3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0
1200 5 3 9 1 12 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 0 4 8 2 8 2 9 1 7 3 6 4 8 2 9 1 7
0
 3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0
1200 5 3 9 1 7 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 6 4 8 2 8 2 9 0 7 3 6 4 11 2 9 1 7
0
 3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0
1200 5 3 9 1 12 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 0 4 8 2 8 2 9 1 7 3 5 4 8 2 9 1 7
0
 3
1010 5 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0
1200 5 3 9 1 7 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 6 4 8 2 8 2 9 0 7 3 6 4 11 2 9 1 7
0
 3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0
1200 5 3 9 1 9 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 6 4 8 2 8 2 9 1 7 3 6 4 8 2 9 1 7
0
 3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 16 1 9 0
1200 5 3 9 1 7 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 0 4 8 2 8 2 9 1 7 3 6 4 8 2 9 1 7
0
 3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 1 9 0
1200 5 3 9 1 7 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 6 4 8 2 8 2 9 0 7 3 6 4 8 2 9 1 7
0
 3
1010 6 3 10 7 1 0 7 9 1 10 6 2 4 3 9 2 9 0
1200 5 3 9 1 9 1 0 0 8 1 10 10 4 3 9 1 8 2 9
1101 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
3321 8 2 10 9 1 7 0 10 10 10 0 8 10 10 10 10
3332 5 0 10 9 1 4 1 9 0 10 10 7 1 5 2 8 1
3335 10 10 10 10 10 10 10 10 10 10 10 10
3340 8 2 7 3 6 4 8 2 8 2 9 1 7 3 6 4 8 2 9 1 7
0

1200 127
1010 123
1101 60
3335 300
3321 200
3340 155
3332 122
 1200 127
1010 123
1101 60
3335 300
3321 200
3340 167
3332 122
 1200 137
1010 123
1101 60
3335 300
3321 200
3340 155
3332 122
 1200 127
1010 123
1101 60
3335 300
3321 200
3340 164
3332 122
 1200 137
1010 123
1101 60
3335 300
3321 200
3340 145
3332 122
 1200 127
1010 122
1101 60
3335 300
3321 200
3340 164
3332 122
 1200 131
1010 123
1101 60
3335 300
3321 200
3340 175
3332 122
 1200 127
1010 121
1101 60
3335 300
3321 200
3340 155
3332 122
 1200 127
1010 123
1101 59
3335 300
3321 200
3340 167
3332 122
 1200 131
1010 115
1101 60
3335 300
3321 200
3340 175
3332 122

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<string.h>
#include<stdlib.h>
#define MAX 21

struct data{
  int num;
  int point;
};

int comp(const void *p1,const void *p2);


int main(void){
  char scorestr[128],*ch;
  int i,j,k,l;
  int score[MAX];
  int set,throw,frame;
  int id,sum;
  struct data *result;

  while(scanf("%d",&set)&&set!=0){
    result=(struct data *)calloc(set,sizeof(struct data));
    for(i=0;i<set;i++){
      scanf("%d%*c",&result[i].num);
      fgets(scorestr,sizeof(scorestr)/sizeof(char),stdin);
      for(j=0;(ch=strtok(j?NULL:scorestr," \n"))!=NULL;j++){
	score[j]=atoi(ch);
      }
      throw=j;
      sum=0;
      k=0;
      frame=1;
      for(j=0;j<throw;j++){
	sum+=score[j];
	if(frame<=9){
	  if(k==0 && score[j]==10){
	    sum+=score[j+1]+score[j+2];
	    frame++;
	    continue;
	  }else if(k==1 && score[j]+score[j-1]==10) sum+=score[j+1];
	  if(++k==2) frame++,k=0;
	}
      }
      result[i].point=sum;
    }
    qsort(result,set,sizeof(struct data),comp);
    for(j=0;j<set;j++){
      printf("%d %d\n",result[j].num,result[j].point);
    }
    free(result);
  }	
  return 0;
}
   
int comp(const void *p1,const void *p2){
  struct data *d1,*d2;
  d1=(struct data *)p1;
  d2=(struct data *)p2;
  if(d1->point==d2->point){
    return d1->num - d2->num;
  }else{
    return d2->point - d1->point;
  }
}   ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%*c"
.LC1:
	.string	" \n"
.LC2:
	.string	"%d %d\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L17:
	movl	-284(%rbp), %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -256(%rbp)
	movl	$0, -280(%rbp)
	jmp	.L3
.L13:
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$128, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -276(%rbp)
	jmp	.L4
.L7:
	movq	-248(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	-276(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -240(%rbp,%rdx,4)
	addl	$1, -276(%rbp)
.L4:
	cmpl	$0, -276(%rbp)
	jne	.L5
	leaq	-144(%rbp), %rax
	jmp	.L6
.L5:
	movl	$0, %eax
.L6:
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, -248(%rbp)
	cmpq	$0, -248(%rbp)
	jne	.L7
	movl	-276(%rbp), %eax
	movl	%eax, -260(%rbp)
	movl	$0, -264(%rbp)
	movl	$0, -272(%rbp)
	movl	$1, -268(%rbp)
	movl	$0, -276(%rbp)
	jmp	.L8
.L12:
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%eax, -264(%rbp)
	cmpl	$9, -268(%rbp)
	jg	.L9
	cmpl	$0, -272(%rbp)
	jne	.L10
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	cmpl	$10, %eax
	jne	.L10
	movl	-276(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %edx
	movl	-276(%rbp), %eax
	addl	$2, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%edx, %eax
	addl	%eax, -264(%rbp)
	addl	$1, -268(%rbp)
	jmp	.L9
.L10:
	cmpl	$1, -272(%rbp)
	jne	.L11
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %edx
	movl	-276(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%edx, %eax
	cmpl	$10, %eax
	jne	.L11
	movl	-276(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%eax, -264(%rbp)
.L11:
	addl	$1, -272(%rbp)
	cmpl	$2, -272(%rbp)
	jne	.L9
	addl	$1, -268(%rbp)
	movl	$0, -272(%rbp)
.L9:
	addl	$1, -276(%rbp)
.L8:
	movl	-276(%rbp), %eax
	cmpl	-260(%rbp), %eax
	jl	.L12
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rax, %rdx
	movl	-264(%rbp), %eax
	movl	%eax, 4(%rdx)
	addl	$1, -280(%rbp)
.L3:
	movl	-284(%rbp), %eax
	cmpl	%eax, -280(%rbp)
	jl	.L13
	movl	-284(%rbp), %eax
	movslq	%eax, %rsi
	movq	-256(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -276(%rbp)
	jmp	.L14
.L15:
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-256(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -276(%rbp)
.L14:
	movl	-284(%rbp), %eax
	cmpl	%eax, -276(%rbp)
	jl	.L15
	movq	-256(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	-284(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L16
	movl	-284(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
.L16:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	comp
	.type	comp, @function
comp:
.LFB7:
	.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, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jne	.L21
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L22
.L21:
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comp, .-comp
	.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
	.section	.rodata
.LC0:
	.string	"%d%*c"
.LC1:
	.string	" \n"
.LC2:
	.string	"%d %d\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$288, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L17:
	movl	-284(%rbp), %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -256(%rbp)
	movl	$0, -280(%rbp)
	jmp	.L3
.L13:
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$128, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -276(%rbp)
	jmp	.L4
.L7:
	movq	-248(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	-276(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -240(%rbp,%rdx,4)
	addl	$1, -276(%rbp)
.L4:
	cmpl	$0, -276(%rbp)
	jne	.L5
	leaq	-144(%rbp), %rax
	jmp	.L6
.L5:
	movl	$0, %eax
.L6:
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strtok@PLT
	movq	%rax, -248(%rbp)
	cmpq	$0, -248(%rbp)
	jne	.L7
	movl	-276(%rbp), %eax
	movl	%eax, -260(%rbp)
	movl	$0, -264(%rbp)
	movl	$0, -272(%rbp)
	movl	$1, -268(%rbp)
	movl	$0, -276(%rbp)
	jmp	.L8
.L12:
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%eax, -264(%rbp)
	cmpl	$9, -268(%rbp)
	jg	.L9
	cmpl	$0, -272(%rbp)
	jne	.L10
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	cmpl	$10, %eax
	jne	.L10
	movl	-276(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %edx
	movl	-276(%rbp), %eax
	addl	$2, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%edx, %eax
	addl	%eax, -264(%rbp)
	addl	$1, -268(%rbp)
	jmp	.L9
.L10:
	cmpl	$1, -272(%rbp)
	jne	.L11
	movl	-276(%rbp), %eax
	cltq
	movl	-240(%rbp,%rax,4), %edx
	movl	-276(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%edx, %eax
	cmpl	$10, %eax
	jne	.L11
	movl	-276(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-240(%rbp,%rax,4), %eax
	addl	%eax, -264(%rbp)
.L11:
	addl	$1, -272(%rbp)
	cmpl	$2, -272(%rbp)
	jne	.L9
	addl	$1, -268(%rbp)
	movl	$0, -272(%rbp)
.L9:
	addl	$1, -276(%rbp)
.L8:
	movl	-276(%rbp), %eax
	cmpl	-260(%rbp), %eax
	jl	.L12
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rax, %rdx
	movl	-264(%rbp), %eax
	movl	%eax, 4(%rdx)
	addl	$1, -280(%rbp)
.L3:
	movl	-284(%rbp), %eax
	cmpl	%eax, -280(%rbp)
	jl	.L13
	movl	-284(%rbp), %eax
	movslq	%eax, %rsi
	movq	-256(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -276(%rbp)
	jmp	.L14
.L15:
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-256(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-256(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -276(%rbp)
.L14:
	movl	-284(%rbp), %eax
	cmpl	%eax, -276(%rbp)
	jl	.L15
	movq	-256(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	-284(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L16
	movl	-284(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
.L16:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	comp
	.type	comp, @function
comp:
.LFB7:
	.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, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jne	.L21
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L22
.L21:
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L22:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comp, .-comp
	.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:
