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

```c
// AOJ 1507 Dungeon (II)
// 2018.3.18 bal4u

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

// 高速数値入力
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()  // 非負整数のみ
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

/* UNION-FIND library */
#define MAX 200005
int id[MAX], size[MAX];
void init(int n) { int i; for (i = 0; i < n; i++) id[i] = i, size[i] = 1; }
int root(int i) { while (i != id[i]) id[i] = id[id[i]], i = id[i]; return i; }
int connected(int p, int q) { return root(p) == root(q); }
void unite(int p, int q)
{
	int i = root(p), j = root(q); if (i == j) return;
	if (size[i] < size[j]) id[i] = j, size[j] += size[i]; else id[j] = i, size[i] += size[j];
}

// 本問題関連
typedef struct { int a, b, c; } T;
T t[MAX]; int N;

int cmp(const void *a, const void *b) {	return ((T *)a)->c - ((T *)b)->c; }

int main()
{
	int i, a, b;
	long long ans;

	N = in() - 1;
	for (i = 0; i < N; i++)
		t[i].a = in(), t[i].b = in(), t[i].c = in();
	qsort(t, N, sizeof(T), cmp);
	init(N + 1);
	ans = 0;
	for (i = 0; i < N; i++) {
		a = t[i].a, b = t[i].b;
		ans += (long long)size[root(a)] * size[root(b)] * t[i].c;
		unite(a, b);
	}
	printf("%lld\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.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	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	id
	.bss
	.align 32
	.type	id, @object
	.size	id, 800020
id:
	.zero	800020
	.globl	size
	.align 32
	.type	size, @object
	.size	size, 800020
size:
	.zero	800020
	.text
	.globl	init
	.type	init, @function
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)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	init, .-init
	.globl	root
	.type	root, @function
root:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	jmp	.L8
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	id(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L9
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	root, .-root
	.globl	connected
	.type	connected, @function
connected:
.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	$8, %rsp
	.cfi_offset 3, -24
	movl	%edi, -12(%rbp)
	movl	%esi, -16(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-16(%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
.LFE9:
	.size	connected, .-connected
	.globl	unite
	.type	unite, @function
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	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L17
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	size(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L16:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L17:
	nop
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	unite, .-unite
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 2400060
t:
	.zero	2400060
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	8(%rax), %edx
	movq	-16(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, N(%rip)
	movl	$0, -36(%rbp)
	jmp	.L21
.L22:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -36(%rbp)
.L21:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L22
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	t(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	init
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L23
.L24:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	root
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rbx
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	root
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	%rax, %rbx
	movq	%rbx, %rcx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+t(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	%rcx, %rax
	addq	%rax, -24(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	addl	$1, -36(%rbp)
.L23:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L24
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB56:
	.cfi_startproc
	endbr64
	movl	8(%rdi), %eax
	subl	8(%rsi), %eax
	ret
	.cfi_endproc
.LFE56:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB51:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L12
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L5:
	xorl	%r12d, %r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L3
.L7:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L9:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L6
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L3
	movq	stdin(%rip), %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L5
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.p2align 4
	.globl	init
	.type	init, @function
init:
.LFB52:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L13
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L18
	movl	%edi, %edx
	movdqa	.LC0(%rip), %xmm0
	xorl	%eax, %eax
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %edx
	movdqa	.LC2(%rip), %xmm2
	leaq	id(%rip), %rsi
	leaq	size(%rip), %rcx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm0, %xmm1
	movaps	%xmm2, (%rcx,%rax)
	paddd	%xmm3, %xmm0
	movaps	%xmm1, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L16
	movl	%edi, %eax
	andl	$-4, %eax
	testb	$3, %dil
	je	.L20
.L15:
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
	movl	$1, (%rcx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L13
	movslq	%edx, %r8
	addl	$2, %eax
	movl	%edx, (%rsi,%r8,4)
	movl	$1, (%rcx,%r8,4)
	cmpl	%eax, %edi
	jle	.L13
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
	movl	$1, (%rcx,%rdx,4)
.L13:
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	ret
.L18:
	xorl	%eax, %eax
	leaq	id(%rip), %rsi
	leaq	size(%rip), %rcx
	jmp	.L15
	.cfi_endproc
.LFE52:
	.size	init, .-init
	.p2align 4
	.globl	root
	.type	root, @function
root:
.LFB53:
	.cfi_startproc
	endbr64
	leaq	id(%rip), %rcx
	movslq	%edi, %rax
	movslq	(%rcx,%rax,4), %rax
	cmpl	%eax, %edi
	je	.L21
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	(%rcx,%rax,4), %rax
	movslq	%edi, %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	%rax, %rdi
	movslq	(%rcx,%rax,4), %rax
	cmpl	%eax, %edi
	jne	.L23
.L21:
	ret
	.cfi_endproc
.LFE53:
	.size	root, .-root
	.p2align 4
	.globl	connected
	.type	connected, @function
connected:
.LFB54:
	.cfi_startproc
	endbr64
	movslq	%edi, %rcx
	leaq	id(%rip), %rax
	movq	%rcx, %rdx
	movslq	(%rax,%rcx,4), %rcx
	cmpl	%ecx, %edx
	je	.L26
	.p2align 4,,10
	.p2align 3
.L27:
	movl	%edx, %edi
	movl	(%rax,%rcx,4), %edx
	movslq	%edi, %rcx
	movl	%edx, (%rax,%rcx,4)
	movslq	%edx, %rcx
	movslq	(%rax,%rcx,4), %rcx
	cmpl	%edx, %ecx
	jne	.L27
.L26:
	movslq	%esi, %rcx
	movslq	(%rax,%rcx,4), %rcx
	cmpl	%ecx, %esi
	je	.L28
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%esi, %edi
	movl	(%rax,%rcx,4), %esi
	movslq	%edi, %rcx
	movl	%esi, (%rax,%rcx,4)
	movslq	%esi, %rcx
	movslq	(%rax,%rcx,4), %rcx
	cmpl	%esi, %ecx
	jne	.L29
.L28:
	xorl	%eax, %eax
	cmpl	%edx, %esi
	sete	%al
	ret
	.cfi_endproc
.LFE54:
	.size	connected, .-connected
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB55:
	.cfi_startproc
	endbr64
	movslq	%edi, %r8
	leaq	id(%rip), %rax
	movl	%esi, %ecx
	movslq	(%rax,%r8,4), %rsi
	movq	%r8, %rdx
	cmpl	%esi, %r8d
	je	.L35
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	(%rax,%rsi,4), %r8
	movl	%edx, %edi
	movslq	%edi, %rsi
	movl	%r8d, (%rax,%rsi,4)
	movslq	(%rax,%r8,4), %rsi
	movq	%r8, %rdx
	cmpl	%r8d, %esi
	jne	.L36
.L35:
	movslq	%ecx, %rdi
	movslq	(%rax,%rdi,4), %rsi
	cmpl	%esi, %ecx
	je	.L37
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%ecx, %edi
	movl	(%rax,%rsi,4), %ecx
	movslq	%edi, %rsi
	movslq	%ecx, %rdi
	movl	%ecx, (%rax,%rsi,4)
	movslq	(%rax,%rdi,4), %rsi
	cmpl	%ecx, %esi
	jne	.L38
.L37:
	cmpl	%edx, %ecx
	je	.L34
	leaq	size(%rip), %rsi
	movl	(%rsi,%r8,4), %r10d
	movl	(%rsi,%rdi,4), %r9d
	leal	(%r10,%r9), %r11d
	cmpl	%r9d, %r10d
	jge	.L40
	movl	%ecx, (%rax,%r8,4)
	movl	%r11d, (%rsi,%rdi,4)
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%edx, (%rax,%rdi,4)
	movl	%r11d, (%rsi,%r8,4)
.L34:
	ret
	.cfi_endproc
.LFE55:
	.size	unite, .-unite
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB57:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	t(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	in
	subl	$1, %eax
	movl	%eax, N(%rip)
	testl	%eax, %eax
	jle	.L46
	movq	%r12, %rbx
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L65:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rdx
	cmpq	%rdx, %rax
	jnb	.L91
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rax), %eax
.L48:
	xorl	%r13d, %r13d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L49:
	leaq	1(%rcx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L51
.L50:
	movq	%rsi, %rcx
.L52:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rdx, %rcx
	jb	.L49
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdx
	cmpl	$47, %eax
	jg	.L50
	.p2align 4,,10
	.p2align 3
.L51:
	movl	%r13d, (%rbx)
	cmpq	%rsi, %rdx
	jbe	.L92
	leaq	1(%rsi), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rsi), %eax
.L54:
	xorl	%r13d, %r13d
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L55:
	leaq	1(%rcx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L57
.L56:
	movq	%rsi, %rcx
.L58:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rdx, %rcx
	jb	.L55
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdx
	cmpl	$47, %eax
	jg	.L56
	.p2align 4,,10
	.p2align 3
.L57:
	movl	%r13d, 4(%rbx)
	cmpq	%rsi, %rdx
	jbe	.L93
	leaq	1(%rsi), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rsi), %eax
.L60:
	xorl	%r13d, %r13d
	jmp	.L64
	.p2align 4,,10
	.p2align 3
.L61:
	leaq	1(%rcx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L63
.L62:
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
.L64:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rdx, %rcx
	jb	.L61
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L63
	movq	stdin(%rip), %rdi
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L63:
	movl	N(%rip), %eax
	addl	$1, %ebp
	movl	%r13d, 8(%rbx)
	addq	$12, %rbx
	cmpl	%ebp, %eax
	jg	.L65
.L46:
	leaq	cmp(%rip), %rcx
	movslq	%eax, %rsi
	movl	$12, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	N(%rip), %ecx
	testl	%ecx, %ecx
	js	.L78
	leal	1(%rcx), %esi
	cmpl	$2, %ecx
	jle	.L79
	movl	%esi, %edx
	movdqa	.LC0(%rip), %xmm0
	xorl	%eax, %eax
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %edx
	movdqa	.LC2(%rip), %xmm2
	leaq	id(%rip), %rbx
	leaq	size(%rip), %r14
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L68:
	movdqa	%xmm0, %xmm1
	movaps	%xmm2, (%r14,%rax)
	paddd	%xmm3, %xmm0
	movaps	%xmm1, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L68
	movl	%esi, %eax
	andl	$-4, %eax
	andl	$3, %esi
	je	.L70
.L67:
	movslq	%eax, %rdx
	movl	%eax, (%rbx,%rdx,4)
	movl	$1, (%r14,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L72
	movslq	%edx, %rsi
	addl	$2, %eax
	movl	%edx, (%rbx,%rsi,4)
	movl	$1, (%r14,%rsi,4)
	cmpl	%eax, %ecx
	jl	.L70
	movslq	%eax, %rdx
	movl	%eax, (%rbx,%rdx,4)
	movl	$1, (%r14,%rdx,4)
.L70:
	leaq	t(%rip), %rbp
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L77:
	movslq	0(%rbp), %rcx
	movl	4(%rbp), %esi
	movslq	(%rbx,%rcx,4), %rax
	movq	%rcx, %rdi
	cmpl	%eax, %ecx
	je	.L73
	movl	%ecx, %edx
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%edx, %ecx
	movl	(%rbx,%rax,4), %edx
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movl	%edx, (%rbx,%rax,4)
	movslq	(%rbx,%rcx,4), %rax
	cmpl	%edx, %eax
	jne	.L74
.L73:
	movslq	(%r14,%rcx,4), %r8
	movslq	%esi, %rcx
	movslq	(%rbx,%rcx,4), %rax
	cmpl	%eax, %esi
	je	.L75
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L76:
	movl	%edx, %ecx
	movl	(%rbx,%rax,4), %edx
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movl	%edx, (%rbx,%rax,4)
	movslq	(%rbx,%rcx,4), %rax
	cmpl	%edx, %eax
	jne	.L76
.L75:
	movslq	(%r14,%rcx,4), %rax
	movslq	8(%rbp), %rdx
	addl	$1, %r13d
	addq	$12, %rbp
	imulq	%r8, %rax
	imulq	%rdx, %rax
	addq	%rax, %r12
	call	unite
	cmpl	%r13d, N(%rip)
	jg	.L77
.L66:
	movq	%r12, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L91:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L93:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L92:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L54
.L72:
	testl	%ecx, %ecx
	jg	.L70
.L78:
	xorl	%r12d, %r12d
	jmp	.L66
.L79:
	xorl	%eax, %eax
	leaq	id(%rip), %rbx
	leaq	size(%rip), %r14
	jmp	.L67
	.cfi_endproc
.LFE57:
	.size	main, .-main
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 2400060
t:
	.zero	2400060
	.globl	size
	.align 32
	.type	size, @object
	.size	size, 800020
size:
	.zero	800020
	.globl	id
	.align 32
	.type	id, @object
	.size	id, 800020
id:
	.zero	800020
	.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
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	cmp
	.type	cmp, @function
cmp:
.LFB56:
	.cfi_startproc
	endbr64
	movl	8(%rdi), %eax
	subl	8(%rsi), %eax
	ret
	.cfi_endproc
.LFE56:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB51:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L12
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L5:
	xorl	%r12d, %r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L3
.L7:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L9:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L6
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L3
	movq	stdin(%rip), %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L5
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.p2align 4
	.globl	init
	.type	init, @function
init:
.LFB52:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L13
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L18
	movl	%edi, %edx
	movdqa	.LC0(%rip), %xmm0
	xorl	%eax, %eax
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %edx
	movdqa	.LC2(%rip), %xmm2
	leaq	id(%rip), %rsi
	leaq	size(%rip), %rcx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm0, %xmm1
	movaps	%xmm2, (%rcx,%rax)
	paddd	%xmm3, %xmm0
	movaps	%xmm1, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L16
	movl	%edi, %eax
	andl	$-4, %eax
	testb	$3, %dil
	je	.L20
.L15:
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
	movl	$1, (%rcx,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L13
	movslq	%edx, %r8
	addl	$2, %eax
	movl	%edx, (%rsi,%r8,4)
	movl	$1, (%rcx,%r8,4)
	cmpl	%eax, %edi
	jle	.L13
	movslq	%eax, %rdx
	movl	%eax, (%rsi,%rdx,4)
	movl	$1, (%rcx,%rdx,4)
.L13:
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	ret
.L18:
	xorl	%eax, %eax
	leaq	id(%rip), %rsi
	leaq	size(%rip), %rcx
	jmp	.L15
	.cfi_endproc
.LFE52:
	.size	init, .-init
	.p2align 4
	.globl	root
	.type	root, @function
root:
.LFB53:
	.cfi_startproc
	endbr64
	leaq	id(%rip), %rcx
	movslq	%edi, %rax
	movslq	(%rcx,%rax,4), %rax
	cmpl	%eax, %edi
	je	.L21
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	(%rcx,%rax,4), %rax
	movslq	%edi, %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	%rax, %rdi
	movslq	(%rcx,%rax,4), %rax
	cmpl	%eax, %edi
	jne	.L23
.L21:
	ret
	.cfi_endproc
.LFE53:
	.size	root, .-root
	.p2align 4
	.globl	connected
	.type	connected, @function
connected:
.LFB54:
	.cfi_startproc
	endbr64
	movslq	%edi, %rcx
	leaq	id(%rip), %rax
	movq	%rcx, %rdx
	movslq	(%rax,%rcx,4), %rcx
	cmpl	%ecx, %edx
	je	.L26
	.p2align 4,,10
	.p2align 3
.L27:
	movl	%edx, %edi
	movl	(%rax,%rcx,4), %edx
	movslq	%edi, %rcx
	movl	%edx, (%rax,%rcx,4)
	movslq	%edx, %rcx
	movslq	(%rax,%rcx,4), %rcx
	cmpl	%edx, %ecx
	jne	.L27
.L26:
	movslq	%esi, %rcx
	movslq	(%rax,%rcx,4), %rcx
	cmpl	%ecx, %esi
	je	.L28
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%esi, %edi
	movl	(%rax,%rcx,4), %esi
	movslq	%edi, %rcx
	movl	%esi, (%rax,%rcx,4)
	movslq	%esi, %rcx
	movslq	(%rax,%rcx,4), %rcx
	cmpl	%esi, %ecx
	jne	.L29
.L28:
	xorl	%eax, %eax
	cmpl	%edx, %esi
	sete	%al
	ret
	.cfi_endproc
.LFE54:
	.size	connected, .-connected
	.p2align 4
	.globl	unite
	.type	unite, @function
unite:
.LFB55:
	.cfi_startproc
	endbr64
	movslq	%edi, %r8
	leaq	id(%rip), %rax
	movl	%esi, %ecx
	movslq	(%rax,%r8,4), %rsi
	movq	%r8, %rdx
	cmpl	%esi, %r8d
	je	.L35
	.p2align 4,,10
	.p2align 3
.L36:
	movslq	(%rax,%rsi,4), %r8
	movl	%edx, %edi
	movslq	%edi, %rsi
	movl	%r8d, (%rax,%rsi,4)
	movslq	(%rax,%r8,4), %rsi
	movq	%r8, %rdx
	cmpl	%r8d, %esi
	jne	.L36
.L35:
	movslq	%ecx, %rdi
	movslq	(%rax,%rdi,4), %rsi
	cmpl	%esi, %ecx
	je	.L37
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%ecx, %edi
	movl	(%rax,%rsi,4), %ecx
	movslq	%edi, %rsi
	movslq	%ecx, %rdi
	movl	%ecx, (%rax,%rsi,4)
	movslq	(%rax,%rdi,4), %rsi
	cmpl	%ecx, %esi
	jne	.L38
.L37:
	cmpl	%edx, %ecx
	je	.L34
	leaq	size(%rip), %rsi
	movl	(%rsi,%r8,4), %r10d
	movl	(%rsi,%rdi,4), %r9d
	leal	(%r10,%r9), %r11d
	cmpl	%r9d, %r10d
	jge	.L40
	movl	%ecx, (%rax,%r8,4)
	movl	%r11d, (%rsi,%rdi,4)
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%edx, (%rax,%rdi,4)
	movl	%r11d, (%rsi,%r8,4)
.L34:
	ret
	.cfi_endproc
.LFE55:
	.size	unite, .-unite
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB57:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	t(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	in
	subl	$1, %eax
	movl	%eax, N(%rip)
	testl	%eax, %eax
	jle	.L46
	movq	%r12, %rbx
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L65:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rdx
	cmpq	%rdx, %rax
	jnb	.L91
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rax), %eax
.L48:
	xorl	%r13d, %r13d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L49:
	leaq	1(%rcx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L51
.L50:
	movq	%rsi, %rcx
.L52:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rdx, %rcx
	jb	.L49
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdx
	cmpl	$47, %eax
	jg	.L50
	.p2align 4,,10
	.p2align 3
.L51:
	movl	%r13d, (%rbx)
	cmpq	%rsi, %rdx
	jbe	.L92
	leaq	1(%rsi), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rsi), %eax
.L54:
	xorl	%r13d, %r13d
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L55:
	leaq	1(%rcx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L57
.L56:
	movq	%rsi, %rcx
.L58:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rdx, %rcx
	jb	.L55
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdx
	cmpl	$47, %eax
	jg	.L56
	.p2align 4,,10
	.p2align 3
.L57:
	movl	%r13d, 4(%rbx)
	cmpq	%rsi, %rdx
	jbe	.L93
	leaq	1(%rsi), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rsi), %eax
.L60:
	xorl	%r13d, %r13d
	jmp	.L64
	.p2align 4,,10
	.p2align 3
.L61:
	leaq	1(%rcx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L63
.L62:
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
.L64:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rdx, %rcx
	jb	.L61
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L63
	movq	stdin(%rip), %rdi
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L63:
	movl	N(%rip), %eax
	addl	$1, %ebp
	movl	%r13d, 8(%rbx)
	addq	$12, %rbx
	cmpl	%ebp, %eax
	jg	.L65
.L46:
	leaq	cmp(%rip), %rcx
	movslq	%eax, %rsi
	movl	$12, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	movl	N(%rip), %ecx
	testl	%ecx, %ecx
	js	.L78
	leal	1(%rcx), %esi
	cmpl	$2, %ecx
	jle	.L79
	movl	%esi, %edx
	movdqa	.LC0(%rip), %xmm0
	xorl	%eax, %eax
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %edx
	movdqa	.LC2(%rip), %xmm2
	leaq	id(%rip), %rbx
	leaq	size(%rip), %r14
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L68:
	movdqa	%xmm0, %xmm1
	movaps	%xmm2, (%r14,%rax)
	paddd	%xmm3, %xmm0
	movaps	%xmm1, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L68
	movl	%esi, %eax
	andl	$-4, %eax
	andl	$3, %esi
	je	.L70
.L67:
	movslq	%eax, %rdx
	movl	%eax, (%rbx,%rdx,4)
	movl	$1, (%r14,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L72
	movslq	%edx, %rsi
	addl	$2, %eax
	movl	%edx, (%rbx,%rsi,4)
	movl	$1, (%r14,%rsi,4)
	cmpl	%eax, %ecx
	jl	.L70
	movslq	%eax, %rdx
	movl	%eax, (%rbx,%rdx,4)
	movl	$1, (%r14,%rdx,4)
.L70:
	leaq	t(%rip), %rbp
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L77:
	movslq	0(%rbp), %rcx
	movl	4(%rbp), %esi
	movslq	(%rbx,%rcx,4), %rax
	movq	%rcx, %rdi
	cmpl	%eax, %ecx
	je	.L73
	movl	%ecx, %edx
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%edx, %ecx
	movl	(%rbx,%rax,4), %edx
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movl	%edx, (%rbx,%rax,4)
	movslq	(%rbx,%rcx,4), %rax
	cmpl	%edx, %eax
	jne	.L74
.L73:
	movslq	(%r14,%rcx,4), %r8
	movslq	%esi, %rcx
	movslq	(%rbx,%rcx,4), %rax
	cmpl	%eax, %esi
	je	.L75
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L76:
	movl	%edx, %ecx
	movl	(%rbx,%rax,4), %edx
	movslq	%ecx, %rax
	movslq	%edx, %rcx
	movl	%edx, (%rbx,%rax,4)
	movslq	(%rbx,%rcx,4), %rax
	cmpl	%edx, %eax
	jne	.L76
.L75:
	movslq	(%r14,%rcx,4), %rax
	movslq	8(%rbp), %rdx
	addl	$1, %r13d
	addq	$12, %rbp
	imulq	%r8, %rax
	imulq	%rdx, %rax
	addq	%rax, %r12
	call	unite
	cmpl	%r13d, N(%rip)
	jg	.L77
.L66:
	movq	%r12, %rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L91:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L93:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L92:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L54
.L72:
	testl	%ecx, %ecx
	jg	.L70
.L78:
	xorl	%r12d, %r12d
	jmp	.L66
.L79:
	xorl	%eax, %eax
	leaq	id(%rip), %rbx
	leaq	size(%rip), %r14
	jmp	.L67
	.cfi_endproc
.LFE57:
	.size	main, .-main
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 2400060
t:
	.zero	2400060
	.globl	size
	.align 32
	.type	size, @object
	.size	size, 800020
size:
	.zero	800020
	.globl	id
	.align 32
	.type	id, @object
	.size	id, 800020
id:
	.zero	800020
	.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
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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:

// AOJ 1507 Dungeon (II)
// 2018.3.18 bal4u

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

// 高速数値入力
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()  // 非負整数のみ
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

/* UNION-FIND library */
#define MAX 200005
int id[MAX], size[MAX];
void init(int n) { int i; for (i = 0; i < n; i++) id[i] = i, size[i] = 1; }
int root(int i) { while (i != id[i]) id[i] = id[id[i]], i = id[i]; return i; }
int connected(int p, int q) { return root(p) == root(q); }
void unite(int p, int q)
{
	int i = root(p), j = root(q); if (i == j) return;
	if (size[i] < size[j]) id[i] = j, size[j] += size[i]; else id[j] = i, size[i] += size[j];
}

// 本問題関連
typedef struct { int a, b, c; } T;
T t[MAX]; int N;

int cmp(const void *a, const void *b) {	return ((T *)a)->c - ((T *)b)->c; }

int main()
{
	int i, a, b;
	long long ans;

	N = in() - 1;
	for (i = 0; i < N; i++)
		t[i].a = in(), t[i].b = in(), t[i].c = in();
	qsort(t, N, sizeof(T), cmp);
	init(N + 1);
	ans = 0;
	for (i = 0; i < N; i++) {
		a = t[i].a, b = t[i].b;
		ans += (long long)size[root(a)] * size[root(b)] * t[i].c;
		unite(a, b);
	}
	printf("%lld\n", ans);
	return 0;
}

6
0 2 5
2 1 1
2 3 10
3 5 2
3 4 2
 6
0 2 5
2 1 0
2 3 10
3 5 2
3 4 2
 4
0 1 3
0 2 5
1 3 2
 6
0 2 5
2 1 1
2 3 6
3 5 4
3 4 2
 6
0 2 5
2 1 1
2 3 18
3 5 2
3 4 2
 6
0 2 5
2 1 1
2 3 6
3 5 7
3 4 2
 6
0 2 5
3 1 1
2 3 18
3 5 2
3 4 2
 6
0 2 5
2 1 0
2 3 2
3 5 2
3 4 2
 6
0 2 5
3 1 1
2 3 18
3 5 4
3 4 2
 6
0 2 5
3 1 1
2 3 18
3 5 4
3 4 3

107
 106
 23
 75
 179
 84
 160
 43
 166
 168

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

```c
// AOJ 1507 Dungeon (II)
// 2018.3.18 bal4u

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

// 高速数値入力
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()  // 非負整数のみ
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

/* UNION-FIND library */
#define MAX 200005
int id[MAX], size[MAX];
void init(int n) { int i; for (i = 0; i < n; i++) id[i] = i, size[i] = 1; }
int root(int i) { while (i != id[i]) id[i] = id[id[i]], i = id[i]; return i; }
int connected(int p, int q) { return root(p) == root(q); }
void unite(int p, int q)
{
	int i = root(p), j = root(q); if (i == j) return;
	if (size[i] < size[j]) id[i] = j, size[j] += size[i]; else id[j] = i, size[i] += size[j];
}

// 本問題関連
typedef struct { int a, b, c; } T;
T t[MAX]; int N;

int cmp(const void *a, const void *b) {	return ((T *)a)->c - ((T *)b)->c; }

int main()
{
	int i, a, b;
	long long ans;

	N = in() - 1;
	for (i = 0; i < N; i++)
		t[i].a = in(), t[i].b = in(), t[i].c = in();
	qsort(t, N, sizeof(T), cmp);
	init(N + 1);
	ans = 0;
	for (i = 0; i < N; i++) {
		a = t[i].a, b = t[i].b;
		ans += (long long)size[root(a)] * size[root(b)] * t[i].c;
		unite(a, b);
	}
	printf("%lld\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.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	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	id
	.bss
	.align 32
	.type	id, @object
	.size	id, 800020
id:
	.zero	800020
	.globl	size
	.align 32
	.type	size, @object
	.size	size, 800020
size:
	.zero	800020
	.text
	.globl	init
	.type	init, @function
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)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	init, .-init
	.globl	root
	.type	root, @function
root:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	jmp	.L8
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	id(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L9
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	root, .-root
	.globl	connected
	.type	connected, @function
connected:
.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	$8, %rsp
	.cfi_offset 3, -24
	movl	%edi, -12(%rbp)
	movl	%esi, -16(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-16(%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
.LFE9:
	.size	connected, .-connected
	.globl	unite
	.type	unite, @function
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	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L17
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	size(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L16:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L17:
	nop
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	unite, .-unite
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 2400060
t:
	.zero	2400060
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	8(%rax), %edx
	movq	-16(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, N(%rip)
	movl	$0, -36(%rbp)
	jmp	.L21
.L22:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -36(%rbp)
.L21:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L22
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	t(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	init
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L23
.L24:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	root
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rbx
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	root
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	%rax, %rbx
	movq	%rbx, %rcx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+t(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	%rcx, %rax
	addq	%rax, -24(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	addl	$1, -36(%rbp)
.L23:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L24
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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	in
	.type	in, @function
in:
.LFB6:
	.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	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	id
	.bss
	.align 32
	.type	id, @object
	.size	id, 800020
id:
	.zero	800020
	.globl	size
	.align 32
	.type	size, @object
	.size	size, 800020
size:
	.zero	800020
	.text
	.globl	init
	.type	init, @function
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)
	movl	$0, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L5:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	init, .-init
	.globl	root
	.type	root, @function
root:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	jmp	.L8
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	id(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	id(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L9
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	root, .-root
	.globl	connected
	.type	connected, @function
connected:
.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	$8, %rsp
	.cfi_offset 3, -24
	movl	%edi, -12(%rbp)
	movl	%esi, -16(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, %ebx
	movl	-16(%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
.LFE9:
	.size	connected, .-connected
	.globl	unite
	.type	unite, @function
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	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	root
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L17
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	size(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L16
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L16:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	id(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L17:
	nop
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	unite, .-unite
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 2400060
t:
	.zero	2400060
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	8(%rax), %edx
	movq	-16(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, N(%rip)
	movl	$0, -36(%rbp)
	jmp	.L21
.L22:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	4+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	leaq	8+t(%rip), %rax
	movl	%edx, (%rcx,%rax)
	addl	$1, -36(%rbp)
.L21:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L22
	movl	N(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rsi
	leaq	t(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	N(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	init
	movq	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L23
.L24:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, %edi
	call	root
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rbx
	movl	-28(%rbp), %eax
	movl	%eax, %edi
	call	root
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	size(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	%rax, %rbx
	movq	%rbx, %rcx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+t(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	%rcx, %rax
	addq	%rax, -24(%rbp)
	movl	-28(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	unite
	addl	$1, -36(%rbp)
.L23:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L24
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.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:
