// File: /workspace/github_cpp_makefile_star2_O1/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, 0x48(%rsp)
movl %esi, %ebp
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x143d0
movslq 0x9c8(%r14), %rsi
incq %rsi
leaq 0x58(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rcx
callq 0xa54e
movslq 0x9c8(%r14), %rsi
incq %rsi
leaq 0x10(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x58(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0xab6e
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movq 0xad0(%r14), %rax
movslq %ebp, %rdx
movq %rcx, %rbp
movq %rdx, 0x18(%rsp)
leaq (%rdx,%rdx,2), %rcx
shlq $0x4, %rcx
addq %rax, %rcx
addq $0x8, %rcx
movq 0x10(%rcx), %r15
cmpq %rcx, %r15
movq %rcx, 0x50(%rsp)
je 0x10d51
movq 0x20(%rsp), %rbx
movq 0x48(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %r12
leaq 0x3f(%rbp), %r13
movq %r15, %rax
movslq 0x20(%rax), %rcx
leaq 0x3f(%rcx), %rdx
testq %rcx, %rcx
cmovnsq %rcx, %rdx
sarq $0x6, %rdx
movq %rcx, %rsi
andq %r13, %rsi
xorl %edi, %edi
cmpq %rbp, %rsi
setbe %dil
movl $0x1, %esi
shlq %cl, %rsi
leaq (%rbx,%rdx,8), %rdx
orq %rsi, -0x8(%rdx,%rdi,8)
movss (%r12,%rcx,4), %xmm0
addss 0x7383(%rip), %xmm0     # 0x180bc
movss %xmm0, (%r12,%rcx,4)
movq %rax, %rdi
callq 0x33c0
movq 0x50(%rsp), %rcx
cmpq %rcx, %rax
jne 0x10cf8
cmpq %rcx, %r15
je 0x10e62
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0x3f(%rax), %r12
movslq 0x20(%r15), %r13
movq 0xa20(%r14), %rax
cmpl $0x0, (%rax,%r13,4)
jle 0x10e4c
leaq (,%r13,8), %rax
leaq (%rax,%rax,2), %rbp
xorl %ebx, %ebx
movq 0x9d8(%r14), %rax
movq (%rax,%rbp), %rax
movslq (%rax,%rbx,4), %rax
movl %eax, 0x10(%rsp)
movq 0x9f0(%r14), %rcx
movq (%rcx,%rbp), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rcx,%rbx,4), %xmm0
movq 0x58(%rsp), %rcx
addsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
leaq 0x3f(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0x6, %rcx
shlq $0x3, %rcx
addq 0x20(%rsp), %rcx
movq %rax, %rdx
andq %r12, %rdx
xorl %esi, %esi
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
cmpq %rdi, %rdx
setbe %sil
movq -0x8(%rcx,%rsi,8), %rcx
btq %rax, %rcx
jb 0x10e35
movq 0xa0(%rsp), %rcx
movq 0xb0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x10e26
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0xa0(%rsp)
jmp 0x10e35
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x14538
incq %rbx
movq 0xa20(%r14), %rax
movslq (%rax,%r13,4), %rax
cmpq %rax, %rbx
jl 0x10d8c
movq %r15, %rdi
callq 0x33c0
movq %rax, %r15
cmpq 0x50(%rsp), %rax
jne 0x10d68
movq 0x80(%rsp), %rax
cmpq %rax, 0xa0(%rsp)
je 0x110ab
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
leaq 0x3f(%rcx), %rbp
leaq 0x10(%rsp), %r12
movslq (%rax), %r13
movq 0x90(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x10ea5
addq $0x4, %rax
jmp 0x10ee1
movq 0x88(%rsp), %rdi
callq 0x3340
movq 0x98(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x98(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x88(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x90(%rsp)
leaq 0x3f(%r13), %rdx
testq %r13, %r13
cmovnsq %r13, %rdx
sarq $0x6, %rdx
shlq $0x3, %rdx
addq 0x20(%rsp), %rdx
movq %r13, %rcx
andq %rbp, %rcx
xorl %esi, %esi
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
cmpq %rdi, %rcx
setbe %sil
movl $0x1, %edi
movl %r13d, %ecx
shlq %cl, %rdi
movq %rax, 0x80(%rsp)
movq -0x8(%rdx,%rsi,8), %rax
btq %r13, %rax
jb 0x11095
movq 0x58(%rsp), %rcx
xorps %xmm0, %xmm0
cvtsd2ss (%rcx,%r13,8), %xmm0
cmpb $0x1, 0xb20(%r14)
jne 0x10f75
cvtss2sd %xmm0, %xmm0
movq 0xae0(%r14), %rcx
leaq (,%r13,2), %r8
addq %r13, %r8
movq (%rcx,%r8,8), %rcx
movq 0x18(%rsp), %r8
mulsd (%rcx,%r8,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0xab8(%r14), %rcx
ucomiss (%rcx,%r13,4), %xmm0
jb 0x11095
leaq -0x8(,%rsi,8), %rcx
orq %rdi, %rax
movq %rax, (%rdx,%rcx)
movq 0x48(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movss (%rax,%r13,4), %xmm0
addss 0x710a(%rip), %xmm0     # 0x180bc
movss %xmm0, (%rax,%r13,4)
movq 0xa20(%r14), %rax
cmpl $0x0, (%rax,%r13,4)
jle 0x11095
leaq (,%r13,2), %r15
addq %r13, %r15
xorl %ebx, %ebx
movq 0x9d8(%r14), %rax
movq (%rax,%r15,8), %rax
movslq (%rax,%rbx,4), %rax
movl %eax, 0x10(%rsp)
leaq 0x3f(%rax), %rcx
testq %rax, %rax
cmovnsq %rax, %rcx
sarq $0x6, %rcx
shlq $0x3, %rcx
addq 0x20(%rsp), %rcx
movq %rax, %rdx
andq %rbp, %rdx
xorl %esi, %esi
movabsq $-0x8000000000000000, %rdi # imm = 0x8000000000000000
cmpq %rdi, %rdx
setbe %sil
movq -0x8(%rcx,%rsi,8), %rcx
btq %rax, %rcx
jb 0x11048
movq 0x9f0(%r14), %rcx
movq (%rcx,%r15,8), %rcx
xorps %xmm0, %xmm0
cvtss2sd (%rcx,%rbx,4), %xmm0
movq 0x58(%rsp), %rcx
addsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
movq 0xa0(%rsp), %rcx
movq 0xb0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x11071
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0xa0(%rsp)
jmp 0x1107e
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x14538
incq %rbx
movq 0xa20(%r14), %rax
movslq (%rax,%r13,4), %rax
cmpq %rax, %rbx
jl 0x10fd7
movq 0x80(%rsp), %rax
cmpq %rax, 0xa0(%rsp)
jne 0x10e8b
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x110ba
callq 0x3340
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x110e2
callq 0x3340
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x12d12
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1111c
movq %rax, %rbx
jmp 0x11144
jmp 0x1110a
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x1111c
callq 0x3340
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x11144
callq 0x3340
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x12d12
movq %rbx, %rdi
callq 0x35c0