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

```c
// AOJ 2013: Osaki
// 2017.11.1 bal4u@uu
// 2017.12.30

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct { int t; int a; } T;
T tbl[20005]; int sz; 
char buf[30], *p;
short f[86400];

int in()
{
	int n;
	n = *p++ & 0xf;
	n = 10*n + (*p++ & 0xf);
	p++;
	return n;
}

int cmp(T *a, T *b) { return a->t - b->t; }

int solve1(int n)
{
	int i, h, m, s, ans;
	T *tp;

	tp = tbl, sz = n << 1;
	while (n--) {
		fgets(p=buf, 30, stdin);
		h = in(), m = in(), s = in();
		tp->t = (((((h<<6)+m)<<6)+s)<<1)+1, tp->a = 1;
		tp++;
		
		h = in(), m = in(), s = in();
		tp->t = ((((h<<6)+m)<<6)+s)<<1, tp->a = -1;
		tp++;
	}

	qsort(tbl, sz, sizeof(T), cmp);
	
	ans = s = 0;
	for (i = 0; i < sz; i++) {
		s += tbl[i].a;
		if (s > ans) ans = s;
	}
	return ans;
}

int solve2(int n)
{
	int i, h, m, s, t, ans;

	memset(f, 0, sizeof(f));
	while (n--) {
		fgets(p=buf, 30, stdin);
		h = in(), m = in(), s = in();
		t = ((h*60)+m)*60+s, f[t]++;

		h = in(), m = in(), s = in();
		t = ((h*60)+m)*60+s, f[t]--;
	}

	ans = t = 0;
	for (ans = 0, i = 0; i < 86400; i++) {
		t += f[i];
		if (t > ans) ans = t;
	}
	return ans;
}

int main()
{
	int n;

	while (fgets(buf, 10, stdin) && *buf != '0') {
		n = atoi(buf);
		if (n <= 5000) printf("%d\n", solve1(n));
		else           printf("%d\n", solve2(n));
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 160040
tbl:
	.zero	160040
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 30
buf:
	.zero	30
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 172800
f:
	.zero	172800
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp, .-cmp
	.globl	solve1
	.type	solve1, @function
solve1:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	leaq	tbl(%rip), %rax
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, sz(%rip)
	jmp	.L6
.L7:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$30, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	-16(%rbp), %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	$1, 4(%rax)
	addq	$8, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	-16(%rbp), %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	$-1, 4(%rax)
	addq	$8, -8(%rbp)
.L6:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	sz(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L8
.L10:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L9
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
.L9:
	addl	$1, -28(%rbp)
.L8:
	movl	sz(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L10
	movl	-20(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	solve1, .-solve1
	.globl	solve2
	.type	solve2, @function
solve2:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	$172800, %edx
	movl	$0, %esi
	leaq	f(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	jmp	.L13
.L14:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$30, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	imull	$60, %eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	addl	$1, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movw	%cx, (%rdx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	imull	$60, %eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movw	%cx, (%rdx,%rax)
.L13:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L14
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L15
.L17:
	movl	-24(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	addl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L16
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
.L16:
	addl	$1, -24(%rbp)
.L15:
	cmpl	$86399, -24(%rbp)
	jle	.L17
	movl	-16(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	solve2, .-solve2
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L20
.L23:
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -4(%rbp)
	cmpl	$5000, -4(%rbp)
	jg	.L21
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	solve1
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	solve2
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L20:
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$10, %esi
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L22
	movzbl	buf(%rip), %eax
	cmpb	$48, %al
	jne	.L23
.L22:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB51:
	.cfi_startproc
	endbr64
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	leaq	2(%rax), %rdx
	addq	$3, %rax
	movq	%rdx, p(%rip)
	movzbl	-2(%rax), %edx
	movq	%rax, p(%rip)
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.p2align 4
	.globl	solve1
	.type	solve1, @function
solve1:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leal	(%rdi,%rdi), %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	tbl(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	%esi, sz(%rip)
	testl	%edi, %edi
	je	.L5
	movl	%edi, %edi
	movq	%rbp, %r12
	leaq	buf(%rip), %r13
	salq	$4, %rdi
	leaq	(%rdi,%rbp), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	stdin(%rip), %rdx
	movl	$30, %esi
	movq	%r13, %rdi
	movq	%r13, p(%rip)
	addq	$16, %r12
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	leaq	2(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	leaq	4(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	3(%rax), %ecx
	sall	$6, %edx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	leaq	5(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	4(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %edi
	leaq	7(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	6(%rax), %ecx
	addl	%edi, %edx
	sall	$6, %edx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	leaq	8(%rax), %rcx
	addq	$18, %rax
	movq	%rcx, p(%rip)
	movzbl	-11(%rax), %ecx
	movl	$1, -12(%r12)
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %ecx
	addl	%ecx, %edx
	leal	1(%rdx,%rdx), %edx
	movl	%edx, -16(%r12)
	movzbl	-9(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	movzbl	-8(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	movzbl	-6(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	movzbl	-5(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %esi
	movzbl	-3(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %edi
	movzbl	-2(%rax), %ecx
	movq	%rax, p(%rip)
	movl	%edx, %eax
	movl	$-1, -4(%r12)
	sall	$6, %eax
	andl	$15, %ecx
	addl	%esi, %eax
	leal	(%rcx,%rdi,2), %ecx
	sall	$6, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%eax, -8(%r12)
	cmpq	%rbx, %r12
	jne	.L6
	movl	sz(%rip), %esi
.L5:
	movslq	%esi, %rsi
	leaq	cmp(%rip), %rcx
	movl	$8, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	sz(%rip), %eax
	testl	%eax, %eax
	jle	.L9
	leaq	4+tbl(%rip), %rdx
	leal	-1(%rax), %ecx
	xorl	%r8d, %r8d
	leaq	8(%rdx), %rax
	leaq	(%rax,%rcx,8), %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	addl	(%rdx), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$8, %rdx
	cmpq	%rdx, %rcx
	jne	.L8
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r8d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%r8d, %r8d
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	%r8d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	solve1, .-solve1
	.p2align 4
	.globl	solve2
	.type	solve2, @function
solve2:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%esi, %esi
	movl	$172800, %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	f(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	movq	%rbp, %rdi
	call	memset@PLT
	testl	%ebx, %ebx
	je	.L17
	leaq	buf(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	movq	stdin(%rip), %rdx
	movl	$30, %esi
	movq	%r12, %rdi
	movq	%r12, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	leaq	2(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	leaq	4(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	3(%rax), %ecx
	imull	$60, %edx, %edx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	leaq	5(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	4(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %edi
	leaq	7(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	6(%rax), %ecx
	addl	%edi, %edx
	imull	$60, %edx, %edx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	leaq	8(%rax), %rcx
	addq	$18, %rax
	movq	%rcx, p(%rip)
	movzbl	-11(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %ecx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	addw	$1, 0(%rbp,%rdx,2)
	movzbl	-9(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	movzbl	-8(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	movzbl	-6(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	movzbl	-5(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %esi
	movzbl	-3(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %edi
	movzbl	-2(%rax), %ecx
	movq	%rax, p(%rip)
	imull	$60, %edx, %eax
	andl	$15, %ecx
	leal	(%rcx,%rdi,2), %ecx
	addl	%esi, %eax
	imull	$60, %eax, %eax
	addl	%ecx, %eax
	cltq
	subw	$1, 0(%rbp,%rax,2)
	subl	$1, %ebx
	jne	.L18
.L17:
	leaq	f(%rip), %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	leaq	172800(%rdx), %rsi
	.p2align 4,,10
	.p2align 3
.L19:
	movswl	(%rdx), %ecx
	addl	%ecx, %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$2, %rdx
	cmpq	%rdx, %rsi
	jne	.L19
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	%r8d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE54:
	.size	solve2, .-solve2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	buf(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L37:
	call	solve1
.L36:
	movl	%eax, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L27:
	movq	stdin(%rip), %rdx
	movl	$10, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L30
	cmpb	$48, (%rbx)
	je	.L30
	movq	%rbx, %rdi
	movl	$10, %edx
	xorl	%esi, %esi
	call	strtol@PLT
	movl	%eax, %edi
	cmpl	$5000, %eax
	jle	.L37
	call	solve2
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L30:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	f
	.bss
	.align 32
	.type	f, @object
	.size	f, 172800
f:
	.zero	172800
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 30
buf:
	.zero	30
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 160040
tbl:
	.zero	160040
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB51:
	.cfi_startproc
	endbr64
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	leaq	2(%rax), %rdx
	addq	$3, %rax
	movq	%rdx, p(%rip)
	movzbl	-2(%rax), %edx
	movq	%rax, p(%rip)
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.p2align 4
	.globl	solve1
	.type	solve1, @function
solve1:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leal	(%rdi,%rdi), %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	tbl(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	%esi, sz(%rip)
	testl	%edi, %edi
	je	.L5
	movl	%edi, %edi
	movq	%rbp, %r12
	leaq	buf(%rip), %r13
	salq	$4, %rdi
	leaq	(%rdi,%rbp), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	stdin(%rip), %rdx
	movl	$30, %esi
	movq	%r13, %rdi
	movq	%r13, p(%rip)
	addq	$16, %r12
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	leaq	2(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	leaq	4(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	3(%rax), %ecx
	sall	$6, %edx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	leaq	5(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	4(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %edi
	leaq	7(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	6(%rax), %ecx
	addl	%edi, %edx
	sall	$6, %edx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	leaq	8(%rax), %rcx
	addq	$18, %rax
	movq	%rcx, p(%rip)
	movzbl	-11(%rax), %ecx
	movl	$1, -12(%r12)
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %ecx
	addl	%ecx, %edx
	leal	1(%rdx,%rdx), %edx
	movl	%edx, -16(%r12)
	movzbl	-9(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	movzbl	-8(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	movzbl	-6(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	movzbl	-5(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %esi
	movzbl	-3(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %edi
	movzbl	-2(%rax), %ecx
	movq	%rax, p(%rip)
	movl	%edx, %eax
	movl	$-1, -4(%r12)
	sall	$6, %eax
	andl	$15, %ecx
	addl	%esi, %eax
	leal	(%rcx,%rdi,2), %ecx
	sall	$6, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%eax, -8(%r12)
	cmpq	%rbx, %r12
	jne	.L6
	movl	sz(%rip), %esi
.L5:
	movslq	%esi, %rsi
	leaq	cmp(%rip), %rcx
	movl	$8, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	sz(%rip), %eax
	testl	%eax, %eax
	jle	.L9
	leaq	4+tbl(%rip), %rdx
	leal	-1(%rax), %ecx
	xorl	%r8d, %r8d
	leaq	8(%rdx), %rax
	leaq	(%rax,%rcx,8), %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	addl	(%rdx), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$8, %rdx
	cmpq	%rdx, %rcx
	jne	.L8
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r8d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%r8d, %r8d
	popq	%rbx
	.cfi_def_cfa_offset 32
	movl	%r8d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	solve1, .-solve1
	.p2align 4
	.globl	solve2
	.type	solve2, @function
solve2:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%esi, %esi
	movl	$172800, %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	f(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	movq	%rbp, %rdi
	call	memset@PLT
	testl	%ebx, %ebx
	je	.L17
	leaq	buf(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L18:
	movq	stdin(%rip), %rdx
	movl	$30, %esi
	movq	%r12, %rdi
	movq	%r12, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	leaq	2(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	leaq	4(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	3(%rax), %ecx
	imull	$60, %edx, %edx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	leaq	5(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	4(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %edi
	leaq	7(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	6(%rax), %ecx
	addl	%edi, %edx
	imull	$60, %edx, %edx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	leaq	8(%rax), %rcx
	addq	$18, %rax
	movq	%rcx, p(%rip)
	movzbl	-11(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %ecx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	addw	$1, 0(%rbp,%rdx,2)
	movzbl	-9(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rdx,4), %ecx
	movzbl	-8(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	movzbl	-6(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %esi
	movzbl	-5(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rsi,2), %esi
	movzbl	-3(%rax), %ecx
	andl	$15, %ecx
	leal	(%rcx,%rcx,4), %edi
	movzbl	-2(%rax), %ecx
	movq	%rax, p(%rip)
	imull	$60, %edx, %eax
	andl	$15, %ecx
	leal	(%rcx,%rdi,2), %ecx
	addl	%esi, %eax
	imull	$60, %eax, %eax
	addl	%ecx, %eax
	cltq
	subw	$1, 0(%rbp,%rax,2)
	subl	$1, %ebx
	jne	.L18
.L17:
	leaq	f(%rip), %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	leaq	172800(%rdx), %rsi
	.p2align 4,,10
	.p2align 3
.L19:
	movswl	(%rdx), %ecx
	addl	%ecx, %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$2, %rdx
	cmpq	%rdx, %rsi
	jne	.L19
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	%r8d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE54:
	.size	solve2, .-solve2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	buf(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L37:
	call	solve1
.L36:
	movl	%eax, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L27:
	movq	stdin(%rip), %rdx
	movl	$10, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L30
	cmpb	$48, (%rbx)
	je	.L30
	movq	%rbx, %rdi
	movl	$10, %edx
	xorl	%esi, %esi
	call	strtol@PLT
	movl	%eax, %edi
	cmpl	$5000, %eax
	jle	.L37
	call	solve2
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L30:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	f
	.bss
	.align 32
	.type	f, @object
	.size	f, 172800
f:
	.zero	172800
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 30
buf:
	.zero	30
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	tbl
	.align 32
	.type	tbl, @object
	.size	tbl, 160040
tbl:
	.zero	160040
	.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:

// AOJ 2013: Osaki
// 2017.11.1 bal4u@uu
// 2017.12.30

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct { int t; int a; } T;
T tbl[20005]; int sz; 
char buf[30], *p;
short f[86400];

int in()
{
	int n;
	n = *p++ & 0xf;
	n = 10*n + (*p++ & 0xf);
	p++;
	return n;
}

int cmp(T *a, T *b) { return a->t - b->t; }

int solve1(int n)
{
	int i, h, m, s, ans;
	T *tp;

	tp = tbl, sz = n << 1;
	while (n--) {
		fgets(p=buf, 30, stdin);
		h = in(), m = in(), s = in();
		tp->t = (((((h<<6)+m)<<6)+s)<<1)+1, tp->a = 1;
		tp++;
		
		h = in(), m = in(), s = in();
		tp->t = ((((h<<6)+m)<<6)+s)<<1, tp->a = -1;
		tp++;
	}

	qsort(tbl, sz, sizeof(T), cmp);
	
	ans = s = 0;
	for (i = 0; i < sz; i++) {
		s += tbl[i].a;
		if (s > ans) ans = s;
	}
	return ans;
}

int solve2(int n)
{
	int i, h, m, s, t, ans;

	memset(f, 0, sizeof(f));
	while (n--) {
		fgets(p=buf, 30, stdin);
		h = in(), m = in(), s = in();
		t = ((h*60)+m)*60+s, f[t]++;

		h = in(), m = in(), s = in();
		t = ((h*60)+m)*60+s, f[t]--;
	}

	ans = t = 0;
	for (ans = 0, i = 0; i < 86400; i++) {
		t += f[i];
		if (t > ans) ans = t;
	}
	return ans;
}

int main()
{
	int n;

	while (fgets(buf, 10, stdin) && *buf != '0') {
		n = atoi(buf);
		if (n <= 5000) printf("%d\n", solve1(n));
		else           printf("%d\n", solve2(n));
	}
	return 0;
}
3
05:47:15 04:45:90
12:12:59 12:13:00
16:30:20 21:18:53
6
00:00:00 03:00:00
01:00:00 03:00:00
02:00:00 03:00:00
03:00:00 04:00:00
03:00:00 05:00:00
03:00:00 06:00:00
0
 3
05:47:15 09:54:40
12:12:59 12:13:00
16:30:20 21:18:53
6
00:00:00 03:00:00
01:00:00 03:00:00
02:00:00 03:00:00
03:00:00 04:00:00
00:30:00 05:00:00
03:00:00 06:00:00
0
 3
05:67:15 09:54:40
12:12:59 12:13:00
02:03:61 21:18:53
6
00:00:00 03:00:00
01:00:00 03:00:00
02:00:00 03:00:00
03:00:00 04:00:00
00:30:00 05:00:00
03:00:00 06:00:00
0
 3
05:67:15 09:54:40
12:12:59 12:13:00
16:30:20 21:18:53
6
00:00:00 03:00:00
01:00:00 03:00:00
02:00:00 03:00:00
02:00:00 04:00:00
00:30:00 05:00:00
03:00:00 06:00:00
0
 3
05:57:15 09:54:40
12:12:59 12:13:00
16:30:20 21:18:53
6
00:00:00 00:00:30
01:00:00 00:00:30
02:00:00 03:00:00
03:00:00 04:00:00
00:30:00 05:00:00
00:01:30 00:00:70
0
 3
05:57:15 09:54:40
12:12:59 12:13:00
02:03:61 21:18:53
6
00:00:00 00:00:30
01:00:00 03:00:00
02:00:00 03:00:00
03:00:00 04:00:00
00:30:00 05:00:00
03:10:00 06:00:00
0
 3
05:57:15 19:54:40
12:12:59 12:13:00
16:30:20 21:18:53
6
00:00:00 00:00:30
01:00:00 00:00:30
02:00:00 03:00:00
03:00:00 04:00:00
00:30:00 05:00:00
00:01:30 00:00:70
0
 3
05:67:15 09:54:40
12:12:59 12:13:00
02:03:61 21:18:63
6
00:00:00 03:00:00
00:00:10 03:00:00
02:00:00 03:00:00
02:00:00 04:00:00
00:30:00 05:00:00
03:00:00 06:00:00
0
 3
05:67:15 09:54:41
11:12:59 00:31:21
15:40:20 21:18:53
0
00:00:00 03:00:00
00:00:10 00:00:30
20:00:00 03:00:00
03:00:00 04:00:00
00:30:00 05:00:00
00:10:30 06:00:00
0
 3
05:67:15 09:53:40
11:12:59 00:31:21
15:30:20 21:18:53
6
00:00:00 03:00:00
01:00:00 03:00:00
02:00:00 03:00:00
00:00:30 04:00:00
00:30:00 05:00:00
00:00:30 06:00:00
0

1
3
 1
4
 2
4
 1
5
 1
2
 2
3
 2
2
 2
5
 1
 1
6

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

```c
// AOJ 2013: Osaki
// 2017.11.1 bal4u@uu
// 2017.12.30

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct { int t; int a; } T;
T tbl[20005]; int sz; 
char buf[30], *p;
short f[86400];

int in()
{
	int n;
	n = *p++ & 0xf;
	n = 10*n + (*p++ & 0xf);
	p++;
	return n;
}

int cmp(T *a, T *b) { return a->t - b->t; }

int solve1(int n)
{
	int i, h, m, s, ans;
	T *tp;

	tp = tbl, sz = n << 1;
	while (n--) {
		fgets(p=buf, 30, stdin);
		h = in(), m = in(), s = in();
		tp->t = (((((h<<6)+m)<<6)+s)<<1)+1, tp->a = 1;
		tp++;
		
		h = in(), m = in(), s = in();
		tp->t = ((((h<<6)+m)<<6)+s)<<1, tp->a = -1;
		tp++;
	}

	qsort(tbl, sz, sizeof(T), cmp);
	
	ans = s = 0;
	for (i = 0; i < sz; i++) {
		s += tbl[i].a;
		if (s > ans) ans = s;
	}
	return ans;
}

int solve2(int n)
{
	int i, h, m, s, t, ans;

	memset(f, 0, sizeof(f));
	while (n--) {
		fgets(p=buf, 30, stdin);
		h = in(), m = in(), s = in();
		t = ((h*60)+m)*60+s, f[t]++;

		h = in(), m = in(), s = in();
		t = ((h*60)+m)*60+s, f[t]--;
	}

	ans = t = 0;
	for (ans = 0, i = 0; i < 86400; i++) {
		t += f[i];
		if (t > ans) ans = t;
	}
	return ans;
}

int main()
{
	int n;

	while (fgets(buf, 10, stdin) && *buf != '0') {
		n = atoi(buf);
		if (n <= 5000) printf("%d\n", solve1(n));
		else           printf("%d\n", solve2(n));
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 160040
tbl:
	.zero	160040
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 30
buf:
	.zero	30
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 172800
f:
	.zero	172800
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp, .-cmp
	.globl	solve1
	.type	solve1, @function
solve1:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	leaq	tbl(%rip), %rax
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, sz(%rip)
	jmp	.L6
.L7:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$30, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	-16(%rbp), %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	$1, 4(%rax)
	addq	$8, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	-16(%rbp), %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	$-1, 4(%rax)
	addq	$8, -8(%rbp)
.L6:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	sz(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L8
.L10:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L9
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
.L9:
	addl	$1, -28(%rbp)
.L8:
	movl	sz(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L10
	movl	-20(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	solve1, .-solve1
	.globl	solve2
	.type	solve2, @function
solve2:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	$172800, %edx
	movl	$0, %esi
	leaq	f(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	jmp	.L13
.L14:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$30, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	imull	$60, %eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	addl	$1, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movw	%cx, (%rdx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	imull	$60, %eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movw	%cx, (%rdx,%rax)
.L13:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L14
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L15
.L17:
	movl	-24(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	addl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L16
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
.L16:
	addl	$1, -24(%rbp)
.L15:
	cmpl	$86399, -24(%rbp)
	jle	.L17
	movl	-16(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	solve2, .-solve2
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L20
.L23:
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -4(%rbp)
	cmpl	$5000, -4(%rbp)
	jg	.L21
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	solve1
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	solve2
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L20:
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$10, %esi
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L22
	movzbl	buf(%rip), %eax
	cmpb	$48, %al
	jne	.L23
.L22:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 160040
tbl:
	.zero	160040
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 30
buf:
	.zero	30
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	f
	.align 32
	.type	f, @object
	.size	f, 172800
f:
	.zero	172800
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp, .-cmp
	.globl	solve1
	.type	solve1, @function
solve1:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	leaq	tbl(%rip), %rax
	movq	%rax, -8(%rbp)
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, sz(%rip)
	jmp	.L6
.L7:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$30, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	-16(%rbp), %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	$1, 4(%rax)
	addq	$8, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	-16(%rbp), %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	sall	$6, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	leal	(%rax,%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	$-1, 4(%rax)
	addq	$8, -8(%rbp)
.L6:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L7
	movl	sz(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L8
.L10:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L9
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
.L9:
	addl	$1, -28(%rbp)
.L8:
	movl	sz(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L10
	movl	-20(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	solve1, .-solve1
	.globl	solve2
	.type	solve2, @function
solve2:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	$172800, %edx
	movl	$0, %esi
	leaq	f(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	jmp	.L13
.L14:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$30, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	imull	$60, %eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	addl	$1, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movw	%cx, (%rdx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	imull	$60, %eax, %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	imull	$60, %eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movw	%cx, (%rdx,%rax)
.L13:
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -36(%rbp)
	testl	%eax, %eax
	jne	.L14
	movl	$0, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L15
.L17:
	movl	-24(%rbp), %eax
	cltq
	leaq	(%rax,%rax), %rdx
	leaq	f(%rip), %rax
	movzwl	(%rdx,%rax), %eax
	cwtl
	addl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L16
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
.L16:
	addl	$1, -24(%rbp)
.L15:
	cmpl	$86399, -24(%rbp)
	jle	.L17
	movl	-16(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	solve2, .-solve2
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	jmp	.L20
.L23:
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -4(%rbp)
	cmpl	$5000, -4(%rbp)
	jg	.L21
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	solve1
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L20
.L21:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	solve2
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L20:
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$10, %esi
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L22
	movzbl	buf(%rip), %eax
	cmpb	$48, %al
	jne	.L23
.L22:
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
