// File: /workspace/github_cpp_makefile_star2_O3/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), %ebp
movl %ebp, 0x2c(%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 0x6574
movq 0x30(%r14), %rdx
movq 0x40(%r14), %rax
addq $-0x4, %rax
cmpq %rax, %rdx
je 0x3967
movl %ebp, (%rdx)
addq $0x4, %rdx
movq %rdx, 0x80(%rsp)
jmp 0x3982
leaq 0x50(%rsp), %rdi
leaq 0x2c(%rsp), %rsi
callq 0x66ea
movl 0x2c(%rsp), %ebp
movq 0x80(%rsp), %rdx
movslq %ebp, %rcx
leal 0x3f(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
addq 0xc0(%rbx), %rax
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
leaq 0x3f(%r15), %rsi
andq %rcx, %rsi
xorl %edi, %edi
cmpq %r15, %rsi
setbe %dil
movl $0x1, %esi
shlq %cl, %rsi
orq %rsi, -0x8(%rax,%rdi,8)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x60(%rsp), %rax
cmpq %rax, %rdx
je 0x3b70
leaq 0x3f(%r15), %r14
leaq 0x50(%rsp), %r12
leaq 0xc(%rsp), %r13
movl (%rax), %ecx
movl %ecx, 0x10(%rsp)
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3a0b
addq $0x4, %rax
jmp 0x3a3d
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 0x3a5f
movl 0x10(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x3a72
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x6498
movl 0x10(%rsp), %ecx
movslq %ecx, %rdx
movq 0x118(%rbx), %rax
movslq (%rax,%rdx,4), %rbp
cmpl 0x4(%rax,%rdx,4), %ebp
jge 0x3b5d
movq 0xc0(%rbx), %rdx
movq 0xe8(%rbx), %rsi
movslq (%rsi,%rbp,4), %rsi
leal 0x3f(%rsi), %edi
testq %rsi, %rsi
cmovnsl %esi, %edi
movl %esi, 0xc(%rsp)
sarl $0x6, %edi
movslq %edi, %rdi
leaq (%rdx,%rdi,8), %rdi
movq %rsi, %r8
andq %r14, %r8
xorl %r9d, %r9d
cmpq %r15, %r8
setbe %r9b
movq -0x8(%rdi,%r9,8), %rdi
btq %rsi, %rdi
jb 0x3b49
movq 0x80(%rsp), %rcx
movq 0x90(%rsp), %rdi
addq $-0x4, %rdi
cmpq %rdi, %rcx
je 0x3af7
movl %esi, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x80(%rsp)
jmp 0x3b10
movq %r12, %rdi
movq %r13, %rsi
callq 0x66ea
movq 0xc0(%rbx), %rdx
movq 0x118(%rbx), %rax
movslq 0xc(%rsp), %rcx
leal 0x3f(%rcx), %esi
testq %rcx, %rcx
cmovnsl %ecx, %esi
sarl $0x6, %esi
movslq %esi, %rsi
leaq (%rdx,%rsi,8), %rsi
movq %rcx, %rdi
andq %r14, %rdi
xorl %r8d, %r8d
cmpq %r15, %rdi
setbe %r8b
movl $0x1, %edi
shlq %cl, %rdi
orq %rdi, -0x8(%rsi,%r8,8)
movl 0x10(%rsp), %ecx
incq %rbp
movslq %ecx, %rsi
movslq 0x4(%rax,%rsi,4), %rsi
cmpq %rsi, %rbp
jl 0x3a91
movq 0x60(%rsp), %rax
cmpq %rax, 0x80(%rsp)
jne 0x39f1
movq 0x80(%rbx), %rcx
cmpq %rcx, 0x88(%rbx)
je 0x3b87
movq %rcx, 0x88(%rbx)
leaq 0x80(%rbx), %rcx
movq %rcx, 0xa8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
testl %edx, %edx
jle 0x3d99
xorl %edx, %edx
leaq 0x3f(%r15), %r12
movq %rdx, 0xb0(%rsp)
movslq (%rcx,%rdx,4), %rbp
leal 0x3f(%rbp), %eax
testq %rbp, %rbp
cmovnsl %ebp, %eax
sarl $0x6, %eax
cltq
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 0x3c6b
leaq (,%r14,4), %r13
movq 0x50(%rbx), %rdx
addq %r13, %rdx
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x3c49
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rbx)
jmp 0x3c5a
movq 0xa8(%rsp), %rdi
callq 0x6498
movq 0x68(%rbx), %rax
incq %r14
movslq 0x4(%rax,%rbp,4), %rcx
addq $0x4, %r13
cmpq %rcx, %r14
jl 0x3c21
movq 0x130(%rbx), %rax
movslq (%rax,%rbp,4), %r14
cmpl 0x4(%rax,%rbp,4), %r14d
jge 0x3d6d
movq 0x100(%rbx), %rax
movslq (%rax,%r14,4), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
movl %ecx, 0xc(%rsp)
cmovnsl %ecx, %eax
sarl $0x6, %eax
cltq
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 0x3d55
leaq -0x8(,%rsi,8), %rsi
addq 0x148(%rbx), %rax
movq (%rsi,%rax), %rdi
testq %rdx, %rdi
jne 0x3d55
orq %rdx, %rdi
movq %rdi, (%rax,%rsi)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3d0a
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x3d19
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x6498
movq 0x80(%rsp), %rax
movq 0x90(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3d46
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x80(%rsp)
jmp 0x3d55
leaq 0x50(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x66ea
incq %r14
movq 0x130(%rbx), %rax
movslq 0x4(%rax,%rbp,4), %rax
cmpq %rax, %r14
jl 0x3c81
movq 0xb0(%rsp), %rdx
incq %rdx
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
subq %rcx, %rax
shrq $0x2, %rax
cltq
cmpq %rax, %rdx
jl 0x3bc6
movq 0x60(%rsp), %rax
cmpq %rax, 0x80(%rsp)
je 0x3f91
leaq 0x3f(%r15), %r13
movslq (%rax), %rbp
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3dc2
addq $0x4, %rax
jmp 0x3df4
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)
leal 0x3f(%rbp), %eax
testl %ebp, %ebp
cmovnsl %ebp, %eax
sarl $0x6, %eax
cltq
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
cmpl 0x4(%rax,%rbp,4), %r14d
jge 0x3e91
leaq (,%r14,4), %r12
movq 0x50(%rbx), %rdx
addq %r12, %rdx
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x3e6f
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rbx)
jmp 0x3e80
movq 0xa8(%rsp), %rdi
callq 0x6498
movq 0x68(%rbx), %rax
incq %r14
movslq 0x4(%rax,%rbp,4), %rcx
addq $0x4, %r12
cmpq %rcx, %r14
jl 0x3e47
movq 0x130(%rbx), %rax
movslq (%rax,%rbp,4), %r14
cmpl 0x4(%rax,%rbp,4), %r14d
leaq 0x10(%rsp), %r12
jge 0x3f7e
movq 0x100(%rbx), %rax
movslq (%rax,%r14,4), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
movl %ecx, 0xc(%rsp)
cmovnsl %ecx, %eax
sarl $0x6, %eax
cltq
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 0x3f66
leaq -0x8(,%rdx,8), %rdx
orq %rsi, %rdi
movq %rdi, (%rax,%rdx)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3f1d
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x3f2a
movq %r12, %rdi
leaq 0xc(%rsp), %rdx
callq 0x6498
movq 0x80(%rsp), %rax
movq 0x90(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x3f57
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x80(%rsp)
jmp 0x3f66
leaq 0x50(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x66ea
incq %r14
movq 0x130(%rbx), %rax
movslq 0x4(%rax,%rbp,4), %rax
cmpq %rax, %r14
jl 0x3eac
movq 0x60(%rsp), %rax
cmpq %rax, 0x80(%rsp)
jne 0x3dab
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
je 0x3ffc
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
leal 0x3f(%rcx), %r9d
testq %rcx, %rcx
cmovnsl %ecx, %r9d
sarl $0x6, %r9d
movslq %r9d, %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 0x3fb9
jmp 0x4001
testq %rdi, %rdi
je 0x400e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4025
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
leaq 0x50(%rsp), %rdi
callq 0x50ee
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4084
jmp 0x404a
jmp 0x4053
movq %rax, %rbx
jmp 0x406d
jmp 0x4053
jmp 0x4053
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x406d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4084
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
leaq 0x50(%rsp), %rdi
callq 0x50ee
movq %rbx, %rdi
callq 0x2200