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>
#include <string.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define MOD 1000000007
#define SIZE 100005
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
int a[200000];
int b[200001];
int cnt[200001];
int main(void)
{
	int n,m,sum=0,x,y,t1,t2,i,j;
	scanf("%d%d",&n,&m);
	FOR(i,0,n){
		scanf("%d",&a[i]);
		cnt[a[i]]++;
	}
	FOR(i,1,n+1){
		b[MAX(0,i-cnt[i])]++;
		b[i]--;
	}
	FOR(i,1,n) b[i]+=b[i-1];
	FOR(i,0,n) sum+=(b[i]==0);
	//FOR(i,0,n) printf("%d ",b[i]);
	FOR(i,0,m){
		scanf("%d %d",&x,&y);
		x--;
		t1=a[x]-cnt[a[x]];
		if(t1>=0&&--b[t1]==0) sum++;
		cnt[a[x]]--;
		
		t2=y-cnt[y]-1;
		if(t2>=0&&++b[t2]==1) sum--;
		cnt[y]++;
		
		printf("%d\n",sum);
		a[x]=y;
	}
	return 0;
}
```

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, -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
.LFE6:
	.size	comp, .-comp
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800004
b:
	.zero	800004
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 800004
cnt:
	.zero	800004
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L4
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	subl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L6:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L7
	movl	$1, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	movl	$0, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	addl	%eax, -24(%rbp)
	addl	$1, -20(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$0, -20(%rbp)
	jmp	.L12
.L15:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	js	.L13
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -24(%rbp)
.L13:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	js	.L14
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L14
	subl	$1, -24(%rbp)
.L14:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L12:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L15
	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
.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edi
	testl	%edi, %edi
	jle	.L4
	leaq	a(%rip), %rbx
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r12
	leaq	cnt(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movl	24(%rsp), %edi
	addq	$4, %rbx
	addl	$1, (%r14,%rax,4)
	cmpl	%ebp, %edi
	jg	.L5
	testl	%edi, %edi
	jle	.L22
	leal	1(%rdi), %r9d
	movl	$1, %edx
	leaq	b(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, %eax
	movl	$0, %r8d
	subl	(%r14,%rdx,4), %eax
	cmovs	%r8d, %eax
	cltq
	addl	$1, (%rsi,%rax,4)
	subl	$1, (%rsi,%rdx,4)
	addq	$1, %rdx
	cmpq	%r9, %rdx
	jne	.L7
	cmpl	$1, %edi
	jle	.L4
	leaq	4+b(%rip), %rax
	leal	-2(%rdi), %ecx
	movl	(%rsi), %edx
	leaq	4(%rax), %r8
	leaq	(%r8,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	addl	(%rax), %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%rcx, %rax
	jne	.L8
	testl	%edi, %edi
	movl	$1, %ecx
	cmovg	%edi, %ecx
	cmpl	$3, %edi
	jle	.L33
	leaq	b(%rip), %rax
	pxor	%xmm0, %xmm0
	movl	%ecx, %edx
	shrl	$2, %edx
	leaq	16(%rax), %r8
	movdqa	%xmm0, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r13d
	je	.L6
	movslq	%eax, %rdx
	cmpl	$1, (%rsi,%rdx,4)
	adcl	$0, %r13d
	addl	$1, %eax
	cmpl	%eax, %edi
	jle	.L6
.L18:
	movslq	%eax, %rdx
	cmpl	$1, (%rsi,%rdx,4)
	adcl	$0, %r13d
	addl	$1, %eax
	cmpl	%eax, %edi
	jle	.L6
	cltq
	cmpl	$1, (%rsi,%rax,4)
	adcl	$0, %r13d
.L6:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	32(%rsp), %rax
	xorl	%ebx, %ebx
	leaq	a(%rip), %r12
	movq	%rax, 8(%rsp)
	leaq	cnt(%rip), %r14
	leaq	36(%rsp), %r15
	leaq	b(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 32(%rsp)
	cltq
	movslq	(%r12,%rax,4), %rsi
	movl	(%r14,%rsi,4), %edx
	movq	%rsi, %rax
	subl	%edx, %eax
	js	.L15
	cltq
	movl	0(%rbp,%rax,4), %ecx
	leal	-1(%rcx), %edi
	movl	%edi, 0(%rbp,%rax,4)
	cmpl	$1, %edi
	adcl	$0, %r13d
.L15:
	subl	$1, %edx
	movl	%edx, (%r14,%rsi,4)
	movslq	36(%rsp), %rsi
	movl	(%r14,%rsi,4), %edx
	movq	%rsi, %rax
	subl	%edx, %eax
	subl	$1, %eax
	js	.L16
	cltq
	movl	0(%rbp,%rax,4), %ecx
	leal	1(%rcx), %edi
	movl	%edi, 0(%rbp,%rax,4)
	xorl	%eax, %eax
	cmpl	$1, %edi
	sete	%al
	subl	%eax, %r13d
.L16:
	addl	$1, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	movl	%edx, (%r14,%rsi,4)
	movl	%r13d, %edx
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movslq	32(%rsp), %rax
	movl	36(%rsp), %edx
	movl	%edx, (%r12,%rax,4)
	cmpl	%ebx, 28(%rsp)
	jg	.L17
.L14:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$56, %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
.L4:
	.cfi_restore_state
	subl	$1, %edi
	je	.L11
.L22:
	xorl	%r13d, %r13d
	jmp	.L6
.L33:
	xorl	%r13d, %r13d
	cmpl	$0, b(%rip)
	movl	$1, %eax
	sete	%r13b
	jmp	.L18
.L11:
	xorl	%r13d, %r13d
	cmpl	$0, b(%rip)
	sete	%r13b
	jmp	.L6
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 800004
cnt:
	.zero	800004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800004
b:
	.zero	800004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edi
	testl	%edi, %edi
	jle	.L4
	leaq	a(%rip), %rbx
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r12
	leaq	cnt(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movl	24(%rsp), %edi
	addq	$4, %rbx
	addl	$1, (%r14,%rax,4)
	cmpl	%ebp, %edi
	jg	.L5
	testl	%edi, %edi
	jle	.L22
	leal	1(%rdi), %r9d
	movl	$1, %edx
	leaq	b(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, %eax
	movl	$0, %r8d
	subl	(%r14,%rdx,4), %eax
	cmovs	%r8d, %eax
	cltq
	addl	$1, (%rsi,%rax,4)
	subl	$1, (%rsi,%rdx,4)
	addq	$1, %rdx
	cmpq	%r9, %rdx
	jne	.L7
	cmpl	$1, %edi
	jle	.L4
	leaq	4+b(%rip), %rax
	leal	-2(%rdi), %ecx
	movl	(%rsi), %edx
	leaq	4(%rax), %r8
	leaq	(%r8,%rcx,4), %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	addl	(%rax), %edx
	addq	$4, %rax
	movl	%edx, -4(%rax)
	cmpq	%rcx, %rax
	jne	.L8
	testl	%edi, %edi
	movl	$1, %ecx
	cmovg	%edi, %ecx
	cmpl	$3, %edi
	jle	.L33
	leaq	b(%rip), %rax
	pxor	%xmm0, %xmm0
	movl	%ecx, %edx
	shrl	$2, %edx
	leaq	16(%rax), %r8
	movdqa	%xmm0, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm2, %xmm1
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r13d
	je	.L6
	movslq	%eax, %rdx
	cmpl	$1, (%rsi,%rdx,4)
	adcl	$0, %r13d
	addl	$1, %eax
	cmpl	%eax, %edi
	jle	.L6
.L18:
	movslq	%eax, %rdx
	cmpl	$1, (%rsi,%rdx,4)
	adcl	$0, %r13d
	addl	$1, %eax
	cmpl	%eax, %edi
	jle	.L6
	cltq
	cmpl	$1, (%rsi,%rax,4)
	adcl	$0, %r13d
.L6:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L14
	leaq	32(%rsp), %rax
	xorl	%ebx, %ebx
	leaq	a(%rip), %r12
	movq	%rax, 8(%rsp)
	leaq	cnt(%rip), %r14
	leaq	36(%rsp), %r15
	leaq	b(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L17:
	movq	8(%rsp), %rsi
	movq	%r15, %rdx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 32(%rsp)
	cltq
	movslq	(%r12,%rax,4), %rsi
	movl	(%r14,%rsi,4), %edx
	movq	%rsi, %rax
	subl	%edx, %eax
	js	.L15
	cltq
	movl	0(%rbp,%rax,4), %ecx
	leal	-1(%rcx), %edi
	movl	%edi, 0(%rbp,%rax,4)
	cmpl	$1, %edi
	adcl	$0, %r13d
.L15:
	subl	$1, %edx
	movl	%edx, (%r14,%rsi,4)
	movslq	36(%rsp), %rsi
	movl	(%r14,%rsi,4), %edx
	movq	%rsi, %rax
	subl	%edx, %eax
	subl	$1, %eax
	js	.L16
	cltq
	movl	0(%rbp,%rax,4), %ecx
	leal	1(%rcx), %edi
	movl	%edi, 0(%rbp,%rax,4)
	xorl	%eax, %eax
	cmpl	$1, %edi
	sete	%al
	subl	%eax, %r13d
.L16:
	addl	$1, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	movl	%edx, (%r14,%rsi,4)
	movl	%r13d, %edx
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movslq	32(%rsp), %rax
	movl	36(%rsp), %edx
	movl	%edx, (%r12,%rax,4)
	cmpl	%ebx, 28(%rsp)
	jg	.L17
.L14:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$56, %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
.L4:
	.cfi_restore_state
	subl	$1, %edi
	je	.L11
.L22:
	xorl	%r13d, %r13d
	jmp	.L6
.L33:
	xorl	%r13d, %r13d
	cmpl	$0, b(%rip)
	movl	$1, %eax
	sete	%r13b
	jmp	.L18
.L11:
	xorl	%r13d, %r13d
	cmpl	$0, b(%rip)
	sete	%r13b
	jmp	.L6
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	cnt
	.bss
	.align 32
	.type	cnt, @object
	.size	cnt, 800004
cnt:
	.zero	800004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800004
b:
	.zero	800004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.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>
#include <string.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define MOD 1000000007
#define SIZE 100005
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
int a[200000];
int b[200001];
int cnt[200001];
int main(void)
{
	int n,m,sum=0,x,y,t1,t2,i,j;
	scanf("%d%d",&n,&m);
	FOR(i,0,n){
		scanf("%d",&a[i]);
		cnt[a[i]]++;
	}
	FOR(i,1,n+1){
		b[MAX(0,i-cnt[i])]++;
		b[i]--;
	}
	FOR(i,1,n) b[i]+=b[i-1];
	FOR(i,0,n) sum+=(b[i]==0);
	//FOR(i,0,n) printf("%d ",b[i]);
	FOR(i,0,m){
		scanf("%d %d",&x,&y);
		x--;
		t1=a[x]-cnt[a[x]];
		if(t1>=0&&--b[t1]==0) sum++;
		cnt[a[x]]--;
		
		t2=y-cnt[y]-1;
		if(t2>=0&&++b[t2]==1) sum--;
		cnt[y]++;
		
		printf("%d\n",sum);
		a[x]=y;
	}
	return 0;
}

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

1
1
1
 1
0
1
2
2
3
3
3
3
2
 1
0
0
 1
1
2
3
 1
0
1
2
2
3
3
4
4
3
 1
1
1
2
2
2
3
3
3
2
 1
0
1
2
2
3
2
2
3
2
 1
0
1
1
1
2
3
3
3
2
 1
0
1
2
2
2
3
3
3
2
 2
1
1
2
2
2
3
3
3
2

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>
#include <string.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ll long long
#define INF 100000000
#define MOD 1000000007
#define SIZE 100005
#define FOR(i,a,n) for(i=(a);i<(n);i++)
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
int a[200000];
int b[200001];
int cnt[200001];
int main(void)
{
	int n,m,sum=0,x,y,t1,t2,i,j;
	scanf("%d%d",&n,&m);
	FOR(i,0,n){
		scanf("%d",&a[i]);
		cnt[a[i]]++;
	}
	FOR(i,1,n+1){
		b[MAX(0,i-cnt[i])]++;
		b[i]--;
	}
	FOR(i,1,n) b[i]+=b[i-1];
	FOR(i,0,n) sum+=(b[i]==0);
	//FOR(i,0,n) printf("%d ",b[i]);
	FOR(i,0,m){
		scanf("%d %d",&x,&y);
		x--;
		t1=a[x]-cnt[a[x]];
		if(t1>=0&&--b[t1]==0) sum++;
		cnt[a[x]]--;
		
		t2=y-cnt[y]-1;
		if(t2>=0&&++b[t2]==1) sum--;
		cnt[y]++;
		
		printf("%d\n",sum);
		a[x]=y;
	}
	return 0;
}
```

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, -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
.LFE6:
	.size	comp, .-comp
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800004
b:
	.zero	800004
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 800004
cnt:
	.zero	800004
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L4
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	subl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L6:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L7
	movl	$1, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	movl	$0, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	addl	%eax, -24(%rbp)
	addl	$1, -20(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$0, -20(%rbp)
	jmp	.L12
.L15:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	js	.L13
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -24(%rbp)
.L13:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	js	.L14
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L14
	subl	$1, -24(%rbp)
.L14:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L12:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L15
	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
.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.
train
	.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, -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
.LFE6:
	.size	comp, .-comp
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800004
b:
	.zero	800004
	.globl	cnt
	.align 32
	.type	cnt, @object
	.size	cnt, 800004
cnt:
	.zero	800004
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d"
.LC3:
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L4
.L5:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L5
	movl	$1, -20(%rbp)
	jmp	.L6
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	subl	%edx, %eax
	movl	$0, %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L6:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L7
	movl	$1, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L8:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L9
	movl	$0, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	addl	%eax, -24(%rbp)
	addl	$1, -20(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movl	$0, -20(%rbp)
	jmp	.L12
.L15:
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -16(%rbp)
	cmpl	$0, -16(%rbp)
	js	.L13
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -24(%rbp)
.L13:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-28(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	cmpl	$0, -12(%rbp)
	js	.L14
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L14
	subl	$1, -24(%rbp)
.L14:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	cnt(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	cnt(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L12:
	movl	-36(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L15
	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
.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:
