// File: dtsaras[P]GCW/rwgraph.cpp
// Function: HyperGraph::pollingIC2(Graph&, std::vector<unsigned int, std::allocator<unsigned int>>&, unsigned int, std::vector<bool, std::allocator<bool>>&, std::vector<int, std::allocator<int>>&, sampler<int>&, int)
bool HyperGraph::pollingIC2(Graph &g, vector<unsigned int> & link, unsigned int k, vector<bool> &visit, vector<int> &visit_mark, sampler<int> &samp, int p)
{
    int i, v;
    unsigned cur = samp();
	int curPos=0;
    int num_marked=1;
	visit[cur] = true;
	visit_mark[0] = cur;
	bool t = false;
    // cout << "Starting Cur Node: " << cur << endl; // del
    while(curPos < num_marked){
		cur = visit_mark[curPos];
		curPos++;
		if (link[cur] < k)
            t=true;
		for (i = 0; i < g.inv_node_deg[cur]; ++i){
            v = g.invAdjList[cur][i];
            if (sfmt_genrand_real1(&sfmtSeed) <  g.get_inv_AP_IC(cur, v, i, p)){
                if (!visit[v]){
					visit[v] = true;
					visit_mark[num_marked]=v;
					num_marked++;
				}
			}
		}
    }
    edge_node.push_back(vector<int>(visit_mark.begin(),visit_mark.begin()+num_marked));

	for(i = 0; i < num_marked;++i){
		visit[visit_mark[i]]=false;
	}
	return t;
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movl 0x128(%rsp), %eax
movq 0x120(%rsp), %rax
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq %rdx, 0x100(%rsp)
movl %ecx, 0xfc(%rsp)
movq %r8, 0xf0(%rsp)
movq %r9, 0xe8(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x120(%rsp), %rdi
callq 0x24d10
movl %eax, 0xdc(%rsp)
movl $0x0, 0xd8(%rsp)
movl $0x1, 0xd4(%rsp)
movq 0xf0(%rsp), %rdi
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0xe790
movq %rax, 0xc0(%rsp)
movq %rdx, 0xc8(%rsp)
leaq 0xc0(%rsp), %rdi
movl $0x1, %esi
callq 0xe7f0
movl 0xdc(%rsp), %eax
movl %eax, 0x3c(%rsp)
movq 0xe8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe3b0
movl 0x3c(%rsp), %ecx
movl %ecx, (%rax)
movb $0x0, 0xbf(%rsp)
movl 0xd8(%rsp), %eax
cmpl 0xd4(%rsp), %eax
jge 0x20b7b
movq 0xe8(%rsp), %rdi
movslq 0xd8(%rsp), %rsi
callq 0xe3b0
movl (%rax), %eax
movl %eax, 0xdc(%rsp)
movl 0xd8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd8(%rsp)
movq 0x100(%rsp), %rdi
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0xee00
movl (%rax), %eax
cmpl 0xfc(%rsp), %eax
jae 0x209ea
movb $0x1, 0xbf(%rsp)
movl $0x0, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
movl %eax, 0x2c(%rsp)
movq 0x108(%rsp), %rdi
addq $0xa70, %rdi            # imm = 0xA70
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0xe3b0
movq %rax, %rcx
movl 0x2c(%rsp), %eax
cmpl (%rcx), %eax
jge 0x20b76
movq 0x108(%rsp), %rdi
addq $0xa88, %rdi            # imm = 0xA88
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0x24850
movq %rax, %rdi
movslq 0xe4(%rsp), %rsi
callq 0xe3b0
movq 0x30(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0xe0(%rsp)
addq $0x40, %rdi
callq 0x20880
movsd %xmm0, 0x20(%rsp)
movq 0x108(%rsp), %rdi
movl 0xdc(%rsp), %esi
movl 0xe0(%rsp), %edx
movl 0xe4(%rsp), %ecx
movl 0x128(%rsp), %r8d
callq 0x1eac0
movsd 0x20(%rsp), %xmm1
cvtss2sd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x20b5e
movq 0xf0(%rsp), %rdi
movslq 0xe0(%rsp), %rsi
callq 0xe790
movq %rax, 0xa8(%rsp)
movq %rdx, 0xb0(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xeb50
xorb $-0x1, %al
testb $0x1, %al
jne 0x20aee
jmp 0x20b5c
movq 0xf0(%rsp), %rdi
movslq 0xe0(%rsp), %rsi
callq 0xe790
movq %rax, 0x98(%rsp)
movq %rdx, 0xa0(%rsp)
leaq 0x98(%rsp), %rdi
movl $0x1, %esi
callq 0xe7f0
movl 0xe0(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0xe8(%rsp), %rdi
movslq 0xd4(%rsp), %rsi
callq 0xe3b0
movl 0x1c(%rsp), %ecx
movl %ecx, (%rax)
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
jmp 0x20b5e
jmp 0x20b60
movl 0xe4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe4(%rsp)
jmp 0x209f5
jmp 0x2097e
movq 0x30(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x8(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x13b30
movq %rax, 0x78(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x13b30
movq %rax, 0x68(%rsp)
movslq 0xd4(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x14a30
movq %rax, 0x70(%rsp)
leaq 0x67(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xe180
movq 0x10(%rsp), %rcx
movq 0x78(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x80(%rsp), %rdi
callq 0x24ff0
jmp 0x20bf1
movq 0x8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x24fc0
jmp 0x20c05
leaq 0x80(%rsp), %rdi
callq 0xe2e0
leaq 0x67(%rsp), %rdi
callq 0xe210
movl $0x0, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
cmpl 0xd4(%rsp), %eax
jge 0x20cc8
movq 0xf0(%rsp), %rax
movq %rax, (%rsp)
movq 0xe8(%rsp), %rdi
movslq 0xe4(%rsp), %rsi
callq 0xe3b0
movq (%rsp), %rdi
movslq (%rax), %rsi
callq 0xe790
movq %rax, 0x40(%rsp)
movq %rdx, 0x48(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0xe7f0
movl 0xe4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe4(%rsp)
jmp 0x20c27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0x20cbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xe2e0
leaq 0x67(%rsp), %rdi
callq 0xe210
jmp 0x20cd9
movb 0xbf(%rsp), %al
andb $0x1, %al
addq $0x118, %rsp            # imm = 0x118
retq
movq 0x58(%rsp), %rdi
callq 0x4690
nopw %cs:(%rax,%rax)