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

```c
#include<stdio.h>
int main(){
int sum=0,ans=0,n,i,t,r,l,a[100010];
scanf("%d %d\n",&n,&t);
for(i=0;i<=t;i++){
a[i]=0;
}
for(i=0;i<n;i++){
scanf("%d %d\n",&l,&r);
a[l]++;
a[r]--;
}
for(i=0;i<=t;i++){
sum=sum+a[i];
if(sum>ans){
ans=sum;
}
}
printf("%d\n",ans);
return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2768, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400060(%rbp)
	movl	$0, -400056(%rbp)
	leaq	-400072(%rbp), %rdx
	leaq	-400076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400052(%rbp)
	jmp	.L2
.L3:
	movl	-400052(%rbp), %eax
	cltq
	movl	$0, -400048(%rbp,%rax,4)
	addl	$1, -400052(%rbp)
.L2:
	movl	-400072(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jle	.L3
	movl	$0, -400052(%rbp)
	jmp	.L4
.L5:
	leaq	-400068(%rbp), %rdx
	leaq	-400064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400064(%rbp), %eax
	movslq	%eax, %rdx
	movl	-400048(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	movl	-400068(%rbp), %eax
	movslq	%eax, %rdx
	movl	-400048(%rbp,%rdx,4), %edx
	subl	$1, %edx
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	addl	$1, -400052(%rbp)
.L4:
	movl	-400076(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jl	.L5
	movl	$0, -400052(%rbp)
	jmp	.L6
.L8:
	movl	-400052(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	addl	%eax, -400060(%rbp)
	movl	-400060(%rbp), %eax
	cmpl	-400056(%rbp), %eax
	jle	.L7
	movl	-400060(%rbp), %eax
	movl	%eax, -400056(%rbp)
.L7:
	addl	$1, -400052(%rbp)
.L6:
	movl	-400072(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jle	.L8
	movl	-400056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397352
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2760, %rsp
	.cfi_def_cfa_offset 400112
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 400056(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ebx
	testl	%ebx, %ebx
	js	.L2
	leaq	16(%rsp), %rcx
	movslq	%ebx, %rax
	xorl	%esi, %esi
	movq	%rcx, %rdi
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	%rax, %rcx
	movl	(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
.L3:
	xorl	%ebx, %ebx
	leaq	8(%rsp), %r13
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	addl	$1, %ebx
	addl	$1, 16(%rsp,%rax,4)
	movslq	8(%rsp), %rax
	subl	$1, 16(%rsp,%rax,4)
	cmpl	%ebx, (%rsp)
	jg	.L6
	movl	4(%rsp), %ebx
	leaq	16(%rsp), %rcx
	testl	%ebx, %ebx
	js	.L15
.L4:
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	addl	(%rcx,%rdx,4), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rdx
	cmpl	%edx, %ebx
	jge	.L8
.L5:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	400056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$400072, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %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
.L2:
	.cfi_restore_state
	cmpl	$0, (%rsp)
	jg	.L3
.L15:
	xorl	%r8d, %r8d
	jmp	.L5
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397352
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2760, %rsp
	.cfi_def_cfa_offset 400112
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	movq	%fs:40, %rax
	movq	%rax, 400056(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %ebx
	testl	%ebx, %ebx
	js	.L2
	leaq	16(%rsp), %rcx
	movslq	%ebx, %rax
	xorl	%esi, %esi
	movq	%rcx, %rdi
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	%rax, %rcx
	movl	(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
.L3:
	xorl	%ebx, %ebx
	leaq	8(%rsp), %r13
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	addl	$1, %ebx
	addl	$1, 16(%rsp,%rax,4)
	movslq	8(%rsp), %rax
	subl	$1, 16(%rsp,%rax,4)
	cmpl	%ebx, (%rsp)
	jg	.L6
	movl	4(%rsp), %ebx
	leaq	16(%rsp), %rcx
	testl	%ebx, %ebx
	js	.L15
.L4:
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	addl	(%rcx,%rdx,4), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rdx
	cmpl	%edx, %ebx
	jge	.L8
.L5:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	400056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$400072, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %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
.L2:
	.cfi_restore_state
	cmpl	$0, (%rsp)
	jg	.L3
.L15:
	xorl	%r8d, %r8d
	jmp	.L5
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
int main(){
int sum=0,ans=0,n,i,t,r,l,a[100010];
scanf("%d %d\n",&n,&t);
for(i=0;i<=t;i++){
a[i]=0;
}
for(i=0;i<n;i++){
scanf("%d %d\n",&l,&r);
a[l]++;
a[r]--;
}
for(i=0;i<=t;i++){
sum=sum+a[i];
if(sum>ans){
ans=sum;
}
}
printf("%d\n",ans);
return 0;
}

2 4
0 1
1 2
 2 10
0 2
1 3
2 6
3 8
4 10
5 10
 0 10
0 2
1 3
2 6
3 8
4 10
5 10
 6 16
0 2
1 3
2 6
3 8
4 10
5 10
 6 16
0 2
1 3
2 6
0 8
8 15
5 10
 2 2
0 0
1 2
 2 4
0 1
1 3
 0 10
0 2
1 3
2 8
3 8
4 10
5 10
 0 10
0 2
1 4
2 8
3 8
4 10
5 10
 0 10
0 2
1 4
2 8
3 8
3 10
5 10

1
 2
 0
 4
 3
 1
 1
 0
 0
 0

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

```c
#include<stdio.h>
int main(){
int sum=0,ans=0,n,i,t,r,l,a[100010];
scanf("%d %d\n",&n,&t);
for(i=0;i<=t;i++){
a[i]=0;
}
for(i=0;i<n;i++){
scanf("%d %d\n",&l,&r);
a[l]++;
a[r]--;
}
for(i=0;i<=t;i++){
sum=sum+a[i];
if(sum>ans){
ans=sum;
}
}
printf("%d\n",ans);
return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2768, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400060(%rbp)
	movl	$0, -400056(%rbp)
	leaq	-400072(%rbp), %rdx
	leaq	-400076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400052(%rbp)
	jmp	.L2
.L3:
	movl	-400052(%rbp), %eax
	cltq
	movl	$0, -400048(%rbp,%rax,4)
	addl	$1, -400052(%rbp)
.L2:
	movl	-400072(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jle	.L3
	movl	$0, -400052(%rbp)
	jmp	.L4
.L5:
	leaq	-400068(%rbp), %rdx
	leaq	-400064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400064(%rbp), %eax
	movslq	%eax, %rdx
	movl	-400048(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	movl	-400068(%rbp), %eax
	movslq	%eax, %rdx
	movl	-400048(%rbp,%rdx,4), %edx
	subl	$1, %edx
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	addl	$1, -400052(%rbp)
.L4:
	movl	-400076(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jl	.L5
	movl	$0, -400052(%rbp)
	jmp	.L6
.L8:
	movl	-400052(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	addl	%eax, -400060(%rbp)
	movl	-400060(%rbp), %eax
	cmpl	-400056(%rbp), %eax
	jle	.L7
	movl	-400060(%rbp), %eax
	movl	%eax, -400056(%rbp)
.L7:
	addl	$1, -400052(%rbp)
.L6:
	movl	-400072(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jle	.L8
	movl	-400056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2768, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400060(%rbp)
	movl	$0, -400056(%rbp)
	leaq	-400072(%rbp), %rdx
	leaq	-400076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400052(%rbp)
	jmp	.L2
.L3:
	movl	-400052(%rbp), %eax
	cltq
	movl	$0, -400048(%rbp,%rax,4)
	addl	$1, -400052(%rbp)
.L2:
	movl	-400072(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jle	.L3
	movl	$0, -400052(%rbp)
	jmp	.L4
.L5:
	leaq	-400068(%rbp), %rdx
	leaq	-400064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400064(%rbp), %eax
	movslq	%eax, %rdx
	movl	-400048(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	movl	-400068(%rbp), %eax
	movslq	%eax, %rdx
	movl	-400048(%rbp,%rdx,4), %edx
	subl	$1, %edx
	cltq
	movl	%edx, -400048(%rbp,%rax,4)
	addl	$1, -400052(%rbp)
.L4:
	movl	-400076(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jl	.L5
	movl	$0, -400052(%rbp)
	jmp	.L6
.L8:
	movl	-400052(%rbp), %eax
	cltq
	movl	-400048(%rbp,%rax,4), %eax
	addl	%eax, -400060(%rbp)
	movl	-400060(%rbp), %eax
	cmpl	-400056(%rbp), %eax
	jle	.L7
	movl	-400060(%rbp), %eax
	movl	%eax, -400056(%rbp)
.L7:
	addl	$1, -400052(%rbp)
.L6:
	movl	-400072(%rbp), %eax
	cmpl	%eax, -400052(%rbp)
	jle	.L8
	movl	-400056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
