// File: /workspace/github_cpp_makefile_star2_O1/todo314[P]pruned-monte-carlo/src/pmc.cpp
// Function: PrunedEstimater::add(int)
void PrunedEstimater::add(int v0) {
	v0 = comp[v0];
	queue<int> Q;
	Q.push(v0);
	removed[v0] = true;
	vector<int> rm;
	for (; !Q.empty();) {
		const int v = Q.front();
		Q.pop();
		rm.push_back(v);
		for (int i = at_e[v]; i < at_e[v + 1]; i++) {
			const int u = es[i];
			if (!removed[u]) {
				Q.push(u);
				removed[u] = true;
			}
		}
	}

	up.clear();

	vector<int> vec;
	for (int i = 0; i < (int) rm.size(); i++) {
		const int v = rm[i];
		memo[v] = false; // for update()
		for (int j = at_p[v]; j < at_p[v + 1]; j++) {
			up.push_back(pmoc[j]);
		}
		for (int j = at_r[v]; j < at_r[v + 1]; j++) {
			const int u = rs[j];
			if (!removed[u] && !visited[u]) {
				visited[u] = true;
				vec.push_back(u);
				Q.push(u);
			}
		}
	}
	// reachable to removed node
	for (; !Q.empty();) {
		const int v = Q.front();
		Q.pop();
		memo[v] = false;
		for (int j = at_p[v]; j < at_p[v + 1]; j++) {
			up.push_back(pmoc[j]);
		}
		for (int i = at_r[v]; i < at_r[v + 1]; i++) {
			const int u = rs[i];
			if (!visited[u]) {
				visited[u] = true;
				vec.push_back(u);
				Q.push(u);
			}
		}
	}
	for (int i = 0; i < vec.size(); i++) {
		visited[vec[i]] = false;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
movslq %esi, %rax
movq 0x20(%rdi), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0xc(%rsp)
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r14
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0x621c
movq 0x30(%r14), %rax
movq 0x40(%r14), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x39db
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x80(%rsp)
jmp 0x39ea
leaq 0x50(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x6392
movslq 0xc(%rsp), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0xc0(%rbx), %rax
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
leaq 0x3f(%r15), %rdx
andq %rcx, %rdx
xorl %esi, %esi
cmpq %r15, %rdx
setbe %sil
movl $0x1, %edx
shlq %cl, %rdx
orq %rdx, -0x8(%rax,%rsi,8)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x60(%rsp), %rax
cmpq %rax, 0x80(%rsp)
je 0x3bdb
leaq 0x3f(%r15), %r14
leaq 0x50(%rsp), %r12
leaq 0x8(%rsp), %r13
movl (%rax), %ecx
movl %ecx, 0x10(%rsp)
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3a7c
addq $0x4, %rax
jmp 0x3aae
movq 0x68(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2170
movq 0x78(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x68(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x70(%rsp)
movq %rax, 0x60(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x3ad0
movl 0x10(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x3adf
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x6140
movslq 0x10(%rsp), %rax
movq 0x118(%rbx), %rcx
movslq (%rcx,%rax,4), %rbp
cmpl 0x4(%rcx,%rax,4), %ebp
jge 0x3bc8
movq 0xe8(%rbx), %rax
movslq (%rax,%rbp,4), %rax
movl %eax, 0x8(%rsp)
leaq 0x3f(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0x6, %rcx
shlq $0x3, %rcx
addq 0xc0(%rbx), %rcx
movq %rax, %rdx
andq %r14, %rdx
xorl %esi, %esi
cmpq %r15, %rdx
setbe %sil
movq -0x8(%rcx,%rsi,8), %rcx
btq %rax, %rcx
jb 0x3bab
movq 0x80(%rsp), %rcx
movq 0x90(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x3b65
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x80(%rsp)
jmp 0x3b70
movq %r12, %rdi
movq %r13, %rsi
callq 0x6392
movslq 0x8(%rsp), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0xc0(%rbx), %rax
movq %rcx, %rdx
andq %r14, %rdx
xorl %esi, %esi
cmpq %r15, %rdx
setbe %sil
movl $0x1, %edx
shlq %cl, %rdx
orq %rdx, -0x8(%rax,%rsi,8)
incq %rbp
movslq 0x10(%rsp), %rax
movq 0x118(%rbx), %rcx
movslq 0x4(%rcx,%rax,4), %rax
cmpq %rax, %rbp
jl 0x3af9
movq 0x60(%rsp), %rax
cmpq %rax, 0x80(%rsp)
jne 0x3a62
movq 0x80(%rbx), %rax
cmpq %rax, 0x88(%rbx)
je 0x3bf2
movq %rax, 0x88(%rbx)
leaq 0x80(%rbx), %rax
movq %rax, 0xa8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x3e02
xorl %edx, %edx
leaq 0x3f(%r15), %r12
movq %rdx, 0xb0(%rsp)
movslq (%rax,%rdx,4), %rbp
leaq 0x3f(%rbp), %rax
testq %rbp, %rbp
cmovnsq %rbp, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x98(%rbx), %rax
movq %rbp, %rcx
andq %r12, %rcx
xorl %edx, %edx
cmpq %r15, %rcx
setbe %dl
movq $-0x2, %rsi
movl %ebp, %ecx
rolq %cl, %rsi
andq %rsi, -0x8(%rax,%rdx,8)
movq 0x68(%rbx), %rax
movslq (%rax,%rbp,4), %r14
cmpl 0x4(%rax,%rbp,4), %r14d
jge 0x3cd7
leaq (,%r14,4), %r13
movq 0x50(%rbx), %rdx
addq %r13, %rdx
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x3cb5
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rbx)
jmp 0x3cc2
movq 0xa8(%rsp), %rdi
callq 0x6140
incq %r14
movq 0x68(%rbx), %rax
movslq 0x4(%rax,%rbp,4), %rax
addq $0x4, %r13
cmpq %rax, %r14
jl 0x3c8d
movq 0x130(%rbx), %rax
movslq (%rax,%rbp,4), %r14
cmpl 0x4(%rax,%rbp,4), %r14d
jge 0x3dda
movq 0x100(%rbx), %rax
movslq (%rax,%r14,4), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
movl %ecx, 0x8(%rsp)
sarq $0x6, %rax
shlq $0x3, %rax
movq 0xc0(%rbx), %rdi
addq %rax, %rdi
movq %rcx, %rdx
andq %r12, %rdx
xorl %esi, %esi
cmpq %r15, %rdx
setbe %sil
movl $0x1, %edx
shlq %cl, %rdx
movq -0x8(%rdi,%rsi,8), %rdi
btq %rcx, %rdi
jb 0x3dc2
leaq -0x8(,%rsi,8), %rsi
addq 0x148(%rbx), %rax
movq (%rsi,%rax), %rdi
testq %rdx, %rdi
jne 0x3dc2
orq %rdx, %rdi
movq %rdi, (%rax,%rsi)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3d77
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x3d86
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x6140
movq 0x80(%rsp), %rax
movq 0x90(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3db3
movl 0x8(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x80(%rsp)
jmp 0x3dc2
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6392
incq %r14
movq 0x130(%rbx), %rax
movslq 0x4(%rax,%rbp,4), %rax
cmpq %rax, %r14
jl 0x3ced
movq 0xb0(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %rdx
jl 0x3c31
movq 0x60(%rsp), %rax
cmpq %rax, 0x80(%rsp)
je 0x400d
leaq 0x3f(%r15), %r13
movslq (%rax), %rbp
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3e30
addq $0x4, %rax
jmp 0x3e62
movq 0x68(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2170
movq 0x78(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x68(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x70(%rsp)
movq %rax, 0x60(%rsp)
leaq 0x3f(%rbp), %rax
testq %rbp, %rbp
cmovnsq %rbp, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x98(%rbx), %rax
movq %rbp, %rcx
andq %r13, %rcx
xorl %edx, %edx
cmpq %r15, %rcx
setbe %dl
movq $-0x2, %rsi
movl %ebp, %ecx
rolq %cl, %rsi
andq %rsi, -0x8(%rax,%rdx,8)
movq 0x68(%rbx), %rax
movslq (%rax,%rbp,4), %r14
leaq 0x1(%rbp), %r12
cmpl 0x4(%rax,%rbp,4), %r14d
jge 0x3f04
leaq (,%r14,4), %r15
movq 0x50(%rbx), %rdx
addq %r15, %rdx
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x3ee3
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rbx)
jmp 0x3ef0
movq 0xa8(%rsp), %rdi
callq 0x6140
incq %r14
movq 0x68(%rbx), %rax
movslq (%rax,%r12,4), %rax
addq $0x4, %r15
cmpq %rax, %r14
jl 0x3ebb
movq 0x130(%rbx), %rax
movslq (%rax,%rbp,4), %r14
cmpl (%rax,%r12,4), %r14d
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
leaq 0x10(%rsp), %rbp
jge 0x3ffa
movq 0x100(%rbx), %rax
movslq (%rax,%r14,4), %rcx
movl %ecx, 0x8(%rsp)
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
addq 0x148(%rbx), %rax
movq %rcx, %rsi
andq %r13, %rsi
xorl %edx, %edx
cmpq %r15, %rsi
setbe %dl
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rax,%rdx,8), %rdi
btq %rcx, %rdi
jb 0x3fe3
leaq -0x8(,%rdx,8), %rdx
orq %rsi, %rdi
movq %rdi, (%rax,%rdx)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3f9a
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x3fa7
movq %rbp, %rdi
leaq 0x8(%rsp), %rdx
callq 0x6140
movq 0x80(%rsp), %rax
movq 0x90(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3fd4
movl 0x8(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x80(%rsp)
jmp 0x3fe3
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x6392
incq %r14
movq 0x130(%rbx), %rax
movslq (%rax,%r12,4), %rax
cmpq %rax, %r14
jl 0x3f28
movq 0x60(%rsp), %rax
cmpq %rax, 0x80(%rsp)
jne 0x3e19
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
je 0x4073
sarq $0x2, %rax
movq 0x148(%rbx), %rdx
cmpq $0x1, %rax
adcq $0x0, %rax
xorl %esi, %esi
leaq 0x3f(%r15), %r8
movslq (%rdi,%rsi,4), %rcx
leaq 0x3f(%rcx), %r9
testq %rcx, %rcx
cmovnsq %rcx, %r9
sarq $0x6, %r9
movq %rcx, %r10
andq %r8, %r10
xorl %r11d, %r11d
cmpq %r15, %r10
setbe %r11b
movq $-0x2, %r10
rolq %cl, %r10
leaq (%rdx,%r9,8), %rcx
andq %r10, -0x8(%rcx,%r11,8)
incq %rsi
cmpq %rsi, %rax
jne 0x4035
testq %rdi, %rdi
je 0x4085
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x409c
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
leaq 0x50(%rsp), %rdi
callq 0x5170
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x40fb
jmp 0x40c1
jmp 0x40ca
movq %rax, %rbx
jmp 0x40e4
jmp 0x40ca
jmp 0x40ca
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x40e4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x40fb
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
leaq 0x50(%rsp), %rdi
callq 0x5170
movq %rbx, %rdi
callq 0x2200
nop