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>
#include<string.h>
int d[20000]={0};

int main()
{
	int n,c,m,s,i,j,t;
	for(;scanf("%d",&n),n;memset(d,0,sizeof(d)))
	{
		for(i=0;i<n;i++)
		{
			scanf("%d",&c);
			for(j=t=0;j<4;t+=m*60+s,j++)
				scanf("%d%d",&m,&s);
			d[t]=c;
		}
		for(i=0;d[i]==0;i++);
		printf("%d\n",d[i++]);
		for(;d[i]==0;i++);
		printf("%d\n",d[i]);
		for(i=20000;d[i]==0;i--);
		for(i--;d[i]==0;i--);
		printf("%d\n",d[i]);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	leaq	.LC1(%rip), %r13
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L13
	jle	.L14
	leaq	28(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	movl	$4, %ebx
	call	__isoc99_scanf@PLT
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	imull	$60, 32(%rsp), %eax
	addl	36(%rsp), %eax
	addl	%eax, %r15d
	subl	$1, %ebx
	jne	.L3
	movl	28(%rsp), %eax
	movslq	%r15d, %rcx
	leaq	d(%rip), %rsi
	addl	$1, %r14d
	movl	%eax, (%rsi,%rcx,4)
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L14:
	leaq	d(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jne	.L16
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, %ecx
	leaq	-4+d(%rip), %rdi
	addq	$1, %rax
	movl	(%rdi,%rax,4), %edx
	testl	%edx, %edx
	je	.L6
	leal	1(%rcx), %ebx
.L5:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	%ebx, %rcx
	leaq	d(%rip), %rax
	movl	(%rax,%rcx,4), %edx
	testl	%edx, %edx
	jne	.L7
	leaq	(%rax,%rcx,4), %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rax), %edx
	addq	$4, %rax
	testl	%edx, %edx
	je	.L8
.L7:
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	80000+d(%rip), %edi
	testl	%edi, %edi
	jne	.L17
	movl	$19999, %eax
	leaq	4+d(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, %edx
	subq	$1, %rax
	movl	(%rcx,%rax,4), %esi
	testl	%esi, %esi
	je	.L10
	leal	-1(%rdx), %eax
.L9:
	cltq
	leaq	d(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L11
	leaq	(%rcx,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	-4(%rax), %edx
	subq	$4, %rax
	testl	%edx, %edx
	je	.L12
.L11:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$80000, %edx
	xorl	%esi, %esi
	leaq	d(%rip), %rdi
	call	memset@PLT
	jmp	.L2
.L13:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$56, %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
.L17:
	.cfi_restore_state
	movl	$19999, %eax
	jmp	.L9
.L16:
	movl	$1, %ebx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 80000
d:
	.zero	80000
	.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	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	leaq	.LC1(%rip), %r13
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L13
	jle	.L14
	leaq	28(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	movl	$4, %ebx
	call	__isoc99_scanf@PLT
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	imull	$60, 32(%rsp), %eax
	addl	36(%rsp), %eax
	addl	%eax, %r15d
	subl	$1, %ebx
	jne	.L3
	movl	28(%rsp), %eax
	movslq	%r15d, %rcx
	leaq	d(%rip), %rsi
	addl	$1, %r14d
	movl	%eax, (%rsi,%rcx,4)
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L14:
	leaq	d(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jne	.L16
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, %ecx
	leaq	-4+d(%rip), %rdi
	addq	$1, %rax
	movl	(%rdi,%rax,4), %edx
	testl	%edx, %edx
	je	.L6
	leal	1(%rcx), %ebx
.L5:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	%ebx, %rcx
	leaq	d(%rip), %rax
	movl	(%rax,%rcx,4), %edx
	testl	%edx, %edx
	jne	.L7
	leaq	(%rax,%rcx,4), %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rax), %edx
	addq	$4, %rax
	testl	%edx, %edx
	je	.L8
.L7:
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	80000+d(%rip), %edi
	testl	%edi, %edi
	jne	.L17
	movl	$19999, %eax
	leaq	4+d(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, %edx
	subq	$1, %rax
	movl	(%rcx,%rax,4), %esi
	testl	%esi, %esi
	je	.L10
	leal	-1(%rdx), %eax
.L9:
	cltq
	leaq	d(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L11
	leaq	(%rcx,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	-4(%rax), %edx
	subq	$4, %rax
	testl	%edx, %edx
	je	.L12
.L11:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$80000, %edx
	xorl	%esi, %esi
	leaq	d(%rip), %rdi
	call	memset@PLT
	jmp	.L2
.L13:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$56, %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
.L17:
	.cfi_restore_state
	movl	$19999, %eax
	jmp	.L9
.L16:
	movl	$1, %ebx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 80000
d:
	.zero	80000
	.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	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	leaq	.LC1(%rip), %r13
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L13
	jle	.L14
	leaq	28(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	movl	$4, %ebx
	call	__isoc99_scanf@PLT
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	imull	$60, 32(%rsp), %eax
	addl	36(%rsp), %eax
	addl	%eax, %r15d
	subl	$1, %ebx
	jne	.L3
	movl	28(%rsp), %eax
	movslq	%r15d, %rcx
	leaq	d(%rip), %rsi
	addl	$1, %r14d
	movl	%eax, (%rsi,%rcx,4)
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L14:
	leaq	d(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jne	.L16
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, %ecx
	leaq	-4+d(%rip), %rdi
	addq	$1, %rax
	movl	(%rdi,%rax,4), %edx
	testl	%edx, %edx
	je	.L6
	leal	1(%rcx), %ebx
.L5:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	%ebx, %rcx
	leaq	d(%rip), %rax
	movl	(%rax,%rcx,4), %edx
	testl	%edx, %edx
	jne	.L7
	leaq	(%rax,%rcx,4), %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rax), %edx
	addq	$4, %rax
	testl	%edx, %edx
	je	.L8
.L7:
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	80000+d(%rip), %edi
	testl	%edi, %edi
	jne	.L17
	movl	$19999, %eax
	leaq	4+d(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, %edx
	subq	$1, %rax
	movl	(%rcx,%rax,4), %esi
	testl	%esi, %esi
	je	.L10
	leal	-1(%rdx), %eax
.L9:
	cltq
	leaq	d(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L11
	leaq	(%rcx,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	-4(%rax), %edx
	subq	$4, %rax
	testl	%edx, %edx
	je	.L12
.L11:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$80000, %edx
	xorl	%esi, %esi
	leaq	d(%rip), %rdi
	call	memset@PLT
	jmp	.L2
.L13:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$56, %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
.L17:
	.cfi_restore_state
	movl	$19999, %eax
	jmp	.L9
.L16:
	movl	$1, %ebx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 80000
d:
	.zero	80000
	.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>
#include<string.h>
int d[20000]={0};

int main()
{
	int n,c,m,s,i,j,t;
	for(;scanf("%d",&n),n;memset(d,0,sizeof(d)))
	{
		for(i=0;i<n;i++)
		{
			scanf("%d",&c);
			for(j=t=0;j<4;t+=m*60+s,j++)
				scanf("%d%d",&m,&s);
			d[t]=c;
		}
		for(i=0;d[i]==0;i++);
		printf("%d\n",d[i++]);
		for(;d[i]==0;i++);
		printf("%d\n",d[i]);
		for(i=20000;d[i]==0;i--);
		for(i--;d[i]==0;i--);
		printf("%d\n",d[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>
#include<string.h>
int d[20000]={0};

int main()
{
	int n,c,m,s,i,j,t;
	for(;scanf("%d",&n),n;memset(d,0,sizeof(d)))
	{
		for(i=0;i<n;i++)
		{
			scanf("%d",&c);
			for(j=t=0;j<4;t+=m*60+s,j++)
				scanf("%d%d",&m,&s);
			d[t]=c;
		}
		for(i=0;d[i]==0;i++);
		printf("%d\n",d[i++]);
		for(;d[i]==0;i++);
		printf("%d\n",d[i]);
		for(i=20000;d[i]==0;i--);
		for(i--;d[i]==0;i--);
		printf("%d\n",d[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:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<string.h>
int d[20000]={0};

int main()
{
	int n,c,m,s,i,j,t;
	for(;scanf("%d",&n),n;memset(d,0,sizeof(d)))
	{
		for(i=0;i<n;i++)
		{
			scanf("%d",&c);
			for(j=t=0;j<4;t+=m*60+s,j++)
				scanf("%d%d",&m,&s);
			d[t]=c;
		}
		for(i=0;d[i]==0;i++);
		printf("%d\n",d[i++]);
		for(;d[i]==0;i++);
		printf("%d\n",d[i]);
		for(i=20000;d[i]==0;i--);
		for(i--;d[i]==0;i--);
		printf("%d\n",d[i]);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	leaq	.LC1(%rip), %r13
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L13
	jle	.L14
	leaq	28(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	movl	$4, %ebx
	call	__isoc99_scanf@PLT
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	imull	$60, 32(%rsp), %eax
	addl	36(%rsp), %eax
	addl	%eax, %r15d
	subl	$1, %ebx
	jne	.L3
	movl	28(%rsp), %eax
	movslq	%r15d, %rcx
	leaq	d(%rip), %rsi
	addl	$1, %r14d
	movl	%eax, (%rsi,%rcx,4)
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L14:
	leaq	d(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jne	.L16
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, %ecx
	leaq	-4+d(%rip), %rdi
	addq	$1, %rax
	movl	(%rdi,%rax,4), %edx
	testl	%edx, %edx
	je	.L6
	leal	1(%rcx), %ebx
.L5:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	%ebx, %rcx
	leaq	d(%rip), %rax
	movl	(%rax,%rcx,4), %edx
	testl	%edx, %edx
	jne	.L7
	leaq	(%rax,%rcx,4), %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rax), %edx
	addq	$4, %rax
	testl	%edx, %edx
	je	.L8
.L7:
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	80000+d(%rip), %edi
	testl	%edi, %edi
	jne	.L17
	movl	$19999, %eax
	leaq	4+d(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, %edx
	subq	$1, %rax
	movl	(%rcx,%rax,4), %esi
	testl	%esi, %esi
	je	.L10
	leal	-1(%rdx), %eax
.L9:
	cltq
	leaq	d(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L11
	leaq	(%rcx,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	-4(%rax), %edx
	subq	$4, %rax
	testl	%edx, %edx
	je	.L12
.L11:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$80000, %edx
	xorl	%esi, %esi
	leaq	d(%rip), %rdi
	call	memset@PLT
	jmp	.L2
.L13:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$56, %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
.L17:
	.cfi_restore_state
	movl	$19999, %eax
	jmp	.L9
.L16:
	movl	$1, %ebx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 80000
d:
	.zero	80000
	.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	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	leaq	.LC1(%rip), %r13
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	je	.L13
	jle	.L14
	leaq	28(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	36(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	movl	$4, %ebx
	call	__isoc99_scanf@PLT
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	imull	$60, 32(%rsp), %eax
	addl	36(%rsp), %eax
	addl	%eax, %r15d
	subl	$1, %ebx
	jne	.L3
	movl	28(%rsp), %eax
	movslq	%r15d, %rcx
	leaq	d(%rip), %rsi
	addl	$1, %r14d
	movl	%eax, (%rsi,%rcx,4)
	cmpl	%r14d, 24(%rsp)
	jg	.L4
.L14:
	leaq	d(%rip), %rax
	movl	(%rax), %edx
	testl	%edx, %edx
	jne	.L16
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, %ecx
	leaq	-4+d(%rip), %rdi
	addq	$1, %rax
	movl	(%rdi,%rax,4), %edx
	testl	%edx, %edx
	je	.L6
	leal	1(%rcx), %ebx
.L5:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	%ebx, %rcx
	leaq	d(%rip), %rax
	movl	(%rax,%rcx,4), %edx
	testl	%edx, %edx
	jne	.L7
	leaq	(%rax,%rcx,4), %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rax), %edx
	addq	$4, %rax
	testl	%edx, %edx
	je	.L8
.L7:
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	80000+d(%rip), %edi
	testl	%edi, %edi
	jne	.L17
	movl	$19999, %eax
	leaq	4+d(%rip), %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, %edx
	subq	$1, %rax
	movl	(%rcx,%rax,4), %esi
	testl	%esi, %esi
	je	.L10
	leal	-1(%rdx), %eax
.L9:
	cltq
	leaq	d(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	testl	%edx, %edx
	jne	.L11
	leaq	(%rcx,%rax,4), %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	-4(%rax), %edx
	subq	$4, %rax
	testl	%edx, %edx
	je	.L12
.L11:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$80000, %edx
	xorl	%esi, %esi
	leaq	d(%rip), %rdi
	call	memset@PLT
	jmp	.L2
.L13:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$56, %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
.L17:
	.cfi_restore_state
	movl	$19999, %eax
	jmp	.L9
.L16:
	movl	$1, %ebx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 80000
d:
	.zero	80000
	.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:
```