// File: /workspace/github_cpp_makefile_star2_O2/todo314[P]pruned-monte-carlo/src/pmc.cpp
// Function: InfluenceMaximizer::scc(std::vector<int, std::allocator<int>>&)
int InfluenceMaximizer::scc(vector<int> &comp) {
	vector<bool> vis(n);
	stack<pair<int, int> > S;
	vector<int> lis;
	int k = 0;
	for (int i = 0; i < n; i++) {
		S.push(make_pair(i, 0));
	}
	for (; !S.empty();) {
		int v = S.top().first, state = S.top().second;
		S.pop();
		if (state == 0) {
			if (vis[v]) {
				continue;
			}
			vis[v] = true;
			S.push(make_pair(v, 1));
			for (int i = at_e[v]; i < at_e[v + 1]; i++) {
				int u = es1[i];
				S.push(make_pair(u, 0));
			}
		} else {
			lis.push_back(v);
		}
	}
	for (int i = 0; i < n; i++) {
		S.push(make_pair(lis[i], -1));
	}
	vis.assign(n, false);
	for (; !S.empty();) {
		int v = S.top().first, arg = S.top().second;
		S.pop();
		if (vis[v]) {
			continue;
		}
		vis[v] = true;
		comp[v] = arg == -1 ? k++ : arg;
		for (int i = at_r[v]; i < at_r[v + 1]; i++) {
			int u = rs1[i];
			S.push(make_pair(u, comp[v]));
		}
	}
	return k;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, 0x18(%rsp)
movq %rdi, %r14
movslq (%rdi), %rsi
leaq 0x90(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x4286
leaq 0x40(%rsp), %rdi
callq 0x429a
xorps %xmm0, %xmm0
andq $0x0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
xorl %ebx, %ebx
leaq 0x40(%rsp), %r15
leaq 0x8(%rsp), %r12
movslq (%r14), %rax
cmpq %rax, %rbx
jge 0x3ba5
movq %rbx, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6a02
incq %rbx
jmp 0x3b88
leaq 0x40(%rsp), %r15
leaq 0x8(%rsp), %r13
leaq 0x20(%rsp), %rbp
leaq 0x4(%rsp), %r12
movq 0x70(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0x3c97
cmpq 0x78(%rsp), %rax
je 0x3bd6
leaq -0x8(%rax), %rcx
jmp 0x3bef
movq 0x88(%rsp), %rax
movq -0x8(%rax), %rax
leaq 0x1f8(%rax), %rcx
addq $0x200, %rax            # imm = 0x200
movl (%rcx), %ecx
movl %ecx, 0x4(%rsp)
movl -0x4(%rax), %ebx
movq %r15, %rdi
callq 0x6c62
testl %ebx, %ebx
je 0x3c11
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4034
jmp 0x3bb9
movslq 0x4(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x4052
testq %rdx, (%rax)
jne 0x3bb9
movslq 0x4(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x4052
orq %rdx, (%rax)
movl 0x4(%rsp), %eax
btsq $0x20, %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x6a02
movslq 0x4(%rsp), %rax
movq 0x20(%r14), %rcx
movslq (%rcx,%rax,4), %rbx
cltq
movslq 0x4(%rcx,%rax,4), %rax
cmpq %rax, %rbx
jge 0x3bb9
movq 0x8(%r14), %rax
movl (%rax,%rbx,4), %eax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x6a02
incq %rbx
movl 0x4(%rsp), %eax
movq 0x20(%r14), %rcx
jmp 0x3c63
xorl %ebx, %ebx
movabsq $-0x100000000, %r13     # imm = 0xFFFFFFFF00000000
leaq 0x40(%rsp), %r15
leaq 0x8(%rsp), %r12
movslq (%r14), %rsi
cmpq %rsi, %rbx
jge 0x3cd5
movq 0x20(%rsp), %rax
movl (%rax,%rbx,4), %eax
orq %r13, %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6a02
incq %rbx
jmp 0x3cad
leaq 0x90(%rsp), %rdi
movl $0x0, 0x14(%rsp)
xorl %edx, %edx
callq 0x5a32
leaq 0x40(%rsp), %r15
leaq 0x90(%rsp), %r12
leaq 0x8(%rsp), %r13
movq 0x70(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0x3dc8
cmpq 0x78(%rsp), %rax
je 0x3d1b
leaq -0x8(%rax), %rcx
jmp 0x3d34
movq 0x88(%rsp), %rax
movq -0x8(%rax), %rax
leaq 0x1f8(%rax), %rcx
addq $0x200, %rax            # imm = 0x200
movslq (%rcx), %rbp
movl -0x4(%rax), %ebx
movq %r15, %rdi
callq 0x6c62
movq %r12, %rdi
movq %rbp, %rsi
callq 0x4052
testq %rdx, (%rax)
jne 0x3cfe
movq %r12, %rdi
movq %rbp, %rsi
callq 0x4052
orq %rdx, (%rax)
xorl %eax, %eax
cmpl $-0x1, %ebx
sete %al
movl 0x14(%rsp), %ecx
cmovel %ecx, %ebx
addl %eax, %ecx
movl %ecx, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movl %ebx, (%rax,%rbp,4)
movq 0x50(%r14), %rax
movslq (%rax,%rbp,4), %rbx
movslq 0x4(%rax,%rbp,4), %rax
cmpq %rax, %rbx
jge 0x3cfe
movq 0x38(%r14), %rax
movl (%rax,%rbx,4), %eax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movl (%rcx,%rbp,4), %ecx
shlq $0x20, %rcx
orq %rax, %rcx
movq %rcx, 0x8(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x6a02
incq %rbx
movq 0x50(%r14), %rax
jmp 0x3d88
leaq 0x20(%rsp), %rdi
callq 0x284a
leaq 0x40(%rsp), %rdi
callq 0x4346
leaq 0x90(%rsp), %rdi
callq 0x42b6
movl 0x14(%rsp), %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3e18
jmp 0x3e18
movq %rax, %rbx
jmp 0x3e2f
jmp 0x3e18
jmp 0x3e18
jmp 0x3e18
jmp 0x3e18
jmp 0x3e18
jmp 0x3e18
jmp 0x3e18
jmp 0x3e18
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x284a
leaq 0x40(%rsp), %rdi
callq 0x4346
leaq 0x90(%rsp), %rdi
callq 0x42b6
movq %rbx, %rdi
callq 0x21d0