// File: 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
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
addq $0x20, %rdi
movslq -0xc(%rbp), %rsi
callq 0x29c0
movl (%rax), %eax
movl %eax, -0xc(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x7b10
movq -0x1a0(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x7b40
jmp 0x55e1
movq -0x1a8(%rbp), %rdi
addq $0xc0, %rdi
movslq -0xc(%rbp), %rsi
callq 0x7930
movq %rdx, -0x1b8(%rbp)
movq %rax, -0x1b0(%rbp)
jmp 0x5608
movq -0x1b8(%rbp), %rax
movq -0x1b0(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movq %rax, -0x78(%rbp)
leaq -0x80(%rbp), %rdi
movl $0x1, %esi
callq 0x79c0
leaq -0x98(%rbp), %rdi
callq 0x2c00
leaq -0x60(%rbp), %rdi
callq 0x7b70
movb %al, -0x1b9(%rbp)
jmp 0x5649
movb -0x1b9(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x565a
jmp 0x5820
leaq -0x60(%rbp), %rdi
callq 0x7b90
movq %rax, -0x1c8(%rbp)
jmp 0x566c
movq -0x1c8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x9c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7bb0
jmp 0x5686
leaq -0x98(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
callq 0x7860
jmp 0x569b
movq -0x1a8(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movslq -0x9c(%rbp), %rsi
callq 0x29c0
movl (%rax), %eax
movl %eax, -0xa0(%rbp)
movq -0x1a8(%rbp), %rdi
movl -0xa0(%rbp), %eax
movl %eax, -0x1cc(%rbp)
addq $0x118, %rdi            # imm = 0x118
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movl -0x1cc(%rbp), %eax
cmpl (%rcx), %eax
jge 0x581b
movq -0x1a8(%rbp), %rdi
addq $0xe8, %rdi
movslq -0xa0(%rbp), %rsi
callq 0x29c0
movq -0x1a8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
addq $0xc0, %rdi
movslq -0xa4(%rbp), %rsi
callq 0x7930
movq %rdx, -0x1e0(%rbp)
movq %rax, -0x1d8(%rbp)
jmp 0x5745
movq -0x1e0(%rbp), %rax
movq -0x1d8(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movq %rax, -0xb0(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x7990
xorb $-0x1, %al
testb $0x1, %al
jne 0x5778
jmp 0x5805
leaq -0x60(%rbp), %rdi
leaq -0xa4(%rbp), %rsi
callq 0x7b40
jmp 0x578a
movq -0x1a8(%rbp), %rdi
addq $0xc0, %rdi
movslq -0xa4(%rbp), %rsi
callq 0x7930
movq %rdx, -0x1f0(%rbp)
movq %rax, -0x1e8(%rbp)
jmp 0x57b4
movq -0x1f0(%rbp), %rax
movq -0x1e8(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movq %rax, -0xc0(%rbp)
leaq -0xc8(%rbp), %rdi
movl $0x1, %esi
callq 0x79c0
jmp 0x5805
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5f3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x5f2f
jmp 0x5807
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x56bd
jmp 0x5638
movq -0x1a8(%rbp), %rdi
addq $0x80, %rdi
callq 0x7c50
leaq -0xe0(%rbp), %rdi
callq 0x2c00
movl $0x0, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
movl %eax, -0x1f4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x71f0
movq %rax, %rcx
movl -0x1f4(%rbp), %eax
cmpl %ecx, %eax
jge 0x5b91
movslq -0xe4(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x29c0
movq -0x1a8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xe8(%rbp)
addq $0x98, %rdi
movslq -0xe8(%rbp), %rsi
callq 0x7930
movq %rdx, -0x208(%rbp)
movq %rax, -0x200(%rbp)
jmp 0x58b7
movq -0x208(%rbp), %rax
movq -0x200(%rbp), %rcx
movq %rcx, -0xf8(%rbp)
movq %rax, -0xf0(%rbp)
leaq -0xf8(%rbp), %rdi
xorl %esi, %esi
callq 0x79c0
movq -0x1a8(%rbp), %rdi
addq $0x68, %rdi
movslq -0xe8(%rbp), %rsi
callq 0x29c0
movl (%rax), %eax
movl %eax, -0xfc(%rbp)
movq -0x1a8(%rbp), %rdi
movl -0xfc(%rbp), %eax
movl %eax, -0x20c(%rbp)
addq $0x68, %rdi
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movl -0x20c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x599b
movq -0x1a8(%rbp), %rdi
movq %rdi, %rax
subq $-0x80, %rax
movq %rax, -0x218(%rbp)
addq $0x50, %rdi
movslq -0xfc(%rbp), %rsi
callq 0x29c0
movq -0x218(%rbp), %rdi
movq %rax, %rsi
callq 0x7860
jmp 0x596b
jmp 0x596d
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x5900
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x29e0
jmp 0x5f2f
movq -0x1a8(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movslq -0xe8(%rbp), %rsi
callq 0x29c0
movl (%rax), %eax
movl %eax, -0x100(%rbp)
movq -0x1a8(%rbp), %rdi
movl -0x100(%rbp), %eax
movl %eax, -0x21c(%rbp)
addq $0x130, %rdi            # imm = 0x130
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movl -0x21c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x5b7b
movq -0x1a8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x100(%rbp), %rsi
callq 0x29c0
movq -0x1a8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x104(%rbp)
addq $0xc0, %rdi
movslq -0x104(%rbp), %rsi
callq 0x7930
movq %rdx, -0x230(%rbp)
movq %rax, -0x228(%rbp)
jmp 0x5a45
movq -0x230(%rbp), %rax
movq -0x228(%rbp), %rcx
movq %rcx, -0x118(%rbp)
movq %rax, -0x110(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x7990
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x231(%rbp)
jne 0x5ad6
movq -0x1a8(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
movslq -0x104(%rbp), %rsi
callq 0x7930
movq %rdx, -0x248(%rbp)
movq %rax, -0x240(%rbp)
jmp 0x5aa6
movq -0x248(%rbp), %rax
movq -0x240(%rbp), %rcx
movq %rcx, -0x128(%rbp)
movq %rax, -0x120(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x7990
xorb $-0x1, %al
movb %al, -0x231(%rbp)
movb -0x231(%rbp), %al
testb $0x1, %al
jne 0x5ae5
jmp 0x5b65
movq -0x1a8(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
movslq -0x104(%rbp), %rsi
callq 0x7930
movq %rdx, -0x258(%rbp)
movq %rax, -0x250(%rbp)
jmp 0x5b0f
movq -0x258(%rbp), %rax
movq -0x250(%rbp), %rcx
movq %rcx, -0x138(%rbp)
movq %rax, -0x130(%rbp)
leaq -0x138(%rbp), %rdi
movl $0x1, %esi
callq 0x79c0
leaq -0xe0(%rbp), %rdi
leaq -0x104(%rbp), %rsi
callq 0x7860
jmp 0x5b51
leaq -0x60(%rbp), %rdi
leaq -0x104(%rbp), %rsi
callq 0x7b40
jmp 0x5b63
jmp 0x5b65
jmp 0x5b67
movl -0x100(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x100(%rbp)
jmp 0x59bd
jmp 0x5b7d
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x5849
jmp 0x5b93
leaq -0x60(%rbp), %rdi
callq 0x7b70
movb %al, -0x259(%rbp)
jmp 0x5ba4
movb -0x259(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5bb5
jmp 0x5e4a
leaq -0x60(%rbp), %rdi
callq 0x7b90
movq %rax, -0x268(%rbp)
jmp 0x5bc7
movq -0x268(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x13c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7bb0
jmp 0x5be1
movq -0x1a8(%rbp), %rdi
addq $0x98, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x7930
movq %rdx, -0x278(%rbp)
movq %rax, -0x270(%rbp)
jmp 0x5c0b
movq -0x278(%rbp), %rax
movq -0x270(%rbp), %rcx
movq %rcx, -0x150(%rbp)
movq %rax, -0x148(%rbp)
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
callq 0x79c0
movq -0x1a8(%rbp), %rdi
addq $0x68, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x29c0
movl (%rax), %eax
movl %eax, -0x154(%rbp)
movq -0x1a8(%rbp), %rdi
movl -0x154(%rbp), %eax
movl %eax, -0x27c(%rbp)
addq $0x68, %rdi
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movl -0x27c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x5cd2
movq -0x1a8(%rbp), %rdi
movq %rdi, %rax
subq $-0x80, %rax
movq %rax, -0x288(%rbp)
addq $0x50, %rdi
movslq -0x154(%rbp), %rsi
callq 0x29c0
movq -0x288(%rbp), %rdi
movq %rax, %rsi
callq 0x7860
jmp 0x5cbf
jmp 0x5cc1
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x5c54
movq -0x1a8(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movslq -0x13c(%rbp), %rsi
callq 0x29c0
movl (%rax), %eax
movl %eax, -0x158(%rbp)
movq -0x1a8(%rbp), %rdi
movl -0x158(%rbp), %eax
movl %eax, -0x28c(%rbp)
addq $0x130, %rdi            # imm = 0x130
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x29c0
movq %rax, %rcx
movl -0x28c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x5e45
movq -0x1a8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x158(%rbp), %rsi
callq 0x29c0
movq -0x1a8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x15c(%rbp)
addq $0x148, %rdi            # imm = 0x148
movslq -0x15c(%rbp), %rsi
callq 0x7930
movq %rdx, -0x2a0(%rbp)
movq %rax, -0x298(%rbp)
jmp 0x5d7c
movq -0x2a0(%rbp), %rax
movq -0x298(%rbp), %rcx
movq %rcx, -0x170(%rbp)
movq %rax, -0x168(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x7990
xorb $-0x1, %al
testb $0x1, %al
jne 0x5daf
jmp 0x5e2f
movq -0x1a8(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
movslq -0x15c(%rbp), %rsi
callq 0x7930
movq %rdx, -0x2b0(%rbp)
movq %rax, -0x2a8(%rbp)
jmp 0x5dd9
movq -0x2b0(%rbp), %rax
movq -0x2a8(%rbp), %rcx
movq %rcx, -0x180(%rbp)
movq %rax, -0x178(%rbp)
leaq -0x180(%rbp), %rdi
movl $0x1, %esi
callq 0x79c0
leaq -0xe0(%rbp), %rdi
leaq -0x15c(%rbp), %rsi
callq 0x7860
jmp 0x5e1b
leaq -0x60(%rbp), %rdi
leaq -0x15c(%rbp), %rsi
callq 0x7b40
jmp 0x5e2d
jmp 0x5e2f
jmp 0x5e31
movl -0x158(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x158(%rbp)
jmp 0x5cf4
jmp 0x5b93
movl $0x0, -0x184(%rbp)
movslq -0x184(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x71f0
movq %rax, %rcx
movq -0x2b8(%rbp), %rax
cmpq %rcx, %rax
jae 0x5f05
movq -0x1a8(%rbp), %rax
addq $0x148, %rax            # imm = 0x148
movq %rax, -0x2d0(%rbp)
movslq -0x184(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x29c0
movq -0x2d0(%rbp), %rdi
movslq (%rax), %rsi
callq 0x7930
movq %rdx, -0x2c8(%rbp)
movq %rax, -0x2c0(%rbp)
jmp 0x5ec7
movq -0x2c8(%rbp), %rax
movq -0x2c0(%rbp), %rcx
movq %rcx, -0x198(%rbp)
movq %rax, -0x190(%rbp)
leaq -0x198(%rbp), %rdi
xorl %esi, %esi
callq 0x79c0
movl -0x184(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x184(%rbp)
jmp 0x5e54
leaq -0xe0(%rbp), %rdi
callq 0x29e0
leaq -0x98(%rbp), %rdi
callq 0x29e0
leaq -0x60(%rbp), %rdi
callq 0x7bd0
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0x29e0
leaq -0x60(%rbp), %rdi
callq 0x7bd0
movq -0x68(%rbp), %rdi
callq 0x2280
nopl (%rax)