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

```c
#include<stdio.h>
#include<stdlib.h>
typedef struct{
    int attr;
    int time;
}Data;
int comp(const void *a,const void *b){
    Data c = *(Data *)a;
    Data d = *(Data *)b;
    if(c.time<d.time) return -1;
    else if(c.time>d.time) return 1;
    else{
        if(c.attr==0) return 1;
        else return -1;
    }
    return 0;
}
int main(void){
    while(1){
        int n;
        scanf("%d",&n);
        if(n==0) break;
        getchar();
        Data d[20000];
        for(int i=0;i<n;i++){
            char a[10],b[10];
            scanf("%s%s",a,b);
            //printf("%s %s\n",a,b);
            int h,m,s;
            sscanf(&a[0],"%d",&h); sscanf(&a[3],"%d",&m); sscanf(&a[6],"%d",&s);
            //printf("%d %d %d\n",h,m,s);
            d[i*2].attr=0; d[i*2].time=3600*h+60*m+s;
            sscanf(&b[0],"%d",&h); sscanf(&b[3],"%d",&m); sscanf(&b[6],"%d",&s);
            d[i*2+1].attr=1; d[i*2+1].time=3600*h+60*m+s;
        }
        qsort(d,2*n,sizeof(Data),comp);
        int ans=0; int max=0;
        for(int i=0;i<2*n;i++){
            if(d[i].attr==0){
                ans++;
                if(max<ans) max=ans;
            }else{
                ans--;
            }
        }
        printf("%d\n",max);
    }
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	$-1, %eax
	jmp	.L6
.L2:
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$1, %eax
	jmp	.L6
.L4:
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	movl	$1, %eax
	jmp	.L6
.L5:
	movl	$-1, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$320, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L16:
	leaq	-160064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160064(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L18
.L8:
	call	getchar@PLT
	movl	$0, -160048(%rbp)
	jmp	.L10
.L11:
	leaq	-18(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160060(%rbp), %rdx
	leaq	-28(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160056(%rbp), %rax
	leaq	-28(%rbp), %rdx
	leaq	3(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160052(%rbp), %rax
	leaq	-28(%rbp), %rdx
	leaq	6(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$0, -160032(%rbp,%rax,8)
	movl	-160060(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-160056(%rbp), %eax
	imull	$60, %eax, %eax
	leal	(%rdx,%rax), %ecx
	movl	-160052(%rbp), %edx
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -160028(%rbp,%rax,8)
	leaq	-160060(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160056(%rbp), %rax
	leaq	-18(%rbp), %rdx
	leaq	3(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160052(%rbp), %rax
	leaq	-18(%rbp), %rdx
	leaq	6(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	movl	$1, -160032(%rbp,%rax,8)
	movl	-160060(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-160056(%rbp), %eax
	imull	$60, %eax, %eax
	leal	(%rdx,%rax), %ecx
	movl	-160052(%rbp), %edx
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -160028(%rbp,%rax,8)
	addl	$1, -160048(%rbp)
.L10:
	movl	-160064(%rbp), %eax
	cmpl	%eax, -160048(%rbp)
	jl	.L11
	movl	-160064(%rbp), %eax
	addl	%eax, %eax
	movslq	%eax, %rsi
	leaq	-160032(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -160044(%rbp)
	movl	$0, -160040(%rbp)
	movl	$0, -160036(%rbp)
	jmp	.L12
.L15:
	movl	-160036(%rbp), %eax
	cltq
	movl	-160032(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -160044(%rbp)
	movl	-160040(%rbp), %eax
	cmpl	-160044(%rbp), %eax
	jge	.L14
	movl	-160044(%rbp), %eax
	movl	%eax, -160040(%rbp)
	jmp	.L14
.L13:
	subl	$1, -160044(%rbp)
.L14:
	addl	$1, -160036(%rbp)
.L12:
	movl	-160064(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -160036(%rbp)
	jl	.L15
	movl	-160040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L16
.L18:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %ecx
	movl	4(%rsi), %edx
	movl	$-1, %eax
	cmpl	%edx, %ecx
	jl	.L1
	movl	(%rdi), %esi
	testl	%esi, %esi
	je	.L6
	cmpl	%edx, %ecx
	jle	.L1
.L6:
	movl	$1, %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-159744(%rsp), %r11
	.cfi_def_cfa 11, 159800
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$376, %rsp
	.cfi_def_cfa_offset 160176
	leaq	.LC0(%rip), %r15
	movq	%fs:40, %rax
	movq	%rax, 160104(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rax
	movq	%rax, 56(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	56(%rsp), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	64(%rsp), %edi
	testl	%edi, %edi
	je	.L10
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	64(%rsp), %esi
	testl	%esi, %esi
	jle	.L11
	leaq	160087(%rsp), %rax
	movq	48(%rsp), %rbx
	xorl	%r8d, %r8d
	leaq	160094(%rsp), %r14
	movq	%rax, 16(%rsp)
	leaq	76(%rsp), %rax
	leaq	68(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	160090(%rsp), %rax
	leaq	72(%rsp), %rbp
	movq	%rax, 24(%rsp)
	leaq	160097(%rsp), %rax
	leaq	160084(%rsp), %r13
	movq	%rax, 32(%rsp)
	leaq	160100(%rsp), %rax
	movq	%rax, 40(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r14, %rdx
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movl	%r8d, 12(%rsp)
	addq	$16, %rbx
	call	__isoc99_scanf@PLT
	movq	%r12, %rdx
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movq	16(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%r15, %rsi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movq	(%rsp), %rdx
	movq	24(%rsp), %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	imull	$60, 72(%rsp), %edx
	movq	%r15, %rsi
	movq	%r14, %rdi
	imull	$3600, 68(%rsp), %eax
	movl	$0, -16(%rbx)
	addl	%edx, %eax
	addl	76(%rsp), %eax
	movq	%r12, %rdx
	movl	%eax, -12(%rbx)
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movq	32(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%r15, %rsi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movq	(%rsp), %rdx
	movq	40(%rsp), %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	imull	$60, 72(%rsp), %edx
	movl	12(%rsp), %r8d
	movl	$1, -8(%rbx)
	imull	$3600, 68(%rsp), %eax
	movl	64(%rsp), %esi
	addl	$1, %r8d
	addl	%edx, %eax
	addl	76(%rsp), %eax
	movl	%eax, -4(%rbx)
	cmpl	%r8d, %esi
	jg	.L12
.L11:
	movq	48(%rsp), %rbx
	addl	%esi, %esi
	movl	$8, %edx
	leaq	comp(%rip), %rcx
	movslq	%esi, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	64(%rsp), %eax
	leal	(%rax,%rax), %edx
	testl	%edx, %edx
	jle	.L19
	subl	$1, %edx
	movq	%rbx, %rax
	xorl	%r8d, %r8d
	leaq	88(%rsp,%rdx,8), %rcx
	xorl	%edx, %edx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	addq	$8, %rax
	cmpq	%rax, %rcx
	je	.L13
.L16:
	movl	(%rax), %esi
	testl	%esi, %esi
	je	.L24
	addq	$8, %rax
	subl	$1, %edx
	cmpq	%rax, %rcx
	jne	.L16
.L13:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L10:
	movq	160104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$160120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L13
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %ecx
	movl	4(%rsi), %edx
	movl	$-1, %eax
	cmpl	%edx, %ecx
	jl	.L1
	movl	(%rdi), %esi
	testl	%esi, %esi
	je	.L6
	cmpl	%edx, %ecx
	jle	.L1
.L6:
	movl	$1, %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-159744(%rsp), %r11
	.cfi_def_cfa 11, 159800
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$376, %rsp
	.cfi_def_cfa_offset 160176
	leaq	.LC0(%rip), %r15
	movq	%fs:40, %rax
	movq	%rax, 160104(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %rax
	movq	%rax, 56(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 48(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	56(%rsp), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	64(%rsp), %edi
	testl	%edi, %edi
	je	.L10
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	64(%rsp), %esi
	testl	%esi, %esi
	jle	.L11
	leaq	160087(%rsp), %rax
	movq	48(%rsp), %rbx
	xorl	%r8d, %r8d
	leaq	160094(%rsp), %r14
	movq	%rax, 16(%rsp)
	leaq	76(%rsp), %rax
	leaq	68(%rsp), %r12
	movq	%rax, (%rsp)
	leaq	160090(%rsp), %rax
	leaq	72(%rsp), %rbp
	movq	%rax, 24(%rsp)
	leaq	160097(%rsp), %rax
	leaq	160084(%rsp), %r13
	movq	%rax, 32(%rsp)
	leaq	160100(%rsp), %rax
	movq	%rax, 40(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r14, %rdx
	movq	%r13, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movl	%r8d, 12(%rsp)
	addq	$16, %rbx
	call	__isoc99_scanf@PLT
	movq	%r12, %rdx
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movq	16(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%r15, %rsi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movq	(%rsp), %rdx
	movq	24(%rsp), %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	imull	$60, 72(%rsp), %edx
	movq	%r15, %rsi
	movq	%r14, %rdi
	imull	$3600, 68(%rsp), %eax
	movl	$0, -16(%rbx)
	addl	%edx, %eax
	addl	76(%rsp), %eax
	movq	%r12, %rdx
	movl	%eax, -12(%rbx)
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movq	32(%rsp), %rdi
	movq	%rbp, %rdx
	movq	%r15, %rsi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movq	(%rsp), %rdx
	movq	40(%rsp), %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	imull	$60, 72(%rsp), %edx
	movl	12(%rsp), %r8d
	movl	$1, -8(%rbx)
	imull	$3600, 68(%rsp), %eax
	movl	64(%rsp), %esi
	addl	$1, %r8d
	addl	%edx, %eax
	addl	76(%rsp), %eax
	movl	%eax, -4(%rbx)
	cmpl	%r8d, %esi
	jg	.L12
.L11:
	movq	48(%rsp), %rbx
	addl	%esi, %esi
	movl	$8, %edx
	leaq	comp(%rip), %rcx
	movslq	%esi, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	64(%rsp), %eax
	leal	(%rax,%rax), %edx
	testl	%edx, %edx
	jle	.L19
	subl	$1, %edx
	movq	%rbx, %rax
	xorl	%r8d, %r8d
	leaq	88(%rsp,%rdx,8), %rcx
	xorl	%edx, %edx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	addq	$8, %rax
	cmpq	%rax, %rcx
	je	.L13
.L16:
	movl	(%rax), %esi
	testl	%esi, %esi
	je	.L24
	addq	$8, %rax
	subl	$1, %edx
	cmpq	%rax, %rcx
	jne	.L16
.L13:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L10:
	movq	160104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$160120, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L13
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<stdlib.h>
typedef struct{
    int attr;
    int time;
}Data;
int comp(const void *a,const void *b){
    Data c = *(Data *)a;
    Data d = *(Data *)b;
    if(c.time<d.time) return -1;
    else if(c.time>d.time) return 1;
    else{
        if(c.attr==0) return 1;
        else return -1;
    }
    return 0;
}
int main(void){
    while(1){
        int n;
        scanf("%d",&n);
        if(n==0) break;
        getchar();
        Data d[20000];
        for(int i=0;i<n;i++){
            char a[10],b[10];
            scanf("%s%s",a,b);
            //printf("%s %s\n",a,b);
            int h,m,s;
            sscanf(&a[0],"%d",&h); sscanf(&a[3],"%d",&m); sscanf(&a[6],"%d",&s);
            //printf("%d %d %d\n",h,m,s);
            d[i*2].attr=0; d[i*2].time=3600*h+60*m+s;
            sscanf(&b[0],"%d",&h); sscanf(&b[3],"%d",&m); sscanf(&b[6],"%d",&s);
            d[i*2+1].attr=1; d[i*2+1].time=3600*h+60*m+s;
        }
        qsort(d,2*n,sizeof(Data),comp);
        int ans=0; int max=0;
        for(int i=0;i<2*n;i++){
            if(d[i].attr==0){
                ans++;
                if(max<ans) max=ans;
            }else{
                ans--;
            }
        }
        printf("%d\n",max);
    }
}


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
#include<stdio.h>
#include<stdlib.h>
typedef struct{
    int attr;
    int time;
}Data;
int comp(const void *a,const void *b){
    Data c = *(Data *)a;
    Data d = *(Data *)b;
    if(c.time<d.time) return -1;
    else if(c.time>d.time) return 1;
    else{
        if(c.attr==0) return 1;
        else return -1;
    }
    return 0;
}
int main(void){
    while(1){
        int n;
        scanf("%d",&n);
        if(n==0) break;
        getchar();
        Data d[20000];
        for(int i=0;i<n;i++){
            char a[10],b[10];
            scanf("%s%s",a,b);
            //printf("%s %s\n",a,b);
            int h,m,s;
            sscanf(&a[0],"%d",&h); sscanf(&a[3],"%d",&m); sscanf(&a[6],"%d",&s);
            //printf("%d %d %d\n",h,m,s);
            d[i*2].attr=0; d[i*2].time=3600*h+60*m+s;
            sscanf(&b[0],"%d",&h); sscanf(&b[3],"%d",&m); sscanf(&b[6],"%d",&s);
            d[i*2+1].attr=1; d[i*2+1].time=3600*h+60*m+s;
        }
        qsort(d,2*n,sizeof(Data),comp);
        int ans=0; int max=0;
        for(int i=0;i<2*n;i++){
            if(d[i].attr==0){
                ans++;
                if(max<ans) max=ans;
            }else{
                ans--;
            }
        }
        printf("%d\n",max);
    }
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	$-1, %eax
	jmp	.L6
.L2:
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$1, %eax
	jmp	.L6
.L4:
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	movl	$1, %eax
	jmp	.L6
.L5:
	movl	$-1, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$320, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L16:
	leaq	-160064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160064(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L18
.L8:
	call	getchar@PLT
	movl	$0, -160048(%rbp)
	jmp	.L10
.L11:
	leaq	-18(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160060(%rbp), %rdx
	leaq	-28(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160056(%rbp), %rax
	leaq	-28(%rbp), %rdx
	leaq	3(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160052(%rbp), %rax
	leaq	-28(%rbp), %rdx
	leaq	6(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$0, -160032(%rbp,%rax,8)
	movl	-160060(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-160056(%rbp), %eax
	imull	$60, %eax, %eax
	leal	(%rdx,%rax), %ecx
	movl	-160052(%rbp), %edx
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -160028(%rbp,%rax,8)
	leaq	-160060(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160056(%rbp), %rax
	leaq	-18(%rbp), %rdx
	leaq	3(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160052(%rbp), %rax
	leaq	-18(%rbp), %rdx
	leaq	6(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	movl	$1, -160032(%rbp,%rax,8)
	movl	-160060(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-160056(%rbp), %eax
	imull	$60, %eax, %eax
	leal	(%rdx,%rax), %ecx
	movl	-160052(%rbp), %edx
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -160028(%rbp,%rax,8)
	addl	$1, -160048(%rbp)
.L10:
	movl	-160064(%rbp), %eax
	cmpl	%eax, -160048(%rbp)
	jl	.L11
	movl	-160064(%rbp), %eax
	addl	%eax, %eax
	movslq	%eax, %rsi
	leaq	-160032(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -160044(%rbp)
	movl	$0, -160040(%rbp)
	movl	$0, -160036(%rbp)
	jmp	.L12
.L15:
	movl	-160036(%rbp), %eax
	cltq
	movl	-160032(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -160044(%rbp)
	movl	-160040(%rbp), %eax
	cmpl	-160044(%rbp), %eax
	jge	.L14
	movl	-160044(%rbp), %eax
	movl	%eax, -160040(%rbp)
	jmp	.L14
.L13:
	subl	$1, -160044(%rbp)
.L14:
	addl	$1, -160036(%rbp)
.L12:
	movl	-160064(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -160036(%rbp)
	jl	.L15
	movl	-160040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L16
.L18:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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.
val
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	$-1, %eax
	jmp	.L6
.L2:
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$1, %eax
	jmp	.L6
.L4:
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	movl	$1, %eax
	jmp	.L6
.L5:
	movl	$-1, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-159744(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$320, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L16:
	leaq	-160064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160064(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L18
.L8:
	call	getchar@PLT
	movl	$0, -160048(%rbp)
	jmp	.L10
.L11:
	leaq	-18(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-160060(%rbp), %rdx
	leaq	-28(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160056(%rbp), %rax
	leaq	-28(%rbp), %rdx
	leaq	3(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160052(%rbp), %rax
	leaq	-28(%rbp), %rdx
	leaq	6(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	cltq
	movl	$0, -160032(%rbp,%rax,8)
	movl	-160060(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-160056(%rbp), %eax
	imull	$60, %eax, %eax
	leal	(%rdx,%rax), %ecx
	movl	-160052(%rbp), %edx
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -160028(%rbp,%rax,8)
	leaq	-160060(%rbp), %rdx
	leaq	-18(%rbp), %rax
	leaq	.LC0(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160056(%rbp), %rax
	leaq	-18(%rbp), %rdx
	leaq	3(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	leaq	-160052(%rbp), %rax
	leaq	-18(%rbp), %rdx
	leaq	6(%rdx), %rcx
	movq	%rax, %rdx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rsi
	movq	%rcx, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	cltq
	movl	$1, -160032(%rbp,%rax,8)
	movl	-160060(%rbp), %eax
	imull	$3600, %eax, %edx
	movl	-160056(%rbp), %eax
	imull	$60, %eax, %eax
	leal	(%rdx,%rax), %ecx
	movl	-160052(%rbp), %edx
	movl	-160048(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -160028(%rbp,%rax,8)
	addl	$1, -160048(%rbp)
.L10:
	movl	-160064(%rbp), %eax
	cmpl	%eax, -160048(%rbp)
	jl	.L11
	movl	-160064(%rbp), %eax
	addl	%eax, %eax
	movslq	%eax, %rsi
	leaq	-160032(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -160044(%rbp)
	movl	$0, -160040(%rbp)
	movl	$0, -160036(%rbp)
	jmp	.L12
.L15:
	movl	-160036(%rbp), %eax
	cltq
	movl	-160032(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -160044(%rbp)
	movl	-160040(%rbp), %eax
	cmpl	-160044(%rbp), %eax
	jge	.L14
	movl	-160044(%rbp), %eax
	movl	%eax, -160040(%rbp)
	jmp	.L14
.L13:
	subl	$1, -160044(%rbp)
.L14:
	addl	$1, -160036(%rbp)
.L12:
	movl	-160064(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -160036(%rbp)
	jl	.L15
	movl	-160040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L16
.L18:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
