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>
#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 3, stdin), p1 == p2) ? EOF : *p1++)
char buf[3], *p1 = buf, *p2 = buf;
inline int read() {
    char c = getchar(); int x = 0, f = 1;
    while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
    while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * f;
}
int ab[100001];
int main(int argc, char *argv[])
{
	int i;
	int n = read(),m = read();
	for (i = 0; i < m; ++i) {
		int a = read(),b = read();
		if (*(ab+b) < a) {*(ab+b) = a;}
	}
	int ans = 0;
	int k = 1;
	for (i = 1; i <= n; ++i) {
		if (k <= *(ab+i)) {
			k = i;
			++ans;
		}
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	buf
	.bss
	.type	buf, @object
	.size	buf, 3
buf:
	.zero	3
	.globl	p1
	.section	.data.rel.local,"aw"
	.align 8
	.type	p1, @object
	.size	p1, 8
p1:
	.quad	buf
	.globl	p2
	.align 8
	.type	p2, @object
	.size	p2, 8
p2:
	.quad	buf
	.globl	ab
	.bss
	.align 32
	.type	ab, @object
	.size	ab, 400004
ab:
	.zero	400004
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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)
	movq	%rsi, -48(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -12(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L4:
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
.L3:
	addl	$1, -28(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L4
	movl	$0, -24(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L5
.L7:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jg	.L6
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -24(%rbp)
.L6:
	addl	$1, -28(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L7
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	buf(%rip), %r15
	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	ab(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	read@PLT
	movl	%eax, 12(%rsp)
	xorl	%eax, %eax
	call	read@PLT
	movl	%eax, 8(%rsp)
	testl	%eax, %eax
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L2:
	movq	p1(%rip), %rdx
	movq	p2(%rip), %rax
	cmpq	%rax, %rdx
	je	.L53
.L5:
	leaq	1(%rdx), %rcx
	movq	%rcx, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %esi
	cmpb	$9, %sil
	jbe	.L54
.L6:
	movl	$1, %r14d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	1(%rdx), %rcx
	movq	%rcx, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %esi
	cmpb	$9, %sil
	jbe	.L7
.L11:
	cmpb	$45, %dl
	movl	$-1, %edx
	cmove	%edx, %r14d
	movq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rax
	jne	.L9
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L9
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$1, %r14d
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%r13d, %r13d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rdx), %rcx
	movq	%rcx, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %esi
	cmpb	$9, %sil
	ja	.L55
.L14:
	leal	0(%r13,%r13,4), %esi
	leal	-48(%rdx,%rsi,2), %r13d
	movq	%rcx, %rdx
	cmpq	%rax, %rcx
	jne	.L12
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L12
	imull	%r13d, %r14d
.L30:
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rcx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rcx, %rax
	je	.L36
	.p2align 4,,10
	.p2align 3
.L15:
	leaq	1(%rcx), %rsi
	movq	%rsi, p1(%rip)
	movsbl	(%rcx), %edx
	leal	-48(%rdx), %ecx
	cmpb	$9, %cl
	jbe	.L56
.L16:
	movl	$1, %r12d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	leaq	1(%rdx), %rsi
	movq	%rsi, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %ecx
	cmpb	$9, %cl
	jbe	.L17
.L21:
	cmpb	$45, %dl
	movl	$-1, %edx
	cmove	%edx, %r12d
	movq	%rsi, %rdx
.L20:
	cmpq	%rax, %rdx
	jne	.L19
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L19
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L56:
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%r13d, %r13d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	leaq	1(%rdx), %rsi
	movq	%rsi, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %ecx
	cmpb	$9, %cl
	ja	.L26
.L25:
	leal	0(%r13,%r13,4), %ecx
	leal	-48(%rdx,%rcx,2), %r13d
	movq	%rsi, %rdx
	cmpq	%rax, %rsi
	jne	.L22
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L22
.L26:
	movl	%r12d, %r9d
	imull	%r13d, %r9d
	movslq	%r9d, %r9
	leaq	0(%rbp,%r9,4), %rax
	cmpl	%r14d, (%rax)
	jge	.L24
	movl	%r14d, (%rax)
.L24:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jne	.L2
.L27:
	movl	12(%rsp), %eax
	xorl	%r8d, %r8d
	testl	%eax, %eax
	jle	.L4
	movl	12(%rsp), %eax
	movl	$1, %edx
	xorl	%r8d, %r8d
	leaq	ab(%rip), %rbp
	leal	1(%rax), %ecx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	%edx, 0(%rbp,%rax,4)
	jl	.L28
	addl	$1, %r8d
	movl	%eax, %edx
.L28:
	addq	$1, %rax
	cmpq	%rax, %rcx
	jne	.L29
.L4:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$24, %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
.L55:
	.cfi_restore_state
	imull	%r13d, %r14d
	cmpq	%rax, %rcx
	jne	.L15
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L53:
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L5
	movq	%rax, %rcx
	movl	$-1, %edx
	jmp	.L6
.L36:
	movq	%rax, %rsi
	movl	$-1, %edx
	jmp	.L16
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	ab
	.bss
	.align 32
	.type	ab, @object
	.size	ab, 400004
ab:
	.zero	400004
	.globl	p2
	.section	.data.rel.local,"aw"
	.align 8
	.type	p2, @object
	.size	p2, 8
p2:
	.quad	buf
	.globl	p1
	.align 8
	.type	p1, @object
	.size	p1, 8
p1:
	.quad	buf
	.globl	buf
	.bss
	.type	buf, @object
	.size	buf, 3
buf:
	.zero	3
	.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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	buf(%rip), %r15
	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	ab(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	read@PLT
	movl	%eax, 12(%rsp)
	xorl	%eax, %eax
	call	read@PLT
	movl	%eax, 8(%rsp)
	testl	%eax, %eax
	jle	.L27
	.p2align 4,,10
	.p2align 3
.L2:
	movq	p1(%rip), %rdx
	movq	p2(%rip), %rax
	cmpq	%rax, %rdx
	je	.L53
.L5:
	leaq	1(%rdx), %rcx
	movq	%rcx, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %esi
	cmpb	$9, %sil
	jbe	.L54
.L6:
	movl	$1, %r14d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	1(%rdx), %rcx
	movq	%rcx, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %esi
	cmpb	$9, %sil
	jbe	.L7
.L11:
	cmpb	$45, %dl
	movl	$-1, %edx
	cmove	%edx, %r14d
	movq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rax
	jne	.L9
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L9
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$1, %r14d
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%r13d, %r13d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rdx), %rcx
	movq	%rcx, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %esi
	cmpb	$9, %sil
	ja	.L55
.L14:
	leal	0(%r13,%r13,4), %esi
	leal	-48(%rdx,%rsi,2), %r13d
	movq	%rcx, %rdx
	cmpq	%rax, %rcx
	jne	.L12
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L12
	imull	%r13d, %r14d
.L30:
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rcx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rcx, %rax
	je	.L36
	.p2align 4,,10
	.p2align 3
.L15:
	leaq	1(%rcx), %rsi
	movq	%rsi, p1(%rip)
	movsbl	(%rcx), %edx
	leal	-48(%rdx), %ecx
	cmpb	$9, %cl
	jbe	.L56
.L16:
	movl	$1, %r12d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	leaq	1(%rdx), %rsi
	movq	%rsi, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %ecx
	cmpb	$9, %cl
	jbe	.L17
.L21:
	cmpb	$45, %dl
	movl	$-1, %edx
	cmove	%edx, %r12d
	movq	%rsi, %rdx
.L20:
	cmpq	%rax, %rdx
	jne	.L19
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L19
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L56:
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L17:
	xorl	%r13d, %r13d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	leaq	1(%rdx), %rsi
	movq	%rsi, p1(%rip)
	movsbl	(%rdx), %edx
	leal	-48(%rdx), %ecx
	cmpb	$9, %cl
	ja	.L26
.L25:
	leal	0(%r13,%r13,4), %ecx
	leal	-48(%rdx,%rcx,2), %r13d
	movq	%rsi, %rdx
	cmpq	%rax, %rsi
	jne	.L22
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L22
.L26:
	movl	%r12d, %r9d
	imull	%r13d, %r9d
	movslq	%r9d, %r9
	leaq	0(%rbp,%r9,4), %rax
	cmpl	%r14d, (%rax)
	jge	.L24
	movl	%r14d, (%rax)
.L24:
	addl	$1, %ebx
	cmpl	%ebx, 8(%rsp)
	jne	.L2
.L27:
	movl	12(%rsp), %eax
	xorl	%r8d, %r8d
	testl	%eax, %eax
	jle	.L4
	movl	12(%rsp), %eax
	movl	$1, %edx
	xorl	%r8d, %r8d
	leaq	ab(%rip), %rbp
	leal	1(%rax), %ecx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	%edx, 0(%rbp,%rax,4)
	jl	.L28
	addl	$1, %r8d
	movl	%eax, %edx
.L28:
	addq	$1, %rax
	cmpq	%rax, %rcx
	jne	.L29
.L4:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$24, %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
.L55:
	.cfi_restore_state
	imull	%r13d, %r14d
	cmpq	%rax, %rcx
	jne	.L15
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L53:
	movq	stdin(%rip), %rcx
	movl	$3, %edx
	movl	$1, %esi
	movq	%r15, %rdi
	movq	%r15, p1(%rip)
	call	fread@PLT
	movq	p1(%rip), %rdx
	addq	%r15, %rax
	movq	%rax, p2(%rip)
	cmpq	%rdx, %rax
	jne	.L5
	movq	%rax, %rcx
	movl	$-1, %edx
	jmp	.L6
.L36:
	movq	%rax, %rsi
	movl	$-1, %edx
	jmp	.L16
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	ab
	.bss
	.align 32
	.type	ab, @object
	.size	ab, 400004
ab:
	.zero	400004
	.globl	p2
	.section	.data.rel.local,"aw"
	.align 8
	.type	p2, @object
	.size	p2, 8
p2:
	.quad	buf
	.globl	p1
	.align 8
	.type	p1, @object
	.size	p1, 8
p1:
	.quad	buf
	.globl	buf
	.bss
	.type	buf, @object
	.size	buf, 3
buf:
	.zero	3
	.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>
#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 3, stdin), p1 == p2) ? EOF : *p1++)
char buf[3], *p1 = buf, *p2 = buf;
inline int read() {
    char c = getchar(); int x = 0, f = 1;
    while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
    while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * f;
}
int ab[100001];
int main(int argc, char *argv[])
{
	int i;
	int n = read(),m = read();
	for (i = 0; i < m; ++i) {
		int a = read(),b = read();
		if (*(ab+b) < a) {*(ab+b) = a;}
	}
	int ans = 0;
	int k = 1;
	for (i = 1; i <= n; ++i) {
		if (k <= *(ab+i)) {
			k = i;
			++ans;
		}
	}
	printf("%d\n", ans);
	return 0;
}

5 2
2 4
2 5
 9 5
1 8
2 7
3 5
4 6
7 5
 5 10
1 2
1 4
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
 5 10
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 5
3 5
4 5
 5 2
1 5
2 5
 5 1
1 5
2 5
 5 1
0 5
2 5
 5 2
1 4
2 8
 9 5
2 8
2 7
3 5
4 6
7 5
 5 2
0 5
2 5

0
 0
 0
 0
 0
 0
 0
 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>
#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 3, stdin), p1 == p2) ? EOF : *p1++)
char buf[3], *p1 = buf, *p2 = buf;
inline int read() {
    char c = getchar(); int x = 0, f = 1;
    while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
    while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * f;
}
int ab[100001];
int main(int argc, char *argv[])
{
	int i;
	int n = read(),m = read();
	for (i = 0; i < m; ++i) {
		int a = read(),b = read();
		if (*(ab+b) < a) {*(ab+b) = a;}
	}
	int ans = 0;
	int k = 1;
	for (i = 1; i <= n; ++i) {
		if (k <= *(ab+i)) {
			k = i;
			++ans;
		}
	}
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	buf
	.bss
	.type	buf, @object
	.size	buf, 3
buf:
	.zero	3
	.globl	p1
	.section	.data.rel.local,"aw"
	.align 8
	.type	p1, @object
	.size	p1, 8
p1:
	.quad	buf
	.globl	p2
	.align 8
	.type	p2, @object
	.size	p2, 8
p2:
	.quad	buf
	.globl	ab
	.bss
	.align 32
	.type	ab, @object
	.size	ab, 400004
ab:
	.zero	400004
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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)
	movq	%rsi, -48(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -12(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L4:
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
.L3:
	addl	$1, -28(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L4
	movl	$0, -24(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L5
.L7:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jg	.L6
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -24(%rbp)
.L6:
	addl	$1, -28(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L7
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	buf
	.bss
	.type	buf, @object
	.size	buf, 3
buf:
	.zero	3
	.globl	p1
	.section	.data.rel.local,"aw"
	.align 8
	.type	p1, @object
	.size	p1, 8
p1:
	.quad	buf
	.globl	p2
	.align 8
	.type	p2, @object
	.size	p2, 8
p2:
	.quad	buf
	.globl	ab
	.bss
	.align 32
	.type	ab, @object
	.size	ab, 400004
ab:
	.zero	400004
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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)
	movq	%rsi, -48(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -12(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L4:
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -8(%rbp)
	movl	$0, %eax
	call	read@PLT
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
.L3:
	addl	$1, -28(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L4
	movl	$0, -24(%rbp)
	movl	$1, -20(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L5
.L7:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ab(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jg	.L6
	movl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -24(%rbp)
.L6:
	addl	$1, -28(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L7
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
