// File: /workspace/github_cpp_makefile_star2_O2/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
movslq %esi, %rax
movq 0x20(%rdi), %rcx
movl (%rcx,%rax,4), %eax
leaq 0xc(%rsp), %r14
movl %eax, (%r14)
leaq 0x68(%rsp), %r15
movq %r15, %rdi
callq 0x4114
movq %r15, %rdi
movq %r14, %rsi
callq 0x57a8
leaq 0xc0(%rbx), %r13
movslq 0xc(%rsp), %rsi
movq %r13, %rdi
callq 0x4052
orq %rdx, (%rax)
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r14
andq $0x0, 0x10(%r14)
movaps %xmm0, (%r14)
leaq 0x68(%rsp), %r15
leaq 0x8(%rsp), %rbp
movq 0x78(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x3325
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movq %r15, %rdi
callq 0x59dc
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x4034
movslq 0x10(%rsp), %rax
movq 0x118(%rbx), %rcx
movslq (%rcx,%rax,4), %r12
cltq
movslq 0x4(%rcx,%rax,4), %rax
cmpq %rax, %r12
jge 0x3298
movq 0xe8(%rbx), %rax
movslq (%rax,%r12,4), %rsi
movl %esi, 0x8(%rsp)
movq %r13, %rdi
callq 0x4052
testq %rdx, (%rax)
jne 0x3315
movq %r15, %rdi
movq %rbp, %rsi
callq 0x57a8
movslq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x4052
orq %rdx, (%rax)
incq %r12
movl 0x10(%rsp), %eax
movq 0x118(%rbx), %rcx
jmp 0x32d2
movq 0x80(%rbx), %rax
cmpq %rax, 0x88(%rbx)
je 0x333c
movq %rax, 0x88(%rbx)
leaq 0x80(%rbx), %r15
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x98(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x148(%rbx), %r14
xorl %edx, %edx
movq %r14, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %rdx
jge 0x347a
movq %rdx, 0x40(%rsp)
movslq (%rax,%rdx,4), %r14
movq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x4052
notq %rdx
andq %rdx, (%rax)
movq 0x68(%rbx), %rax
movslq (%rax,%r14,4), %rbp
movq %r14, 0x48(%rsp)
leal 0x1(%r14), %ecx
movslq %ecx, %r12
leaq (,%rbp,4), %r14
movslq (%rax,%r12,4), %rax
cmpq %rax, %rbp
jge 0x33e7
movq 0x50(%rbx), %rsi
addq %r14, %rsi
movq %r15, %rdi
callq 0x4034
incq %rbp
movq 0x68(%rbx), %rax
addq $0x4, %r14
jmp 0x33c2
movq 0x130(%rbx), %rax
movq 0x48(%rsp), %rcx
movslq (%rax,%rcx,4), %rbp
movq 0x30(%rsp), %r14
movslq (%rax,%r12,4), %rax
cmpq %rax, %rbp
jge 0x346d
movq 0x100(%rbx), %rax
movslq (%rax,%rbp,4), %rsi
movl %esi, 0x8(%rsp)
movq %r13, %rdi
callq 0x4052
testq %rdx, (%rax)
jne 0x3461
movslq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4052
testq %rdx, (%rax)
jne 0x3461
movslq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4052
orq %rdx, (%rax)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4034
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x57a8
incq %rbp
movq 0x130(%rbx), %rax
jmp 0x33fc
movq 0x40(%rsp), %rdx
incq %rdx
jmp 0x336d
leaq 0x68(%rsp), %rbp
movq 0x78(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x3562
movslq (%rax), %r13
movq %rbp, %rdi
callq 0x59dc
movq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0x4052
notq %rdx
andq %rdx, (%rax)
movq 0x68(%rbx), %rax
movslq (%rax,%r13,4), %rbp
leal 0x1(%r13), %ecx
movslq %ecx, %r12
leaq (,%rbp,4), %r14
movslq (%rax,%r12,4), %rax
cmpq %rax, %rbp
jge 0x34ec
movq 0x50(%rbx), %rsi
addq %r14, %rsi
movq %r15, %rdi
callq 0x4034
incq %rbp
movq 0x68(%rbx), %rax
addq $0x4, %r14
jmp 0x34c7
movq 0x130(%rbx), %rax
movslq (%rax,%r13,4), %r13
movq 0x30(%rsp), %r14
leaq 0x68(%rsp), %rbp
movslq (%rax,%r12,4), %rax
cmpq %rax, %r13
jge 0x347f
movq 0x100(%rbx), %rax
movslq (%rax,%r13,4), %rsi
movl %esi, 0x8(%rsp)
movq %r14, %rdi
callq 0x4052
testq %rdx, (%rax)
jne 0x3556
movslq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4052
orq %rdx, (%rax)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4034
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x57a8
incq %r13
movq 0x130(%rbx), %rax
jmp 0x3501
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
jbe 0x3591
movslq (%rax,%rbx,4), %rsi
movq %r14, %rdi
callq 0x4052
notq %rdx
andq %rdx, (%rax)
incq %rbx
jmp 0x3564
leaq 0x10(%rsp), %rdi
callq 0x284a
leaq 0x50(%rsp), %rdi
callq 0x284a
leaq 0x68(%rsp), %rdi
callq 0x42c6
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x35c3
movq %rax, %rbx
jmp 0x3600
jmp 0x35e4
jmp 0x35e4
jmp 0x35e4
jmp 0x35f3
jmp 0x35e4
jmp 0x35e4
jmp 0x35e4
jmp 0x35e4
jmp 0x35f3
jmp 0x35f3
jmp 0x35e4
jmp 0x35e4
jmp 0x35e4
jmp 0x35e4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x284a
jmp 0x35f6
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x284a
leaq 0x68(%rsp), %rdi
callq 0x42c6
movq %rbx, %rdi
callq 0x21d0