// File: /workspace/github_cpp_makefile_star2_O2/dtsaras[P]GCW/rwgraph.cpp
// Function: Graph::BFS_LT(int, float**)
void Graph::BFS_LT(int p, float** APc){
    // (u) ---> (v)
    queue<int> myqueue;
    vector<bool> active(getSize() + 1,false); //tracks the users that are active
    vector<double> active_prob(getSize() + 1,0); //tracks the probability of the active incoming edges for each node
    int user_front, user_front_friend;
    int u, v;

    for (int seed : seedSets[p]){ // Sets seeds as active and counts that they are Aware of p
        active[seed] = true;
        APc[p][seed]++;
    }

    for (int seed : seedSets[p]){
        for (int i = 0; i < node_deg[seed]; i++){ // Inserts all the users that are not active to the queue and could be activated (seed) ---> (v)
            v = adjList[seed][i];
            active_prob[v] += probabilities[seed][i];
            if (active[v] == false){
                myqueue.push(v); // Now we need to check if (v) will become active since the seeds were active
            }
        }
    }

    while (!myqueue.empty()){ // Continues till none can get aware
        user_front = myqueue.front(); // Gets the first guy from the queue
        u = myqueue.front(); // Gets the first guy from the queue
        myqueue.pop();
        // if (active[user_front] == false && similarities[user_front][p] >= sfmt_to_real1(LT_node[user_front]) && active_prob[user_front] * similarities[user_front][p] >= sfmt_to_real1(LT_node[user_front])){ // Making sure the first guy is not active

        // if (active[u] == false && get_AP_LT(active_prob[u], u, p)  >= sfmt_to_real1(LT_node[user_front])){ // Making sure the first guy is not active
        if (active[u] == false && get_AP_LT(active_prob[u], u, p)  >= LT_node[user_front]){ // Making sure the first guy is not active
            active[u] = true;
            APc[p][u]++;
            for (int i = 0; i < node_deg[u]; i++){ // Inserts all the outgoing neighbors that are not active since they can become aware
                v = adjList[u][i];
                if (active[v] == false)
                    active_prob[v] += probabilities[u][i];
                    myqueue.push(v);
            }
        }
    }  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, 0x20(%rsp)
movl %esi, 0x14(%rsp)
movq %rdi, %r14
leaq 0x78(%rsp), %rdi
callq 0xee54
movslq 0x9c8(%r14), %rsi
incq %rsi
leaq 0x28(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rcx
callq 0x840c
movslq 0x9c8(%r14), %rsi
incq %rsi
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0x87c4
movq 0xad0(%r14), %rax
movslq 0x14(%rsp), %rdx
movq %rdx, 0x18(%rsp)
imulq $0x30, %rdx, %rbx
leaq (%rax,%rbx), %rbp
addq $0x8, %rbp
movq 0x10(%rbp), %r12
leaq 0x50(%rsp), %r15
cmpq %rbp, %r12
je 0xd9c9
movslq 0x20(%r12), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x85d6
orq %rdx, (%rax)
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movss (%rax,%r13,4), %xmm0
addss 0x56d6(%rip), %xmm0     # 0x1308c
movss %xmm0, (%rax,%r13,4)
movq %r12, %rdi
callq 0x33a0
movq %rax, %r12
jmp 0xd982
movq 0xad0(%r14), %rax
addq %rbx, %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0x10(%rax), %rax
leaq 0x50(%rsp), %r15
leaq 0x8(%rsp), %rbp
cmpq 0x40(%rsp), %rax
je 0xda76
movq %rax, 0x48(%rsp)
movslq 0x20(%rax), %rbx
imulq $0x18, %rbx, %r12
xorl %r13d, %r13d
movq 0xa20(%r14), %rax
movslq (%rax,%rbx,4), %rax
cmpq %rax, %r13
jge 0xda67
movq 0x9d8(%r14), %rax
movq (%rax,%r12), %rax
movslq (%rax,%r13,4), %rsi
movl %esi, 0x8(%rsp)
movq 0x9f0(%r14), %rax
movq (%rax,%r12), %rax
cvtss2sd (%rax,%r13,4), %xmm0
movq 0x28(%rsp), %rax
addsd (%rax,%rsi,8), %xmm0
movsd %xmm0, (%rax,%rsi,8)
movq %r15, %rdi
callq 0x85d6
testq %rdx, (%rax)
jne 0xda62
leaq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x10694
incq %r13
jmp 0xda05
movq 0x48(%rsp), %rdi
callq 0x33a0
jmp 0xd9ea
leaq 0x78(%rsp), %r15
leaq 0x50(%rsp), %r12
movq 0x88(%rsp), %rax
cmpq %rax, 0xa8(%rsp)
je 0xdb76
movslq (%rax), %rbp
movq %r15, %rdi
callq 0x108bc
movq %r12, %rdi
movq %rbp, %rsi
callq 0x85d6
testq %rdx, (%rax)
jne 0xda80
movq 0x28(%rsp), %rax
cvtsd2ss (%rax,%rbp,8), %xmm0
movq %r14, %rdi
movl %ebp, %esi
movl 0x14(%rsp), %edx
callq 0xc2c2
movq 0xab8(%r14), %rax
ucomiss (%rax,%rbp,4), %xmm0
jb 0xda80
movq %r12, %rdi
movq %rbp, %rsi
callq 0x85d6
orq %rdx, (%rax)
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movss (%rax,%rbp,4), %xmm0
addss 0x558d(%rip), %xmm0     # 0x1308c
movss %xmm0, (%rax,%rbp,4)
imulq $0x18, %rbp, %rbx
xorl %r13d, %r13d
movq 0xa20(%r14), %rax
movslq (%rax,%rbp,4), %rax
cmpq %rax, %r13
jge 0xda80
movq 0x9d8(%r14), %rax
movq (%rax,%rbx), %rax
movslq (%rax,%r13,4), %rsi
movl %esi, 0x8(%rsp)
movq %r12, %rdi
callq 0x85d6
testq %rdx, (%rax)
jne 0xdb64
movq 0x9f0(%r14), %rax
movq (%rax,%rbx), %rax
cvtss2sd (%rax,%r13,4), %xmm0
movslq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
addsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x10694
incq %r13
jmp 0xdb0b
leaq 0x28(%rsp), %rdi
callq 0x9976
leaq 0x50(%rsp), %rdi
callq 0x8470
leaq 0x78(%rsp), %rdi
callq 0xeea2
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xdbc9
movq %rax, %rbx
jmp 0xdbd3
jmp 0xdbbc
jmp 0xdbbc
jmp 0xdbbc
jmp 0xdbbc
jmp 0xdbbc
jmp 0xdbbc
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x9976
leaq 0x50(%rsp), %rdi
callq 0x8470
leaq 0x78(%rsp), %rdi
callq 0xeea2
movq %rbx, %rdi
callq 0x3590
nop