// File: dtsaras[P]GCW/rwgraph.cpp
// Function: HyperGraph::pollingIC1(Graph&, std::vector<bool, std::allocator<bool>>&, std::vector<int, std::allocator<int>>&, sampler<int>&, int)
void HyperGraph::pollingIC1(Graph &g, vector<bool> &visit, vector<int> &visit_mark, sampler<int> &samp, int p)
{
    int i, v;
    unsigned cur = samp();
    int num_marked=1;
    int curPos=0;
    visit[cur] = true;
    visit_mark[0] = cur;
    float prob;
    while(curPos < num_marked){
        cur = visit_mark[curPos];
        curPos++;
        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)){ //Check here is it supposed to be g.similarities[cur][p] or g.similarities[g[cur][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;
    }
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq %rdx, 0x100(%rsp)
movq %rcx, 0xf8(%rsp)
movq %r8, 0xf0(%rsp)
movl %r9d, 0xec(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xf0(%rsp), %rdi
callq 0x24d10
movl %eax, 0xe0(%rsp)
movl $0x1, 0xdc(%rsp)
movl $0x0, 0xd8(%rsp)
movq 0x100(%rsp), %rdi
movl 0xe0(%rsp), %eax
movl %eax, %esi
callq 0xe790
movq %rax, 0xc8(%rsp)
movq %rdx, 0xd0(%rsp)
leaq 0xc8(%rsp), %rdi
movl $0x1, %esi
callq 0xe7f0
movl 0xe0(%rsp), %eax
movl %eax, 0x44(%rsp)
movq 0xf8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe3b0
movl 0x44(%rsp), %ecx
movl %ecx, (%rax)
movl 0xd8(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jge 0x2070c
movq 0xf8(%rsp), %rdi
movslq 0xd8(%rsp), %rsi
callq 0xe3b0
movl (%rax), %eax
movl %eax, 0xe0(%rsp)
movl 0xd8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd8(%rsp)
movl $0x0, 0xe8(%rsp)
movl 0xe8(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0x108(%rsp), %rdi
addq $0xa70, %rdi            # imm = 0xA70
movl 0xe0(%rsp), %eax
movl %eax, %esi
callq 0xe3b0
movq %rax, %rcx
movl 0x34(%rsp), %eax
cmpl (%rcx), %eax
jge 0x20707
movq 0x108(%rsp), %rdi
addq $0xa88, %rdi            # imm = 0xA88
movl 0xe0(%rsp), %eax
movl %eax, %esi
callq 0x24850
movq %rax, %rdi
movslq 0xe8(%rsp), %rsi
callq 0xe3b0
movq 0x38(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0xe4(%rsp)
addq $0x40, %rdi
callq 0x20880
movsd %xmm0, 0x28(%rsp)
movq 0x108(%rsp), %rdi
movl 0xe0(%rsp), %esi
movl 0xe4(%rsp), %edx
movl 0xe8(%rsp), %ecx
movl 0xec(%rsp), %r8d
callq 0x1eac0
movsd 0x28(%rsp), %xmm1
cvtss2sd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x206ef
movq 0x100(%rsp), %rdi
movslq 0xe4(%rsp), %rsi
callq 0xe790
movq %rax, 0xb0(%rsp)
movq %rdx, 0xb8(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xeb50
xorb $-0x1, %al
testb $0x1, %al
jne 0x2067f
jmp 0x206ed
movq 0x100(%rsp), %rdi
movslq 0xe4(%rsp), %rsi
callq 0xe790
movq %rax, 0xa0(%rsp)
movq %rdx, 0xa8(%rsp)
leaq 0xa0(%rsp), %rdi
movl $0x1, %esi
callq 0xe7f0
movl 0xe4(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0xf8(%rsp), %rdi
movslq 0xdc(%rsp), %rsi
callq 0xe3b0
movl 0x24(%rsp), %ecx
movl %ecx, (%rax)
movl 0xdc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xdc(%rsp)
jmp 0x206ef
jmp 0x206f1
movl 0xe8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe8(%rsp)
jmp 0x20586
jmp 0x20538
movq 0x38(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x10(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x13b30
movq %rax, 0x80(%rsp)
movq 0xf8(%rsp), %rdi
callq 0x13b30
movq %rax, 0x70(%rsp)
movslq 0xdc(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x14a30
movq %rax, 0x78(%rsp)
leaq 0x6f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xe180
movq 0x18(%rsp), %rcx
movq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
leaq 0x88(%rsp), %rdi
callq 0x24ff0
jmp 0x20788
movq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x24fc0
jmp 0x2079c
leaq 0x88(%rsp), %rdi
callq 0xe2e0
leaq 0x6f(%rsp), %rdi
callq 0xe210
movl $0x0, 0xe8(%rsp)
movl 0xe8(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jge 0x20861
movq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xf8(%rsp), %rdi
movslq 0xe8(%rsp), %rsi
callq 0xe3b0
movq 0x8(%rsp), %rdi
movslq (%rax), %rsi
callq 0xe790
movq %rax, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
callq 0xe7f0
movl 0xe8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe8(%rsp)
jmp 0x207be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
jmp 0x20855
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
leaq 0x88(%rsp), %rdi
callq 0xe2e0
leaq 0x6f(%rsp), %rdi
callq 0xe210
jmp 0x20869
addq $0x118, %rsp            # imm = 0x118
retq
movq 0x60(%rsp), %rdi
callq 0x4690
nopw %cs:(%rax,%rax)