// File: /workspace/github_cpp_makefile_star2_O2/dtsaras[P]GCW/rwgraph.cpp
// Function: HyperGraph::pollingIC(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::pollingIC(Graph &g, vector<unsigned int> & link, unsigned int k, vector<bool> &visit, vector<int> &visit_mark, sampler<int> &samp, int p)
{
    int i;
    // unsigned int cur = sfmt_genrand_uint32(&sfmtSeed)%(g.getSize())+1;
    unsigned cur = samp();
    int curPos=0;
    int num_marked=1;
    visit[cur] = true;
    visit_mark[0] = cur;
    bool t = false;
    while(curPos < num_marked){
        cur = visit_mark[curPos];
        curPos++;
        if (link[cur] < k){
            t=true;
            break;
        }
        // const vector<UI> &w=g.getWeight(cur);
        const vector<float> &w=g.getWeight(cur);
        const vector<int> &neigh = g[cur];
        for (i = 0; i < g.inv_node_deg[cur]; ++i){
            if (sfmt_genrand_real1(&sfmtSeed) <  w[i]){
            // if (sfmt_genrand_real1(&sfmtSeed) <  w[i] * g.similarities[cur][p]){
                if (!visit[neigh[i]]){
                    visit[neigh[i]] = true;
                    visit_mark[num_marked]=neigh[i];
                    num_marked++;
                }
            }
        }
    }
    for(i = 0; i < num_marked;++i){
        visit[visit_mark[i]]=false;
    }
    return t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, %r14
movl %ecx, 0x14(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, %r12
movq %rdi, %r13
movq 0x70(%rsp), %rdi
callq 0xecc6
movl %eax, %ebp
movl %eax, %esi
movq %r14, 0x18(%rsp)
movq %r14, %rdi
callq 0x85d6
orq %rdx, (%rax)
movq %rbx, 0x8(%rsp)
movq (%rbx), %rax
movl %ebp, (%rax)
addq $0x40, %r13
pushq $0x1
popq %rax
xorl %ecx, %ecx
movq %rax, (%rsp)
movslq %eax, %rbx
cmpq %rbx, %rcx
jge 0xd425
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl (%rax,%rcx,4), %ebp
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl 0x14(%rsp), %edx
cmpl %edx, (%rax,%rbp,4)
jb 0xd425
incq %rcx
movq %rcx, 0x30(%rsp)
movslq %ebp, %rax
imulq $0x18, %rax, %rbx
movq 0xaa0(%r12), %r14
addq %rbx, %r14
addq 0xa88(%r12), %rbx
xorl %r15d, %r15d
movq %rbp, 0x20(%rsp)
movq 0xa70(%r12), %rax
movslq (%rax,%rbp,4), %rax
cmpq %rax, %r15
jge 0xd417
movq %r13, %rdi
callq 0xd09d
movq (%r14), %rax
cvtss2sd (%rax,%r15,4), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xd40f
movq %r12, %rbp
movq %r13, %r12
movq (%rbx), %rax
movslq (%rax,%r15,4), %rsi
movq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x85d6
testq %rdx, (%rax)
jne 0xd404
movq (%rbx), %rax
movslq (%rax,%r15,4), %rsi
movq %r13, %rdi
callq 0x85d6
orq %rdx, (%rax)
movq (%rbx), %rax
movl (%rax,%r15,4), %eax
movq (%rsp), %rdx
movslq %edx, %rdx
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movl %eax, (%rcx,%rdx,4)
incl %edx
movq %rdx, (%rsp)
movq %r12, %r13
movq %rbp, %r12
movq 0x20(%rsp), %rbp
incq %r15
jmp 0xd38c
movq 0x30(%rsp), %rcx
movq (%rsp), %rax
jmp 0xd332
movq %rcx, %r12
xorl %r14d, %r14d
movq (%rsp), %r13
testl %r13d, %r13d
cmovlel %r14d, %r13d
movq 0x18(%rsp), %r15
cmpq %r14, %r13
je 0xd45f
movq 0x8(%rsp), %rax
movq (%rax), %rax
movslq (%rax,%r14,4), %rsi
movq %r15, %rdi
callq 0x85d6
notq %rdx
andq %rdx, (%rax)
incq %r14
jmp 0xd43b
cmpq %rbx, %r12
setl %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq