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 <math.h>

#define lli long long int
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define true 1
#define false 0

typedef struct unionFind{
	int par;
	int vertext;
	int count;
} unionFind;


unionFind* uf_make(int n){
	unionFind* u;
	u = calloc(sizeof(unionFind),n);
	return u;
}

void uf_init(int n,unionFind *u){
	int i;
	for(i = 0;i < n;i++){
		u[i].par = i;
		u[i].count = 1;
	}
}
int uf_root(int x,unionFind *u){
	if(u[x].par == x){
		return x;
	}else{
		return u[x].par = uf_root(u[x].par,u);
	}
}
int uf_same(int x,int y,unionFind *u){
	return uf_root(x,u) == uf_root(y,u);
}
void uf_unite(int x,int y,unionFind *u){
	x = uf_root(x,u);
	y = uf_root(y,u);
	if(x == y)return;
	u[x].par = y;
	u[y].count += u[x].count;
}
int uf_count(int x,unionFind *u){
	x = uf_root(x,u);
	return u[x].count;
}

typedef struct rode {
	lli cost;
	int i;
	int j;
	int p;
} rode;

int comp(const void *a,const void *b){
	return ((rode*)a)->cost - ((rode*)b)->cost;
}

int main(void){
	int i,j;
	int w,h;
	int wh;
	rode *pq;
	lli ans = 0;
	scanf("%d%d",&w,&h);
	pq = calloc(sizeof(rode),w+h);
	for(i=0;i<w;i++){
		scanf("%lld",&pq[i].cost);
		pq[i].i = i;
		pq[i].p = true;
	}
	for(j=0;j<h;i++,j++){
		scanf("%lld",&pq[i].cost);
		pq[i].j = j;
	}
	qsort(pq,w+h,sizeof(rode),comp);
	wh = w+h;
	w++;
	h++;
	for(i=0;i<wh;i++){
		if(pq[i].p){
			ans += pq[i].cost * h;
			w--;
		}else{
			ans += pq[i].cost * w;
			h--;
		}
	}
	printf("%lld\n", ans);


	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	uf_make
	.type	uf_make, @function
uf_make:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$12, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	uf_make, .-uf_make
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB7:
	.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)
	movq	%rsi, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, 8(%rax)
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	uf_init, .-uf_init
	.globl	uf_root
	.type	uf_root, @function
uf_root:
.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)
	movq	%rsi, -32(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L7
	movl	-20(%rbp), %eax
	jmp	.L8
.L7:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	leaq	(%rcx,%rax), %rbx
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	movl	%edx, %edi
	call	uf_root
	movl	%eax, (%rbx)
	movl	(%rbx), %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	uf_root, .-uf_root
	.globl	uf_same
	.type	uf_same, @function
uf_same:
.LFB9:
	.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)
	movq	%rdx, -32(%rbp)
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, %ebx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	uf_same, .-uf_same
	.globl	uf_unite
	.type	uf_unite, @function
uf_unite:
.LFB10:
	.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)
	movq	%rdx, -16(%rbp)
	movq	-16(%rbp), %rdx
	movl	-4(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -4(%rbp)
	movq	-16(%rbp), %rdx
	movl	-8(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L14
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %esi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	leal	(%rsi,%rcx), %edx
	movl	%edx, 8(%rax)
	jmp	.L11
.L14:
	nop
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	uf_unite, .-uf_unite
	.globl	uf_count
	.type	uf_count, @function
uf_count:
.LFB11:
	.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)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movl	-4(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	uf_count, .-uf_count
	.globl	comp
	.type	comp, @function
comp:
.LFB12:
	.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
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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
	movq	$0, -24(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	movq	%rax, %rsi
	movl	$24, %edi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L20
.L21:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, 8(%rdx)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, 16(%rax)
	addl	$1, -36(%rbp)
.L20:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L21
	movl	$0, -32(%rbp)
	jmp	.L22
.L23:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	movl	%eax, 12(%rdx)
	addl	$1, -36(%rbp)
	addl	$1, -32(%rbp)
.L22:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L23
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rsi
	movq	-16(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$24, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L24
.L27:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	16(%rax), %eax
	testl	%eax, %eax
	je	.L25
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -24(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L26
.L25:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -24(%rbp)
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -40(%rbp)
.L26:
	addl	$1, -36(%rbp)
.L24:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L27
	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	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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:
.LFB45:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE45:
	.size	comp, .-comp
	.p2align 4
	.globl	uf_make
	.type	uf_make, @function
uf_make:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	%edi, %rsi
	movl	$12, %edi
	jmp	calloc@PLT
	.cfi_endproc
.LFE39:
	.size	uf_make, .-uf_make
	.p2align 4
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB40:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L4
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, (%rsi)
	addl	$1, %eax
	addq	$12, %rsi
	movl	$1, -4(%rsi)
	cmpl	%eax, %edi
	jne	.L6
.L4:
	ret
	.cfi_endproc
.LFE40:
	.size	uf_init, .-uf_init
	.p2align 4
	.globl	uf_root
	.type	uf_root, @function
uf_root:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%edi, %rdx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %rax
	leaq	(%rdx,%rdx,2), %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	(%rsi,%rdx,4), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	(%rbx), %edx
	cmpl	%eax, %edx
	jne	.L14
	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
.L14:
	.cfi_restore_state
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %rbp
	movl	0(%rbp), %eax
	cmpl	%eax, %edx
	je	.L10
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r12
	movl	(%r12), %edx
	cmpl	%edx, %eax
	jne	.L15
	movl	%edx, 0(%rbp)
	movl	%edx, %eax
.L10:
	movl	%eax, (%rbx)
	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
.L15:
	.cfi_restore_state
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r13
	movl	0(%r13), %edi
	cmpl	%edi, %edx
	je	.L12
	call	uf_root
	movl	%eax, 0(%r13)
	movl	%eax, %edi
.L12:
	movl	%edi, %edx
	movl	%edi, (%r12)
	movl	%edx, %eax
	movl	%edx, 0(%rbp)
	jmp	.L10
	.cfi_endproc
.LFE41:
	.size	uf_root, .-uf_root
	.p2align 4
	.globl	uf_same
	.type	uf_same, @function
uf_same:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%edi, %rax
	movl	%esi, %ecx
	movq	%rdx, %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	(%rax,%rax,2), %rax
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	(%rdx,%rax,4), %r9
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	(%r9), %r8d
	cmpl	%r8d, %edi
	jne	.L34
.L17:
	movslq	%ecx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r9
	movl	(%r9), %eax
	cmpl	%eax, %ecx
	jne	.L35
.L25:
	cmpl	%r8d, %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
.L34:
	.cfi_restore_state
	movslq	%r8d, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rdx,%rax,4), %r10
	movl	(%r10), %eax
	cmpl	%eax, %r8d
	je	.L18
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r8
	movl	(%r8), %edx
	cmpl	%edx, %eax
	jne	.L36
.L19:
	movl	%edx, (%r10)
	movl	%edx, %eax
.L18:
	movl	%eax, (%r9)
	movl	%eax, %r8d
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L35:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, %eax
	je	.L26
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r10
	movl	(%r10), %eax
	cmpl	%eax, %edx
	jne	.L37
.L27:
	movl	%eax, (%rcx)
	movl	%eax, %edx
.L26:
	movl	%edx, (%r9)
	movl	%edx, %eax
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L37:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r11
	movl	(%r11), %edx
	cmpl	%edx, %eax
	je	.L28
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %rbx
	movl	(%rbx), %eax
	cmpl	%eax, %edx
	jne	.L38
.L29:
	movl	%eax, (%r11)
	movl	%eax, %edx
.L28:
	movl	%edx, (%r10)
	movl	%edx, %eax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r11
	movl	(%r11), %eax
	cmpl	%eax, %edx
	je	.L20
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %rbx
	movl	(%rbx), %edx
	cmpl	%edx, %eax
	jne	.L39
.L21:
	movl	%edx, (%r11)
	movl	%edx, %eax
.L20:
	movl	%eax, (%r8)
	movl	%eax, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %rbp
	movl	0(%rbp), %eax
	cmpl	%eax, %edx
	je	.L22
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r12
	movl	(%r12), %edx
	cmpl	%edx, %eax
	je	.L23
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r13
	movl	0(%r13), %edi
	cmpl	%edi, %edx
	je	.L24
	call	uf_root
	movl	%eax, 0(%r13)
	movl	%eax, %edi
.L24:
	movl	%edi, (%r12)
	movl	%edi, %edx
.L23:
	movl	%edx, 0(%rbp)
	movl	%edx, %eax
.L22:
	movl	%eax, (%rbx)
	movl	%eax, %edx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %rbp
	movl	0(%rbp), %edx
	cmpl	%edx, %eax
	je	.L30
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r12
	movl	(%r12), %edi
	cmpl	%edi, %edx
	je	.L31
	movslq	%edi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r13
	movl	0(%r13), %eax
	cmpl	%eax, %edi
	je	.L32
	movl	%eax, %edi
	call	uf_root
	movl	%eax, 0(%r13)
.L32:
	movl	%eax, (%r12)
	movl	%eax, %edi
.L31:
	movl	%edi, 0(%rbp)
	movl	%edi, %edx
.L30:
	movl	%edx, (%rbx)
	movl	%edx, %eax
	jmp	.L29
	.cfi_endproc
.LFE42:
	.size	uf_same, .-uf_same
	.p2align 4
	.globl	uf_unite
	.type	uf_unite, @function
uf_unite:
.LFB43:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%esi, %r9d
	movq	%rdx, %rcx
	leaq	(%rax,%rax,2), %rax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	(%rdx,%rax,4), %r10
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movslq	(%r10), %r8
	cmpl	%r8d, %edi
	jne	.L59
.L41:
	movslq	%r9d, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r10
	movslq	(%r10), %rax
	cmpl	%eax, %r9d
	jne	.L60
.L49:
	cmpl	%r8d, %eax
	je	.L40
	leaq	(%r8,%r8,2), %rdx
	leaq	(%rcx,%rdx,4), %rdx
	movl	%eax, (%rdx)
	leaq	(%rax,%rax,2), %rax
	movl	8(%rdx), %edx
	addl	%edx, 8(%rcx,%rax,4)
.L40:
	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
.L59:
	.cfi_restore_state
	movslq	%r8d, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rdx,%rax,4), %r11
	movl	(%r11), %eax
	cmpl	%eax, %r8d
	je	.L42
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %r8
	movl	(%r8), %edx
	cmpl	%edx, %eax
	jne	.L61
.L43:
	movl	%edx, (%r11)
	movl	%edx, %eax
.L42:
	movl	%eax, (%r10)
	movslq	%eax, %r8
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L60:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %r9
	movl	(%r9), %edx
	cmpl	%edx, %eax
	je	.L50
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r11
	movl	(%r11), %eax
	cmpl	%eax, %edx
	jne	.L62
.L51:
	movl	%eax, (%r9)
	movl	%eax, %edx
.L50:
	movl	%edx, (%r10)
	movslq	%edx, %rax
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L62:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %rbx
	movl	(%rbx), %edx
	cmpl	%edx, %eax
	je	.L52
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %rbp
	movl	0(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L63
.L53:
	movl	%eax, (%rbx)
	movl	%eax, %edx
.L52:
	movl	%edx, (%r11)
	movl	%edx, %eax
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L61:
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %rbx
	movl	(%rbx), %eax
	cmpl	%eax, %edx
	je	.L44
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %rbp
	movl	0(%rbp), %edx
	cmpl	%edx, %eax
	jne	.L64
.L45:
	movl	%edx, (%rbx)
	movl	%edx, %eax
.L44:
	movl	%eax, (%r8)
	movl	%eax, %edx
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L64:
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r12
	movl	(%r12), %eax
	cmpl	%eax, %edx
	je	.L46
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %r13
	movl	0(%r13), %edx
	cmpl	%edx, %eax
	je	.L47
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r14
	movl	(%r14), %edi
	cmpl	%edi, %edx
	je	.L48
	movq	%rcx, %rsi
	call	uf_root
	movl	%eax, (%r14)
	movl	%eax, %edi
.L48:
	movl	%edi, 0(%r13)
	movl	%edi, %edx
.L47:
	movl	%edx, (%r12)
	movl	%edx, %eax
.L46:
	movl	%eax, 0(%rbp)
	movl	%eax, %edx
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L63:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %r12
	movl	(%r12), %edx
	cmpl	%edx, %eax
	je	.L54
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r13
	movl	0(%r13), %esi
	cmpl	%esi, %edx
	je	.L55
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r14
	movl	(%r14), %edi
	cmpl	%edi, %esi
	je	.L56
	movq	%rcx, %rsi
	call	uf_root
	movl	%eax, (%r14)
	movl	%eax, %edi
.L56:
	movl	%edi, 0(%r13)
	movl	%edi, %esi
.L55:
	movl	%esi, (%r12)
	movl	%esi, %edx
.L54:
	movl	%edx, 0(%rbp)
	movl	%edx, %eax
	jmp	.L53
	.cfi_endproc
.LFE43:
	.size	uf_unite, .-uf_unite
	.p2align 4
	.globl	uf_count
	.type	uf_count, @function
uf_count:
.LFB44:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r9
	movslq	(%r9), %rdx
	movq	%rdx, %rax
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r8
	cmpl	%eax, %edi
	jne	.L80
	movl	8(%r8), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L80:
	movl	(%r8), %edx
	cmpl	%edx, %eax
	je	.L76
	movslq	%edx, %rax
	movq	%rsi, %rcx
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r10
	movl	(%r10), %eax
	cmpl	%eax, %edx
	jne	.L81
	movl	%eax, (%r8)
	movl	%eax, %edx
	movq	%r10, %r8
.L76:
	movl	%edx, (%r9)
	movl	8(%r8), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L81:
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%eax, %rdx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	(%rdx,%rdx,2), %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	(%rsi,%rdx,4), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movslq	(%rbx), %rsi
	movq	%rsi, %rdx
	leaq	(%rsi,%rsi,2), %rsi
	leaq	(%rcx,%rsi,4), %r11
	cmpl	%edx, %eax
	je	.L69
	movl	(%r11), %eax
	cmpl	%eax, %edx
	jne	.L82
.L70:
	movl	%eax, (%rbx)
	movl	%eax, %edx
.L69:
	movl	%edx, (%r10)
	movl	8(%r11), %eax
	movl	%edx, (%r8)
	movl	%edx, (%r9)
	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
.L82:
	.cfi_restore_state
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %rbp
	movl	0(%rbp), %edx
	cmpl	%edx, %eax
	je	.L71
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r12
	movl	(%r12), %esi
	cmpl	%esi, %edx
	je	.L72
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r13
	movl	0(%r13), %edi
	cmpl	%edi, %esi
	je	.L73
	movq	%rcx, %rsi
	call	uf_root
	movl	%eax, 0(%r13)
	movl	%eax, %edi
	cltq
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r13
.L73:
	movl	%edi, (%r12)
	movl	%edi, %esi
	movq	%r13, %r12
.L72:
	movl	%esi, 0(%rbp)
	movl	%esi, %edx
	movq	%r12, %rbp
.L71:
	movl	%edx, (%r11)
	movl	%edx, %eax
	movq	%rbp, %r11
	jmp	.L70
	.cfi_endproc
.LFE44:
	.size	uf_count, .-uf_count
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB46:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	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	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ebp
	movl	4(%rsp), %esi
	movl	$24, %edi
	addl	%ebp, %esi
	movslq	%esi, %rsi
	call	calloc@PLT
	movq	%rax, %rbx
	testl	%ebp, %ebp
	jle	.L95
	movq	%rax, %rbp
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L85:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$24, %rbp
	call	__isoc99_scanf@PLT
	movl	%r12d, -16(%rbp)
	addl	$1, %r12d
	movl	$1, -8(%rbp)
	cmpl	%r12d, (%rsp)
	jg	.L85
.L84:
	movl	4(%rsp), %esi
	testl	%esi, %esi
	jle	.L86
	movslq	%r12d, %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
	leaq	(%r12,%r12,2), %rax
	leaq	(%rbx,%rax,8), %r12
	.p2align 4,,10
	.p2align 3
.L87:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$24, %r12
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %esi
	movl	%ebp, -12(%r12)
	addl	$1, %ebp
	cmpl	%ebp, %esi
	jg	.L87
.L86:
	addl	(%rsp), %esi
	leaq	comp(%rip), %rcx
	movl	$24, %edx
	movq	%rbx, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	(%rsp), %ecx
	movl	4(%rsp), %esi
	leal	(%rcx,%rsi), %edx
	addl	$1, %ecx
	addl	$1, %esi
	movl	%ecx, (%rsp)
	movl	%esi, 4(%rsp)
	testl	%edx, %edx
	jle	.L96
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rbx, %rax
	xorl	%r10d, %r10d
	xorl	%r11d, %r11d
	leaq	(%rbx,%rdx,8), %r9
	xorl	%edx, %edx
	jmp	.L91
	.p2align 4,,10
	.p2align 3
.L108:
	movslq	%esi, %rdi
	addq	$24, %rax
	subl	$1, %ecx
	movl	$1, %r10d
	imulq	%r8, %rdi
	addq	%rdi, %rdx
	cmpq	%rax, %r9
	je	.L107
.L91:
	movl	16(%rax), %edi
	movq	(%rax), %r8
	testl	%edi, %edi
	jne	.L108
	movslq	%ecx, %rdi
	addq	$24, %rax
	subl	$1, %esi
	movl	$1, %r11d
	imulq	%r8, %rdi
	addq	%rdi, %rdx
	cmpq	%rax, %r9
	jne	.L91
.L107:
	testb	%r10b, %r10b
	je	.L92
	movl	%ecx, (%rsp)
.L92:
	testb	%r11b, %r11b
	je	.L88
	movl	%esi, 4(%rsp)
.L88:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L109
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L96:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L88
.L95:
	xorl	%r12d, %r12d
	jmp	.L84
.L109:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE46:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB45:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE45:
	.size	comp, .-comp
	.p2align 4
	.globl	uf_make
	.type	uf_make, @function
uf_make:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	%edi, %rsi
	movl	$12, %edi
	jmp	calloc@PLT
	.cfi_endproc
.LFE39:
	.size	uf_make, .-uf_make
	.p2align 4
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB40:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L4
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%eax, (%rsi)
	addl	$1, %eax
	addq	$12, %rsi
	movl	$1, -4(%rsi)
	cmpl	%eax, %edi
	jne	.L6
.L4:
	ret
	.cfi_endproc
.LFE40:
	.size	uf_init, .-uf_init
	.p2align 4
	.globl	uf_root
	.type	uf_root, @function
uf_root:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%edi, %rdx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdx, %rax
	leaq	(%rdx,%rdx,2), %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	(%rsi,%rdx,4), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	(%rbx), %edx
	cmpl	%eax, %edx
	jne	.L14
	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
.L14:
	.cfi_restore_state
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %rbp
	movl	0(%rbp), %eax
	cmpl	%eax, %edx
	je	.L10
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r12
	movl	(%r12), %edx
	cmpl	%edx, %eax
	jne	.L15
	movl	%edx, 0(%rbp)
	movl	%edx, %eax
.L10:
	movl	%eax, (%rbx)
	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
.L15:
	.cfi_restore_state
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r13
	movl	0(%r13), %edi
	cmpl	%edi, %edx
	je	.L12
	call	uf_root
	movl	%eax, 0(%r13)
	movl	%eax, %edi
.L12:
	movl	%edi, %edx
	movl	%edi, (%r12)
	movl	%edx, %eax
	movl	%edx, 0(%rbp)
	jmp	.L10
	.cfi_endproc
.LFE41:
	.size	uf_root, .-uf_root
	.p2align 4
	.globl	uf_same
	.type	uf_same, @function
uf_same:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%edi, %rax
	movl	%esi, %ecx
	movq	%rdx, %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	(%rax,%rax,2), %rax
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	(%rdx,%rax,4), %r9
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	(%r9), %r8d
	cmpl	%r8d, %edi
	jne	.L34
.L17:
	movslq	%ecx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r9
	movl	(%r9), %eax
	cmpl	%eax, %ecx
	jne	.L35
.L25:
	cmpl	%r8d, %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
.L34:
	.cfi_restore_state
	movslq	%r8d, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rdx,%rax,4), %r10
	movl	(%r10), %eax
	cmpl	%eax, %r8d
	je	.L18
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r8
	movl	(%r8), %edx
	cmpl	%edx, %eax
	jne	.L36
.L19:
	movl	%edx, (%r10)
	movl	%edx, %eax
.L18:
	movl	%eax, (%r9)
	movl	%eax, %r8d
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L35:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, %eax
	je	.L26
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r10
	movl	(%r10), %eax
	cmpl	%eax, %edx
	jne	.L37
.L27:
	movl	%eax, (%rcx)
	movl	%eax, %edx
.L26:
	movl	%edx, (%r9)
	movl	%edx, %eax
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L37:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r11
	movl	(%r11), %edx
	cmpl	%edx, %eax
	je	.L28
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %rbx
	movl	(%rbx), %eax
	cmpl	%eax, %edx
	jne	.L38
.L29:
	movl	%eax, (%r11)
	movl	%eax, %edx
.L28:
	movl	%edx, (%r10)
	movl	%edx, %eax
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r11
	movl	(%r11), %eax
	cmpl	%eax, %edx
	je	.L20
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %rbx
	movl	(%rbx), %edx
	cmpl	%edx, %eax
	jne	.L39
.L21:
	movl	%edx, (%r11)
	movl	%edx, %eax
.L20:
	movl	%eax, (%r8)
	movl	%eax, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %rbp
	movl	0(%rbp), %eax
	cmpl	%eax, %edx
	je	.L22
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r12
	movl	(%r12), %edx
	cmpl	%edx, %eax
	je	.L23
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r13
	movl	0(%r13), %edi
	cmpl	%edi, %edx
	je	.L24
	call	uf_root
	movl	%eax, 0(%r13)
	movl	%eax, %edi
.L24:
	movl	%edi, (%r12)
	movl	%edi, %edx
.L23:
	movl	%edx, 0(%rbp)
	movl	%edx, %eax
.L22:
	movl	%eax, (%rbx)
	movl	%eax, %edx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %rbp
	movl	0(%rbp), %edx
	cmpl	%edx, %eax
	je	.L30
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r12
	movl	(%r12), %edi
	cmpl	%edi, %edx
	je	.L31
	movslq	%edi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r13
	movl	0(%r13), %eax
	cmpl	%eax, %edi
	je	.L32
	movl	%eax, %edi
	call	uf_root
	movl	%eax, 0(%r13)
.L32:
	movl	%eax, (%r12)
	movl	%eax, %edi
.L31:
	movl	%edi, 0(%rbp)
	movl	%edi, %edx
.L30:
	movl	%edx, (%rbx)
	movl	%edx, %eax
	jmp	.L29
	.cfi_endproc
.LFE42:
	.size	uf_same, .-uf_same
	.p2align 4
	.globl	uf_unite
	.type	uf_unite, @function
uf_unite:
.LFB43:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%esi, %r9d
	movq	%rdx, %rcx
	leaq	(%rax,%rax,2), %rax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	(%rdx,%rax,4), %r10
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movslq	(%r10), %r8
	cmpl	%r8d, %edi
	jne	.L59
.L41:
	movslq	%r9d, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r10
	movslq	(%r10), %rax
	cmpl	%eax, %r9d
	jne	.L60
.L49:
	cmpl	%r8d, %eax
	je	.L40
	leaq	(%r8,%r8,2), %rdx
	leaq	(%rcx,%rdx,4), %rdx
	movl	%eax, (%rdx)
	leaq	(%rax,%rax,2), %rax
	movl	8(%rdx), %edx
	addl	%edx, 8(%rcx,%rax,4)
.L40:
	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
.L59:
	.cfi_restore_state
	movslq	%r8d, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rdx,%rax,4), %r11
	movl	(%r11), %eax
	cmpl	%eax, %r8d
	je	.L42
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %r8
	movl	(%r8), %edx
	cmpl	%edx, %eax
	jne	.L61
.L43:
	movl	%edx, (%r11)
	movl	%edx, %eax
.L42:
	movl	%eax, (%r10)
	movslq	%eax, %r8
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L60:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %r9
	movl	(%r9), %edx
	cmpl	%edx, %eax
	je	.L50
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r11
	movl	(%r11), %eax
	cmpl	%eax, %edx
	jne	.L62
.L51:
	movl	%eax, (%r9)
	movl	%eax, %edx
.L50:
	movl	%edx, (%r10)
	movslq	%edx, %rax
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L62:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %rbx
	movl	(%rbx), %edx
	cmpl	%edx, %eax
	je	.L52
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %rbp
	movl	0(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L63
.L53:
	movl	%eax, (%rbx)
	movl	%eax, %edx
.L52:
	movl	%edx, (%r11)
	movl	%edx, %eax
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L61:
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %rbx
	movl	(%rbx), %eax
	cmpl	%eax, %edx
	je	.L44
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %rbp
	movl	0(%rbp), %edx
	cmpl	%edx, %eax
	jne	.L64
.L45:
	movl	%edx, (%rbx)
	movl	%edx, %eax
.L44:
	movl	%eax, (%r8)
	movl	%eax, %edx
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L64:
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r12
	movl	(%r12), %eax
	cmpl	%eax, %edx
	je	.L46
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %r13
	movl	0(%r13), %edx
	cmpl	%edx, %eax
	je	.L47
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r14
	movl	(%r14), %edi
	cmpl	%edi, %edx
	je	.L48
	movq	%rcx, %rsi
	call	uf_root
	movl	%eax, (%r14)
	movl	%eax, %edi
.L48:
	movl	%edi, 0(%r13)
	movl	%edi, %edx
.L47:
	movl	%edx, (%r12)
	movl	%edx, %eax
.L46:
	movl	%eax, 0(%rbp)
	movl	%eax, %edx
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L63:
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %r12
	movl	(%r12), %edx
	cmpl	%edx, %eax
	je	.L54
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r13
	movl	0(%r13), %esi
	cmpl	%esi, %edx
	je	.L55
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r14
	movl	(%r14), %edi
	cmpl	%edi, %esi
	je	.L56
	movq	%rcx, %rsi
	call	uf_root
	movl	%eax, (%r14)
	movl	%eax, %edi
.L56:
	movl	%edi, 0(%r13)
	movl	%edi, %esi
.L55:
	movl	%esi, (%r12)
	movl	%esi, %edx
.L54:
	movl	%edx, 0(%rbp)
	movl	%edx, %eax
	jmp	.L53
	.cfi_endproc
.LFE43:
	.size	uf_unite, .-uf_unite
	.p2align 4
	.globl	uf_count
	.type	uf_count, @function
uf_count:
.LFB44:
	.cfi_startproc
	endbr64
	movslq	%edi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r9
	movslq	(%r9), %rdx
	movq	%rdx, %rax
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rsi,%rdx,4), %r8
	cmpl	%eax, %edi
	jne	.L80
	movl	8(%r8), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L80:
	movl	(%r8), %edx
	cmpl	%edx, %eax
	je	.L76
	movslq	%edx, %rax
	movq	%rsi, %rcx
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %r10
	movl	(%r10), %eax
	cmpl	%eax, %edx
	jne	.L81
	movl	%eax, (%r8)
	movl	%eax, %edx
	movq	%r10, %r8
.L76:
	movl	%edx, (%r9)
	movl	8(%r8), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L81:
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movslq	%eax, %rdx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	(%rdx,%rdx,2), %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	(%rsi,%rdx,4), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movslq	(%rbx), %rsi
	movq	%rsi, %rdx
	leaq	(%rsi,%rsi,2), %rsi
	leaq	(%rcx,%rsi,4), %r11
	cmpl	%edx, %eax
	je	.L69
	movl	(%r11), %eax
	cmpl	%eax, %edx
	jne	.L82
.L70:
	movl	%eax, (%rbx)
	movl	%eax, %edx
.L69:
	movl	%edx, (%r10)
	movl	8(%r11), %eax
	movl	%edx, (%r8)
	movl	%edx, (%r9)
	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
.L82:
	.cfi_restore_state
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rcx,%rdx,4), %rbp
	movl	0(%rbp), %edx
	cmpl	%edx, %eax
	je	.L71
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r12
	movl	(%r12), %esi
	cmpl	%esi, %edx
	je	.L72
	movslq	%esi, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r13
	movl	0(%r13), %edi
	cmpl	%edi, %esi
	je	.L73
	movq	%rcx, %rsi
	call	uf_root
	movl	%eax, 0(%r13)
	movl	%eax, %edi
	cltq
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,4), %r13
.L73:
	movl	%edi, (%r12)
	movl	%edi, %esi
	movq	%r13, %r12
.L72:
	movl	%esi, 0(%rbp)
	movl	%esi, %edx
	movq	%r12, %rbp
.L71:
	movl	%edx, (%r11)
	movl	%edx, %eax
	movq	%rbp, %r11
	jmp	.L70
	.cfi_endproc
.LFE44:
	.size	uf_count, .-uf_count
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB46:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	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	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ebp
	movl	4(%rsp), %esi
	movl	$24, %edi
	addl	%ebp, %esi
	movslq	%esi, %rsi
	call	calloc@PLT
	movq	%rax, %rbx
	testl	%ebp, %ebp
	jle	.L95
	movq	%rax, %rbp
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L85:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$24, %rbp
	call	__isoc99_scanf@PLT
	movl	%r12d, -16(%rbp)
	addl	$1, %r12d
	movl	$1, -8(%rbp)
	cmpl	%r12d, (%rsp)
	jg	.L85
.L84:
	movl	4(%rsp), %esi
	testl	%esi, %esi
	jle	.L86
	movslq	%r12d, %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
	leaq	(%r12,%r12,2), %rax
	leaq	(%rbx,%rax,8), %r12
	.p2align 4,,10
	.p2align 3
.L87:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$24, %r12
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %esi
	movl	%ebp, -12(%r12)
	addl	$1, %ebp
	cmpl	%ebp, %esi
	jg	.L87
.L86:
	addl	(%rsp), %esi
	leaq	comp(%rip), %rcx
	movl	$24, %edx
	movq	%rbx, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	(%rsp), %ecx
	movl	4(%rsp), %esi
	leal	(%rcx,%rsi), %edx
	addl	$1, %ecx
	addl	$1, %esi
	movl	%ecx, (%rsp)
	movl	%esi, 4(%rsp)
	testl	%edx, %edx
	jle	.L96
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rbx, %rax
	xorl	%r10d, %r10d
	xorl	%r11d, %r11d
	leaq	(%rbx,%rdx,8), %r9
	xorl	%edx, %edx
	jmp	.L91
	.p2align 4,,10
	.p2align 3
.L108:
	movslq	%esi, %rdi
	addq	$24, %rax
	subl	$1, %ecx
	movl	$1, %r10d
	imulq	%r8, %rdi
	addq	%rdi, %rdx
	cmpq	%rax, %r9
	je	.L107
.L91:
	movl	16(%rax), %edi
	movq	(%rax), %r8
	testl	%edi, %edi
	jne	.L108
	movslq	%ecx, %rdi
	addq	$24, %rax
	subl	$1, %esi
	movl	$1, %r11d
	imulq	%r8, %rdi
	addq	%rdi, %rdx
	cmpq	%rax, %r9
	jne	.L91
.L107:
	testb	%r10b, %r10b
	je	.L92
	movl	%ecx, (%rsp)
.L92:
	testb	%r11b, %r11b
	je	.L88
	movl	%esi, 4(%rsp)
.L88:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L109
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L96:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L88
.L95:
	xorl	%r12d, %r12d
	jmp	.L84
.L109:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE46:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define lli long long int
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define true 1
#define false 0

typedef struct unionFind{
	int par;
	int vertext;
	int count;
} unionFind;


unionFind* uf_make(int n){
	unionFind* u;
	u = calloc(sizeof(unionFind),n);
	return u;
}

void uf_init(int n,unionFind *u){
	int i;
	for(i = 0;i < n;i++){
		u[i].par = i;
		u[i].count = 1;
	}
}
int uf_root(int x,unionFind *u){
	if(u[x].par == x){
		return x;
	}else{
		return u[x].par = uf_root(u[x].par,u);
	}
}
int uf_same(int x,int y,unionFind *u){
	return uf_root(x,u) == uf_root(y,u);
}
void uf_unite(int x,int y,unionFind *u){
	x = uf_root(x,u);
	y = uf_root(y,u);
	if(x == y)return;
	u[x].par = y;
	u[y].count += u[x].count;
}
int uf_count(int x,unionFind *u){
	x = uf_root(x,u);
	return u[x].count;
}

typedef struct rode {
	lli cost;
	int i;
	int j;
	int p;
} rode;

int comp(const void *a,const void *b){
	return ((rode*)a)->cost - ((rode*)b)->cost;
}

int main(void){
	int i,j;
	int w,h;
	int wh;
	rode *pq;
	lli ans = 0;
	scanf("%d%d",&w,&h);
	pq = calloc(sizeof(rode),w+h);
	for(i=0;i<w;i++){
		scanf("%lld",&pq[i].cost);
		pq[i].i = i;
		pq[i].p = true;
	}
	for(j=0;j<h;i++,j++){
		scanf("%lld",&pq[i].cost);
		pq[i].j = j;
	}
	qsort(pq,w+h,sizeof(rode),comp);
	wh = w+h;
	w++;
	h++;
	for(i=0;i<wh;i++){
		if(pq[i].p){
			ans += pq[i].cost * h;
			w--;
		}else{
			ans += pq[i].cost * w;
			h--;
		}
	}
	printf("%lld\n", ans);


	return 0;
}
4 3
2
6
8
1
2
9
3
 2 2
3
6
2
7
 0 3
2
6
8
1
2
9
3
 2 2
3
9
2
7
 0 3
2
6
13
1
2
9
3
 2 2
3
16
2
7
 2 2
3
32
2
7
 2 2
0
32
2
7
 0 3
1
6
8
1
2
9
0
 2 2
-1
32
2
7

64
 31
 16
 35
 21
 42
 58
 50
 15
 47

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 <math.h>

#define lli long long int
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define true 1
#define false 0

typedef struct unionFind{
	int par;
	int vertext;
	int count;
} unionFind;


unionFind* uf_make(int n){
	unionFind* u;
	u = calloc(sizeof(unionFind),n);
	return u;
}

void uf_init(int n,unionFind *u){
	int i;
	for(i = 0;i < n;i++){
		u[i].par = i;
		u[i].count = 1;
	}
}
int uf_root(int x,unionFind *u){
	if(u[x].par == x){
		return x;
	}else{
		return u[x].par = uf_root(u[x].par,u);
	}
}
int uf_same(int x,int y,unionFind *u){
	return uf_root(x,u) == uf_root(y,u);
}
void uf_unite(int x,int y,unionFind *u){
	x = uf_root(x,u);
	y = uf_root(y,u);
	if(x == y)return;
	u[x].par = y;
	u[y].count += u[x].count;
}
int uf_count(int x,unionFind *u){
	x = uf_root(x,u);
	return u[x].count;
}

typedef struct rode {
	lli cost;
	int i;
	int j;
	int p;
} rode;

int comp(const void *a,const void *b){
	return ((rode*)a)->cost - ((rode*)b)->cost;
}

int main(void){
	int i,j;
	int w,h;
	int wh;
	rode *pq;
	lli ans = 0;
	scanf("%d%d",&w,&h);
	pq = calloc(sizeof(rode),w+h);
	for(i=0;i<w;i++){
		scanf("%lld",&pq[i].cost);
		pq[i].i = i;
		pq[i].p = true;
	}
	for(j=0;j<h;i++,j++){
		scanf("%lld",&pq[i].cost);
		pq[i].j = j;
	}
	qsort(pq,w+h,sizeof(rode),comp);
	wh = w+h;
	w++;
	h++;
	for(i=0;i<wh;i++){
		if(pq[i].p){
			ans += pq[i].cost * h;
			w--;
		}else{
			ans += pq[i].cost * w;
			h--;
		}
	}
	printf("%lld\n", ans);


	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	uf_make
	.type	uf_make, @function
uf_make:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$12, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	uf_make, .-uf_make
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB7:
	.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)
	movq	%rsi, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, 8(%rax)
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	uf_init, .-uf_init
	.globl	uf_root
	.type	uf_root, @function
uf_root:
.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)
	movq	%rsi, -32(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L7
	movl	-20(%rbp), %eax
	jmp	.L8
.L7:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	leaq	(%rcx,%rax), %rbx
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	movl	%edx, %edi
	call	uf_root
	movl	%eax, (%rbx)
	movl	(%rbx), %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	uf_root, .-uf_root
	.globl	uf_same
	.type	uf_same, @function
uf_same:
.LFB9:
	.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)
	movq	%rdx, -32(%rbp)
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, %ebx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	uf_same, .-uf_same
	.globl	uf_unite
	.type	uf_unite, @function
uf_unite:
.LFB10:
	.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)
	movq	%rdx, -16(%rbp)
	movq	-16(%rbp), %rdx
	movl	-4(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -4(%rbp)
	movq	-16(%rbp), %rdx
	movl	-8(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L14
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %esi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	leal	(%rsi,%rcx), %edx
	movl	%edx, 8(%rax)
	jmp	.L11
.L14:
	nop
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	uf_unite, .-uf_unite
	.globl	uf_count
	.type	uf_count, @function
uf_count:
.LFB11:
	.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)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movl	-4(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	uf_count, .-uf_count
	.globl	comp
	.type	comp, @function
comp:
.LFB12:
	.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
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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
	movq	$0, -24(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	movq	%rax, %rsi
	movl	$24, %edi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L20
.L21:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, 8(%rdx)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, 16(%rax)
	addl	$1, -36(%rbp)
.L20:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L21
	movl	$0, -32(%rbp)
	jmp	.L22
.L23:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	movl	%eax, 12(%rdx)
	addl	$1, -36(%rbp)
	addl	$1, -32(%rbp)
.L22:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L23
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rsi
	movq	-16(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$24, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L24
.L27:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	16(%rax), %eax
	testl	%eax, %eax
	je	.L25
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -24(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L26
.L25:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -24(%rbp)
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -40(%rbp)
.L26:
	addl	$1, -36(%rbp)
.L24:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L27
	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	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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	uf_make
	.type	uf_make, @function
uf_make:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$12, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	uf_make, .-uf_make
	.globl	uf_init
	.type	uf_init, @function
uf_init:
.LFB7:
	.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)
	movq	%rsi, -32(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L4
.L5:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, 8(%rax)
	addl	$1, -4(%rbp)
.L4:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	uf_init, .-uf_init
	.globl	uf_root
	.type	uf_root, @function
uf_root:
.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)
	movq	%rsi, -32(%rbp)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L7
	movl	-20(%rbp), %eax
	jmp	.L8
.L7:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-32(%rbp), %rax
	leaq	(%rcx,%rax), %rbx
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	movl	%edx, %edi
	call	uf_root
	movl	%eax, (%rbx)
	movl	(%rbx), %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	uf_root, .-uf_root
	.globl	uf_same
	.type	uf_same, @function
uf_same:
.LFB9:
	.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)
	movq	%rdx, -32(%rbp)
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, %ebx
	movq	-32(%rbp), %rdx
	movl	-24(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	cmpl	%eax, %ebx
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	uf_same, .-uf_same
	.globl	uf_unite
	.type	uf_unite, @function
uf_unite:
.LFB10:
	.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)
	movq	%rdx, -16(%rbp)
	movq	-16(%rbp), %rdx
	movl	-4(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -4(%rbp)
	movq	-16(%rbp), %rdx
	movl	-8(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L14
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %esi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %ecx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	leal	(%rsi,%rcx), %edx
	movl	%edx, 8(%rax)
	jmp	.L11
.L14:
	nop
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	uf_unite, .-uf_unite
	.globl	uf_count
	.type	uf_count, @function
uf_count:
.LFB11:
	.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)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movl	-4(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	uf_root
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	uf_count, .-uf_count
	.globl	comp
	.type	comp, @function
comp:
.LFB12:
	.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
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	comp, .-comp
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.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
	movq	$0, -24(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	cltq
	movq	%rax, %rsi
	movl	$24, %edi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L20
.L21:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	movl	%eax, 8(%rdx)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	$1, 16(%rax)
	addl	$1, -36(%rbp)
.L20:
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L21
	movl	$0, -32(%rbp)
	jmp	.L22
.L23:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	movl	%eax, 12(%rdx)
	addl	$1, -36(%rbp)
	addl	$1, -32(%rbp)
.L22:
	movl	-40(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L23
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rsi
	movq	-16(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$24, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L24
.L27:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	16(%rax), %eax
	testl	%eax, %eax
	je	.L25
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -24(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L26
.L25:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, -24(%rbp)
	movl	-40(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -40(%rbp)
.L26:
	addl	$1, -36(%rbp)
.L24:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L27
	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	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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:
