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>

enum flugs{
  NONE=0,
  SPARE=1,
  STRIKE=2
};

struct data{
  int stud;
  int point;
};

int comp(const void *p1, const void *p2);
struct data inputmake(void);
void output(struct data datas);

int main(void){
  int i,j,k;
  int student;
  struct data *cases;

  while(scanf("%d",&student) && student){
    cases=(struct data *)calloc(student,sizeof(struct data));
    for(i=0;i<student;i++) cases[i]=inputmake();
    qsort(cases,student,sizeof(struct data),comp);
    for(i=0;i<student;i++) output(cases[i]);
    free(cases);
  }
  return 0;
}

int comp(const void *p1, const void *p2) {
  struct data *n1, *n2;
  n1 = (struct data *)p1;
  n2 = (struct data *)p2;
  if (n1->point == n2->point) {
    return n1->stud - n2->stud;
  }else{
    return n2->point - n1->point;
  }
}

struct data inputmake(void){
  enum flugs flg[3]={NONE,NONE,NONE};
  int frame=1,through=0,nums[3];
  struct data ret;
  scanf("%d",&ret.stud);
  ret.point=0;
  while(frame<11){
    scanf("%d",&nums[0]);
    through++;
    if(frame!=10){
      if(through==1 && nums[0]==10) flg[0]=STRIKE;
      else if(through==2 && nums[0]+nums[1]==10) flg[0]=SPARE;
      else flg[0]=NONE;
      ret.point+=nums[0];
      if(flg[1]==SPARE || flg[1]==STRIKE) ret.point+=nums[0];
      if(flg[2]==STRIKE) ret.point+=nums[0];
    }else{
      if(through==1){
	flg[0]=NONE;
	ret.point+=nums[0];
	if(flg[1]==SPARE || flg[1]==STRIKE) ret.point+=nums[0];
	if(flg[2]==STRIKE) ret.point+=nums[0];
      }else{
	ret.point+=nums[0];
	if(flg[2]==STRIKE) ret.point+=nums[0];
	if(nums[0]+nums[1]>=10){
	  scanf("%d",&nums[2]);
	  ret.point+=nums[2];
	}
	break;
      }
    }
    nums[2]=nums[1];
    nums[1]=nums[0];
    flg[2]=flg[1];
    flg[1]=flg[0];
    if(through==2 || (through==1 && flg[0]==STRIKE)){
      frame++;
      through=0;
    }
  }
  return ret;
}

void output(struct data datas){
  printf("%d %d\n",datas.stud,datas.point);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L8:
	movl	-40(%rbp), %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L3
.L4:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	call	inputmake
	movq	%rax, (%rbx)
	addl	$1, -36(%rbp)
.L3:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L4
	movl	-40(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -36(%rbp)
	jmp	.L5
.L6:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdi
	call	output
	addl	$1, -36(%rbp)
.L5:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L6
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L7
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
.L7:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	movq	-8(%rbp), %rbx
	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	.L12
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L13
.L12:
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comp, .-comp
	.globl	inputmake
	.type	inputmake, @function
inputmake:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L15
.L30:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
	cmpl	$10, -48(%rbp)
	je	.L16
	cmpl	$1, -44(%rbp)
	jne	.L17
	movl	-20(%rbp), %eax
	cmpl	$10, %eax
	jne	.L17
	movl	$2, -32(%rbp)
	jmp	.L18
.L17:
	cmpl	$2, -44(%rbp)
	jne	.L19
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	$10, %eax
	jne	.L19
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	$0, -32(%rbp)
.L18:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	je	.L20
	movl	-28(%rbp), %eax
	cmpl	$2, %eax
	jne	.L21
.L20:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L21:
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L22
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L22
.L16:
	cmpl	$1, -44(%rbp)
	jne	.L23
	movl	$0, -32(%rbp)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	je	.L24
	movl	-28(%rbp), %eax
	cmpl	$2, %eax
	jne	.L25
.L24:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L25:
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L22
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L22
.L23:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L26
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L26:
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jle	.L33
	leaq	-20(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L33
.L22:
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	cmpl	$2, -44(%rbp)
	je	.L29
	cmpl	$1, -44(%rbp)
	jne	.L15
	movl	-32(%rbp), %eax
	cmpl	$2, %eax
	jne	.L15
.L29:
	addl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
.L15:
	cmpl	$10, -48(%rbp)
	jle	.L30
	jmp	.L28
.L33:
	nop
.L28:
	movq	-40(%rbp), %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	inputmake, .-inputmake
	.section	.rodata
.LC1:
	.string	"%d %d\n"
	.text
	.globl	output
	.type	output, @function
output:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	output, .-output
	.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:
.LFB40:
	.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
.LFE40:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	inputmake
	.type	inputmake, @function
inputmake:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	8(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	$0, 4(%rsp)
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L41:
	movq	8(%rsp), %rsi
	movl	8(%rsp), %edx
	movl	12(%rsp), %eax
	cmpl	$1, %ebx
	je	.L39
	addl	%edx, %eax
	xorl	%ecx, %ecx
	cmpl	$10, %eax
	sete	%cl
.L9:
	movl	4(%rsp), %eax
	leal	-1(%rbp), %edi
	addl	%edx, %eax
	cmpl	$1, %edi
	ja	.L37
	addl	%edx, %eax
.L37:
	movl	%eax, 4(%rsp)
	cmpl	$2, %r14d
	jne	.L12
	addl	%edx, %eax
	movl	%eax, 4(%rsp)
.L12:
	movq	%rsi, 12(%rsp)
	cmpl	$2, %ebx
	jne	.L40
.L24:
	addl	$1, %r12d
	xorl	%ebx, %ebx
.L21:
	cmpl	$11, %r12d
	je	.L20
.L23:
	movl	%ebp, %r14d
	movl	%ecx, %ebp
.L22:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	cmpl	$10, %r12d
	jne	.L41
	movl	8(%rsp), %eax
	movl	4(%rsp), %edx
	addl	%eax, %edx
	cmpl	$1, %ebx
	jne	.L13
	leal	-1(%rbp), %ecx
	cmpl	$1, %ecx
	ja	.L38
	addl	%eax, %edx
.L38:
	movl	%edx, 4(%rsp)
	cmpl	$2, %r14d
	jne	.L16
	addl	%eax, %edx
	movl	%edx, 4(%rsp)
.L16:
	movd	12(%rsp), %xmm1
	movd	%eax, %xmm0
	xorl	%ecx, %ecx
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, 12(%rsp)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L39:
	xorl	%ecx, %ecx
	cmpl	$10, %edx
	sete	%cl
	addl	%ecx, %ecx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	leal	(%rdx,%rax), %ecx
	cmpl	$2, %r14d
	cmove	%ecx, %edx
	addl	12(%rsp), %eax
	movl	%edx, 4(%rsp)
	cmpl	$9, %eax
	jg	.L42
	.p2align 4,,10
	.p2align 3
.L20:
	movq	(%rsp), %rax
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L43
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L42:
	.cfi_restore_state
	leaq	16(%rsp), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	addl	%eax, 4(%rsp)
	jmp	.L20
.L43:
	call	__stack_chk_fail@PLT
.L40:
	movl	$1, %ebx
	cmpl	$2, %ecx
	jne	.L21
	jmp	.L24
	.cfi_endproc
.LFE41:
	.size	inputmake, .-inputmake
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L45:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L50
	movl	4(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L50
	movslq	%ebx, %r15
	movl	$8, %esi
	movq	%r15, %rdi
	call	calloc@PLT
	movq	%rax, %r14
	testl	%ebx, %ebx
	jle	.L46
	movq	%rax, %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L47:
	call	inputmake
	addl	$1, %ebx
	addq	$8, %r15
	movq	%rax, -8(%r15)
	movl	4(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L47
	movslq	%eax, %r15
.L46:
	leaq	comp(%rip), %rcx
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%ebx, %ebx
	movl	$8, %edx
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L49
	.p2align 4,,10
	.p2align 3
.L48:
	movl	4(%r14,%rbx,8), %ecx
	movl	(%r14,%rbx,8), %edx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jg	.L48
.L49:
	movq	%r14, %rdi
	call	free@PLT
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L50:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	addq	$24, %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
.L61:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	output
	.type	output, @function
output:
.LFB42:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rdi, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	shrq	$32, %rax
	movq	%rax, %rcx
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE42:
	.size	output, .-output
	.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:
.LFB40:
	.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
.LFE40:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	inputmake
	.type	inputmake, @function
inputmake:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	xorl	%r14d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	$1, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	8(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	$0, 4(%rsp)
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L41:
	movq	8(%rsp), %rsi
	movl	8(%rsp), %edx
	movl	12(%rsp), %eax
	cmpl	$1, %ebx
	je	.L39
	addl	%edx, %eax
	xorl	%ecx, %ecx
	cmpl	$10, %eax
	sete	%cl
.L9:
	movl	4(%rsp), %eax
	leal	-1(%rbp), %edi
	addl	%edx, %eax
	cmpl	$1, %edi
	ja	.L37
	addl	%edx, %eax
.L37:
	movl	%eax, 4(%rsp)
	cmpl	$2, %r14d
	jne	.L12
	addl	%edx, %eax
	movl	%eax, 4(%rsp)
.L12:
	movq	%rsi, 12(%rsp)
	cmpl	$2, %ebx
	jne	.L40
.L24:
	addl	$1, %r12d
	xorl	%ebx, %ebx
.L21:
	cmpl	$11, %r12d
	je	.L20
.L23:
	movl	%ebp, %r14d
	movl	%ecx, %ebp
.L22:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	cmpl	$10, %r12d
	jne	.L41
	movl	8(%rsp), %eax
	movl	4(%rsp), %edx
	addl	%eax, %edx
	cmpl	$1, %ebx
	jne	.L13
	leal	-1(%rbp), %ecx
	cmpl	$1, %ecx
	ja	.L38
	addl	%eax, %edx
.L38:
	movl	%edx, 4(%rsp)
	cmpl	$2, %r14d
	jne	.L16
	addl	%eax, %edx
	movl	%edx, 4(%rsp)
.L16:
	movd	12(%rsp), %xmm1
	movd	%eax, %xmm0
	xorl	%ecx, %ecx
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, 12(%rsp)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L39:
	xorl	%ecx, %ecx
	cmpl	$10, %edx
	sete	%cl
	addl	%ecx, %ecx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	leal	(%rdx,%rax), %ecx
	cmpl	$2, %r14d
	cmove	%ecx, %edx
	addl	12(%rsp), %eax
	movl	%edx, 4(%rsp)
	cmpl	$9, %eax
	jg	.L42
	.p2align 4,,10
	.p2align 3
.L20:
	movq	(%rsp), %rax
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L43
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L42:
	.cfi_restore_state
	leaq	16(%rsp), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	addl	%eax, 4(%rsp)
	jmp	.L20
.L43:
	call	__stack_chk_fail@PLT
.L40:
	movl	$1, %ebx
	cmpl	$2, %ecx
	jne	.L21
	jmp	.L24
	.cfi_endproc
.LFE41:
	.size	inputmake, .-inputmake
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L45:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L50
	movl	4(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L50
	movslq	%ebx, %r15
	movl	$8, %esi
	movq	%r15, %rdi
	call	calloc@PLT
	movq	%rax, %r14
	testl	%ebx, %ebx
	jle	.L46
	movq	%rax, %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L47:
	call	inputmake
	addl	$1, %ebx
	addq	$8, %r15
	movq	%rax, -8(%r15)
	movl	4(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L47
	movslq	%eax, %r15
.L46:
	leaq	comp(%rip), %rcx
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%ebx, %ebx
	movl	$8, %edx
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L49
	.p2align 4,,10
	.p2align 3
.L48:
	movl	4(%r14,%rbx,8), %ecx
	movl	(%r14,%rbx,8), %edx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jg	.L48
.L49:
	movq	%r14, %rdi
	call	free@PLT
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L50:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L61
	addq	$24, %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
.L61:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	output
	.type	output, @function
output:
.LFB42:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	movq	%rdi, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	shrq	$32, %rax
	movq	%rax, %rcx
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.cfi_endproc
.LFE42:
	.size	output, .-output
	.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>

enum flugs{
  NONE=0,
  SPARE=1,
  STRIKE=2
};

struct data{
  int stud;
  int point;
};

int comp(const void *p1, const void *p2);
struct data inputmake(void);
void output(struct data datas);

int main(void){
  int i,j,k;
  int student;
  struct data *cases;

  while(scanf("%d",&student) && student){
    cases=(struct data *)calloc(student,sizeof(struct data));
    for(i=0;i<student;i++) cases[i]=inputmake();
    qsort(cases,student,sizeof(struct data),comp);
    for(i=0;i<student;i++) output(cases[i]);
    free(cases);
  }
  return 0;
}

int comp(const void *p1, const void *p2) {
  struct data *n1, *n2;
  n1 = (struct data *)p1;
  n2 = (struct data *)p2;
  if (n1->point == n2->point) {
    return n1->stud - n2->stud;
  }else{
    return n2->point - n1->point;
  }
}

struct data inputmake(void){
  enum flugs flg[3]={NONE,NONE,NONE};
  int frame=1,through=0,nums[3];
  struct data ret;
  scanf("%d",&ret.stud);
  ret.point=0;
  while(frame<11){
    scanf("%d",&nums[0]);
    through++;
    if(frame!=10){
      if(through==1 && nums[0]==10) flg[0]=STRIKE;
      else if(through==2 && nums[0]+nums[1]==10) flg[0]=SPARE;
      else flg[0]=NONE;
      ret.point+=nums[0];
      if(flg[1]==SPARE || flg[1]==STRIKE) ret.point+=nums[0];
      if(flg[2]==STRIKE) ret.point+=nums[0];
    }else{
      if(through==1){
	flg[0]=NONE;
	ret.point+=nums[0];
	if(flg[1]==SPARE || flg[1]==STRIKE) ret.point+=nums[0];
	if(flg[2]==STRIKE) ret.point+=nums[0];
      }else{
	ret.point+=nums[0];
	if(flg[2]==STRIKE) ret.point+=nums[0];
	if(nums[0]+nums[1]>=10){
	  scanf("%d",&nums[2]);
	  ret.point+=nums[2];
	}
	break;
      }
    }
    nums[2]=nums[1];
    nums[1]=nums[0];
    flg[2]=flg[1];
    flg[1]=flg[0];
    if(through==2 || (through==1 && flg[0]==STRIKE)){
      frame++;
      through=0;
    }
  }
  return ret;
}

void output(struct data datas){
  printf("%d %d\n",datas.stud,datas.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<stdlib.h>

enum flugs{
  NONE=0,
  SPARE=1,
  STRIKE=2
};

struct data{
  int stud;
  int point;
};

int comp(const void *p1, const void *p2);
struct data inputmake(void);
void output(struct data datas);

int main(void){
  int i,j,k;
  int student;
  struct data *cases;

  while(scanf("%d",&student) && student){
    cases=(struct data *)calloc(student,sizeof(struct data));
    for(i=0;i<student;i++) cases[i]=inputmake();
    qsort(cases,student,sizeof(struct data),comp);
    for(i=0;i<student;i++) output(cases[i]);
    free(cases);
  }
  return 0;
}

int comp(const void *p1, const void *p2) {
  struct data *n1, *n2;
  n1 = (struct data *)p1;
  n2 = (struct data *)p2;
  if (n1->point == n2->point) {
    return n1->stud - n2->stud;
  }else{
    return n2->point - n1->point;
  }
}

struct data inputmake(void){
  enum flugs flg[3]={NONE,NONE,NONE};
  int frame=1,through=0,nums[3];
  struct data ret;
  scanf("%d",&ret.stud);
  ret.point=0;
  while(frame<11){
    scanf("%d",&nums[0]);
    through++;
    if(frame!=10){
      if(through==1 && nums[0]==10) flg[0]=STRIKE;
      else if(through==2 && nums[0]+nums[1]==10) flg[0]=SPARE;
      else flg[0]=NONE;
      ret.point+=nums[0];
      if(flg[1]==SPARE || flg[1]==STRIKE) ret.point+=nums[0];
      if(flg[2]==STRIKE) ret.point+=nums[0];
    }else{
      if(through==1){
	flg[0]=NONE;
	ret.point+=nums[0];
	if(flg[1]==SPARE || flg[1]==STRIKE) ret.point+=nums[0];
	if(flg[2]==STRIKE) ret.point+=nums[0];
      }else{
	ret.point+=nums[0];
	if(flg[2]==STRIKE) ret.point+=nums[0];
	if(nums[0]+nums[1]>=10){
	  scanf("%d",&nums[2]);
	  ret.point+=nums[2];
	}
	break;
      }
    }
    nums[2]=nums[1];
    nums[1]=nums[0];
    flg[2]=flg[1];
    flg[1]=flg[0];
    if(through==2 || (through==1 && flg[0]==STRIKE)){
      frame++;
      through=0;
    }
  }
  return ret;
}

void output(struct data datas){
  printf("%d %d\n",datas.stud,datas.point);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L8:
	movl	-40(%rbp), %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L3
.L4:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	call	inputmake
	movq	%rax, (%rbx)
	addl	$1, -36(%rbp)
.L3:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L4
	movl	-40(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -36(%rbp)
	jmp	.L5
.L6:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdi
	call	output
	addl	$1, -36(%rbp)
.L5:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L6
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L7
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
.L7:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	movq	-8(%rbp), %rbx
	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	.L12
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L13
.L12:
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comp, .-comp
	.globl	inputmake
	.type	inputmake, @function
inputmake:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L15
.L30:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
	cmpl	$10, -48(%rbp)
	je	.L16
	cmpl	$1, -44(%rbp)
	jne	.L17
	movl	-20(%rbp), %eax
	cmpl	$10, %eax
	jne	.L17
	movl	$2, -32(%rbp)
	jmp	.L18
.L17:
	cmpl	$2, -44(%rbp)
	jne	.L19
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	$10, %eax
	jne	.L19
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	$0, -32(%rbp)
.L18:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	je	.L20
	movl	-28(%rbp), %eax
	cmpl	$2, %eax
	jne	.L21
.L20:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L21:
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L22
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L22
.L16:
	cmpl	$1, -44(%rbp)
	jne	.L23
	movl	$0, -32(%rbp)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	je	.L24
	movl	-28(%rbp), %eax
	cmpl	$2, %eax
	jne	.L25
.L24:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L25:
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L22
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L22
.L23:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L26
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L26:
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jle	.L33
	leaq	-20(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L33
.L22:
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	cmpl	$2, -44(%rbp)
	je	.L29
	cmpl	$1, -44(%rbp)
	jne	.L15
	movl	-32(%rbp), %eax
	cmpl	$2, %eax
	jne	.L15
.L29:
	addl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
.L15:
	cmpl	$10, -48(%rbp)
	jle	.L30
	jmp	.L28
.L33:
	nop
.L28:
	movq	-40(%rbp), %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	inputmake, .-inputmake
	.section	.rodata
.LC1:
	.string	"%d %d\n"
	.text
	.globl	output
	.type	output, @function
output:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	output, .-output
	.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"
	.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
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L8:
	movl	-40(%rbp), %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L3
.L4:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	call	inputmake
	movq	%rax, (%rbx)
	addl	$1, -36(%rbp)
.L3:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L4
	movl	-40(%rbp), %eax
	movslq	%eax, %rsi
	movq	-32(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -36(%rbp)
	jmp	.L5
.L6:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdi
	call	output
	addl	$1, -36(%rbp)
.L5:
	movl	-40(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L6
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L7
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
.L7:
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	movq	-8(%rbp), %rbx
	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	.L12
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L13
.L12:
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	comp, .-comp
	.globl	inputmake
	.type	inputmake, @function
inputmake:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L15
.L30:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
	cmpl	$10, -48(%rbp)
	je	.L16
	cmpl	$1, -44(%rbp)
	jne	.L17
	movl	-20(%rbp), %eax
	cmpl	$10, %eax
	jne	.L17
	movl	$2, -32(%rbp)
	jmp	.L18
.L17:
	cmpl	$2, -44(%rbp)
	jne	.L19
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	$10, %eax
	jne	.L19
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	$0, -32(%rbp)
.L18:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	je	.L20
	movl	-28(%rbp), %eax
	cmpl	$2, %eax
	jne	.L21
.L20:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L21:
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L22
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L22
.L16:
	cmpl	$1, -44(%rbp)
	jne	.L23
	movl	$0, -32(%rbp)
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	je	.L24
	movl	-28(%rbp), %eax
	cmpl	$2, %eax
	jne	.L25
.L24:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L25:
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L22
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L22
.L23:
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	cmpl	$2, %eax
	jne	.L26
	movl	-36(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
.L26:
	movl	-20(%rbp), %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	cmpl	$9, %eax
	jle	.L33
	leaq	-20(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L33
.L22:
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -28(%rbp)
	cmpl	$2, -44(%rbp)
	je	.L29
	cmpl	$1, -44(%rbp)
	jne	.L15
	movl	-32(%rbp), %eax
	cmpl	$2, %eax
	jne	.L15
.L29:
	addl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
.L15:
	cmpl	$10, -48(%rbp)
	jle	.L30
	jmp	.L28
.L33:
	nop
.L28:
	movq	-40(%rbp), %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	inputmake, .-inputmake
	.section	.rodata
.LC1:
	.string	"%d %d\n"
	.text
	.globl	output
	.type	output, @function
output:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	output, .-output
	.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:
