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

```c
/*
AizuOnline A2013
Title Osaki
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//Global data section
int N;
int  dept[10000];
int  arrv[10000];
//
int solve(int n)
{
        int i,j,c,mx;

        i=j=0;
        c=mx=0;

        while(i<N && j<N)
        {
                if(dept[i]==arrv[j])
                {
                        i++;j++;
                }
                else if(dept[i]<arrv[j])
                {
                        i++;
                        c++;
                        if(c>mx)
                                mx=c;
                }
                else
                {
                        j++;
                        c--;
                }
        }
        return(mx);
}
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

main()
{
        int i,ret,h,m,s;

        while(EOF!=scanf("%d",&N) && N) 
        {
                for(i=0;i<N;i++)
                {
                        scanf("%d:%d:%d ",&h,&m,&s);
                        dept[i]=3600*h+60*m+s;
                        scanf("%d:%d:%d",&h,&m,&s);
                        arrv[i]=3600*h+60*m+s;
                }
                qsort(dept,N,sizeof(int),compare_int);
                qsort(arrv,N,sizeof(int),compare_int);

                ret=solve(N);
                printf("%d\n",ret);
        }
                
return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	dept
	.align 32
	.type	dept, @object
	.size	dept, 40000
dept:
	.zero	40000
	.globl	arrv
	.align 32
	.type	arrv, @object
	.size	arrv, 40000
arrv:
	.zero	40000
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	arrv(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	addl	$1, -16(%rbp)
	addl	$1, -12(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	arrv(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	addl	$1, -16(%rbp)
	addl	$1, -8(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L4:
	addl	$1, -12(%rbp)
	subl	$1, -8(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L5
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
.L5:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	solve, .-solve
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.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	compare_int, .-compare_int
	.section	.rodata
.LC0:
	.string	"%d:%d:%d "
.LC1:
	.string	"%d:%d:%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L11
.L15:
	movl	$0, -16(%rbp)
	jmp	.L12
.L13:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-24(%rbp), %eax
	imull	$60, %eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-24(%rbp), %eax
	imull	$60, %eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arrv(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L12:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L13
	movl	N(%rip), %eax
	cltq
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	dept(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	cltq
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	arrv(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	solve
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L14
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L15
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	compare_int
	.type	compare_int, @function
compare_int:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	compare_int, .-compare_int
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB51:
	.cfi_startproc
	endbr64
	movl	N(%rip), %r8d
	xorl	%r9d, %r9d
	testl	%r8d, %r8d
	jle	.L3
	xorl	%esi, %esi
	xorl	%edx, %edx
	leaq	dept(%rip), %r11
	xorl	%eax, %eax
	leaq	arrv(%rip), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	jge	.L7
	addl	$1, %esi
	addl	$1, %eax
	cmpl	%esi, %r9d
	cmovl	%esi, %r9d
.L6:
	cmpl	%edx, %eax
	movl	%edx, %ecx
	cmovge	%eax, %ecx
	cmpl	%ecx, %r8d
	jle	.L3
.L8:
	movslq	%edx, %rdi
	movslq	%eax, %rcx
	movl	(%r10,%rdi,4), %edi
	cmpl	%edi, (%r11,%rcx,4)
	jne	.L5
	addl	$1, %eax
	addl	$1, %edx
	cmpl	%edx, %eax
	movl	%edx, %ecx
	cmovge	%eax, %ecx
	cmpl	%ecx, %r8d
	jg	.L8
.L3:
	movl	%r9d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %edx
	subl	$1, %esi
	jmp	.L6
	.cfi_endproc
.LFE51:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d:%d:%d "
.LC1:
	.string	"%d:%d:%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	dept(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	arrv(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movslq	N(%rip), %rsi
	testl	%esi, %esi
	je	.L19
	jle	.L20
	xorl	%r15d, %r15d
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	imull	$60, 16(%rsp), %edx
	movq	%r12, %rsi
	movq	%r14, %rcx
	imull	$3600, 12(%rsp), %eax
	leaq	.LC1(%rip), %rdi
	addl	%edx, %eax
	addl	20(%rsp), %eax
	movq	%r13, %rdx
	movl	%eax, 0(%rbp,%r15,4)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	imull	$3600, 12(%rsp), %eax
	movslq	N(%rip), %rsi
	imull	$60, 16(%rsp), %edx
	addl	%edx, %eax
	addl	20(%rsp), %eax
	movl	%eax, (%rbx,%r15,4)
	addq	$1, %r15
	cmpl	%r15d, %esi
	jg	.L13
.L20:
	leaq	compare_int(%rip), %r12
	movl	$4, %edx
	movq	%rbp, %rdi
	movq	%r12, %rcx
	call	qsort@PLT
	movq	%r12, %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	movslq	N(%rip), %rsi
	call	qsort@PLT
	movl	N(%rip), %r8d
	xorl	%r9d, %r9d
	testl	%r8d, %r8d
	jle	.L14
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	jge	.L17
	addl	$1, %esi
	addl	$1, %eax
	cmpl	%esi, %r9d
	cmovl	%esi, %r9d
.L16:
	cmpl	%edx, %eax
	movl	%edx, %ecx
	cmovge	%eax, %ecx
	cmpl	%ecx, %r8d
	jle	.L14
.L18:
	movslq	%edx, %rdi
	movslq	%eax, %rcx
	movl	(%rbx,%rdi,4), %edi
	cmpl	%edi, 0(%rbp,%rcx,4)
	jne	.L15
	addl	$1, %eax
	addl	$1, %edx
	cmpl	%edx, %eax
	movl	%edx, %ecx
	cmovge	%eax, %ecx
	cmpl	%ecx, %r8d
	jg	.L18
.L14:
	movl	%r9d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %edx
	subl	$1, %esi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L19:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$40, %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
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	arrv
	.bss
	.align 32
	.type	arrv, @object
	.size	arrv, 40000
arrv:
	.zero	40000
	.globl	dept
	.align 32
	.type	dept, @object
	.size	dept, 40000
dept:
	.zero	40000
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	compare_int
	.type	compare_int, @function
compare_int:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	compare_int, .-compare_int
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB51:
	.cfi_startproc
	endbr64
	movl	N(%rip), %r8d
	xorl	%r9d, %r9d
	testl	%r8d, %r8d
	jle	.L3
	xorl	%esi, %esi
	xorl	%edx, %edx
	leaq	dept(%rip), %r11
	xorl	%eax, %eax
	leaq	arrv(%rip), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	jge	.L7
	addl	$1, %esi
	addl	$1, %eax
	cmpl	%esi, %r9d
	cmovl	%esi, %r9d
.L6:
	cmpl	%edx, %eax
	movl	%edx, %ecx
	cmovge	%eax, %ecx
	cmpl	%ecx, %r8d
	jle	.L3
.L8:
	movslq	%edx, %rdi
	movslq	%eax, %rcx
	movl	(%r10,%rdi,4), %edi
	cmpl	%edi, (%r11,%rcx,4)
	jne	.L5
	addl	$1, %eax
	addl	$1, %edx
	cmpl	%edx, %eax
	movl	%edx, %ecx
	cmovge	%eax, %ecx
	cmpl	%ecx, %r8d
	jg	.L8
.L3:
	movl	%r9d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %edx
	subl	$1, %esi
	jmp	.L6
	.cfi_endproc
.LFE51:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d:%d:%d "
.LC1:
	.string	"%d:%d:%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	dept(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	arrv(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movslq	N(%rip), %rsi
	testl	%esi, %esi
	je	.L19
	jle	.L20
	xorl	%r15d, %r15d
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	imull	$60, 16(%rsp), %edx
	movq	%r12, %rsi
	movq	%r14, %rcx
	imull	$3600, 12(%rsp), %eax
	leaq	.LC1(%rip), %rdi
	addl	%edx, %eax
	addl	20(%rsp), %eax
	movq	%r13, %rdx
	movl	%eax, 0(%rbp,%r15,4)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	imull	$3600, 12(%rsp), %eax
	movslq	N(%rip), %rsi
	imull	$60, 16(%rsp), %edx
	addl	%edx, %eax
	addl	20(%rsp), %eax
	movl	%eax, (%rbx,%r15,4)
	addq	$1, %r15
	cmpl	%r15d, %esi
	jg	.L13
.L20:
	leaq	compare_int(%rip), %r12
	movl	$4, %edx
	movq	%rbp, %rdi
	movq	%r12, %rcx
	call	qsort@PLT
	movq	%r12, %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	movslq	N(%rip), %rsi
	call	qsort@PLT
	movl	N(%rip), %r8d
	xorl	%r9d, %r9d
	testl	%r8d, %r8d
	jle	.L14
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	jge	.L17
	addl	$1, %esi
	addl	$1, %eax
	cmpl	%esi, %r9d
	cmovl	%esi, %r9d
.L16:
	cmpl	%edx, %eax
	movl	%edx, %ecx
	cmovge	%eax, %ecx
	cmpl	%ecx, %r8d
	jle	.L14
.L18:
	movslq	%edx, %rdi
	movslq	%eax, %rcx
	movl	(%rbx,%rdi,4), %edi
	cmpl	%edi, 0(%rbp,%rcx,4)
	jne	.L15
	addl	$1, %eax
	addl	$1, %edx
	cmpl	%edx, %eax
	movl	%edx, %ecx
	cmovge	%eax, %ecx
	cmpl	%ecx, %r8d
	jg	.L18
.L14:
	movl	%r9d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %edx
	subl	$1, %esi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L19:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$40, %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
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	arrv
	.bss
	.align 32
	.type	arrv, @object
	.size	arrv, 40000
arrv:
	.zero	40000
	.globl	dept
	.align 32
	.type	dept, @object
	.size	dept, 40000
dept:
	.zero	40000
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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:

/*
AizuOnline A2013
Title Osaki
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//Global data section
int N;
int  dept[10000];
int  arrv[10000];
//
int solve(int n)
{
        int i,j,c,mx;

        i=j=0;
        c=mx=0;

        while(i<N && j<N)
        {
                if(dept[i]==arrv[j])
                {
                        i++;j++;
                }
                else if(dept[i]<arrv[j])
                {
                        i++;
                        c++;
                        if(c>mx)
                                mx=c;
                }
                else
                {
                        j++;
                        c--;
                }
        }
        return(mx);
}
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

main()
{
        int i,ret,h,m,s;

        while(EOF!=scanf("%d",&N) && N) 
        {
                for(i=0;i<N;i++)
                {
                        scanf("%d:%d:%d ",&h,&m,&s);
                        dept[i]=3600*h+60*m+s;
                        scanf("%d:%d:%d",&h,&m,&s);
                        arrv[i]=3600*h+60*m+s;
                }
                qsort(dept,N,sizeof(int),compare_int);
                qsort(arrv,N,sizeof(int),compare_int);

                ret=solve(N);
                printf("%d\n",ret);
        }
                
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
/*
AizuOnline A2013
Title Osaki
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//Global data section
int N;
int  dept[10000];
int  arrv[10000];
//
int solve(int n)
{
        int i,j,c,mx;

        i=j=0;
        c=mx=0;

        while(i<N && j<N)
        {
                if(dept[i]==arrv[j])
                {
                        i++;j++;
                }
                else if(dept[i]<arrv[j])
                {
                        i++;
                        c++;
                        if(c>mx)
                                mx=c;
                }
                else
                {
                        j++;
                        c--;
                }
        }
        return(mx);
}
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

main()
{
        int i,ret,h,m,s;

        while(EOF!=scanf("%d",&N) && N) 
        {
                for(i=0;i<N;i++)
                {
                        scanf("%d:%d:%d ",&h,&m,&s);
                        dept[i]=3600*h+60*m+s;
                        scanf("%d:%d:%d",&h,&m,&s);
                        arrv[i]=3600*h+60*m+s;
                }
                qsort(dept,N,sizeof(int),compare_int);
                qsort(arrv,N,sizeof(int),compare_int);

                ret=solve(N);
                printf("%d\n",ret);
        }
                
return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	dept
	.align 32
	.type	dept, @object
	.size	dept, 40000
dept:
	.zero	40000
	.globl	arrv
	.align 32
	.type	arrv, @object
	.size	arrv, 40000
arrv:
	.zero	40000
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	arrv(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	addl	$1, -16(%rbp)
	addl	$1, -12(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	arrv(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	addl	$1, -16(%rbp)
	addl	$1, -8(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L4:
	addl	$1, -12(%rbp)
	subl	$1, -8(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L5
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
.L5:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	solve, .-solve
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.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	compare_int, .-compare_int
	.section	.rodata
.LC0:
	.string	"%d:%d:%d "
.LC1:
	.string	"%d:%d:%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L11
.L15:
	movl	$0, -16(%rbp)
	jmp	.L12
.L13:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-24(%rbp), %eax
	imull	$60, %eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-24(%rbp), %eax
	imull	$60, %eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arrv(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L12:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L13
	movl	N(%rip), %eax
	cltq
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	dept(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	cltq
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	arrv(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	solve
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L14
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L15
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	dept
	.align 32
	.type	dept, @object
	.size	dept, 40000
dept:
	.zero	40000
	.globl	arrv
	.align 32
	.type	arrv, @object
	.size	arrv, 40000
arrv:
	.zero	40000
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	arrv(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L3
	addl	$1, -16(%rbp)
	addl	$1, -12(%rbp)
	jmp	.L2
.L3:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	arrv(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	addl	$1, -16(%rbp)
	addl	$1, -8(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L2
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L4:
	addl	$1, -12(%rbp)
	subl	$1, -8(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L5
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
.L5:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	solve, .-solve
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.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	compare_int, .-compare_int
	.section	.rodata
.LC0:
	.string	"%d:%d:%d "
.LC1:
	.string	"%d:%d:%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L11
.L15:
	movl	$0, -16(%rbp)
	jmp	.L12
.L13:
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-24(%rbp), %eax
	imull	$60, %eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	dept(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	leaq	-20(%rbp), %rcx
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-24(%rbp), %eax
	imull	$60, %eax, %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	arrv(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L12:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L13
	movl	N(%rip), %eax
	cltq
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	dept(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	cltq
	leaq	compare_int(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	arrv(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	movl	%eax, %edi
	call	solve
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L14
	movl	N(%rip), %eax
	testl	%eax, %eax
	jne	.L15
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
