// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %r9, %r14
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq 0x80(%rsp), %rdi
callq 0x12bb8
movq %rbx, 0x18(%rsp)
movq (%rbx), %rdx
movl %eax, %esi
movl $0x1, %edi
movl %eax, %ecx
shlq %cl, %rdi
shrl $0x6, %esi
orq %rdi, (%rdx,%rsi,8)
movq (%r14), %rcx
movl %eax, (%rcx)
movq %r14, 0x8(%rsp)
movq (%r14), %rax
movl (%rax), %ebx
movq %r15, 0x20(%rsp)
movq (%r15), %rax
movl %ebp, 0x14(%rsp)
cmpl %ebp, (%rax,%rbx,4)
jae 0x10316
movb $0x1, %al
movl $0x1, %r14d
jmp 0x1049e
leaq 0x40(%r13), %rax
movq %rax, 0x38(%rsp)
movl $0x1, %r14d
movsd 0x83f3(%rip), %xmm2     # 0x18720
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
addq $0x3f, %rax
movq %rax, 0x30(%rsp)
movl $0x1, %esi
movq %rsi, 0x28(%rsp)
movq 0xa70(%r12), %rax
cmpl $0x0, (%rax,%rbx,4)
jle 0x1046b
movslq %ebx, %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
movq 0xaa0(%r12), %r15
addq %rax, %r15
addq 0xa88(%r12), %rax
movq %rax, 0x40(%rsp)
xorl %ebp, %ebp
cmpl $0x270, 0xa00(%r13) # imm = 0x270
jl 0x103ab
movq 0x38(%rsp), %rdi
callq 0x16314
movsd 0x8380(%rip), %xmm2     # 0x18720
movl $0x0, 0xa00(%r13)
movslq 0xa00(%r13), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0xa00(%r13)
movl 0x40(%r13,%rax,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd %xmm2, %xmm0
movq (%r15), %rax
xorps %xmm1, %xmm1
cvtss2sd (%rax,%rbp,4), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x10453
movq 0x40(%rsp), %rax
movq (%rax), %rax
movslq (%rax,%rbp,4), %rcx
leaq 0x3f(%rcx), %rax
testq %rcx, %rcx
cmovnsq %rcx, %rax
sarq $0x6, %rax
shlq $0x3, %rax
movq 0x18(%rsp), %rdx
addq (%rdx), %rax
movq %rcx, %rsi
andq 0x30(%rsp), %rsi
xorl %edx, %edx
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
cmpq %rdi, %rsi
setbe %dl
movl $0x1, %esi
shlq %cl, %rsi
movq -0x8(%rax,%rdx,8), %rdi
btq %rcx, %rdi
jb 0x10453
leaq -0x8(,%rdx,8), %rdx
orq %rdi, %rsi
movq %rsi, (%rax,%rdx)
movslq %r14d, %r14
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl %ecx, (%rax,%r14,4)
incl %r14d
incq %rbp
movq 0xa70(%r12), %rax
movslq (%rax,%rbx,4), %rax
cmpq %rax, %rbp
jl 0x10381
movslq %r14d, %rax
movq 0x28(%rsp), %rsi
cmpq %rax, %rsi
setl %al
jge 0x1049e
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movl (%rcx,%rsi,4), %ebx
incq %rsi
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
movl 0x14(%rsp), %edx
cmpl %edx, (%rcx,%rbx,4)
jae 0x10345
testl %r14d, %r14d
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
jle 0x10503
movq 0x8(%rsp), %rcx
movq (%rcx), %rdx
movq 0x18(%rsp), %rcx
movq (%rcx), %rsi
movl %r14d, %edi
xorl %r8d, %r8d
leaq 0x3f(%r15), %r9
movslq (%rdx,%r8,4), %rcx
leaq 0x3f(%rcx), %r10
testq %rcx, %rcx
cmovnsq %rcx, %r10
sarq $0x6, %r10
movq %rcx, %r11
andq %r9, %r11
xorl %ebx, %ebx
cmpq %r15, %r11
setbe %bl
movq $-0x2, %r11
rolq %cl, %r11
leaq (%rsi,%r10,8), %rcx
andq %r11, -0x8(%rcx,%rbx,8)
incq %r8
cmpq %r8, %rdi
jne 0x104c7
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq