// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movq %r9, %r15
movq %r8, %r14
movl %ecx, 0xc(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, %r13
movq %rdi, %rbp
movq 0x90(%rsp), %rdi
movabsq $-0x8000000000000000, %rbx # imm = 0x8000000000000000
callq 0x12988
movq %rbx, %r11
movq %r14, 0x28(%rsp)
movq (%r14), %rdx
movl %eax, %esi
movl $0x1, %edi
movl %eax, %ecx
shlq %cl, %rdi
shrl $0x6, %esi
orq %rdi, (%rdx,%rsi,8)
movq %r15, 0x10(%rsp)
movq (%r15), %rcx
movl %eax, (%rcx)
leaq 0x40(%rbp), %rax
movq %rax, 0x48(%rsp)
movl $0x1, %esi
xorl %edx, %edx
movsd 0x75ec(%rip), %xmm2     # 0x17720
leaq 0x3f(%rbx), %r15
movq %r13, 0x40(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl (%rax,%rdx,4), %r9d
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r9,4), %ecx
cmpl 0xc(%rsp), %ecx
movl %ecx, 0x24(%rsp)
jb 0x102ae
movq %rdx, 0x38(%rsp)
movq %rsi, 0x18(%rsp)
movq 0xa70(%r13), %rax
cmpl $0x0, (%rax,%r9,4)
jle 0x10295
movslq %r9d, %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
movq 0xaa0(%r13), %r14
addq %rax, %r14
addq 0xa88(%r13), %rax
movq %rax, 0x50(%rsp)
xorl %r12d, %r12d
movl 0xa00(%rbp), %eax
cmpl $0x270, %eax            # imm = 0x270
jl 0x101e1
movq 0x48(%rsp), %rdi
movq %r15, %r13
movq %r11, %r15
movq %rbp, %rbx
movq %r9, %rbp
callq 0x16088
movq %rbp, %r9
movq %rbx, %rbp
movsd 0x754c(%rip), %xmm2     # 0x17720
movq %r15, %r11
movq %r13, %r15
movq 0x40(%rsp), %r13
xorl %eax, %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa00(%rbp)
cltq
movl 0x40(%rbp,%rax,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd %xmm2, %xmm0
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtss2sd (%rax,%r12,4), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1027e
movq 0x50(%rsp), %rax
movq (%rax), %rax
movslq (%rax,%r12,4), %rcx
leal 0x3f(%rcx), %eax
testq %rcx, %rcx
cmovnsl %ecx, %eax
sarl $0x6, %eax
cltq
shlq $0x3, %rax
movq 0x28(%rsp), %rdx
addq (%rdx), %rax
movq %rcx, %rsi
andq %r15, %rsi
xorl %edx, %edx
cmpq %r11, %rsi
setbe %dl
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rax,%rdx,8), %rdi
btq %rcx, %rdi
jb 0x1027e
leaq -0x8(,%rdx,8), %rdx
orq %rdi, %rsi
movq %rsi, (%rax,%rdx)
movq 0x18(%rsp), %rdx
movslq %edx, %rdx
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl %ecx, (%rax,%rdx,4)
incl %edx
movq %rdx, 0x18(%rsp)
incq %r12
movq 0xa70(%r13), %rax
movslq (%rax,%r9,4), %rax
cmpq %rax, %r12
jl 0x101a3
movq 0x38(%rsp), %rdx
incq %rdx
movq 0x18(%rsp), %rsi
movslq %esi, %rax
cmpq %rax, %rdx
jl 0x1013d
testl %esi, %esi
jle 0x10307
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rdx
movl %esi, %esi
xorl %edi, %edi
movslq (%rax,%rdi,4), %rcx
leal 0x3f(%rcx), %r8d
testq %rcx, %rcx
cmovnsl %ecx, %r8d
sarl $0x6, %r8d
movslq %r8d, %r8
movq %rcx, %r9
andq %r15, %r9
xorl %r10d, %r10d
cmpq %r11, %r9
setbe %r10b
movq $-0x2, %r9
rolq %cl, %r9
leaq (%rdx,%r8,8), %rcx
andq %r9, -0x8(%rcx,%r10,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x102c6
movl 0x24(%rsp), %eax
cmpl 0xc(%rsp), %eax
setb %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq