Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(){
  int n,w,l,d,a,p[20],r[20],s=0;
  char t[10][22];
  int i,j;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      r[i]=i;
      scanf("%s %d %d %d",&t[i],&w,&l,&d);
      p[i]=3*w+d;
    }
    for(i=0;i<n;i++){
      for(j=1;i+j<n;j++){
	if(p[r[j-1]]<p[r[j]]){
	  a=r[j-1];
	  r[j-1]=r[j];
	  r[j]=a;
	}
      }
    }
    if(s!=0)printf("\n");
    s=1;
    for(i=0;i<n;i++){
      printf("%s,%d\n",t[r[i]],p[r[i]]);
    }
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d %d %d"
.LC2:
	.string	"%s,%d\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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$472, %rsp
	.cfi_def_cfa_offset 528
	movq	%fs:40, %rax
	movq	%rax, 456(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rax
	movl	$0, 36(%rsp)
	movq	%rax, 40(%rsp)
	leaq	148(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	40(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	jle	.L3
	leaq	224(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	60(%rsp), %r15
	movq	%rax, 24(%rsp)
	movq	%rax, %rbp
	leaq	64(%rsp), %rax
	leaq	144(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	56(%rsp), %r14
	leaq	52(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	xorl	%eax, %eax
	movl	%r12d, (%rbx,%r12,4)
	addq	$22, %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,2), %eax
	addl	60(%rsp), %eax
	movl	%eax, (%rdi,%r12,4)
	movl	48(%rsp), %edi
	addq	$1, %r12
	cmpl	%r12d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	xorl	%r8d, %r8d
	leal	-1(%rdi), %r9d
.L5:
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L10:
	movq	16(%rsp), %rsi
	movl	%r9d, %eax
	movq	%rbx, %rdx
	subl	%r8d, %eax
	leaq	(%rsi,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	movslq	(%rdx), %rcx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cltq
	movl	64(%rsp,%rax,4), %eax
	cmpl	%eax, 64(%rsp,%rcx,4)
	jge	.L6
	movq	%xmm1, (%rdx)
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jg	.L10
.L27:
	jne	.L5
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jne	.L16
.L12:
	movq	24(%rsp), %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	(%rbx,%r12,4), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r12
	leaq	(%rax,%rax,4), %rdx
	movl	64(%rsp,%rax,4), %ecx
	leaq	(%rax,%rdx,2), %rax
	leaq	0(%rbp,%rax,2), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r12d, 48(%rsp)
	jg	.L14
.L15:
	movl	$1, 36(%rsp)
	jmp	.L13
.L3:
	movl	36(%rsp), %edx
	testl	%edx, %edx
	je	.L15
.L16:
	movl	$10, %edi
	leaq	144(%rsp), %rbx
	call	putchar@PLT
	movl	48(%rsp), %ecx
	leaq	224(%rsp), %rax
	movq	%rax, 24(%rsp)
	testl	%ecx, %ecx
	jg	.L12
	jmp	.L15
.L2:
	movq	456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$472, %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
.L28:
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d %d %d"
.LC2:
	.string	"%s,%d\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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$472, %rsp
	.cfi_def_cfa_offset 528
	movq	%fs:40, %rax
	movq	%rax, 456(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rax
	movl	$0, 36(%rsp)
	movq	%rax, 40(%rsp)
	leaq	148(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	40(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	jle	.L3
	leaq	224(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	60(%rsp), %r15
	movq	%rax, 24(%rsp)
	movq	%rax, %rbp
	leaq	64(%rsp), %rax
	leaq	144(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	56(%rsp), %r14
	leaq	52(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	xorl	%eax, %eax
	movl	%r12d, (%rbx,%r12,4)
	addq	$22, %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,2), %eax
	addl	60(%rsp), %eax
	movl	%eax, (%rdi,%r12,4)
	movl	48(%rsp), %edi
	addq	$1, %r12
	cmpl	%r12d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	xorl	%r8d, %r8d
	leal	-1(%rdi), %r9d
.L5:
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L10:
	movq	16(%rsp), %rsi
	movl	%r9d, %eax
	movq	%rbx, %rdx
	subl	%r8d, %eax
	leaq	(%rsi,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	movslq	(%rdx), %rcx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cltq
	movl	64(%rsp,%rax,4), %eax
	cmpl	%eax, 64(%rsp,%rcx,4)
	jge	.L6
	movq	%xmm1, (%rdx)
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jg	.L10
.L27:
	jne	.L5
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jne	.L16
.L12:
	movq	24(%rsp), %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	(%rbx,%r12,4), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r12
	leaq	(%rax,%rax,4), %rdx
	movl	64(%rsp,%rax,4), %ecx
	leaq	(%rax,%rdx,2), %rax
	leaq	0(%rbp,%rax,2), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r12d, 48(%rsp)
	jg	.L14
.L15:
	movl	$1, 36(%rsp)
	jmp	.L13
.L3:
	movl	36(%rsp), %edx
	testl	%edx, %edx
	je	.L15
.L16:
	movl	$10, %edi
	leaq	144(%rsp), %rbx
	call	putchar@PLT
	movl	48(%rsp), %ecx
	leaq	224(%rsp), %rax
	movq	%rax, 24(%rsp)
	testl	%ecx, %ecx
	jg	.L12
	jmp	.L15
.L2:
	movq	456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$472, %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
.L28:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d %d %d"
.LC2:
	.string	"%s,%d\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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$472, %rsp
	.cfi_def_cfa_offset 528
	movq	%fs:40, %rax
	movq	%rax, 456(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rax
	movl	$0, 36(%rsp)
	movq	%rax, 40(%rsp)
	leaq	148(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	40(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	jle	.L3
	leaq	224(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	60(%rsp), %r15
	movq	%rax, 24(%rsp)
	movq	%rax, %rbp
	leaq	64(%rsp), %rax
	leaq	144(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	56(%rsp), %r14
	leaq	52(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	xorl	%eax, %eax
	movl	%r12d, (%rbx,%r12,4)
	addq	$22, %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,2), %eax
	addl	60(%rsp), %eax
	movl	%eax, (%rdi,%r12,4)
	movl	48(%rsp), %edi
	addq	$1, %r12
	cmpl	%r12d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	xorl	%r8d, %r8d
	leal	-1(%rdi), %r9d
.L5:
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L10:
	movq	16(%rsp), %rsi
	movl	%r9d, %eax
	movq	%rbx, %rdx
	subl	%r8d, %eax
	leaq	(%rsi,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	movslq	(%rdx), %rcx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cltq
	movl	64(%rsp,%rax,4), %eax
	cmpl	%eax, 64(%rsp,%rcx,4)
	jge	.L6
	movq	%xmm1, (%rdx)
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jg	.L10
.L27:
	jne	.L5
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jne	.L16
.L12:
	movq	24(%rsp), %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	(%rbx,%r12,4), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r12
	leaq	(%rax,%rax,4), %rdx
	movl	64(%rsp,%rax,4), %ecx
	leaq	(%rax,%rdx,2), %rax
	leaq	0(%rbp,%rax,2), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r12d, 48(%rsp)
	jg	.L14
.L15:
	movl	$1, 36(%rsp)
	jmp	.L13
.L3:
	movl	36(%rsp), %edx
	testl	%edx, %edx
	je	.L15
.L16:
	movl	$10, %edi
	leaq	144(%rsp), %rbx
	call	putchar@PLT
	movl	48(%rsp), %ecx
	leaq	224(%rsp), %rax
	movq	%rax, 24(%rsp)
	testl	%ecx, %ecx
	jg	.L12
	jmp	.L15
.L2:
	movq	456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$472, %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
.L28:
	.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:
```
```c
#include<stdio.h>
int main(){
  int n,w,l,d,a,p[20],r[20],s=0;
  char t[10][22];
  int i,j;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      r[i]=i;
      scanf("%s %d %d %d",&t[i],&w,&l,&d);
      p[i]=3*w+d;
    }
    for(i=0;i<n;i++){
      for(j=1;i+j<n;j++){
	if(p[r[j-1]]<p[r[j]]){
	  a=r[j-1];
	  r[j-1]=r[j];
	  r[j]=a;
	}
      }
    }
    if(s!=0)printf("\n");
    s=1;
    for(i=0;i<n;i++){
      printf("%s,%d\n",t[r[i]],p[r[i]]);
    }
  }
  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(){
  int n,w,l,d,a,p[20],r[20],s=0;
  char t[10][22];
  int i,j;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      r[i]=i;
      scanf("%s %d %d %d",&t[i],&w,&l,&d);
      p[i]=3*w+d;
    }
    for(i=0;i<n;i++){
      for(j=1;i+j<n;j++){
	if(p[r[j-1]]<p[r[j]]){
	  a=r[j-1];
	  r[j-1]=r[j];
	  r[j]=a;
	}
      }
    }
    if(s!=0)printf("\n");
    s=1;
    for(i=0;i<n;i++){
      printf("%s,%d\n",t[r[i]],p[r[i]]);
    }
  }
  return 0;
}```

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.
Optimized Assembly Code:

4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 2 0 1
3
India 0 2 0
Poland 1 0 1
Italy 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 2 0 1
3
India 0 2 0
Poland 1 0 1
Italx 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
niapS 2 0 1
3
India 0 2 0
Poland 1 0 1
Italy 1 1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 2 0 1
3
India -1 2 0
Poland 1 0 1
Italx 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Caaadn 0 2 1
niapS 2 0 1
3
India 0 2 0
Poland 1 0 1
Italy 1 1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 2 0 1
3
Jndia -1 2 0
Poland 1 0 1
Italx 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Caaadn 0 2 1
niapS 2 0 1
3
Iodia 0 2 0
Poland 1 0 1
Italy 1 1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Canada 0 2 1
Spain 1 0 1
3
Jndia -1 2 0
Poland 1 0 1
Italx 1 -1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Caaadn 0 2 1
niapS 2 0 1
3
Ioida 0 2 0
Poland 1 0 1
Italy 1 1 1
0
 4
Japan 1 0 2
Egypt 1 2 0
Caaadn 0 2 1
nibpS 2 0 1
3
Ioida 0 2 0
Poland 1 0 1
Italy 1 1 1
0

Spain,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italy,4
India,0
 Spain,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italx,4
India,0
 niapS,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italy,4
India,0
 Spain,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italx,4
India,-3
 niapS,7
Japan,5
Egypt,3
Caaadn,1

Poland,4
Italy,4
India,0
 Spain,7
Japan,5
Egypt,3
Canada,1

Poland,4
Italx,4
Jndia,-3
 niapS,7
Japan,5
Egypt,3
Caaadn,1

Poland,4
Italy,4
Iodia,0
 Japan,5
Spain,4
Egypt,3
Canada,1

Poland,4
Italx,4
Jndia,-3
 niapS,7
Japan,5
Egypt,3
Caaadn,1

Poland,4
Italy,4
Ioida,0
 nibpS,7
Japan,5
Egypt,3
Caaadn,1

Poland,4
Italy,4
Ioida,0

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(){
  int n,w,l,d,a,p[20],r[20],s=0;
  char t[10][22];
  int i,j;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      r[i]=i;
      scanf("%s %d %d %d",&t[i],&w,&l,&d);
      p[i]=3*w+d;
    }
    for(i=0;i<n;i++){
      for(j=1;i+j<n;j++){
	if(p[r[j-1]]<p[r[j]]){
	  a=r[j-1];
	  r[j-1]=r[j];
	  r[j]=a;
	}
      }
    }
    if(s!=0)printf("\n");
    s=1;
    for(i=0;i<n;i++){
      printf("%s,%d\n",t[r[i]],p[r[i]]);
    }
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d %d %d"
.LC2:
	.string	"%s,%d\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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$472, %rsp
	.cfi_def_cfa_offset 528
	movq	%fs:40, %rax
	movq	%rax, 456(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rax
	movl	$0, 36(%rsp)
	movq	%rax, 40(%rsp)
	leaq	148(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	40(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	jle	.L3
	leaq	224(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	60(%rsp), %r15
	movq	%rax, 24(%rsp)
	movq	%rax, %rbp
	leaq	64(%rsp), %rax
	leaq	144(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	56(%rsp), %r14
	leaq	52(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	xorl	%eax, %eax
	movl	%r12d, (%rbx,%r12,4)
	addq	$22, %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,2), %eax
	addl	60(%rsp), %eax
	movl	%eax, (%rdi,%r12,4)
	movl	48(%rsp), %edi
	addq	$1, %r12
	cmpl	%r12d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	xorl	%r8d, %r8d
	leal	-1(%rdi), %r9d
.L5:
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L10:
	movq	16(%rsp), %rsi
	movl	%r9d, %eax
	movq	%rbx, %rdx
	subl	%r8d, %eax
	leaq	(%rsi,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	movslq	(%rdx), %rcx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cltq
	movl	64(%rsp,%rax,4), %eax
	cmpl	%eax, 64(%rsp,%rcx,4)
	jge	.L6
	movq	%xmm1, (%rdx)
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jg	.L10
.L27:
	jne	.L5
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jne	.L16
.L12:
	movq	24(%rsp), %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	(%rbx,%r12,4), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r12
	leaq	(%rax,%rax,4), %rdx
	movl	64(%rsp,%rax,4), %ecx
	leaq	(%rax,%rdx,2), %rax
	leaq	0(%rbp,%rax,2), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r12d, 48(%rsp)
	jg	.L14
.L15:
	movl	$1, 36(%rsp)
	jmp	.L13
.L3:
	movl	36(%rsp), %edx
	testl	%edx, %edx
	je	.L15
.L16:
	movl	$10, %edi
	leaq	144(%rsp), %rbx
	call	putchar@PLT
	movl	48(%rsp), %ecx
	leaq	224(%rsp), %rax
	movq	%rax, 24(%rsp)
	testl	%ecx, %ecx
	jg	.L12
	jmp	.L15
.L2:
	movq	456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$472, %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
.L28:
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %d %d %d"
.LC2:
	.string	"%s,%d\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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$472, %rsp
	.cfi_def_cfa_offset 528
	movq	%fs:40, %rax
	movq	%rax, 456(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rax
	movl	$0, 36(%rsp)
	movq	%rax, 40(%rsp)
	leaq	148(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L13:
	movq	40(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	jle	.L3
	leaq	224(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	60(%rsp), %r15
	movq	%rax, 24(%rsp)
	movq	%rax, %rbp
	leaq	64(%rsp), %rax
	leaq	144(%rsp), %rbx
	movq	%rax, 8(%rsp)
	leaq	56(%rsp), %r14
	leaq	52(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC1(%rip), %rdi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	xorl	%eax, %eax
	movl	%r12d, (%rbx,%r12,4)
	addq	$22, %rbp
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	movq	8(%rsp), %rdi
	leal	(%rax,%rax,2), %eax
	addl	60(%rsp), %eax
	movl	%eax, (%rdi,%r12,4)
	movl	48(%rsp), %edi
	addq	$1, %r12
	cmpl	%r12d, %edi
	jg	.L4
	testl	%edi, %edi
	jle	.L3
	xorl	%r8d, %r8d
	leal	-1(%rdi), %r9d
.L5:
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L10:
	movq	16(%rsp), %rsi
	movl	%r9d, %eax
	movq	%rbx, %rdx
	subl	%r8d, %eax
	leaq	(%rsi,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %xmm0
	movslq	(%rdx), %rcx
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cltq
	movl	64(%rsp,%rax,4), %eax
	cmpl	%eax, 64(%rsp,%rcx,4)
	jge	.L6
	movq	%xmm1, (%rdx)
.L6:
	addq	$4, %rdx
	cmpq	%rsi, %rdx
	jne	.L7
	addl	$1, %r8d
	cmpl	%r8d, %edi
	jg	.L10
.L27:
	jne	.L5
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jne	.L16
.L12:
	movq	24(%rsp), %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	(%rbx,%r12,4), %rax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	addq	$1, %r12
	leaq	(%rax,%rax,4), %rdx
	movl	64(%rsp,%rax,4), %ecx
	leaq	(%rax,%rdx,2), %rax
	leaq	0(%rbp,%rax,2), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r12d, 48(%rsp)
	jg	.L14
.L15:
	movl	$1, 36(%rsp)
	jmp	.L13
.L3:
	movl	36(%rsp), %edx
	testl	%edx, %edx
	je	.L15
.L16:
	movl	$10, %edi
	leaq	144(%rsp), %rbx
	call	putchar@PLT
	movl	48(%rsp), %ecx
	leaq	224(%rsp), %rax
	movq	%rax, 24(%rsp)
	testl	%ecx, %ecx
	jg	.L12
	jmp	.L15
.L2:
	movq	456(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$472, %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
.L28:
	.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:
```