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>
int main(){
  int n,k,i,j;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    int r[10]={0};
    char t[10],w;
    for(i=0;i<n;i++){
      scanf("\n%c",&t[i]);
      for(j=1;j<n;j++){
	scanf("%d",&k);
	if(k==0)r[i]+=10;
	if(k==1)r[i]--;
      }
      // scanf("\n");
      //printf("%d %c",r[i],t[i]);
    }
    for(i=0;i<n;i++){
      for(j=1;i+j<n;j++){
	if(r[j-1]<r[j]){
	  k=r[j-1];
	  r[j-1]=r[j];
	  r[j]=k;
	  w=t[j-1];
	  t[j-1]=t[j];
	  t[j]=w;
	}
      }
    }
    for(i=0;i<n;i++){
      printf("%c\n",t[i]);
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"\n%c"
.LC2:
	.string	"%c\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L17:
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L2:
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L4
.L9:
	leaq	-18(%rbp), %rdx
	movl	-72(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -68(%rbp)
	jmp	.L5
.L8:
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	leal	10(%rax), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
.L6:
	movl	-76(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
.L7:
	addl	$1, -68(%rbp)
.L5:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L8
	addl	$1, -72(%rbp)
.L4:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L9
	movl	$0, -72(%rbp)
	jmp	.L10
.L14:
	movl	$1, -68(%rbp)
	jmp	.L11
.L13:
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-68(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movl	%eax, -76(%rbp)
	movl	-68(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-68(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -64(%rbp,%rax,4)
	movl	-76(%rbp), %edx
	movl	-68(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	movb	%al, -81(%rbp)
	movl	-68(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-68(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %edx
	movslq	%ecx, %rax
	movb	%dl, -18(%rbp,%rax)
	movl	-68(%rbp), %eax
	cltq
	movzbl	-81(%rbp), %edx
	movb	%dl, -18(%rbp,%rax)
.L12:
	addl	$1, -68(%rbp)
.L11:
	movl	-72(%rbp), %edx
	movl	-68(%rbp), %eax
	addl	%eax, %edx
	movl	-80(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L13
	addl	$1, -72(%rbp)
.L10:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L14
	movl	$0, -72(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -72(%rbp)
.L15:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L16
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"\n%c"
.LC2:
	.string	"%c\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L25:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	$0, 64(%rsp)
	pxor	%xmm0, %xmm0
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	jle	.L25
	leaq	78(%rsp), %rax
	leaq	32(%rsp), %rbx
	xorl	%r13d, %r13d
	movq	%rax, (%rsp)
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rsp), %rax
	leaq	.LC1(%rip), %rdi
	leaq	(%rax,%r13), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	cmpl	$1, %eax
	jle	.L4
	movl	$1, %r15d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L40:
	addl	$10, (%rbx)
.L6:
	movl	24(%rsp), %eax
	addl	$1, %r15d
	cmpl	%r15d, %eax
	jle	.L4
.L7:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	cmpl	$1, %eax
	jne	.L6
	movl	24(%rsp), %eax
	addl	$1, %r15d
	subl	$1, (%rbx)
	cmpl	%r15d, %eax
	jg	.L7
.L4:
	addq	$1, %r13
	addq	$4, %rbx
	cmpl	%r13d, %eax
	jg	.L8
	testl	%eax, %eax
	jle	.L25
	xorl	%edx, %edx
	xorl	%edi, %edi
	leal	1(%rdx), %esi
	cmpl	%eax, %esi
	jge	.L41
	.p2align 4,,10
	.p2align 3
.L22:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %r8d
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L10
	rolw	$8, 78(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 32(%rsp)
.L10:
	leal	2(%rdx), %ecx
	cmpl	%eax, %ecx
	jge	.L20
	movq	36(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %r8d
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L12
	rolw	$8, 79(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 36(%rsp)
.L12:
	leal	3(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	40(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %r8d
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L13
	rolw	$8, 80(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 40(%rsp)
.L13:
	leal	4(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	44(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %r8d
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L14
	rolw	$8, 81(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 44(%rsp)
.L14:
	leal	5(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	48(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %r8d
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L15
	rolw	$8, 82(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 48(%rsp)
.L15:
	leal	6(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	52(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %r8d
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L16
	rolw	$8, 83(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 52(%rsp)
.L16:
	leal	7(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	56(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %r8d
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%ecx, %r8d
	jge	.L17
	rolw	$8, 84(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 56(%rsp)
.L17:
	leal	8(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	60(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %r8d
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L18
	rolw	$8, 85(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 60(%rsp)
.L18:
	addl	$9, %edx
	cmpl	%edx, %eax
	jle	.L20
	movq	64(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %ecx
	movd	%xmm5, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%ecx, %edx
	jle	.L20
	rolw	$8, 86(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%esi, %edx
	leal	1(%rdx), %esi
	cmpl	%eax, %esi
	jl	.L22
.L41:
	jne	.L20
	testb	%dil, %dil
	je	.L24
	movl	%r14d, 28(%rsp)
.L24:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L26:
	movq	(%rsp), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movsbl	(%rax,%rbx), %edx
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 24(%rsp)
	jg	.L26
	jmp	.L25
.L2:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$104, %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
.L42:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"\n%c"
.LC2:
	.string	"%c\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L25:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	$0, 64(%rsp)
	pxor	%xmm0, %xmm0
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	jle	.L25
	leaq	78(%rsp), %rax
	leaq	32(%rsp), %rbx
	xorl	%r13d, %r13d
	movq	%rax, (%rsp)
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rsp), %rax
	leaq	.LC1(%rip), %rdi
	leaq	(%rax,%r13), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	cmpl	$1, %eax
	jle	.L4
	movl	$1, %r15d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L40:
	addl	$10, (%rbx)
.L6:
	movl	24(%rsp), %eax
	addl	$1, %r15d
	cmpl	%r15d, %eax
	jle	.L4
.L7:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	cmpl	$1, %eax
	jne	.L6
	movl	24(%rsp), %eax
	addl	$1, %r15d
	subl	$1, (%rbx)
	cmpl	%r15d, %eax
	jg	.L7
.L4:
	addq	$1, %r13
	addq	$4, %rbx
	cmpl	%r13d, %eax
	jg	.L8
	testl	%eax, %eax
	jle	.L25
	xorl	%edx, %edx
	xorl	%edi, %edi
	leal	1(%rdx), %esi
	cmpl	%eax, %esi
	jge	.L41
	.p2align 4,,10
	.p2align 3
.L22:
	movq	32(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %r8d
	movd	%xmm2, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L10
	rolw	$8, 78(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 32(%rsp)
.L10:
	leal	2(%rdx), %ecx
	cmpl	%eax, %ecx
	jge	.L20
	movq	36(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %r8d
	movd	%xmm3, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L12
	rolw	$8, 79(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 36(%rsp)
.L12:
	leal	3(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	40(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %r8d
	movd	%xmm4, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L13
	rolw	$8, 80(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 40(%rsp)
.L13:
	leal	4(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	44(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %r8d
	movd	%xmm5, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L14
	rolw	$8, 81(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 44(%rsp)
.L14:
	leal	5(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	48(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %r8d
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L15
	rolw	$8, 82(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 48(%rsp)
.L15:
	leal	6(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	52(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %r8d
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L16
	rolw	$8, 83(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 52(%rsp)
.L16:
	leal	7(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	56(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm7
	movd	%xmm0, %r8d
	movd	%xmm7, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%ecx, %r8d
	jge	.L17
	rolw	$8, 84(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 56(%rsp)
.L17:
	leal	8(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L20
	movq	60(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm0, %r8d
	movd	%xmm6, %ecx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %ecx
	jle	.L18
	rolw	$8, 85(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 60(%rsp)
.L18:
	addl	$9, %edx
	cmpl	%edx, %eax
	jle	.L20
	movq	64(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %ecx
	movd	%xmm5, %edx
	pshufd	$225, %xmm0, %xmm1
	cmpl	%ecx, %edx
	jle	.L20
	rolw	$8, 86(%rsp)
	movd	%xmm0, %r14d
	movl	$1, %edi
	movq	%xmm1, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%esi, %edx
	leal	1(%rdx), %esi
	cmpl	%eax, %esi
	jl	.L22
.L41:
	jne	.L20
	testb	%dil, %dil
	je	.L24
	movl	%r14d, 28(%rsp)
.L24:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L26:
	movq	(%rsp), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movsbl	(%rax,%rbx), %edx
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 24(%rsp)
	jg	.L26
	jmp	.L25
.L2:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$104, %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
.L42:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
int main(){
  int n,k,i,j;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    int r[10]={0};
    char t[10],w;
    for(i=0;i<n;i++){
      scanf("\n%c",&t[i]);
      for(j=1;j<n;j++){
	scanf("%d",&k);
	if(k==0)r[i]+=10;
	if(k==1)r[i]--;
      }
      // scanf("\n");
      //printf("%d %c",r[i],t[i]);
    }
    for(i=0;i<n;i++){
      for(j=1;i+j<n;j++){
	if(r[j-1]<r[j]){
	  k=r[j-1];
	  r[j-1]=r[j];
	  r[j]=k;
	  w=t[j-1];
	  t[j-1]=t[j];
	  t[j]=w;
	}
      }
    }
    for(i=0;i<n;i++){
      printf("%c\n",t[i]);
    }
  }
  return 0;
}
6
A 1 0 0 2 0
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 2
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
g 0 1 2
x 0 0 0
b 0 2 2
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 2
4
g 1 1 1
g 0 1 0
x 0 0 0
b 0 2 2
0
 6
A 1 0 0 2 0
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
g 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 1 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
h 1 1 1
g 0 1 2
x 0 0 0
b 0 2 2
0
 6
A 1 0 0 2 0
C 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
g 0 1 2
x 0 0 0
b 0 2 1
0

E
A
B
D
F
C
x
h
b
g
 E
B
A
D
F
C
x
h
b
g
 E
D
B
A
F
C
x
h
b
g
 E
D
B
A
F
C
x
b
h
g
 E
D
B
A
F
C
x
b
g
g
 E
D
B
A
F
C
x
g
b
g
 E
A
B
D
F
C
x
g
b
g
 E
D
A
B
F
C
x
h
b
g
 E
D
B
A
F
C
x
b
g
h
 E
A
C
D
F
C
x
g
b
g

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>
int main(){
  int n,k,i,j;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    int r[10]={0};
    char t[10],w;
    for(i=0;i<n;i++){
      scanf("\n%c",&t[i]);
      for(j=1;j<n;j++){
	scanf("%d",&k);
	if(k==0)r[i]+=10;
	if(k==1)r[i]--;
      }
      // scanf("\n");
      //printf("%d %c",r[i],t[i]);
    }
    for(i=0;i<n;i++){
      for(j=1;i+j<n;j++){
	if(r[j-1]<r[j]){
	  k=r[j-1];
	  r[j-1]=r[j];
	  r[j]=k;
	  w=t[j-1];
	  t[j-1]=t[j];
	  t[j]=w;
	}
      }
    }
    for(i=0;i<n;i++){
      printf("%c\n",t[i]);
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"\n%c"
.LC2:
	.string	"%c\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L17:
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L2:
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L4
.L9:
	leaq	-18(%rbp), %rdx
	movl	-72(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -68(%rbp)
	jmp	.L5
.L8:
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	leal	10(%rax), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
.L6:
	movl	-76(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
.L7:
	addl	$1, -68(%rbp)
.L5:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L8
	addl	$1, -72(%rbp)
.L4:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L9
	movl	$0, -72(%rbp)
	jmp	.L10
.L14:
	movl	$1, -68(%rbp)
	jmp	.L11
.L13:
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-68(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movl	%eax, -76(%rbp)
	movl	-68(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-68(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -64(%rbp,%rax,4)
	movl	-76(%rbp), %edx
	movl	-68(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	movb	%al, -81(%rbp)
	movl	-68(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-68(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %edx
	movslq	%ecx, %rax
	movb	%dl, -18(%rbp,%rax)
	movl	-68(%rbp), %eax
	cltq
	movzbl	-81(%rbp), %edx
	movb	%dl, -18(%rbp,%rax)
.L12:
	addl	$1, -68(%rbp)
.L11:
	movl	-72(%rbp), %edx
	movl	-68(%rbp), %eax
	addl	%eax, %edx
	movl	-80(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L13
	addl	$1, -72(%rbp)
.L10:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L14
	movl	$0, -72(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -72(%rbp)
.L15:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L16
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"\n%c"
.LC2:
	.string	"%c\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L17:
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	jmp	.L19
.L2:
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L4
.L9:
	leaq	-18(%rbp), %rdx
	movl	-72(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -68(%rbp)
	jmp	.L5
.L8:
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	leal	10(%rax), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
.L6:
	movl	-76(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	movl	-72(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-72(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
.L7:
	addl	$1, -68(%rbp)
.L5:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L8
	addl	$1, -72(%rbp)
.L4:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L9
	movl	$0, -72(%rbp)
	jmp	.L10
.L14:
	movl	$1, -68(%rbp)
	jmp	.L11
.L13:
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movl	-68(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movl	%eax, -76(%rbp)
	movl	-68(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-68(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -64(%rbp,%rax,4)
	movl	-76(%rbp), %edx
	movl	-68(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	movl	-68(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	movb	%al, -81(%rbp)
	movl	-68(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-68(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %edx
	movslq	%ecx, %rax
	movb	%dl, -18(%rbp,%rax)
	movl	-68(%rbp), %eax
	cltq
	movzbl	-81(%rbp), %edx
	movb	%dl, -18(%rbp,%rax)
.L12:
	addl	$1, -68(%rbp)
.L11:
	movl	-72(%rbp), %edx
	movl	-68(%rbp), %eax
	addl	%eax, %edx
	movl	-80(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L13
	addl	$1, -72(%rbp)
.L10:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L14
	movl	$0, -72(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -72(%rbp)
.L15:
	movl	-80(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L16
	jmp	.L17
.L19:
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
