// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movq %rdi, %rbx
leaq 0x170(%rdi), %r14
movl $0x0, 0x170(%rdi)
movslq (%rdi), %rsi
testq %rsi, %rsi
jle 0x2e95
movq 0x118(%rbx), %rax
movq 0x130(%rbx), %rcx
xorl %edx, %edx
xorl %edi, %edi
movl (%rax,%rdx,4), %r8d
movl 0x4(%rax,%rdx,4), %r9d
addl 0x4(%rcx,%rdx,4), %r9d
addl (%rcx,%rdx,4), %r8d
subl %r8d, %r9d
movslq %edi, %r8
movl (%rax,%r8,4), %r10d
movl 0x4(%rax,%r8,4), %r11d
addl 0x4(%rcx,%r8,4), %r11d
addl (%rcx,%r8,4), %r10d
subl %r10d, %r11d
cmpl %r11d, %r9d
jle 0x2e8d
movl %edx, (%r14)
movl %edx, %edi
incq %rdx
cmpq %rdx, %rsi
jne 0x2e56
leaq 0x178(%rbx), %rdi
movq %rdi, 0x70(%rsp)
xorl %edx, %edx
callq 0x4d48
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, 0x40(%r12)
movaps %xmm0, 0x30(%r12)
movaps %xmm0, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movaps %xmm0, (%r12)
movq %r12, %rdi
xorl %esi, %esi
callq 0x6574
movq 0x30(%r12), %rax
movq 0x40(%r12), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
movq %r14, 0x60(%rsp)
je 0x2eff
movl (%r14), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x2f11
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x66ea
movq 0x40(%rsp), %rax
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
movq 0x20(%rsp), %rdx
cmpq %rdx, %rax
je 0x307b
leaq 0x3f(%r14), %r15
leaq 0xc(%rsp), %r13
movslq (%rdx), %rbp
movq 0x30(%rsp), %rax
addq $-0x4, %rax
cmpq %rax, %rdx
je 0x2f49
addq $0x4, %rdx
jmp 0x2f7b
movq 0x28(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2170
movq 0x38(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x38(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
leaq 0x200(%rdx), %rax
movq %rax, 0x30(%rsp)
movq %rdx, 0x20(%rsp)
leal 0x3f(%rbp), %eax
testl %ebp, %ebp
cmovnsl %ebp, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
addq 0x178(%rbx), %rax
movq %rbp, %rcx
andq %r15, %rcx
xorl %esi, %esi
cmpq %r14, %rcx
setbe %sil
movl $0x1, %edi
movl %ebp, %ecx
shlq %cl, %rdi
orq %rdi, -0x8(%rax,%rsi,8)
movq 0x118(%rbx), %rax
movslq (%rax,%rbp,4), %r12
cmpl 0x4(%rax,%rbp,4), %r12d
jge 0x3070
movq 0xe8(%rbx), %rcx
movslq (%rcx,%r12,4), %rcx
leal 0x3f(%rcx), %edx
testq %rcx, %rcx
movl %ecx, 0xc(%rsp)
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
shlq $0x3, %rdx
addq 0x178(%rbx), %rdx
movq %rcx, %rdi
andq %r15, %rdi
xorl %esi, %esi
cmpq %r14, %rdi
setbe %sil
movl $0x1, %edi
shlq %cl, %rdi
movq -0x8(%rdx,%rsi,8), %r8
btq %rcx, %r8
jb 0x305a
leaq -0x8(,%rsi,8), %rsi
orq %rdi, %r8
movq %r8, (%rdx,%rsi)
movq 0x40(%rsp), %rdx
movq 0x50(%rsp), %rsi
addq $-0x4, %rsi
cmpq %rsi, %rdx
je 0x3046
movl %ecx, (%rdx)
addq $0x4, %rdx
movq %rdx, 0x40(%rsp)
jmp 0x305a
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x66ea
movq 0x118(%rbx), %rax
incq %r12
movslq 0x4(%rax,%rbp,4), %rcx
cmpq %rcx, %r12
jl 0x2fcc
movq 0x20(%rsp), %rdx
cmpq %rdx, 0x40(%rsp)
jne 0x2f32
leaq 0x1a0(%rbx), %rdi
movslq (%rbx), %rsi
movq %rdi, 0x68(%rsp)
xorl %edx, %edx
callq 0x4d48
movq 0x40(%rsp), %rax
movq 0x50(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x30b8
movq 0x60(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x30cc
leaq 0x10(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x66ea
movq 0x40(%rsp), %rax
movq 0x20(%rsp), %rdx
cmpq %rdx, %rax
je 0x322c
leaq 0x3f(%r14), %r12
leaq 0xc(%rsp), %r13
movslq (%rdx), %rbp
movq 0x30(%rsp), %rax
addq $-0x4, %rax
cmpq %rax, %rdx
je 0x30fa
addq $0x4, %rdx
jmp 0x312c
movq 0x28(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2170
movq 0x38(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x38(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
leaq 0x200(%rdx), %rax
movq %rax, 0x30(%rsp)
movq %rdx, 0x20(%rsp)
leal 0x3f(%rbp), %eax
testl %ebp, %ebp
cmovnsl %ebp, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
addq 0x1a0(%rbx), %rax
movq %rbp, %rcx
andq %r12, %rcx
xorl %esi, %esi
cmpq %r14, %rcx
setbe %sil
movl $0x1, %edi
movl %ebp, %ecx
shlq %cl, %rdi
orq %rdi, -0x8(%rax,%rsi,8)
movq 0x130(%rbx), %rax
movslq (%rax,%rbp,4), %r15
cmpl 0x4(%rax,%rbp,4), %r15d
jge 0x3221
movq 0x100(%rbx), %rcx
movslq (%rcx,%r15,4), %rcx
leal 0x3f(%rcx), %edx
testq %rcx, %rcx
movl %ecx, 0xc(%rsp)
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
shlq $0x3, %rdx
addq 0x1a0(%rbx), %rdx
movq %rcx, %rdi
andq %r12, %rdi
xorl %esi, %esi
cmpq %r14, %rdi
setbe %sil
movl $0x1, %edi
shlq %cl, %rdi
movq -0x8(%rdx,%rsi,8), %r8
btq %rcx, %r8
jb 0x320b
leaq -0x8(,%rsi,8), %rsi
orq %rdi, %r8
movq %r8, (%rdx,%rsi)
movq 0x40(%rsp), %rdx
movq 0x50(%rsp), %rsi
addq $-0x4, %rsi
cmpq %rsi, %rdx
je 0x31f7
movl %ecx, (%rdx)
addq $0x4, %rdx
movq %rdx, 0x40(%rsp)
jmp 0x320b
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x66ea
movq 0x130(%rbx), %rax
incq %r15
movslq 0x4(%rax,%rbp,4), %rcx
cmpq %rcx, %r15
jl 0x317d
movq 0x20(%rsp), %rdx
cmpq %rdx, 0x40(%rsp)
jne 0x30e3
movslq 0x170(%rbx), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
cmovnsl %ecx, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
addq 0x1a0(%rbx), %rax
leaq 0x3f(%r14), %rdx
andq %rcx, %rdx
xorl %esi, %esi
cmpq %r14, %rdx
setbe %sil
movq $-0x2, %rdx
rolq %cl, %rdx
andq %rdx, -0x8(%rax,%rsi,8)
movl (%rbx), %eax
testl %eax, %eax
jle 0x3285
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3342
incl %ebp
movl (%rbx), %eax
cmpl %eax, %ebp
jl 0x3273
movslq %eax, %rsi
movq 0x68(%rsp), %rdi
xorl %edx, %edx
callq 0x68fe
movslq (%rbx), %rsi
movq 0x70(%rsp), %rdi
xorl %edx, %edx
callq 0x68fe
movl $0x0, 0xc(%rsp)
cmpl $0x0, 0x4(%rbx)
jle 0x32f8
leaq 0x80(%rbx), %r14
xorl %eax, %eax
leaq 0xc(%rsp), %r15
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x32de
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rbx)
jmp 0x32e9
movq %r14, %rdi
movq %r15, %rdx
callq 0x6498
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
cmpl 0x4(%rbx), %eax
jl 0x32bf
leaq 0x10(%rsp), %rdi
callq 0x50ee
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x331d
jmp 0x331d
jmp 0x331d
jmp 0x331d
jmp 0x331d
jmp 0x331d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x50ee
movq %rbx, %rdi
callq 0x2200