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>

int compare(const void *a,const void *b){
  return *(char *)a - *(char *)b;
}

int compare_line(const void *a,const void *b){
  int i  = 0;
  char *p = (char *)a;
  char *q = (char *)b;
  while(i < 10){
    if(p[i] - q[i] < 0) return -1;
    else if(p[i] - q[i] > 0) return 1;
    else i++;
  }
  return 0;
}
  

int main(void){ 
  long int N,count = 1;
  long int answer = 0;
  scanf("%ld",&N);
  char s[N + 1][11];
  char check[N][11];
  long int check_number[N + 1];
  long int number = 0;
  for(int i = 0;i < N;i++){
    check_number[i] = 0;
    scanf("%s",s[i]);
    qsort(s[i],10,sizeof(char),compare);    
  }
  
  qsort(s,N,sizeof(s[0]),compare_line);
    
  for(int i = 1;i < N;i++){
    if(compare_line(s[i - 1],s[i]) == 0)
      count++;
    else{
      answer += count * (count - 1) / 2;
      count = 1;
    }
  }
  answer += count * (count - 1) / 2;
  printf("%ld",answer);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare
	.type	compare, @function
compare:
.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	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.globl	compare_line
	.type	compare_line, @function
compare_line:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	$0, -20(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rdx), %edx
	movsbl	%dl, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jns	.L5
	movl	$-1, %eax
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rdx), %edx
	movsbl	%dl, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L7
	movl	$1, %eax
	jmp	.L6
.L7:
	addl	$1, -20(%rbp)
.L4:
	cmpl	$9, -20(%rbp)
	jle	.L8
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compare_line, .-compare_line
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$1, -128(%rbp)
	movq	$0, -120(%rbp)
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-136(%rbp), %rax
	leaq	1(%rax), %rsi
	leaq	-1(%rsi), %rax
	movq	%rax, -112(%rbp)
	movq	%rsi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$88, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rcx
	movl	$88, %eax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movq	%rsi, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	-160(%rbp), %r8
	movq	-152(%rbp), %r9
	imulq	$88, %r9, %rdx
	imulq	$0, %r8, %rax
	leaq	(%rdx,%rax), %rcx
	movl	$88, %eax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movq	%rsi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -104(%rbp)
	movq	-136(%rbp), %rcx
	leaq	-1(%rcx), %rax
	movq	%rax, -96(%rbp)
	movq	%rcx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-176(%rbp), %r10
	movq	-168(%rbp), %r11
	imulq	$88, %r11, %rdx
	imulq	$0, %r10, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$88, %eax
	mulq	%r10
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$88, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$88, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -88(%rbp)
	movq	-136(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -80(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	$0, -64(%rbp)
	movl	$0, -144(%rbp)
	jmp	.L19
.L20:
	movq	-72(%rbp), %rax
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$1, %edx
	movl	$10, %esi
	movq	%rax, %rdi
	call	qsort@PLT
	addl	$1, -144(%rbp)
.L19:
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L20
	movq	-136(%rbp), %rax
	movq	%rax, %rsi
	movq	-104(%rbp), %rax
	leaq	compare_line(%rip), %rdx
	movq	%rdx, %rcx
	movl	$11, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -140(%rbp)
	jmp	.L21
.L24:
	movl	-140(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	leaq	(%rax,%rdx), %rcx
	movl	-140(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	compare_line
	testl	%eax, %eax
	jne	.L22
	addq	$1, -128(%rbp)
	jmp	.L23
.L22:
	movq	-128(%rbp), %rax
	subq	$1, %rax
	imulq	-128(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	$1, -128(%rbp)
.L23:
	addl	$1, -140(%rbp)
.L21:
	movl	-140(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L24
	movq	-128(%rbp), %rax
	subq	$1, %rax
	imulq	-128(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	compare
	.type	compare, @function
compare:
.LFB51:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	compare, .-compare
	.p2align 4
	.globl	compare_line
	.type	compare_line, @function
compare_line:
.LFB52:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %ecx
	movsbl	(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	1(%rdi), %ecx
	movsbl	1(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	2(%rdi), %ecx
	movsbl	2(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	3(%rdi), %ecx
	movsbl	3(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	4(%rdi), %ecx
	movsbl	4(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	5(%rdi), %ecx
	movsbl	5(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	6(%rdi), %ecx
	movsbl	6(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	7(%rdi), %ecx
	movsbl	7(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	8(%rdi), %ecx
	movsbl	8(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	9(%rdi), %edx
	movsbl	9(%rsi), %eax
	cmpl	%eax, %edx
	js	.L23
	setne	%al
	movzbl	%al, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	movl	$-1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	compare_line, .-compare_line
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	1(%rsi), %rdx
	leaq	(%rdx,%rdx,4), %rax
	leaq	15(%rdx,%rax,2), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L26
.L48:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L48
.L26:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L49
.L27:
	leaq	15(,%rdx,8), %rax
	movq	%rsp, -72(%rbp)
	movq	%rsp, %rcx
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L28:
	cmpq	%rcx, %rsp
	je	.L29
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L28
.L49:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L27
.L29:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L50
.L30:
	movq	%rsp, %r15
	testq	%rsi, %rsi
	jle	.L31
	movq	-72(%rbp), %rbx
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r13
	leaq	compare(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	$0, (%r15,%r14,8)
	call	__isoc99_scanf@PLT
	movl	$10, %esi
	movq	%rbx, %rdi
	movq	%r12, %rcx
	movl	$1, %edx
	addq	$1, %r14
	addq	$11, %rbx
	call	qsort@PLT
	movq	-64(%rbp), %rsi
	cmpq	%r14, %rsi
	jg	.L32
.L31:
	movq	-72(%rbp), %rbx
	movl	$11, %edx
	leaq	compare_line(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	-64(%rbp), %rdx
	cmpq	$1, %rdx
	jle	.L38
	leaq	(%rdx,%rdx,4), %rsi
	movzbl	(%rbx), %ecx
	leaq	1(%rbx), %rax
	xorl	%edi, %edi
	leaq	-10(%rdx,%rsi,2), %rdx
	leaq	(%rbx,%rdx), %rbx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L36:
	movl	%ecx, %esi
	movzbl	10(%rax), %ecx
	cmpb	%sil, %cl
	jne	.L34
	movzbl	11(%rax), %esi
	cmpb	%sil, (%rax)
	jne	.L34
	movzbl	12(%rax), %esi
	cmpb	%sil, 1(%rax)
	jne	.L34
	movzbl	13(%rax), %esi
	cmpb	%sil, 2(%rax)
	jne	.L34
	movzbl	14(%rax), %esi
	cmpb	%sil, 3(%rax)
	jne	.L34
	movzbl	15(%rax), %esi
	cmpb	%sil, 4(%rax)
	jne	.L34
	movzbl	16(%rax), %esi
	cmpb	%sil, 5(%rax)
	jne	.L34
	movzbl	17(%rax), %esi
	cmpb	%sil, 6(%rax)
	jne	.L34
	movzbl	18(%rax), %esi
	cmpb	%sil, 7(%rax)
	jne	.L34
	movzbl	19(%rax), %esi
	cmpb	%sil, 8(%rax)
	jne	.L34
	movq	%rdx, %rsi
	addq	$1, %rdx
.L35:
	addq	$11, %rax
	cmpq	%rbx, %rax
	jne	.L36
.L33:
	imulq	%rsi, %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	sarq	%rdx
	addq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L51
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	leaq	-1(%rdx), %rsi
	imulq	%rsi, %rdx
	xorl	%esi, %esi
	sarq	%rdx
	addq	%rdx, %rdi
	movl	$1, %edx
	jmp	.L35
.L38:
	xorl	%esi, %esi
	xorl	%edi, %edi
	movl	$1, %edx
	jmp	.L33
.L50:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L30
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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	compare
	.type	compare, @function
compare:
.LFB51:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	compare, .-compare
	.p2align 4
	.globl	compare_line
	.type	compare_line, @function
compare_line:
.LFB52:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %ecx
	movsbl	(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	1(%rdi), %ecx
	movsbl	1(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	2(%rdi), %ecx
	movsbl	2(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	3(%rdi), %ecx
	movsbl	3(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	4(%rdi), %ecx
	movsbl	4(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	5(%rdi), %ecx
	movsbl	5(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	6(%rdi), %ecx
	movsbl	6(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	7(%rdi), %ecx
	movsbl	7(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	8(%rdi), %ecx
	movsbl	8(%rsi), %edx
	cmpl	%edx, %ecx
	js	.L23
	jne	.L22
	movsbl	9(%rdi), %edx
	movsbl	9(%rsi), %eax
	cmpl	%eax, %edx
	js	.L23
	setne	%al
	movzbl	%al, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	movl	$-1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	compare_line, .-compare_line
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	1(%rsi), %rdx
	leaq	(%rdx,%rdx,4), %rax
	leaq	15(%rdx,%rax,2), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L26
.L48:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L48
.L26:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L49
.L27:
	leaq	15(,%rdx,8), %rax
	movq	%rsp, -72(%rbp)
	movq	%rsp, %rcx
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L28:
	cmpq	%rcx, %rsp
	je	.L29
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L28
.L49:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L27
.L29:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L50
.L30:
	movq	%rsp, %r15
	testq	%rsi, %rsi
	jle	.L31
	movq	-72(%rbp), %rbx
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r13
	leaq	compare(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	$0, (%r15,%r14,8)
	call	__isoc99_scanf@PLT
	movl	$10, %esi
	movq	%rbx, %rdi
	movq	%r12, %rcx
	movl	$1, %edx
	addq	$1, %r14
	addq	$11, %rbx
	call	qsort@PLT
	movq	-64(%rbp), %rsi
	cmpq	%r14, %rsi
	jg	.L32
.L31:
	movq	-72(%rbp), %rbx
	movl	$11, %edx
	leaq	compare_line(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	-64(%rbp), %rdx
	cmpq	$1, %rdx
	jle	.L38
	leaq	(%rdx,%rdx,4), %rsi
	movzbl	(%rbx), %ecx
	leaq	1(%rbx), %rax
	xorl	%edi, %edi
	leaq	-10(%rdx,%rsi,2), %rdx
	leaq	(%rbx,%rdx), %rbx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L36:
	movl	%ecx, %esi
	movzbl	10(%rax), %ecx
	cmpb	%sil, %cl
	jne	.L34
	movzbl	11(%rax), %esi
	cmpb	%sil, (%rax)
	jne	.L34
	movzbl	12(%rax), %esi
	cmpb	%sil, 1(%rax)
	jne	.L34
	movzbl	13(%rax), %esi
	cmpb	%sil, 2(%rax)
	jne	.L34
	movzbl	14(%rax), %esi
	cmpb	%sil, 3(%rax)
	jne	.L34
	movzbl	15(%rax), %esi
	cmpb	%sil, 4(%rax)
	jne	.L34
	movzbl	16(%rax), %esi
	cmpb	%sil, 5(%rax)
	jne	.L34
	movzbl	17(%rax), %esi
	cmpb	%sil, 6(%rax)
	jne	.L34
	movzbl	18(%rax), %esi
	cmpb	%sil, 7(%rax)
	jne	.L34
	movzbl	19(%rax), %esi
	cmpb	%sil, 8(%rax)
	jne	.L34
	movq	%rdx, %rsi
	addq	$1, %rdx
.L35:
	addq	$11, %rax
	cmpq	%rbx, %rax
	jne	.L36
.L33:
	imulq	%rsi, %rdx
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rsi
	sarq	%rdx
	addq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L51
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	leaq	-1(%rdx), %rsi
	imulq	%rsi, %rdx
	xorl	%esi, %esi
	sarq	%rdx
	addq	%rdx, %rdi
	movl	$1, %edx
	jmp	.L35
.L38:
	xorl	%esi, %esi
	xorl	%edi, %edi
	movl	$1, %edx
	jmp	.L33
.L50:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L30
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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<string.h>
#include<stdlib.h>

int compare(const void *a,const void *b){
  return *(char *)a - *(char *)b;
}

int compare_line(const void *a,const void *b){
  int i  = 0;
  char *p = (char *)a;
  char *q = (char *)b;
  while(i < 10){
    if(p[i] - q[i] < 0) return -1;
    else if(p[i] - q[i] > 0) return 1;
    else i++;
  }
  return 0;
}
  

int main(void){ 
  long int N,count = 1;
  long int answer = 0;
  scanf("%ld",&N);
  char s[N + 1][11];
  char check[N][11];
  long int check_number[N + 1];
  long int number = 0;
  for(int i = 0;i < N;i++){
    check_number[i] = 0;
    scanf("%s",s[i]);
    qsort(s[i],10,sizeof(char),compare);    
  }
  
  qsort(s,N,sizeof(s[0]),compare_line);
    
  for(int i = 1;i < N;i++){
    if(compare_line(s[i - 1],s[i]) == 0)
      count++;
    else{
      answer += count * (count - 1) / 2;
      count = 1;
    }
  }
  answer += count * (count - 1) / 2;
  printf("%ld",answer);
  return 0;
}

5
abaaaaaaaa
oweplustno
aaaaaaaaba
twoplusone
aaaabaaaaa
 2
oneplustwo
nioemodsix
 3
acornistnt
peaoutbnmb
constraint
 5
abaaaaaaaa
oweplustmo
aaaaaaaaba
unoselpowt
aaaaaaaaba
 5
abaaaaaaaa
oweplustno
aaaaaaaaba
twoplusone
aaaaaaaaba
 2
onepltsuwo
nioemodsix
 3
acornistnt
peaoutbnmb
nonstraict
 5
abaaaaaaaa
oweplustno
aaaaaaaaba
enosulpowt
aaaaaaaaba
 2
owustlpeno
nioemodsix
 3
acornistnt
bmnbtuoaep
nonstraict

4 0 1 3 4 0 1 4 0 1
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>

int compare(const void *a,const void *b){
  return *(char *)a - *(char *)b;
}

int compare_line(const void *a,const void *b){
  int i  = 0;
  char *p = (char *)a;
  char *q = (char *)b;
  while(i < 10){
    if(p[i] - q[i] < 0) return -1;
    else if(p[i] - q[i] > 0) return 1;
    else i++;
  }
  return 0;
}
  

int main(void){ 
  long int N,count = 1;
  long int answer = 0;
  scanf("%ld",&N);
  char s[N + 1][11];
  char check[N][11];
  long int check_number[N + 1];
  long int number = 0;
  for(int i = 0;i < N;i++){
    check_number[i] = 0;
    scanf("%s",s[i]);
    qsort(s[i],10,sizeof(char),compare);    
  }
  
  qsort(s,N,sizeof(s[0]),compare_line);
    
  for(int i = 1;i < N;i++){
    if(compare_line(s[i - 1],s[i]) == 0)
      count++;
    else{
      answer += count * (count - 1) / 2;
      count = 1;
    }
  }
  answer += count * (count - 1) / 2;
  printf("%ld",answer);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare
	.type	compare, @function
compare:
.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	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.globl	compare_line
	.type	compare_line, @function
compare_line:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	$0, -20(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rdx), %edx
	movsbl	%dl, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jns	.L5
	movl	$-1, %eax
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rdx), %edx
	movsbl	%dl, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L7
	movl	$1, %eax
	jmp	.L6
.L7:
	addl	$1, -20(%rbp)
.L4:
	cmpl	$9, -20(%rbp)
	jle	.L8
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compare_line, .-compare_line
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$1, -128(%rbp)
	movq	$0, -120(%rbp)
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-136(%rbp), %rax
	leaq	1(%rax), %rsi
	leaq	-1(%rsi), %rax
	movq	%rax, -112(%rbp)
	movq	%rsi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$88, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rcx
	movl	$88, %eax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movq	%rsi, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	-160(%rbp), %r8
	movq	-152(%rbp), %r9
	imulq	$88, %r9, %rdx
	imulq	$0, %r8, %rax
	leaq	(%rdx,%rax), %rcx
	movl	$88, %eax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movq	%rsi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -104(%rbp)
	movq	-136(%rbp), %rcx
	leaq	-1(%rcx), %rax
	movq	%rax, -96(%rbp)
	movq	%rcx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-176(%rbp), %r10
	movq	-168(%rbp), %r11
	imulq	$88, %r11, %rdx
	imulq	$0, %r10, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$88, %eax
	mulq	%r10
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$88, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$88, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -88(%rbp)
	movq	-136(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -80(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	$0, -64(%rbp)
	movl	$0, -144(%rbp)
	jmp	.L19
.L20:
	movq	-72(%rbp), %rax
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$1, %edx
	movl	$10, %esi
	movq	%rax, %rdi
	call	qsort@PLT
	addl	$1, -144(%rbp)
.L19:
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L20
	movq	-136(%rbp), %rax
	movq	%rax, %rsi
	movq	-104(%rbp), %rax
	leaq	compare_line(%rip), %rdx
	movq	%rdx, %rcx
	movl	$11, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -140(%rbp)
	jmp	.L21
.L24:
	movl	-140(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	leaq	(%rax,%rdx), %rcx
	movl	-140(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	compare_line
	testl	%eax, %eax
	jne	.L22
	addq	$1, -128(%rbp)
	jmp	.L23
.L22:
	movq	-128(%rbp), %rax
	subq	$1, %rax
	imulq	-128(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	$1, -128(%rbp)
.L23:
	addl	$1, -140(%rbp)
.L21:
	movl	-140(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L24
	movq	-128(%rbp), %rax
	subq	$1, %rax
	imulq	-128(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	compare
	.type	compare, @function
compare:
.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	-8(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.globl	compare_line
	.type	compare_line, @function
compare_line:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	$0, -20(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L4
.L8:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rdx), %edx
	movsbl	%dl, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jns	.L5
	movl	$-1, %eax
	jmp	.L6
.L5:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rdx), %edx
	movsbl	%dl, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L7
	movl	$1, %eax
	jmp	.L6
.L7:
	addl	$1, -20(%rbp)
.L4:
	cmpl	$9, -20(%rbp)
	jle	.L8
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compare_line, .-compare_line
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	$1, -128(%rbp)
	movq	$0, -120(%rbp)
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-136(%rbp), %rax
	leaq	1(%rax), %rsi
	leaq	-1(%rsi), %rax
	movq	%rax, -112(%rbp)
	movq	%rsi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$88, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rcx
	movl	$88, %eax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movq	%rsi, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	-160(%rbp), %r8
	movq	-152(%rbp), %r9
	imulq	$88, %r9, %rdx
	imulq	$0, %r8, %rax
	leaq	(%rdx,%rax), %rcx
	movl	$88, %eax
	mulq	%r8
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movq	%rsi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -104(%rbp)
	movq	-136(%rbp), %rcx
	leaq	-1(%rcx), %rax
	movq	%rax, -96(%rbp)
	movq	%rcx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-176(%rbp), %r10
	movq	-168(%rbp), %r11
	imulq	$88, %r11, %rdx
	imulq	$0, %r10, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$88, %eax
	mulq	%r10
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$88, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$88, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movq	%rcx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -88(%rbp)
	movq	-136(%rbp), %rax
	addq	$1, %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -80(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -72(%rbp)
	movq	$0, -64(%rbp)
	movl	$0, -144(%rbp)
	jmp	.L19
.L20:
	movq	-72(%rbp), %rax
	movl	-144(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$1, %edx
	movl	$10, %esi
	movq	%rax, %rdi
	call	qsort@PLT
	addl	$1, -144(%rbp)
.L19:
	movl	-144(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L20
	movq	-136(%rbp), %rax
	movq	%rax, %rsi
	movq	-104(%rbp), %rax
	leaq	compare_line(%rip), %rdx
	movq	%rdx, %rcx
	movl	$11, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -140(%rbp)
	jmp	.L21
.L24:
	movl	-140(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	leaq	(%rax,%rdx), %rcx
	movl	-140(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	movq	-104(%rbp), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	compare_line
	testl	%eax, %eax
	jne	.L22
	addq	$1, -128(%rbp)
	jmp	.L23
.L22:
	movq	-128(%rbp), %rax
	subq	$1, %rax
	imulq	-128(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	$1, -128(%rbp)
.L23:
	addl	$1, -140(%rbp)
.L21:
	movl	-140(%rbp), %eax
	movslq	%eax, %rdx
	movq	-136(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L24
	movq	-128(%rbp), %rax
	subq	$1, %rax
	imulq	-128(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	addq	%rax, -120(%rbp)
	movq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
