// File: /workspace/github_cpp_makefile_star2_O1/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 0x2e93
movl 0x170(%rbx), %edi
movq 0x118(%rbx), %rax
movq 0x130(%rbx), %rcx
xorl %edx, %edx
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 0x2e8b
movl %edx, (%r14)
movl %edx, %edi
incq %rdx
cmpq %rdx, %rsi
jne 0x2e54
leaq 0x178(%rbx), %rdi
movq %rdi, 0x70(%rsp)
xorl %edx, %edx
callq 0x4de4
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 0x621c
movq 0x30(%r12), %rax
movq 0x40(%r12), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
movq %r14, 0x60(%rsp)
je 0x2efd
movl (%r14), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x2f0a
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x6392
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
je 0x3076
leaq 0x3f(%r14), %r15
leaq 0xc(%rsp), %r13
movslq (%rax), %rbp
movq 0x30(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x2f44
addq $0x4, %rax
jmp 0x2f76
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), %rax
movq %rax, 0x28(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x30(%rsp)
movq %rax, 0x20(%rsp)
leaq 0x3f(%rbp), %rax
testq %rbp, %rbp
cmovnsq %rbp, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x178(%rbx), %rax
movq %rbp, %rcx
andq %r15, %rcx
xorl %edx, %edx
cmpq %r14, %rcx
setbe %dl
movl $0x1, %esi
movl %ebp, %ecx
shlq %cl, %rsi
orq %rsi, -0x8(%rax,%rdx,8)
movq 0x118(%rbx), %rax
movslq (%rax,%rbp,4), %r12
cmpl 0x4(%rax,%rbp,4), %r12d
jge 0x3066
movq 0xe8(%rbx), %rax
movslq (%rax,%r12,4), %rcx
movl %ecx, 0xc(%rsp)
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x178(%rbx), %rax
movq %rcx, %rsi
andq %r15, %rsi
xorl %edx, %edx
cmpq %r14, %rsi
setbe %dl
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rax,%rdx,8), %rdi
btq %rcx, %rdi
jb 0x304e
leaq -0x8(,%rdx,8), %rdx
orq %rsi, %rdi
movq %rdi, (%rax,%rdx)
movq 0x40(%rsp), %rax
movq 0x50(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rax
je 0x3041
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x304e
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6392
incq %r12
movq 0x118(%rbx), %rax
movslq 0x4(%rax,%rbp,4), %rax
cmpq %rax, %r12
jl 0x2fc8
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0x2f2d
leaq 0x1a0(%rbx), %rdi
movslq (%rbx), %rsi
movq %rdi, 0x68(%rsp)
xorl %edx, %edx
callq 0x4de4
movq 0x40(%rsp), %rax
movq 0x50(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x30b3
movq 0x60(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x30c2
leaq 0x10(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x6392
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
je 0x3224
leaq 0x3f(%r14), %r12
leaq 0xc(%rsp), %r13
movslq (%rax), %rbp
movq 0x30(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x30f2
addq $0x4, %rax
jmp 0x3124
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), %rax
movq %rax, 0x28(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x30(%rsp)
movq %rax, 0x20(%rsp)
leaq 0x3f(%rbp), %rax
testq %rbp, %rbp
cmovnsq %rbp, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x1a0(%rbx), %rax
movq %rbp, %rcx
andq %r12, %rcx
xorl %edx, %edx
cmpq %r14, %rcx
setbe %dl
movl $0x1, %esi
movl %ebp, %ecx
shlq %cl, %rsi
orq %rsi, -0x8(%rax,%rdx,8)
movq 0x130(%rbx), %rax
movslq (%rax,%rbp,4), %r15
cmpl 0x4(%rax,%rbp,4), %r15d
jge 0x3214
movq 0x100(%rbx), %rax
movslq (%rax,%r15,4), %rcx
movl %ecx, 0xc(%rsp)
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x1a0(%rbx), %rax
movq %rcx, %rsi
andq %r12, %rsi
xorl %edx, %edx
cmpq %r14, %rsi
setbe %dl
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rax,%rdx,8), %rdi
btq %rcx, %rdi
jb 0x31fc
leaq -0x8(,%rdx,8), %rdx
orq %rsi, %rdi
movq %rdi, (%rax,%rdx)
movq 0x40(%rsp), %rax
movq 0x50(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rax
je 0x31ef
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x31fc
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6392
incq %r15
movq 0x130(%rbx), %rax
movslq 0x4(%rax,%rbp,4), %rax
cmpq %rax, %r15
jl 0x3176
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0x30db
movslq 0x170(%rbx), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
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 0x327e
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x333c
incl %ebp
movl (%rbx), %eax
cmpl %eax, %ebp
jl 0x326c
movslq %eax, %rsi
movq 0x68(%rsp), %rdi
xorl %edx, %edx
callq 0x65a6
movslq (%rbx), %rsi
movq 0x70(%rsp), %rdi
xorl %edx, %edx
callq 0x65a6
movl $0x0, 0xc(%rsp)
cmpl $0x0, 0x4(%rbx)
jle 0x32f1
leaq 0x80(%rbx), %r14
xorl %eax, %eax
leaq 0xc(%rsp), %r15
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x32d7
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rbx)
jmp 0x32e2
movq %r14, %rdi
movq %r15, %rdx
callq 0x6140
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
cmpl 0x4(%rbx), %eax
jl 0x32b8
leaq 0x10(%rsp), %rdi
callq 0x5170
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3316
jmp 0x3316
jmp 0x3316
jmp 0x3316
jmp 0x3316
jmp 0x3316
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5170
movq %rbx, %rdi
callq 0x2200
nop