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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define LIMIT 100010
//union-find
int uniroot[LIMIT+10],unicnt[LIMIT+10];
void ufinit(int n){for(int i=0;i<n;i++){uniroot[i]=i;}}//unicnt[i]=1;}}
int root(int x){return uniroot[x]!=x?uniroot[x]=root(uniroot[x]):x;}
int same(int x,int y){return root(x)==root(y);}
void uni(int x,int y){if((x=root(x))==(y=root(y)))return;uniroot[x]=y;}//unicnt[y]+=unicnt[x];}

int a[100010];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	ufinit(n+1);
	rep(i,0,n){
		int t;
		scanf("%d",&t);
		a[t]=i+1;
	}
	rep(i,0,m){
		int p,q;
		scanf("%d%d",&p,&q);
		uni(p,q);
	}
	ll ans=0;
	rep(i,1,n+1)if(same(a[i],i))ans++;
	printf("%lld\n",ans);
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	uniroot
	.bss
	.align 32
	.type	uniroot, @object
	.size	uniroot, 400080
uniroot:
	.zero	400080
	.globl	unicnt
	.align 32
	.type	unicnt, @object
	.size	unicnt, 400080
unicnt:
	.zero	400080
	.text
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ufinit, .-ufinit
	.globl	root
	.type	root, @function
root:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	root
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L5:
	movl	-4(%rbp), %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	same, .-same
	.globl	uni
	.type	uni, @function
uni:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L13:
	nop
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	uni, .-uni
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	ufinit
	movq	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	leal	1(%rax), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addq	$1, -40(%rbp)
.L15:
	movl	-56(%rbp), %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jl	.L16
	movq	$0, -32(%rbp)
	jmp	.L17
.L18:
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uni
	addq	$1, -32(%rbp)
.L17:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jl	.L18
	movq	$0, -24(%rbp)
	movq	$1, -16(%rbp)
	jmp	.L19
.L21:
	movq	-16(%rbp), %rax
	movl	%eax, %ecx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	je	.L20
	addq	$1, -24(%rbp)
.L20:
	addq	$1, -16(%rbp)
.L19:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L21
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	ufinit
	.type	ufinit, @function
ufinit:
.LFB51:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L1
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L6
	movl	%edi, %edx
	leaq	uniroot(%rip), %rcx
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rcx), %rsi
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%edi, %eax
	andl	$-4, %eax
	testb	$3, %dil
	je	.L9
.L3:
	movslq	%eax, %rdx
	movl	%eax, (%rcx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L1
	movslq	%edx, %rsi
	addl	$2, %eax
	movl	%edx, (%rcx,%rsi,4)
	cmpl	%eax, %edi
	jle	.L1
	movslq	%eax, %rdx
	movl	%eax, (%rcx,%rdx,4)
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
.L6:
	xorl	%eax, %eax
	leaq	uniroot(%rip), %rcx
	jmp	.L3
	.cfi_endproc
.LFE51:
	.size	ufinit, .-ufinit
	.p2align 4
	.globl	root
	.type	root, @function
root:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	uniroot(%rip), %rbx
	movq	%rbp, %rax
	movl	(%rbx,%rbp,4), %edx
	cmpl	%ebp, %edx
	jne	.L17
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L12
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	jne	.L18
.L13:
	movl	%edx, (%rbx,%r12,4)
	movl	%edx, %eax
.L12:
	movl	%eax, (%rbx,%rbp,4)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %edi
	cmpl	%edi, %edx
	je	.L14
	call	root
	movl	%eax, (%rbx,%r14,4)
	movl	%eax, %edi
.L14:
	movl	%edi, (%rbx,%r13,4)
	movl	%edi, %edx
	jmp	.L13
	.cfi_endproc
.LFE52:
	.size	root, .-root
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	uniroot(%rip), %rcx
	movslq	%edi, %r8
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	(%rcx,%r8,4), %r9d
	cmpl	%r9d, %edi
	jne	.L37
	movslq	%esi, %r8
	movl	(%rcx,%r8,4), %eax
	cmpl	%eax, %esi
	jne	.L38
.L28:
	cmpl	%r9d, %eax
	sete	%al
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	movslq	%r9d, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %r9d
	je	.L21
	movslq	%eax, %r9
	movl	(%rcx,%r9,4), %edx
	cmpl	%edx, %eax
	jne	.L39
.L22:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L21:
	movl	%eax, (%rcx,%r8,4)
	movslq	%esi, %r8
	movl	%eax, %r9d
	movl	(%rcx,%r8,4), %eax
	cmpl	%eax, %esi
	je	.L28
.L38:
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	je	.L29
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L40
.L30:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
.L29:
	movl	%edx, (%rcx,%r8,4)
	movl	%edx, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L40:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L31
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L41
.L32:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L31:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L23
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L42
.L24:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L23:
	movl	%eax, (%rcx,%r9,4)
	movl	%eax, %edx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L42:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L25
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L26
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %edi
	cmpl	%edi, %edx
	je	.L27
	call	root
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edi
.L27:
	movl	%edi, (%rcx,%r12,4)
	movl	%edi, %edx
.L26:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L25:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L41:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L33
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %edi
	cmpl	%edi, %edx
	je	.L34
	movslq	%edi, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edi
	je	.L35
	movl	%eax, %edi
	call	root
	movl	%eax, (%rcx,%r13,4)
.L35:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edi
.L34:
	movl	%edi, (%rcx,%rbp,4)
	movl	%edi, %edx
.L33:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L32
	.cfi_endproc
.LFE53:
	.size	same, .-same
	.p2align 4
	.globl	uni
	.type	uni, @function
uni:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	uniroot(%rip), %rcx
	movslq	%edi, %r9
	movl	%esi, %r8d
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movslq	(%rcx,%r9,4), %rsi
	cmpl	%esi, %edi
	jne	.L62
	movslq	%r8d, %r9
	movl	(%rcx,%r9,4), %eax
	cmpl	%eax, %r8d
	jne	.L63
.L52:
	cmpl	%esi, %eax
	je	.L43
	movl	%eax, (%rcx,%rsi,4)
.L43:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L62:
	.cfi_restore_state
	movslq	%esi, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %esi
	je	.L45
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	jne	.L64
.L46:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L45:
	movl	%eax, (%rcx,%r9,4)
	movslq	%r8d, %r9
	movslq	%eax, %rsi
	movl	(%rcx,%r9,4), %eax
	cmpl	%eax, %r8d
	je	.L52
.L63:
	movslq	%eax, %r8
	movl	(%rcx,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L53
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L65
.L54:
	movl	%eax, (%rcx,%r8,4)
	movl	%eax, %edx
.L53:
	movl	%edx, (%rcx,%r9,4)
	movl	%edx, %eax
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L65:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L55
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L66
.L56:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L55:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L64:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L47
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L67
.L48:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L47:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L67:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L49
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L50
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %edi
	cmpl	%edi, %edx
	je	.L51
	call	root
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edi
.L51:
	movl	%edi, (%rcx,%r12,4)
	movl	%edi, %edx
.L50:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L49:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L66:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L57
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %edi
	cmpl	%edi, %edx
	je	.L58
	movslq	%edi, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edi
	je	.L59
	movl	%eax, %edi
	call	root
	movl	%eax, (%rcx,%r13,4)
.L59:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edi
.L58:
	movl	%edi, (%rcx,%rbp,4)
	movl	%edi, %edx
.L57:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L56
	.cfi_endproc
.LFE54:
	.size	uni, .-uni
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.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
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rdx
	leaq	40(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L69
	leal	1(%rcx), %esi
	cmpl	$2, %ecx
	jle	.L120
	movl	%esi, %edx
	leaq	uniroot(%rip), %rbx
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rbx), %rdi
	movq	%rbx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L71:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L71
	movl	%esi, %eax
	andl	$-4, %eax
	andl	$3, %esi
	je	.L118
.L70:
	movslq	%eax, %rdx
	movl	%eax, (%rbx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L73
	movslq	%edx, %rsi
	addl	$2, %eax
	movl	%edx, (%rbx,%rsi,4)
	cmpl	%eax, %ecx
	jl	.L118
	movslq	%eax, %rdx
	movl	%eax, (%rbx,%rdx,4)
.L118:
	xorl	%ebx, %ebx
	leaq	52(%rsp), %r12
	leaq	.LC3(%rip), %r14
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L74:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	52(%rsp), %rax
	leal	1(%rbx), %edx
	addq	$1, %rbx
	movl	%edx, 0(%rbp,%rax,4)
	movslq	40(%rsp), %rax
	cmpq	%rbx, %rax
	jg	.L74
.L69:
	movl	44(%rsp), %edx
	testl	%edx, %edx
	jle	.L75
	xorl	%ebp, %ebp
	leaq	52(%rsp), %r12
	leaq	48(%rsp), %r14
	leaq	uniroot(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L96:
	movq	%r14, %rsi
	movq	%r12, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %rsi
	movl	52(%rsp), %ecx
	movslq	(%rbx,%rsi,4), %r9
	cmpl	%r9d, %esi
	je	.L76
	movslq	%r9d, %r8
	movl	(%rbx,%r8,4), %eax
	cmpl	%eax, %r9d
	je	.L77
	movslq	%eax, %r9
	movl	(%rbx,%r9,4), %edx
	cmpl	%edx, %eax
	je	.L78
	movslq	%edx, %r10
	movl	(%rbx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L130
.L79:
	movl	%edx, (%rbx,%r9,4)
.L78:
	movl	%edx, (%rbx,%r8,4)
	movl	%edx, %eax
.L77:
	movl	%eax, (%rbx,%rsi,4)
	movslq	%eax, %r9
.L76:
	movslq	%ecx, %rsi
	movl	(%rbx,%rsi,4), %eax
	cmpl	%eax, %ecx
	je	.L85
	movslq	%eax, %rcx
	movl	(%rbx,%rcx,4), %edx
	cmpl	%edx, %eax
	je	.L86
	movslq	%edx, %r8
	movl	(%rbx,%r8,4), %eax
	cmpl	%eax, %edx
	je	.L87
	movslq	%eax, %r10
	movl	(%rbx,%r10,4), %edx
	cmpl	%edx, %eax
	jne	.L131
.L88:
	movl	%eax, (%rbx,%r8,4)
.L87:
	movl	%eax, (%rbx,%rcx,4)
	movl	%eax, %edx
.L86:
	movl	%edx, (%rbx,%rsi,4)
	movl	%edx, %eax
.L85:
	cmpl	%r9d, %eax
	je	.L94
	movl	%eax, (%rbx,%r9,4)
	movslq	44(%rsp), %rax
	addq	$1, %rbp
	cmpq	%rax, %rbp
	jl	.L96
.L75:
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L123
	movl	$1, %ecx
	xorl	%r9d, %r9d
	leaq	uniroot(%rip), %rbx
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L117:
	movslq	0(%rbp,%rcx,4), %r8
	movl	(%rbx,%r8,4), %esi
	cmpl	%esi, %r8d
	je	.L98
	movslq	%esi, %r10
	movl	(%rbx,%r10,4), %eax
	cmpl	%eax, %esi
	je	.L99
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %edx
	cmpl	%edx, %eax
	je	.L100
	movslq	%edx, %r11
	movl	(%rbx,%r11,4), %eax
	cmpl	%eax, %edx
	jne	.L132
.L101:
	movl	%edx, (%rbx,%rsi,4)
.L100:
	movl	%edx, (%rbx,%r10,4)
	movl	%edx, %eax
.L99:
	movl	%eax, (%rbx,%r8,4)
	movl	%eax, %esi
.L98:
	movl	(%rbx,%rcx,4), %eax
	cmpl	%ecx, %eax
	je	.L107
	movslq	%eax, %r8
	movl	(%rbx,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L108
	movslq	%edx, %r10
	movl	(%rbx,%r10,4), %eax
	cmpl	%eax, %edx
	je	.L109
	movslq	%eax, %r11
	movl	(%rbx,%r11,4), %edx
	cmpl	%edx, %eax
	jne	.L133
.L110:
	movl	%eax, (%rbx,%r10,4)
.L109:
	movl	%eax, (%rbx,%r8,4)
	movl	%eax, %edx
.L108:
	movl	%edx, (%rbx,%rcx,4)
	movl	%edx, %eax
.L107:
	cmpl	%esi, %eax
	sete	%al
	addq	$1, %rcx
	movzbl	%al, %eax
	addq	%rax, %r9
	movl	40(%rsp), %eax
	addl	$1, %eax
	cltq
	cmpq	%rcx, %rax
	jg	.L117
.L97:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L134
	addq	$72, %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
.L94:
	.cfi_restore_state
	movslq	44(%rsp), %rax
	addq	$1, %rbp
	cmpq	%rbp, %rax
	jg	.L96
	jmp	.L75
.L133:
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L111
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	jne	.L135
.L112:
	movl	%edx, (%rbx,%r12,4)
	movl	%edx, %eax
.L111:
	movl	%eax, (%rbx,%r11,4)
	jmp	.L110
.L132:
	movslq	%eax, %r12
	movl	(%rbx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L102
	movslq	%edx, %r13
	movl	(%rbx,%r13,4), %eax
	cmpl	%eax, %edx
	jne	.L136
.L103:
	movl	%eax, (%rbx,%r12,4)
	movl	%eax, %edx
.L102:
	movl	%edx, (%rbx,%r11,4)
	jmp	.L101
.L131:
	movslq	%edx, %r11
	movl	(%rbx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L89
	movslq	%eax, %r15
	movl	(%rbx,%r15,4), %edi
	cmpl	%edi, %eax
	jne	.L137
.L90:
	movl	%edi, (%rbx,%r11,4)
	movl	%edi, %eax
.L89:
	movl	%eax, (%rbx,%r10,4)
	jmp	.L88
.L130:
	movslq	%eax, %r11
	movl	(%rbx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L80
	movslq	%edx, %r15
	movl	(%rbx,%r15,4), %eax
	cmpl	%eax, %edx
	jne	.L138
.L81:
	movl	%eax, (%rbx,%r11,4)
	movl	%eax, %edx
.L80:
	movl	%edx, (%rbx,%r10,4)
	jmp	.L79
.L138:
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	cmpl	%edi, %eax
	je	.L82
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	movl	(%rbx,%rax,4), %eax
	cmpl	%eax, %edi
	jne	.L139
.L83:
	movl	%eax, (%rbx,%rdx,4)
	movl	%eax, %edi
.L82:
	movl	%edi, (%rbx,%r15,4)
	movl	%edi, %eax
	jmp	.L81
.L137:
	movslq	%edi, %rdx
	movl	(%rbx,%rdx,4), %eax
	cmpl	%eax, %edi
	je	.L91
	movslq	%eax, %rdi
	movq	%rdi, 8(%rsp)
	movl	(%rbx,%rdi,4), %edi
	cmpl	%edi, %eax
	jne	.L140
.L92:
	movl	%edi, (%rbx,%rdx,4)
	movl	%edi, %eax
.L91:
	movl	%eax, (%rbx,%r15,4)
	movl	%eax, %edi
	jmp	.L90
.L136:
	movslq	%eax, %r14
	movl	(%rbx,%r14,4), %edx
	cmpl	%edx, %eax
	je	.L104
	movslq	%edx, %r15
	movl	(%rbx,%r15,4), %eax
	cmpl	%eax, %edx
	jne	.L141
.L105:
	movl	%eax, (%rbx,%r14,4)
	movl	%eax, %edx
.L104:
	movl	%edx, (%rbx,%r13,4)
	movl	%edx, %eax
	jmp	.L103
.L135:
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %eax
	cmpl	%eax, %edx
	je	.L113
	movslq	%eax, %r15
	movl	(%rbx,%r15,4), %edi
	cmpl	%edi, %eax
	jne	.L142
.L114:
	movl	%edi, (%rbx,%r14,4)
	movl	%edi, %eax
.L113:
	movl	%eax, (%rbx,%r13,4)
	movl	%eax, %edx
	jmp	.L112
.L123:
	xorl	%r9d, %r9d
	jmp	.L97
.L120:
	xorl	%eax, %eax
	leaq	uniroot(%rip), %rbx
	jmp	.L70
.L73:
	testl	%ecx, %ecx
	jg	.L118
	jmp	.L69
.L142:
	movslq	%edi, %rdx
	movl	(%rbx,%rdx,4), %eax
	movq	%rdx, 8(%rsp)
	cmpl	%eax, %edi
	je	.L115
	movl	%eax, %edi
	call	root
	movq	8(%rsp), %rdx
	movl	%eax, (%rbx,%rdx,4)
.L115:
	movl	%eax, (%rbx,%r15,4)
	movl	%eax, %edi
	jmp	.L114
.L141:
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	movq	%rdx, 8(%rsp)
	cmpl	%edi, %eax
	je	.L106
	call	root
	movq	8(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, (%rbx,%rdx,4)
.L106:
	movl	%edi, (%rbx,%r15,4)
	movl	%edi, %eax
	jmp	.L105
.L140:
	movslq	%edi, %rax
	movq	%rax, 16(%rsp)
	movl	(%rbx,%rax,4), %eax
	cmpl	%eax, %edi
	je	.L93
	movl	%eax, %edi
	movq	%rdx, 24(%rsp)
	call	root
	movq	16(%rsp), %rdi
	movq	24(%rsp), %rdx
	movl	%eax, (%rbx,%rdi,4)
.L93:
	movq	8(%rsp), %rdi
	movl	%eax, (%rbx,%rdi,4)
	movl	%eax, %edi
	jmp	.L92
.L139:
	movslq	%eax, %rdi
	movq	%rdi, 16(%rsp)
	movl	(%rbx,%rdi,4), %edi
	cmpl	%edi, %eax
	je	.L84
	movq	%rdx, 24(%rsp)
	call	root
	movq	24(%rsp), %rdx
	movl	%eax, %edi
	movq	16(%rsp), %rax
	movl	%edi, (%rbx,%rax,4)
.L84:
	movq	8(%rsp), %rax
	movl	%edi, (%rbx,%rax,4)
	movl	%edi, %eax
	jmp	.L83
.L134:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.globl	unicnt
	.align 32
	.type	unicnt, @object
	.size	unicnt, 400080
unicnt:
	.zero	400080
	.globl	uniroot
	.align 32
	.type	uniroot, @object
	.size	uniroot, 400080
uniroot:
	.zero	400080
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB51:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L1
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L6
	movl	%edi, %edx
	leaq	uniroot(%rip), %rcx
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rcx), %rsi
	movq	%rcx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%edi, %eax
	andl	$-4, %eax
	testb	$3, %dil
	je	.L9
.L3:
	movslq	%eax, %rdx
	movl	%eax, (%rcx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L1
	movslq	%edx, %rsi
	addl	$2, %eax
	movl	%edx, (%rcx,%rsi,4)
	cmpl	%eax, %edi
	jle	.L1
	movslq	%eax, %rdx
	movl	%eax, (%rcx,%rdx,4)
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
.L6:
	xorl	%eax, %eax
	leaq	uniroot(%rip), %rcx
	jmp	.L3
	.cfi_endproc
.LFE51:
	.size	ufinit, .-ufinit
	.p2align 4
	.globl	root
	.type	root, @function
root:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movslq	%edi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	uniroot(%rip), %rbx
	movq	%rbp, %rax
	movl	(%rbx,%rbp,4), %edx
	cmpl	%ebp, %edx
	jne	.L17
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L12
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	jne	.L18
.L13:
	movl	%edx, (%rbx,%r12,4)
	movl	%edx, %eax
.L12:
	movl	%eax, (%rbx,%rbp,4)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %edi
	cmpl	%edi, %edx
	je	.L14
	call	root
	movl	%eax, (%rbx,%r14,4)
	movl	%eax, %edi
.L14:
	movl	%edi, (%rbx,%r13,4)
	movl	%edi, %edx
	jmp	.L13
	.cfi_endproc
.LFE52:
	.size	root, .-root
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	uniroot(%rip), %rcx
	movslq	%edi, %r8
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	(%rcx,%r8,4), %r9d
	cmpl	%r9d, %edi
	jne	.L37
	movslq	%esi, %r8
	movl	(%rcx,%r8,4), %eax
	cmpl	%eax, %esi
	jne	.L38
.L28:
	cmpl	%r9d, %eax
	sete	%al
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	movslq	%r9d, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %r9d
	je	.L21
	movslq	%eax, %r9
	movl	(%rcx,%r9,4), %edx
	cmpl	%edx, %eax
	jne	.L39
.L22:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L21:
	movl	%eax, (%rcx,%r8,4)
	movslq	%esi, %r8
	movl	%eax, %r9d
	movl	(%rcx,%r8,4), %eax
	cmpl	%eax, %esi
	je	.L28
.L38:
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	je	.L29
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L40
.L30:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
.L29:
	movl	%edx, (%rcx,%r8,4)
	movl	%edx, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L40:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L31
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L41
.L32:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L31:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L23
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L42
.L24:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L23:
	movl	%eax, (%rcx,%r9,4)
	movl	%eax, %edx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L42:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L25
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L26
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %edi
	cmpl	%edi, %edx
	je	.L27
	call	root
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edi
.L27:
	movl	%edi, (%rcx,%r12,4)
	movl	%edi, %edx
.L26:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L25:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L41:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L33
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %edi
	cmpl	%edi, %edx
	je	.L34
	movslq	%edi, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edi
	je	.L35
	movl	%eax, %edi
	call	root
	movl	%eax, (%rcx,%r13,4)
.L35:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edi
.L34:
	movl	%edi, (%rcx,%rbp,4)
	movl	%edi, %edx
.L33:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L32
	.cfi_endproc
.LFE53:
	.size	same, .-same
	.p2align 4
	.globl	uni
	.type	uni, @function
uni:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	uniroot(%rip), %rcx
	movslq	%edi, %r9
	movl	%esi, %r8d
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movslq	(%rcx,%r9,4), %rsi
	cmpl	%esi, %edi
	jne	.L62
	movslq	%r8d, %r9
	movl	(%rcx,%r9,4), %eax
	cmpl	%eax, %r8d
	jne	.L63
.L52:
	cmpl	%esi, %eax
	je	.L43
	movl	%eax, (%rcx,%rsi,4)
.L43:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L62:
	.cfi_restore_state
	movslq	%esi, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %esi
	je	.L45
	movslq	%eax, %rsi
	movl	(%rcx,%rsi,4), %edx
	cmpl	%edx, %eax
	jne	.L64
.L46:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
.L45:
	movl	%eax, (%rcx,%r9,4)
	movslq	%r8d, %r9
	movslq	%eax, %rsi
	movl	(%rcx,%r9,4), %eax
	cmpl	%eax, %r8d
	je	.L52
.L63:
	movslq	%eax, %r8
	movl	(%rcx,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L53
	movslq	%edx, %r10
	movl	(%rcx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L65
.L54:
	movl	%eax, (%rcx,%r8,4)
	movl	%eax, %edx
.L53:
	movl	%edx, (%rcx,%r9,4)
	movl	%edx, %eax
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L65:
	movslq	%eax, %r11
	movl	(%rcx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L55
	movslq	%edx, %rbx
	movl	(%rcx,%rbx,4), %eax
	cmpl	%eax, %edx
	jne	.L66
.L56:
	movl	%eax, (%rcx,%r11,4)
	movl	%eax, %edx
.L55:
	movl	%edx, (%rcx,%r10,4)
	movl	%edx, %eax
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L64:
	movslq	%edx, %r11
	movl	(%rcx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L47
	movslq	%eax, %rbx
	movl	(%rcx,%rbx,4), %edx
	cmpl	%edx, %eax
	jne	.L67
.L48:
	movl	%edx, (%rcx,%r11,4)
	movl	%edx, %eax
.L47:
	movl	%eax, (%rcx,%rsi,4)
	movl	%eax, %edx
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L67:
	movslq	%edx, %rbp
	movl	(%rcx,%rbp,4), %eax
	cmpl	%eax, %edx
	je	.L49
	movslq	%eax, %r12
	movl	(%rcx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L50
	movslq	%edx, %r13
	movl	(%rcx,%r13,4), %edi
	cmpl	%edi, %edx
	je	.L51
	call	root
	movl	%eax, (%rcx,%r13,4)
	movl	%eax, %edi
.L51:
	movl	%edi, (%rcx,%r12,4)
	movl	%edi, %edx
.L50:
	movl	%edx, (%rcx,%rbp,4)
	movl	%edx, %eax
.L49:
	movl	%eax, (%rcx,%rbx,4)
	movl	%eax, %edx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L66:
	movslq	%eax, %rbp
	movl	(%rcx,%rbp,4), %edx
	cmpl	%edx, %eax
	je	.L57
	movslq	%edx, %r12
	movl	(%rcx,%r12,4), %edi
	cmpl	%edi, %edx
	je	.L58
	movslq	%edi, %r13
	movl	(%rcx,%r13,4), %eax
	cmpl	%eax, %edi
	je	.L59
	movl	%eax, %edi
	call	root
	movl	%eax, (%rcx,%r13,4)
.L59:
	movl	%eax, (%rcx,%r12,4)
	movl	%eax, %edi
.L58:
	movl	%edi, (%rcx,%rbp,4)
	movl	%edi, %edx
.L57:
	movl	%edx, (%rcx,%rbx,4)
	movl	%edx, %eax
	jmp	.L56
	.cfi_endproc
.LFE54:
	.size	uni, .-uni
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.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
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rdx
	leaq	40(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L69
	leal	1(%rcx), %esi
	cmpl	$2, %ecx
	jle	.L120
	movl	%esi, %edx
	leaq	uniroot(%rip), %rbx
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC1(%rip), %xmm2
	shrl	$2, %edx
	leaq	16(%rbx), %rdi
	movq	%rbx, %rax
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L71:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L71
	movl	%esi, %eax
	andl	$-4, %eax
	andl	$3, %esi
	je	.L118
.L70:
	movslq	%eax, %rdx
	movl	%eax, (%rbx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L73
	movslq	%edx, %rsi
	addl	$2, %eax
	movl	%edx, (%rbx,%rsi,4)
	cmpl	%eax, %ecx
	jl	.L118
	movslq	%eax, %rdx
	movl	%eax, (%rbx,%rdx,4)
.L118:
	xorl	%ebx, %ebx
	leaq	52(%rsp), %r12
	leaq	.LC3(%rip), %r14
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L74:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	52(%rsp), %rax
	leal	1(%rbx), %edx
	addq	$1, %rbx
	movl	%edx, 0(%rbp,%rax,4)
	movslq	40(%rsp), %rax
	cmpq	%rbx, %rax
	jg	.L74
.L69:
	movl	44(%rsp), %edx
	testl	%edx, %edx
	jle	.L75
	xorl	%ebp, %ebp
	leaq	52(%rsp), %r12
	leaq	48(%rsp), %r14
	leaq	uniroot(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L96:
	movq	%r14, %rsi
	movq	%r12, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %rsi
	movl	52(%rsp), %ecx
	movslq	(%rbx,%rsi,4), %r9
	cmpl	%r9d, %esi
	je	.L76
	movslq	%r9d, %r8
	movl	(%rbx,%r8,4), %eax
	cmpl	%eax, %r9d
	je	.L77
	movslq	%eax, %r9
	movl	(%rbx,%r9,4), %edx
	cmpl	%edx, %eax
	je	.L78
	movslq	%edx, %r10
	movl	(%rbx,%r10,4), %eax
	cmpl	%eax, %edx
	jne	.L130
.L79:
	movl	%edx, (%rbx,%r9,4)
.L78:
	movl	%edx, (%rbx,%r8,4)
	movl	%edx, %eax
.L77:
	movl	%eax, (%rbx,%rsi,4)
	movslq	%eax, %r9
.L76:
	movslq	%ecx, %rsi
	movl	(%rbx,%rsi,4), %eax
	cmpl	%eax, %ecx
	je	.L85
	movslq	%eax, %rcx
	movl	(%rbx,%rcx,4), %edx
	cmpl	%edx, %eax
	je	.L86
	movslq	%edx, %r8
	movl	(%rbx,%r8,4), %eax
	cmpl	%eax, %edx
	je	.L87
	movslq	%eax, %r10
	movl	(%rbx,%r10,4), %edx
	cmpl	%edx, %eax
	jne	.L131
.L88:
	movl	%eax, (%rbx,%r8,4)
.L87:
	movl	%eax, (%rbx,%rcx,4)
	movl	%eax, %edx
.L86:
	movl	%edx, (%rbx,%rsi,4)
	movl	%edx, %eax
.L85:
	cmpl	%r9d, %eax
	je	.L94
	movl	%eax, (%rbx,%r9,4)
	movslq	44(%rsp), %rax
	addq	$1, %rbp
	cmpq	%rax, %rbp
	jl	.L96
.L75:
	movl	40(%rsp), %eax
	testl	%eax, %eax
	jle	.L123
	movl	$1, %ecx
	xorl	%r9d, %r9d
	leaq	uniroot(%rip), %rbx
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L117:
	movslq	0(%rbp,%rcx,4), %r8
	movl	(%rbx,%r8,4), %esi
	cmpl	%esi, %r8d
	je	.L98
	movslq	%esi, %r10
	movl	(%rbx,%r10,4), %eax
	cmpl	%eax, %esi
	je	.L99
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %edx
	cmpl	%edx, %eax
	je	.L100
	movslq	%edx, %r11
	movl	(%rbx,%r11,4), %eax
	cmpl	%eax, %edx
	jne	.L132
.L101:
	movl	%edx, (%rbx,%rsi,4)
.L100:
	movl	%edx, (%rbx,%r10,4)
	movl	%edx, %eax
.L99:
	movl	%eax, (%rbx,%r8,4)
	movl	%eax, %esi
.L98:
	movl	(%rbx,%rcx,4), %eax
	cmpl	%ecx, %eax
	je	.L107
	movslq	%eax, %r8
	movl	(%rbx,%r8,4), %edx
	cmpl	%edx, %eax
	je	.L108
	movslq	%edx, %r10
	movl	(%rbx,%r10,4), %eax
	cmpl	%eax, %edx
	je	.L109
	movslq	%eax, %r11
	movl	(%rbx,%r11,4), %edx
	cmpl	%edx, %eax
	jne	.L133
.L110:
	movl	%eax, (%rbx,%r10,4)
.L109:
	movl	%eax, (%rbx,%r8,4)
	movl	%eax, %edx
.L108:
	movl	%edx, (%rbx,%rcx,4)
	movl	%edx, %eax
.L107:
	cmpl	%esi, %eax
	sete	%al
	addq	$1, %rcx
	movzbl	%al, %eax
	addq	%rax, %r9
	movl	40(%rsp), %eax
	addl	$1, %eax
	cltq
	cmpq	%rcx, %rax
	jg	.L117
.L97:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L134
	addq	$72, %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
.L94:
	.cfi_restore_state
	movslq	44(%rsp), %rax
	addq	$1, %rbp
	cmpq	%rbp, %rax
	jg	.L96
	jmp	.L75
.L133:
	movslq	%edx, %r12
	movl	(%rbx,%r12,4), %eax
	cmpl	%eax, %edx
	je	.L111
	movslq	%eax, %r13
	movl	(%rbx,%r13,4), %edx
	cmpl	%edx, %eax
	jne	.L135
.L112:
	movl	%edx, (%rbx,%r12,4)
	movl	%edx, %eax
.L111:
	movl	%eax, (%rbx,%r11,4)
	jmp	.L110
.L132:
	movslq	%eax, %r12
	movl	(%rbx,%r12,4), %edx
	cmpl	%edx, %eax
	je	.L102
	movslq	%edx, %r13
	movl	(%rbx,%r13,4), %eax
	cmpl	%eax, %edx
	jne	.L136
.L103:
	movl	%eax, (%rbx,%r12,4)
	movl	%eax, %edx
.L102:
	movl	%edx, (%rbx,%r11,4)
	jmp	.L101
.L131:
	movslq	%edx, %r11
	movl	(%rbx,%r11,4), %eax
	cmpl	%eax, %edx
	je	.L89
	movslq	%eax, %r15
	movl	(%rbx,%r15,4), %edi
	cmpl	%edi, %eax
	jne	.L137
.L90:
	movl	%edi, (%rbx,%r11,4)
	movl	%edi, %eax
.L89:
	movl	%eax, (%rbx,%r10,4)
	jmp	.L88
.L130:
	movslq	%eax, %r11
	movl	(%rbx,%r11,4), %edx
	cmpl	%edx, %eax
	je	.L80
	movslq	%edx, %r15
	movl	(%rbx,%r15,4), %eax
	cmpl	%eax, %edx
	jne	.L138
.L81:
	movl	%eax, (%rbx,%r11,4)
	movl	%eax, %edx
.L80:
	movl	%edx, (%rbx,%r10,4)
	jmp	.L79
.L138:
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	cmpl	%edi, %eax
	je	.L82
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	movl	(%rbx,%rax,4), %eax
	cmpl	%eax, %edi
	jne	.L139
.L83:
	movl	%eax, (%rbx,%rdx,4)
	movl	%eax, %edi
.L82:
	movl	%edi, (%rbx,%r15,4)
	movl	%edi, %eax
	jmp	.L81
.L137:
	movslq	%edi, %rdx
	movl	(%rbx,%rdx,4), %eax
	cmpl	%eax, %edi
	je	.L91
	movslq	%eax, %rdi
	movq	%rdi, 8(%rsp)
	movl	(%rbx,%rdi,4), %edi
	cmpl	%edi, %eax
	jne	.L140
.L92:
	movl	%edi, (%rbx,%rdx,4)
	movl	%edi, %eax
.L91:
	movl	%eax, (%rbx,%r15,4)
	movl	%eax, %edi
	jmp	.L90
.L136:
	movslq	%eax, %r14
	movl	(%rbx,%r14,4), %edx
	cmpl	%edx, %eax
	je	.L104
	movslq	%edx, %r15
	movl	(%rbx,%r15,4), %eax
	cmpl	%eax, %edx
	jne	.L141
.L105:
	movl	%eax, (%rbx,%r14,4)
	movl	%eax, %edx
.L104:
	movl	%edx, (%rbx,%r13,4)
	movl	%edx, %eax
	jmp	.L103
.L135:
	movslq	%edx, %r14
	movl	(%rbx,%r14,4), %eax
	cmpl	%eax, %edx
	je	.L113
	movslq	%eax, %r15
	movl	(%rbx,%r15,4), %edi
	cmpl	%edi, %eax
	jne	.L142
.L114:
	movl	%edi, (%rbx,%r14,4)
	movl	%edi, %eax
.L113:
	movl	%eax, (%rbx,%r13,4)
	movl	%eax, %edx
	jmp	.L112
.L123:
	xorl	%r9d, %r9d
	jmp	.L97
.L120:
	xorl	%eax, %eax
	leaq	uniroot(%rip), %rbx
	jmp	.L70
.L73:
	testl	%ecx, %ecx
	jg	.L118
	jmp	.L69
.L142:
	movslq	%edi, %rdx
	movl	(%rbx,%rdx,4), %eax
	movq	%rdx, 8(%rsp)
	cmpl	%eax, %edi
	je	.L115
	movl	%eax, %edi
	call	root
	movq	8(%rsp), %rdx
	movl	%eax, (%rbx,%rdx,4)
.L115:
	movl	%eax, (%rbx,%r15,4)
	movl	%eax, %edi
	jmp	.L114
.L141:
	movslq	%eax, %rdx
	movl	(%rbx,%rdx,4), %edi
	movq	%rdx, 8(%rsp)
	cmpl	%edi, %eax
	je	.L106
	call	root
	movq	8(%rsp), %rdx
	movl	%eax, %edi
	movl	%eax, (%rbx,%rdx,4)
.L106:
	movl	%edi, (%rbx,%r15,4)
	movl	%edi, %eax
	jmp	.L105
.L140:
	movslq	%edi, %rax
	movq	%rax, 16(%rsp)
	movl	(%rbx,%rax,4), %eax
	cmpl	%eax, %edi
	je	.L93
	movl	%eax, %edi
	movq	%rdx, 24(%rsp)
	call	root
	movq	16(%rsp), %rdi
	movq	24(%rsp), %rdx
	movl	%eax, (%rbx,%rdi,4)
.L93:
	movq	8(%rsp), %rdi
	movl	%eax, (%rbx,%rdi,4)
	movl	%eax, %edi
	jmp	.L92
.L139:
	movslq	%eax, %rdi
	movq	%rdi, 16(%rsp)
	movl	(%rbx,%rdi,4), %edi
	cmpl	%edi, %eax
	je	.L84
	movq	%rdx, 24(%rsp)
	call	root
	movq	24(%rsp), %rdx
	movl	%eax, %edi
	movq	16(%rsp), %rax
	movl	%edi, (%rbx,%rax,4)
.L84:
	movq	8(%rsp), %rax
	movl	%edi, (%rbx,%rax,4)
	movl	%edi, %eax
	jmp	.L83
.L134:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.globl	unicnt
	.align 32
	.type	unicnt, @object
	.size	unicnt, 400080
unicnt:
	.zero	400080
	.globl	uniroot
	.align 32
	.type	uniroot, @object
	.size	uniroot, 400080
uniroot:
	.zero	400080
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	4
	.long	4
	.long	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define LIMIT 100010
//union-find
int uniroot[LIMIT+10],unicnt[LIMIT+10];
void ufinit(int n){for(int i=0;i<n;i++){uniroot[i]=i;}}//unicnt[i]=1;}}
int root(int x){return uniroot[x]!=x?uniroot[x]=root(uniroot[x]):x;}
int same(int x,int y){return root(x)==root(y);}
void uni(int x,int y){if((x=root(x))==(y=root(y)))return;uniroot[x]=y;}//unicnt[y]+=unicnt[x];}

int a[100010];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	ufinit(n+1);
	rep(i,0,n){
		int t;
		scanf("%d",&t);
		a[t]=i+1;
	}
	rep(i,0,m){
		int p,q;
		scanf("%d%d",&p,&q);
		uni(p,q);
	}
	ll ans=0;
	rep(i,1,n+1)if(same(a[i],i))ans++;
	printf("%lld\n",ans);
	return 0;
}


5 2
5 3 1 4 2
1 3
5 4

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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define LIMIT 100010
//union-find
int uniroot[LIMIT+10],unicnt[LIMIT+10];
void ufinit(int n){for(int i=0;i<n;i++){uniroot[i]=i;}}//unicnt[i]=1;}}
int root(int x){return uniroot[x]!=x?uniroot[x]=root(uniroot[x]):x;}
int same(int x,int y){return root(x)==root(y);}
void uni(int x,int y){if((x=root(x))==(y=root(y)))return;uniroot[x]=y;}//unicnt[y]+=unicnt[x];}

int a[100010];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	ufinit(n+1);
	rep(i,0,n){
		int t;
		scanf("%d",&t);
		a[t]=i+1;
	}
	rep(i,0,m){
		int p,q;
		scanf("%d%d",&p,&q);
		uni(p,q);
	}
	ll ans=0;
	rep(i,1,n+1)if(same(a[i],i))ans++;
	printf("%lld\n",ans);
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	uniroot
	.bss
	.align 32
	.type	uniroot, @object
	.size	uniroot, 400080
uniroot:
	.zero	400080
	.globl	unicnt
	.align 32
	.type	unicnt, @object
	.size	unicnt, 400080
unicnt:
	.zero	400080
	.text
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ufinit, .-ufinit
	.globl	root
	.type	root, @function
root:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	root
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L5:
	movl	-4(%rbp), %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	same, .-same
	.globl	uni
	.type	uni, @function
uni:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L13:
	nop
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	uni, .-uni
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	ufinit
	movq	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	leal	1(%rax), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addq	$1, -40(%rbp)
.L15:
	movl	-56(%rbp), %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jl	.L16
	movq	$0, -32(%rbp)
	jmp	.L17
.L18:
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uni
	addq	$1, -32(%rbp)
.L17:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jl	.L18
	movq	$0, -24(%rbp)
	movq	$1, -16(%rbp)
	jmp	.L19
.L21:
	movq	-16(%rbp), %rax
	movl	%eax, %ecx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	je	.L20
	addq	$1, -24(%rbp)
.L20:
	addq	$1, -16(%rbp)
.L19:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L21
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	uniroot
	.bss
	.align 32
	.type	uniroot, @object
	.size	uniroot, 400080
uniroot:
	.zero	400080
	.globl	unicnt
	.align 32
	.type	unicnt, @object
	.size	unicnt, 400080
unicnt:
	.zero	400080
	.text
	.globl	ufinit
	.type	ufinit, @function
ufinit:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L3
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	ufinit, .-ufinit
	.globl	root
	.type	root, @function
root:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	je	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %edi
	call	root
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	uniroot(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L7
.L5:
	movl	-4(%rbp), %eax
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	root, .-root
	.globl	same
	.type	same, @function
same:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	same, .-same
	.globl	uni
	.type	uni, @function
uni:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L13
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	uniroot(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L10
.L13:
	nop
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	uni, .-uni
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	ufinit
	movq	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	leal	1(%rax), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addq	$1, -40(%rbp)
.L15:
	movl	-56(%rbp), %eax
	cltq
	cmpq	%rax, -40(%rbp)
	jl	.L16
	movq	$0, -32(%rbp)
	jmp	.L17
.L18:
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	uni
	addq	$1, -32(%rbp)
.L17:
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jl	.L18
	movq	$0, -24(%rbp)
	movq	$1, -16(%rbp)
	jmp	.L19
.L21:
	movq	-16(%rbp), %rax
	movl	%eax, %ecx
	movq	-16(%rbp), %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	testl	%eax, %eax
	je	.L20
	addq	$1, -24(%rbp)
.L20:
	addq	$1, -16(%rbp)
.L19:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L21
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
