// File: /workspace/github_cpp_makefile_star2_O1/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, %ebx
movq %rcx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %rbp
movl 0x9c8(%rsi), %r14d
movq %r8, %rdi
callq 0x12bb8
testq %r14, %r14
je 0xf8ce
movq %r14, %r8
movl %eax, %r13d
leaq 0x40(%rbp), %rdi
movslq %ebx, %rax
movq %rax, 0x30(%rsp)
xorl %ebx, %ebx
movq %r15, 0x28(%rsp)
movq %rbp, 0x20(%rsp)
movq %r14, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x1, %edx
movl %r13d, %ecx
shlq %cl, %rdx
movl %r13d, %ecx
shrl $0x6, %ecx
movq (%rax,%rcx,8), %rsi
btq %r13, %rsi
jb 0xf8c9
movl %r13d, %r9d
orq %rdx, %rsi
movq %rsi, (%rax,%rcx,8)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl %r13d, (%rax,%rbx,4)
movslq %r13d, %rax
leaq (%rax,%rax,2), %rsi
leaq (,%rsi,8), %r10
addq 0xa88(%r15), %r10
leaq (%r9,%r9,2), %r12
shlq $0x3, %r12
movq 0xa70(%r15), %rax
movl (%rax,%r9,4), %r14d
addq 0xaa0(%r15), %r12
cmpl $0x270, 0xa00(%rbp)     # imm = 0x270
jl 0xf823
movq %rdi, %r15
movq %r10, 0x38(%rsp)
movq %rsi, %rbp
callq 0x16314
movq %rbp, %rsi
movq 0x38(%rsp), %r10
movq %r15, %rdi
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %rbp
movq 0x28(%rsp), %r15
movl $0x0, 0xa00(%rbp)
movslq 0xa00(%rbp), %rcx
leal 0x1(%rcx), %eax
movl %eax, 0xa00(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r14, %r14
je 0xf8a7
movl (%rdi,%rcx,4), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
mulsd 0x8ed0(%rip), %xmm0     # 0x18720
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leal -0x1(%r14), %edx
movq (%r12), %rcx
xorps %xmm2, %xmm2
cvtss2sd (%rcx,%rdx,4), %xmm2
movq 0xae0(%r15), %rdx
movq (%rdx,%rsi,8), %rdx
movq 0x30(%rsp), %rsi
movsd (%rdx,%rsi,8), %xmm1
mulsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0xf8a7
xorl %edx, %edx
xorps %xmm2, %xmm2
cvtss2sd (%rcx,%rdx,4), %xmm2
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jae 0xf8a5
incq %rdx
cmpq %rdx, %r14
jne 0xf889
jmp 0xf8a7
movl %edx, %eax
cmpl $-0x1, %eax
je 0xf8b6
movslq %eax, %rcx
movq (%r10), %rdx
movl (%rdx,%rcx,4), %r13d
incq %rbx
cmpl $-0x1, %eax
je 0xf8c9
cmpq %r8, %rbx
jne 0xf776
jmp 0xf8d1
movl %ebx, %r8d
jmp 0xf8d1
xorl %r8d, %r8d
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq %r8, %r14
movl %r8d, %r12d
leaq (%rsi,%r12,4), %rdx
leaq 0x40(%rsp), %rbx
leaq 0x7(%rsp), %rcx
movq %rbx, %rdi
callq 0x12cc4
addq $0x18, %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1426c
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf913
callq 0x3340
testl %r14d, %r14d
je 0xf976
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq 0x8(%rsp), %rcx
movq (%rcx), %rdx
movq 0x10(%rsp), %rcx
movq (%rcx), %rsi
xorl %edi, %edi
leaq 0x3f(%rax), %r8
movslq (%rdx,%rdi,4), %rcx
leaq 0x3f(%rcx), %r9
testq %rcx, %rcx
cmovnsq %rcx, %r9
sarq $0x6, %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, %r12
jne 0xf938
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf997
callq 0x3340
movq %rbx, %rdi
callq 0x35c0
nop