// File: /workspace/github_cpp_makefile_star2_O2/dtsaras[P]GCW/rwgraph.cpp
// Function: HyperGraph::pollingLT1(Graph&, std::vector<bool, std::allocator<bool>>&, std::vector<int, std::allocator<int>>&, sampler<int>&, int)
void HyperGraph::pollingLT1(Graph &g, vector<bool> &visit, vector<int> &visit_mark, sampler<int> &samp, int p)
{
    unsigned int i;
    unsigned int gSize = g.getSize();
    // unsigned int cur = sfmt_genrand_uint32(&sfmtSeed)%gSize+1;
    unsigned cur = samp();
    unsigned int num_marked = 0;
    // cout << "startLT1: " << cur << endl;
    // cout << "^^^^^^^^^^^^^^^ 1" << endl;
    for (i = 0; i < gSize; ++i){
        // cout << "^^^^^^^^^^^^^^^ 1" << endl;
        if (visit[cur] == true) break;
        visit[cur] = true;
        visit_mark[num_marked] = cur;
    	num_marked++;
        const vector<int> &neigh = g[cur];
        int ind;
        // cout << "^^^^^^^^^^^^^^^ 2" << endl;
        ind = randIndex_lin(g, g.weights[cur],g.inv_node_deg[cur], cur, p);
        // if (g.weights[cur].size() >= 32)
        //     ind = randIndex_bin(g, g.weights[cur],g.inv_node_deg[cur], cur, p);
        // else
        //     ind = randIndex_lin(g, g.weights[cur],g.inv_node_deg[cur], cur, p);

        // cout << "^^^^^^^^^^^^^^^ 3" << endl;
        if (ind == -1)
            break;
        // cur = neigh[ind-1];
        cur = neigh[ind];
        // cout << cur << endl;
    }
    // cout << "^^^^^^^^^^^^^^^ 4" << endl;
	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;
    }
    // cout << "^^^^^^^^^^^^^^^ 5" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0x4(%rsp)
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
movl 0x9c8(%rsi), %eax
movq %rax, 0x10(%rsp)
movq %r8, %rdi
callq 0xecc6
movl %eax, %r13d
xorl %r12d, %r12d
cmpq %r12, 0x10(%rsp)
je 0xccb2
movl %r13d, %ebp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x85d6
testq %rdx, (%rax)
jne 0xccc2
movq %r14, %r15
movq %r14, %rdi
movq %rbp, %rsi
callq 0x85d6
orq %rdx, (%rax)
movq %rbx, %r14
movq (%rbx), %rax
movl %r13d, (%rax,%r12,4)
movq 0x18(%rsp), %rsi
movq 0xa70(%rsi), %rax
movq 0xa88(%rsi), %rbx
imulq $0x18, %rbp, %rdx
addq 0xaa0(%rsi), %rdx
movl (%rax,%rbp,4), %ecx
movq 0x8(%rsp), %rdi
movl %r13d, %r8d
movl 0x4(%rsp), %r9d
callq 0xed9c
cmpl $-0x1, %eax
je 0xccb9
movslq %r13d, %rcx
imulq $0x18, %rcx, %rcx
cltq
movq (%rbx,%rcx), %rcx
movl (%rcx,%rax,4), %r13d
incq %r12
movq %r14, %rbx
movq %r15, %r14
jmp 0xcc1e
movq 0x10(%rsp), %r12
jmp 0xccc2
incl %r12d
movq %r14, %rbx
movq %r15, %r14
movq (%rbx), %rsi
movl %r12d, %r15d
leaq (%rsi,%r15,4), %rdx
leaq 0x20(%rsp), %r12
leaq 0x3(%rsp), %rcx
movq %r12, %rdi
callq 0xee22
movq 0x8(%rsp), %rdi
addq $0x18, %rdi
movq %r12, %rsi
callq 0x103fa
leaq 0x20(%rsp), %rdi
callq 0x90a0
xorl %r12d, %r12d
cmpq %r12, %r15
je 0xcd1b
movq (%rbx), %rax
movslq (%rax,%r12,4), %rsi
movq %r14, %rdi
callq 0x85d6
notq %rdx
andq %rdx, (%rax)
incq %r12
jmp 0xccfc
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x90a0
movq %rbx, %rdi
callq 0x3590
nop