// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movl %r9d, %ebp
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movl 0x9c8(%rsi), %r13d
movq %r8, %rdi
callq 0x12988
testq %r13, %r13
movq %rbx, 0x20(%rsp)
je 0xf712
movl %eax, %ecx
movq %r13, 0x18(%rsp)
leaq 0x40(%rbx), %rdi
movslq %ebp, %r11
xorl %ebp, %ebp
movsd 0x8174(%rip), %xmm3     # 0x17720
movabsq $0x100000000, %r13      # imm = 0x100000000
movq %rbx, %r9
movq %r14, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq (%r14), %rax
movl $0x1, %edx
shlq %cl, %rdx
movl %ecx, %esi
shrl $0x6, %esi
movq (%rax,%rsi,8), %r10
btq %rcx, %r10
jb 0xf710
movl %ecx, %r8d
orq %rdx, %r10
movq %r10, (%rax,%rsi,8)
movq (%r15), %rax
movl %ecx, (%rax,%rbp,4)
movslq %ecx, %rax
leaq (%rax,%rax,2), %r15
leaq (,%r15,8), %rsi
addq 0xa88(%r12), %rsi
leaq (%r8,%r8,2), %r14
shlq $0x3, %r14
addq 0xaa0(%r12), %r14
movq 0xa70(%r12), %rax
movl (%rax,%r8,4), %ebx
movl 0xa00(%r9), %eax
cmpl $0x270, %eax            # imm = 0x270
jl 0xf66a
movq %r12, 0x38(%rsp)
movq %rdi, %r12
movq %r11, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
callq 0x16088
movq 0x28(%rsp), %rsi
movsd 0x80ca(%rip), %xmm3     # 0x17720
movq 0x30(%rsp), %r11
movq %r12, %rdi
movq 0x38(%rsp), %r12
movq 0x20(%rsp), %r9
xorl %eax, %eax
incq %rbp
leal 0x1(%rax), %ecx
movl %ecx, 0xa00(%r9)
testq %rbx, %rbx
je 0xf7ba
cltq
movl (%rdi,%rax,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd %xmm3, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leal -0x1(%rbx), %ecx
movq (%r14), %rax
xorps %xmm2, %xmm2
cvtss2sd (%rax,%rcx,4), %xmm2
movq 0xae0(%r12), %rcx
movq (%rcx,%r15,8), %rcx
movsd (%rcx,%r11,8), %xmm1
mulsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0xf7ba
xorl %ecx, %ecx
xorl %edx, %edx
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r15
xorps %xmm2, %xmm2
cvtss2sd (%rax,%rdx,4), %xmm2
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jae 0xf6f4
incq %rdx
addq %r13, %rcx
cmpq %rdx, %rbx
jne 0xf6d5
jmp 0xf710
movq (%rsi), %rax
sarq $0x1e, %rcx
movl (%rax,%rcx), %ecx
cmpq 0x18(%rsp), %rbp
jne 0xf5c3
movq 0x18(%rsp), %rbp
jmp 0xf714
jmp 0xf714
xorl %ebp, %ebp
movq (%r15), %rsi
movl %ebp, %ebx
leaq (%rsi,%rbx,4), %rdx
leaq 0x40(%rsp), %r12
leaq 0x7(%rsp), %rcx
movq %r12, %rdi
callq 0x12a94
movq 0x20(%rsp), %rdi
addq $0x18, %rdi
movq %r12, %rsi
callq 0x14038
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf74f
callq 0x3340
testq %rbx, %rbx
je 0xf7ab
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq (%r15), %rdx
movq (%r14), %rsi
xorl %edi, %edi
leaq 0x3f(%rax), %r8
movslq (%rdx,%rdi,4), %rcx
leal 0x3f(%rcx), %r9d
testq %rcx, %rcx
cmovnsl %ecx, %r9d
sarl $0x6, %r9d
movslq %r9d, %r9
movq %rcx, %r10
andq %r8, %r10
xorl %r11d, %r11d
cmpq %rax, %r10
setbe %r11b
movq $-0x2, %r10
rolq %cl, %r10
leaq (%rsi,%r9,8), %rcx
andq %r10, -0x8(%rcx,%r11,8)
incq %rdi
cmpq %rdi, %rbx
jne 0xf76a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r15
jmp 0xf714
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf7db
callq 0x3340
movq %rbx, %rdi
callq 0x35c0
nop