// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x170(%rdi), %r12
andl $0x0, 0x170(%rdi)
movslq (%rdi), %rsi
movq 0x118(%rdi), %rax
movq 0x130(%rdi), %rcx
xorl %r8d, %r8d
testl %esi, %esi
movl $0x0, %edx
cmovgl %esi, %edx
xorl %edi, %edi
leal 0x1(%rdi), %r9d
movslq %r9d, %r9
movslq %edi, %r10
leal -0x1(%r8), %edi
movq %r8, %r11
cmpq %r11, %rdx
je 0x2ca7
movl (%rax,%r11,4), %ebp
movl 0x4(%rax,%r11,4), %r14d
addl 0x4(%rcx,%r11,4), %r14d
addl (%rcx,%r11,4), %ebp
leaq 0x1(%r11), %r8
subl %ebp, %r14d
movl (%rax,%r9,4), %ebp
movl (%rax,%r10,4), %r11d
addl (%rcx,%r9,4), %ebp
addl (%rcx,%r10,4), %r11d
subl %r11d, %ebp
incl %edi
movq %r8, %r11
cmpl %ebp, %r14d
jle 0x2c66
movl %edi, (%r12)
jmp 0x2c55
leaq 0x178(%rbx), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x3e44
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x4114
movq %r14, %rdi
movq %r12, 0x10(%rsp)
movq %r12, %rsi
callq 0x57a8
leaq 0x18(%rsp), %r12
leaq 0xc(%rsp), %r13
movq 0x28(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x2d5c
movslq (%rax), %rbp
movq %r12, %rdi
callq 0x59dc
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4052
orq %rdx, (%rax)
movq 0x118(%rbx), %rax
movslq (%rax,%rbp,4), %r14
movslq 0x4(%rax,%rbp,4), %rax
cmpq %rax, %r14
jge 0x2cdf
movq 0xe8(%rbx), %rax
movslq (%rax,%r14,4), %rsi
movl %esi, 0xc(%rsp)
movq %r15, %rdi
callq 0x4052
testq %rdx, (%rax)
jne 0x2d50
movslq 0xc(%rsp), %rsi
movq %r15, %rdi
callq 0x4052
orq %rdx, (%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x57a8
incq %r14
movq 0x118(%rbx), %rax
jmp 0x2d0f
leaq 0x1a0(%rbx), %r12
movslq (%rbx), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x3e44
leaq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x57a8
leaq 0x18(%rsp), %r13
movq 0x28(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x2e03
movslq (%rax), %r14
movq %r13, %rdi
callq 0x59dc
movq %r12, %rdi
movq %r14, %rsi
callq 0x4052
orq %rdx, (%rax)
movq 0x130(%rbx), %rax
movslq (%rax,%r14,4), %rbp
movslq 0x4(%rax,%r14,4), %rax
cmpq %rax, %rbp
jge 0x2d84
movq 0x100(%rbx), %rax
movslq (%rax,%rbp,4), %rsi
movl %esi, 0xc(%rsp)
movq %r12, %rdi
callq 0x4052
testq %rdx, (%rax)
jne 0x2df7
movslq 0xc(%rsp), %rsi
movq %r12, %rdi
callq 0x4052
orq %rdx, (%rax)
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
callq 0x57a8
incq %rbp
movq 0x130(%rbx), %rax
jmp 0x2db4
movq 0x10(%rsp), %rax
movslq (%rax), %rsi
movq %r12, %rdi
callq 0x4052
notq %rdx
andq %rdx, (%rax)
xorl %ebp, %ebp
movslq (%rbx), %rsi
cmpl %esi, %ebp
jge 0x2e30
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2eca
incl %ebp
jmp 0x2e1b
movq %r12, %rdi
xorl %edx, %edx
callq 0x5a32
movslq (%rbx), %rsi
xorl %ebp, %ebp
movq %r15, %rdi
xorl %edx, %edx
callq 0x5a32
leaq 0x80(%rbx), %r14
leaq 0xc(%rsp), %r15
movl %ebp, 0xc(%rsp)
cmpl 0x4(%rbx), %ebp
jge 0x2e71
movq %r14, %rdi
movq %r15, %rsi
callq 0x4034
movl 0xc(%rsp), %ebp
incl %ebp
jmp 0x2e55
leaq 0x18(%rsp), %rdi
callq 0x42c6
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
jmp 0x2ea4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x42c6
movq %rbx, %rdi
callq 0x21d0
nop