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 i;
  int n;
  int s;
  int t[2];
  int m1,m2,m3,m4,s1,s2,s3,s4;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    int b[2][2]={{0,100000},{0,100000}};
    int w[2][2]={{-1,-1},{-1,-1}};
    for(i=0;i<n;i++){
      scanf("%d %d %d %d %d %d %d %d %d",
	    &t[0],&m1,&s1,&m2,&s2,&m3,&s3,&m4,&s4);
      t[1]=(m1+m2+m3+m4)*60;
      s=s1+s2+s3+s4;
      t[1]+=s;
      if(b[1][1]>t[1]){
	b[1][1]=t[1];
	b[1][0]=t[0];
	if(b[0][1]>b[1][1]){
	  b[1][1]=b[0][1];
	  b[1][0]=b[0][0];
	  b[0][1]=t[1];
	  b[0][0]=t[0];
	}
      }
      if(w[1][1]<t[1]){
	w[1][1]=t[1];
	w[1][0]=t[0];
	if(w[0][1]<w[1][1]){
	  w[1][1]=w[0][1];
	  w[1][0]=w[0][0];
	  w[0][1]=t[1];
	  w[0][0]=t[0];
	}	
      }
    }
    printf("%d\n%d\n%d\n",b[0][0],b[1][0],w[1][0]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d %d %d %d %d %d"
.LC2:
	.string	"%d\n%d\n%d\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	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L8:
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	jmp	.L10
.L2:
	movl	$0, -48(%rbp)
	movl	$100000, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$100000, -36(%rbp)
	movl	$-1, -32(%rbp)
	movl	$-1, -28(%rbp)
	movl	$-1, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L4
.L7:
	leaq	-76(%rbp), %r8
	leaq	-92(%rbp), %rdi
	leaq	-80(%rbp), %rcx
	leaq	-96(%rbp), %rdx
	leaq	-56(%rbp), %rax
	leaq	-68(%rbp), %rsi
	pushq	%rsi
	leaq	-84(%rbp), %rsi
	pushq	%rsi
	leaq	-72(%rbp), %rsi
	pushq	%rsi
	leaq	-88(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$32, %rsp
	movl	-96(%rbp), %edx
	movl	-92(%rbp), %eax
	addl	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%eax, %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %eax
	movl	%eax, -52(%rbp)
	movl	-80(%rbp), %edx
	movl	-76(%rbp), %eax
	addl	%eax, %edx
	movl	-72(%rbp), %eax
	addl	%eax, %edx
	movl	-68(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -60(%rbp)
	movl	-52(%rbp), %edx
	movl	-60(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %edx
	movl	-52(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-48(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -48(%rbp)
.L5:
	movl	-20(%rbp), %edx
	movl	-52(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-52(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -32(%rbp)
.L6:
	addl	$1, -64(%rbp)
.L4:
	movl	-100(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L7
	movl	-24(%rbp), %ecx
	movl	-40(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L10:
	call	__stack_chk_fail@PLT
.L9:
	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	"%d %d %d %d %d %d %d %d %d"
.LC2:
	.string	"%d\n%d\n%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	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	92(%rsp), %rax
	movq	%rax, 72(%rsp)
	.p2align 4,,10
	.p2align 3
.L7:
	movq	72(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	92(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L9
	movl	$-1, 52(%rsp)
	movl	$-1, %r12d
	movl	$100000, %ebp
	leaq	128(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	124(%rsp), %rax
	xorl	%ebx, %ebx
	leaq	116(%rsp), %r9
	movq	%rax, 40(%rsp)
	leaq	108(%rsp), %rax
	leaq	100(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	120(%rsp), %rax
	leaq	112(%rsp), %r14
	movq	%rax, 32(%rsp)
	leaq	104(%rsp), %rax
	leaq	96(%rsp), %r13
	movl	$-1, 60(%rsp)
	movl	$-1, 68(%rsp)
	movl	$0, 48(%rsp)
	movl	$100000, 56(%rsp)
	movl	$0, 64(%rsp)
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	pushq	40(%rsp)
	.cfi_def_cfa_offset 216
	movq	%r13, %rdx
	xorl	%eax, %eax
	movq	%r15, %r8
	pushq	32(%rsp)
	.cfi_def_cfa_offset 224
	movq	%r14, %rcx
	leaq	.LC1(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 232
	pushq	40(%rsp)
	.cfi_def_cfa_offset 240
	movq	40(%rsp), %rsi
	movq	%r9, 32(%rsp)
	call	__isoc99_scanf@PLT
	movl	132(%rsp), %eax
	addl	128(%rsp), %eax
	addl	136(%rsp), %eax
	addl	140(%rsp), %eax
	imull	$60, %eax, %eax
	movl	148(%rsp), %edx
	addl	144(%rsp), %edx
	addl	152(%rsp), %edx
	addl	156(%rsp), %edx
	addl	%edx, %eax
	movl	%eax, 164(%rsp)
	addq	$32, %rsp
	.cfi_def_cfa_offset 208
	cmpl	%ebp, %eax
	movq	(%rsp), %r9
	jge	.L4
	movl	128(%rsp), %ecx
	movl	56(%rsp), %esi
	movl	%eax, %ebp
	movl	%ecx, 48(%rsp)
	cmpl	%esi, %eax
	jge	.L4
	movl	64(%rsp), %edx
	movl	%eax, 56(%rsp)
	movl	%esi, %ebp
	movl	%ecx, 64(%rsp)
	movl	%edx, 48(%rsp)
.L4:
	cmpl	%r12d, %eax
	jle	.L5
	movl	128(%rsp), %edi
	movl	60(%rsp), %esi
	movl	%eax, %r12d
	movl	%edi, 52(%rsp)
	cmpl	%esi, %eax
	jle	.L5
	movl	%eax, 60(%rsp)
	movl	68(%rsp), %eax
	movl	%esi, %r12d
	movl	%edi, 68(%rsp)
	movl	%eax, 52(%rsp)
.L5:
	addl	$1, %ebx
	cmpl	%ebx, 92(%rsp)
	jg	.L6
.L3:
	movl	52(%rsp), %r8d
	movl	48(%rsp), %ecx
	movl	$1, %edi
	xorl	%eax, %eax
	movl	64(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$152, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movl	$-1, 52(%rsp)
	movl	$0, 48(%rsp)
	movl	$0, 64(%rsp)
	jmp	.L3
.L15:
	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	"%d %d %d %d %d %d %d %d %d"
.LC2:
	.string	"%d\n%d\n%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	$152, %rsp
	.cfi_def_cfa_offset 208
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	92(%rsp), %rax
	movq	%rax, 72(%rsp)
	.p2align 4,,10
	.p2align 3
.L7:
	movq	72(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	92(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	jle	.L9
	movl	$-1, 52(%rsp)
	movl	$-1, %r12d
	movl	$100000, %ebp
	leaq	128(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	124(%rsp), %rax
	xorl	%ebx, %ebx
	leaq	116(%rsp), %r9
	movq	%rax, 40(%rsp)
	leaq	108(%rsp), %rax
	leaq	100(%rsp), %r15
	movq	%rax, 24(%rsp)
	leaq	120(%rsp), %rax
	leaq	112(%rsp), %r14
	movq	%rax, 32(%rsp)
	leaq	104(%rsp), %rax
	leaq	96(%rsp), %r13
	movl	$-1, 60(%rsp)
	movl	$-1, 68(%rsp)
	movl	$0, 48(%rsp)
	movl	$100000, 56(%rsp)
	movl	$0, 64(%rsp)
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L6:
	pushq	40(%rsp)
	.cfi_def_cfa_offset 216
	movq	%r13, %rdx
	xorl	%eax, %eax
	movq	%r15, %r8
	pushq	32(%rsp)
	.cfi_def_cfa_offset 224
	movq	%r14, %rcx
	leaq	.LC1(%rip), %rdi
	pushq	48(%rsp)
	.cfi_def_cfa_offset 232
	pushq	40(%rsp)
	.cfi_def_cfa_offset 240
	movq	40(%rsp), %rsi
	movq	%r9, 32(%rsp)
	call	__isoc99_scanf@PLT
	movl	132(%rsp), %eax
	addl	128(%rsp), %eax
	addl	136(%rsp), %eax
	addl	140(%rsp), %eax
	imull	$60, %eax, %eax
	movl	148(%rsp), %edx
	addl	144(%rsp), %edx
	addl	152(%rsp), %edx
	addl	156(%rsp), %edx
	addl	%edx, %eax
	movl	%eax, 164(%rsp)
	addq	$32, %rsp
	.cfi_def_cfa_offset 208
	cmpl	%ebp, %eax
	movq	(%rsp), %r9
	jge	.L4
	movl	128(%rsp), %ecx
	movl	56(%rsp), %esi
	movl	%eax, %ebp
	movl	%ecx, 48(%rsp)
	cmpl	%esi, %eax
	jge	.L4
	movl	64(%rsp), %edx
	movl	%eax, 56(%rsp)
	movl	%esi, %ebp
	movl	%ecx, 64(%rsp)
	movl	%edx, 48(%rsp)
.L4:
	cmpl	%r12d, %eax
	jle	.L5
	movl	128(%rsp), %edi
	movl	60(%rsp), %esi
	movl	%eax, %r12d
	movl	%edi, 52(%rsp)
	cmpl	%esi, %eax
	jle	.L5
	movl	%eax, 60(%rsp)
	movl	68(%rsp), %eax
	movl	%esi, %r12d
	movl	%edi, 68(%rsp)
	movl	%eax, 52(%rsp)
.L5:
	addl	$1, %ebx
	cmpl	%ebx, 92(%rsp)
	jg	.L6
.L3:
	movl	52(%rsp), %r8d
	movl	48(%rsp), %ecx
	movl	$1, %edi
	xorl	%eax, %eax
	movl	64(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$152, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movl	$-1, 52(%rsp)
	movl	$0, 48(%rsp)
	movl	$0, 64(%rsp)
	jmp	.L3
.L15:
	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 i;
  int n;
  int s;
  int t[2];
  int m1,m2,m3,m4,s1,s2,s3,s4;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    int b[2][2]={{0,100000},{0,100000}};
    int w[2][2]={{-1,-1},{-1,-1}};
    for(i=0;i<n;i++){
      scanf("%d %d %d %d %d %d %d %d %d",
	    &t[0],&m1,&s1,&m2,&s2,&m3,&s3,&m4,&s4);
      t[1]=(m1+m2+m3+m4)*60;
      s=s1+s2+s3+s4;
      t[1]+=s;
      if(b[1][1]>t[1]){
	b[1][1]=t[1];
	b[1][0]=t[0];
	if(b[0][1]>b[1][1]){
	  b[1][1]=b[0][1];
	  b[1][0]=b[0][0];
	  b[0][1]=t[1];
	  b[0][0]=t[0];
	}
      }
      if(w[1][1]<t[1]){
	w[1][1]=t[1];
	w[1][0]=t[0];
	if(w[0][1]<w[1][1]){
	  w[1][1]=w[0][1];
	  w[1][0]=w[0][0];
	  w[0][1]=t[1];
	  w[0][0]=t[0];
	}	
      }
    }
    printf("%d\n%d\n%d\n",b[0][0],b[1][0],w[1][0]);
  }
  return 0;
}
8
34001 3 20 3 8 6 27 2 25
20941 3 5 2 41 7 19 2 42
90585 4 8 3 12 6 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 12 2 54
63812 4 11 3 11 6 98 2 22
54092 3 33 2 54 6 18 2 19
25012 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 44
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0
 8
34001 3 20 3 8 6 27 2 25
20941 3 5 2 41 7 19 2 42
90585 4 8 3 12 6 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 12 4 54
63812 4 11 3 11 6 98 2 22
54092 3 33 2 54 6 18 2 19
25012 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 44
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0
 8
34001 3 20 3 8 6 27 2 25
20941 3 5 2 41 7 19 0 42
90585 4 8 3 12 6 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 12 4 54
63812 4 11 3 11 6 98 2 22
54092 3 33 2 54 6 18 2 19
25012 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 44
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0
 8
34001 3 20 3 8 6 27 2 25
20941 3 5 2 41 7 19 0 42
90585 4 8 3 12 6 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 12 4 54
63812 4 11 3 11 6 98 2 22
54092 3 33 2 54 6 18 2 19
25012 3 44 2 58 6 45 4 46
4
1 3 23 1 23 1 34 4 44
2 5 16 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0
 8
65541 3 20 3 8 6 27 2 25
20941 3 5 2 41 7 19 2 42
90585 4 8 3 12 6 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 12 4 54
63812 4 11 3 11 6 98 2 22
54092 3 33 2 54 6 18 2 19
25012 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 44
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0
 8
34001 3 20 3 8 6 27 2 25
20941 3 5 2 41 7 19 2 42
90585 4 8 3 12 6 46 2 5
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 12 2 54
63812 4 11 3 11 6 98 2 22
54092 3 33 2 54 6 18 2 19
25012 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 44
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 61
4 4 49 2 22 4 25 4 23
0
 8
65541 3 20 3 8 6 27 2 25
20941 3 5 2 41 7 19 2 42
90585 4 8 3 12 11 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 12 4 54
63812 4 11 3 11 6 98 2 22
54092 3 33 2 54 6 18 2 19
25012 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 69
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0
 8
34001 3 20 3 8 6 27 2 25
20941 3 5 3 41 7 19 2 42
90585 4 8 3 12 5 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 24 2 54
63812 4 11 3 11 6 53 2 22
54092 3 33 2 54 6 18 2 19
5599 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 44
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0
 8
65541 3 20 3 8 6 27 2 25
20941 3 5 2 41 7 19 2 42
90585 4 8 3 12 11 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 12 4 54
63812 4 11 3 11 6 98 2 22
54092 3 56 2 54 6 18 2 19
25012 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 69
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0
 8
34001 3 20 5 8 6 27 2 25
20941 3 5 3 41 7 19 2 42
90585 4 8 3 12 5 46 2 34
92201 3 28 2 47 6 37 2 58
10001 3 50 2 42 7 24 2 54
63812 4 11 3 11 6 53 2 22
54092 3 33 2 54 6 18 2 19
5599 3 44 2 58 6 45 2 46
4
1 3 23 1 23 1 34 4 44
2 5 12 2 12 3 41 2 29
3 5 24 1 24 2 0 3 35
4 4 49 2 22 4 41 4 23
0

54092
34001
90585
1
3
2
 54092
34001
63812
1
3
2
 20941
54092
63812
1
3
2
 20941
54092
25012
1
3
2
 54092
65541
63812
1
3
2
 54092
34001
10001
1
3
2
 54092
65541
10001
1
3
2
 54092
34001
20941
1
3
2
 65541
54092
10001
1
3
2
 54092
90585
10001
1
3
2

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 i;
  int n;
  int s;
  int t[2];
  int m1,m2,m3,m4,s1,s2,s3,s4;
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    int b[2][2]={{0,100000},{0,100000}};
    int w[2][2]={{-1,-1},{-1,-1}};
    for(i=0;i<n;i++){
      scanf("%d %d %d %d %d %d %d %d %d",
	    &t[0],&m1,&s1,&m2,&s2,&m3,&s3,&m4,&s4);
      t[1]=(m1+m2+m3+m4)*60;
      s=s1+s2+s3+s4;
      t[1]+=s;
      if(b[1][1]>t[1]){
	b[1][1]=t[1];
	b[1][0]=t[0];
	if(b[0][1]>b[1][1]){
	  b[1][1]=b[0][1];
	  b[1][0]=b[0][0];
	  b[0][1]=t[1];
	  b[0][0]=t[0];
	}
      }
      if(w[1][1]<t[1]){
	w[1][1]=t[1];
	w[1][0]=t[0];
	if(w[0][1]<w[1][1]){
	  w[1][1]=w[0][1];
	  w[1][0]=w[0][0];
	  w[0][1]=t[1];
	  w[0][0]=t[0];
	}	
      }
    }
    printf("%d\n%d\n%d\n",b[0][0],b[1][0],w[1][0]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d %d %d %d %d %d"
.LC2:
	.string	"%d\n%d\n%d\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	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L8:
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	jmp	.L10
.L2:
	movl	$0, -48(%rbp)
	movl	$100000, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$100000, -36(%rbp)
	movl	$-1, -32(%rbp)
	movl	$-1, -28(%rbp)
	movl	$-1, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L4
.L7:
	leaq	-76(%rbp), %r8
	leaq	-92(%rbp), %rdi
	leaq	-80(%rbp), %rcx
	leaq	-96(%rbp), %rdx
	leaq	-56(%rbp), %rax
	leaq	-68(%rbp), %rsi
	pushq	%rsi
	leaq	-84(%rbp), %rsi
	pushq	%rsi
	leaq	-72(%rbp), %rsi
	pushq	%rsi
	leaq	-88(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$32, %rsp
	movl	-96(%rbp), %edx
	movl	-92(%rbp), %eax
	addl	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%eax, %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %eax
	movl	%eax, -52(%rbp)
	movl	-80(%rbp), %edx
	movl	-76(%rbp), %eax
	addl	%eax, %edx
	movl	-72(%rbp), %eax
	addl	%eax, %edx
	movl	-68(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -60(%rbp)
	movl	-52(%rbp), %edx
	movl	-60(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %edx
	movl	-52(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-48(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -48(%rbp)
.L5:
	movl	-20(%rbp), %edx
	movl	-52(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-52(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -32(%rbp)
.L6:
	addl	$1, -64(%rbp)
.L4:
	movl	-100(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L7
	movl	-24(%rbp), %ecx
	movl	-40(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L10:
	call	__stack_chk_fail@PLT
.L9:
	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	"%d %d %d %d %d %d %d %d %d"
.LC2:
	.string	"%d\n%d\n%d\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	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L8:
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	jmp	.L10
.L2:
	movl	$0, -48(%rbp)
	movl	$100000, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$100000, -36(%rbp)
	movl	$-1, -32(%rbp)
	movl	$-1, -28(%rbp)
	movl	$-1, -24(%rbp)
	movl	$-1, -20(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L4
.L7:
	leaq	-76(%rbp), %r8
	leaq	-92(%rbp), %rdi
	leaq	-80(%rbp), %rcx
	leaq	-96(%rbp), %rdx
	leaq	-56(%rbp), %rax
	leaq	-68(%rbp), %rsi
	pushq	%rsi
	leaq	-84(%rbp), %rsi
	pushq	%rsi
	leaq	-72(%rbp), %rsi
	pushq	%rsi
	leaq	-88(%rbp), %rsi
	pushq	%rsi
	movq	%r8, %r9
	movq	%rdi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$32, %rsp
	movl	-96(%rbp), %edx
	movl	-92(%rbp), %eax
	addl	%eax, %edx
	movl	-88(%rbp), %eax
	addl	%eax, %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %eax
	movl	%eax, -52(%rbp)
	movl	-80(%rbp), %edx
	movl	-76(%rbp), %eax
	addl	%eax, %edx
	movl	-72(%rbp), %eax
	addl	%eax, %edx
	movl	-68(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -60(%rbp)
	movl	-52(%rbp), %edx
	movl	-60(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -52(%rbp)
	movl	-36(%rbp), %edx
	movl	-52(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-52(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-48(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -48(%rbp)
.L5:
	movl	-20(%rbp), %edx
	movl	-52(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-52(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-56(%rbp), %eax
	movl	%eax, -32(%rbp)
.L6:
	addl	$1, -64(%rbp)
.L4:
	movl	-100(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L7
	movl	-24(%rbp), %ecx
	movl	-40(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L10:
	call	__stack_chk_fail@PLT
.L9:
	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:
