// File: todo314[P]pruned-monte-carlo/src/pmc.cpp
// Function: PrunedEstimater::first()
void PrunedEstimater::first() {
	hub = 0;
	for (int i = 0; i < n; i++) {
		if ((at_e[i + 1] - at_e[i]) + (at_r[i + 1] - at_r[i])
				> (at_e[hub + 1] - at_e[hub]) + (at_r[hub + 1] - at_r[hub])) {
			hub = i;
		}
	}

	descendant.resize(n);
	queue<int> Q;
	Q.push(hub);
	for (; !Q.empty();) {
		// forall v, !remove[v]
		const int v = Q.front();
		Q.pop();
		descendant[v] = true;
		for (int i = at_e[v]; i < at_e[v + 1]; i++) {
			const int u = es[i];
			if (!descendant[u]) {
				descendant[u] = true;
				Q.push(u);
			}
		}
	}

	ancestor.resize(n);
	Q.push(hub);
	for (; !Q.empty();) {
		const int v = Q.front();
		Q.pop();
		ancestor[v] = true;
		for (int i = at_r[v]; i < at_r[v + 1]; i++) {
			const int u = rs[i];
			if (!ancestor[u]) {
				ancestor[u] = true;
				Q.push(u);
			}
		}
	}
	ancestor[hub] = false;

	for (int i = 0; i < n; i++) {
		sigma(i);
	}
	ancestor.assign(n, false);
	descendant.assign(n, false);

	for (int i = 0; i < n1; i++) {
		up.push_back(i);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movl $0x0, 0x170(%rax)
movl $0x0, -0xc(%rbp)
movq -0x110(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl (%rcx), %eax
jge 0x46ef
movq -0x110(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq -0x110(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x12c(%rbp)
addq $0x118, %rdi            # imm = 0x118
movslq -0xc(%rbp), %rsi
callq 0x29c0
movq -0x110(%rbp), %rdi
movq %rax, %rcx
movl -0x12c(%rbp), %eax
subl (%rcx), %eax
movl %eax, -0x124(%rbp)
addq $0x130, %rdi            # imm = 0x130
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq -0x110(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x128(%rbp)
addq $0x130, %rdi            # imm = 0x130
movslq -0xc(%rbp), %rsi
callq 0x29c0
movl -0x128(%rbp), %edx
movl -0x124(%rbp), %ecx
movq %rax, %rsi
movq -0x110(%rbp), %rax
subl (%rsi), %edx
addl %edx, %ecx
movl %ecx, -0x114(%rbp)
movq %rax, %rdi
addq $0x118, %rdi            # imm = 0x118
movl 0x170(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movq -0x110(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x120(%rbp)
movq %rax, %rdi
addq $0x118, %rdi            # imm = 0x118
movslq 0x170(%rax), %rsi
callq 0x29c0
movl -0x120(%rbp), %ecx
movq %rax, %rdx
movq -0x110(%rbp), %rax
subl (%rdx), %ecx
movl %ecx, -0x118(%rbp)
movq %rax, %rdi
addq $0x130, %rdi            # imm = 0x130
movl 0x170(%rax), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movq -0x110(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x11c(%rbp)
movq %rax, %rdi
addq $0x130, %rdi            # imm = 0x130
movslq 0x170(%rax), %rsi
callq 0x29c0
movl -0x11c(%rbp), %edx
movl -0x118(%rbp), %ecx
movq %rax, %rsi
movl -0x114(%rbp), %eax
subl (%rsi), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x46df
movq -0x110(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x170(%rax)
jmp 0x46e1
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x455b
movq -0x110(%rbp), %rax
movq %rax, %rdi
addq $0x178, %rdi            # imm = 0x178
movslq (%rax), %rsi
xorl %edx, %edx
callq 0x7210
leaq -0x60(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x7b10
movq -0x110(%rbp), %rsi
movq -0x138(%rbp), %rdi
addq $0x170, %rsi            # imm = 0x170
callq 0x7b40
jmp 0x4736
jmp 0x4738
leaq -0x60(%rbp), %rdi
callq 0x7b70
movb %al, -0x139(%rbp)
jmp 0x4749
movb -0x139(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x475a
jmp 0x4945
leaq -0x60(%rbp), %rdi
callq 0x7b90
movq %rax, -0x148(%rbp)
jmp 0x476c
movq -0x148(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7bb0
jmp 0x4783
movq -0x110(%rbp), %rdi
addq $0x178, %rdi            # imm = 0x178
movslq -0x70(%rbp), %rsi
callq 0x7930
movq %rdx, -0x158(%rbp)
movq %rax, -0x150(%rbp)
jmp 0x47aa
movq -0x158(%rbp), %rax
movq -0x150(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movq %rax, -0x78(%rbp)
leaq -0x80(%rbp), %rdi
movl $0x1, %esi
callq 0x79c0
movq -0x110(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movslq -0x70(%rbp), %rsi
callq 0x29c0
movl (%rax), %eax
movl %eax, -0x84(%rbp)
movq -0x110(%rbp), %rdi
movl -0x84(%rbp), %eax
movl %eax, -0x15c(%rbp)
addq $0x118, %rdi            # imm = 0x118
movl -0x70(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movl -0x15c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x4940
movq -0x110(%rbp), %rdi
addq $0xe8, %rdi
movslq -0x84(%rbp), %rsi
callq 0x29c0
movq -0x110(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x88(%rbp)
addq $0x178, %rdi            # imm = 0x178
movslq -0x88(%rbp), %rsi
callq 0x7930
movq %rdx, -0x170(%rbp)
movq %rax, -0x168(%rbp)
jmp 0x4872
movq -0x170(%rbp), %rax
movq -0x168(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movq %rax, -0x90(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x7990
xorb $-0x1, %al
testb $0x1, %al
jne 0x48a5
jmp 0x492a
movq -0x110(%rbp), %rdi
addq $0x178, %rdi            # imm = 0x178
movslq -0x88(%rbp), %rsi
callq 0x7930
movq %rdx, -0x180(%rbp)
movq %rax, -0x178(%rbp)
jmp 0x48cf
movq -0x180(%rbp), %rax
movq -0x178(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq %rax, -0xa0(%rbp)
leaq -0xa8(%rbp), %rdi
movl $0x1, %esi
callq 0x79c0
leaq -0x60(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x7b40
jmp 0x490e
jmp 0x492a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7bd0
jmp 0x4cc7
jmp 0x492c
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x47ed
jmp 0x4738
movq -0x110(%rbp), %rax
movq %rax, %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq (%rax), %rsi
xorl %edx, %edx
callq 0x7210
jmp 0x4962
movq -0x110(%rbp), %rsi
addq $0x170, %rsi            # imm = 0x170
leaq -0x60(%rbp), %rdi
callq 0x7b40
jmp 0x497b
jmp 0x497d
leaq -0x60(%rbp), %rdi
callq 0x7b70
movb %al, -0x181(%rbp)
jmp 0x498e
movb -0x181(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x499f
jmp 0x4b82
leaq -0x60(%rbp), %rdi
callq 0x7b90
movq %rax, -0x190(%rbp)
jmp 0x49b1
movq -0x190(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xac(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7bb0
jmp 0x49cb
movq -0x110(%rbp), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq -0xac(%rbp), %rsi
callq 0x7930
movq %rdx, -0x1a0(%rbp)
movq %rax, -0x198(%rbp)
jmp 0x49f5
movq -0x1a0(%rbp), %rax
movq -0x198(%rbp), %rcx
movq %rcx, -0xc0(%rbp)
movq %rax, -0xb8(%rbp)
leaq -0xc0(%rbp), %rdi
movl $0x1, %esi
callq 0x79c0
movq -0x110(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movslq -0xac(%rbp), %rsi
callq 0x29c0
movl (%rax), %eax
movl %eax, -0xc4(%rbp)
movq -0x110(%rbp), %rdi
movl -0xc4(%rbp), %eax
movl %eax, -0x1a4(%rbp)
addq $0x130, %rdi            # imm = 0x130
movl -0xac(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movl -0x1a4(%rbp), %eax
cmpl (%rcx), %eax
jge 0x4b7d
movq -0x110(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0xc4(%rbp), %rsi
callq 0x29c0
movq -0x110(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xc8(%rbp)
addq $0x1a0, %rdi            # imm = 0x1A0
movslq -0xc8(%rbp), %rsi
callq 0x7930
movq %rdx, -0x1b8(%rbp)
movq %rax, -0x1b0(%rbp)
jmp 0x4acc
movq -0x1b8(%rbp), %rax
movq -0x1b0(%rbp), %rcx
movq %rcx, -0xd8(%rbp)
movq %rax, -0xd0(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x7990
xorb $-0x1, %al
testb $0x1, %al
jne 0x4afc
jmp 0x4b67
movq -0x110(%rbp), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq -0xc8(%rbp), %rsi
callq 0x7930
movq %rdx, -0x1c8(%rbp)
movq %rax, -0x1c0(%rbp)
jmp 0x4b26
movq -0x1c8(%rbp), %rax
movq -0x1c0(%rbp), %rcx
movq %rcx, -0xe8(%rbp)
movq %rax, -0xe0(%rbp)
leaq -0xe8(%rbp), %rdi
movl $0x1, %esi
callq 0x79c0
leaq -0x60(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x7b40
jmp 0x4b65
jmp 0x4b67
jmp 0x4b69
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x4a44
jmp 0x497d
movq -0x110(%rbp), %rax
movq %rax, %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq 0x170(%rax), %rsi
callq 0x7930
movq %rdx, -0x1d8(%rbp)
movq %rax, -0x1d0(%rbp)
jmp 0x4baf
movq -0x1d8(%rbp), %rax
movq -0x1d0(%rbp), %rcx
movq %rcx, -0xf8(%rbp)
movq %rax, -0xf0(%rbp)
leaq -0xf8(%rbp), %rdi
xorl %esi, %esi
callq 0x79c0
movl $0x0, -0xfc(%rbp)
movq -0x110(%rbp), %rcx
movl -0xfc(%rbp), %eax
cmpl (%rcx), %eax
jge 0x4c1b
movq -0x110(%rbp), %rdi
movl -0xfc(%rbp), %esi
callq 0x4d10
jmp 0x4c08
jmp 0x4c0a
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x4be3
movq -0x110(%rbp), %rax
movq %rax, %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq (%rax), %rsi
movb $0x0, -0xfd(%rbp)
leaq -0xfd(%rbp), %rdx
callq 0x7bf0
jmp 0x4c44
movq -0x110(%rbp), %rax
movq %rax, %rdi
addq $0x178, %rdi            # imm = 0x178
movslq (%rax), %rsi
movb $0x0, -0xfe(%rbp)
leaq -0xfe(%rbp), %rdx
callq 0x7bf0
jmp 0x4c6d
movl $0x0, -0x104(%rbp)
movq -0x110(%rbp), %rcx
movl -0x104(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x4cb5
movq -0x110(%rbp), %rdi
subq $-0x80, %rdi
leaq -0x104(%rbp), %rsi
callq 0x7860
jmp 0x4ca2
jmp 0x4ca4
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x4c77
leaq -0x60(%rbp), %rdi
callq 0x7bd0
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x2280