// File: /workspace/github_cpp_makefile_star2_O3/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, %ebp
movq %rdi, %r14
xorps %xmm0, %xmm0
leaq 0x40(%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 0x1419c
movslq 0x9c8(%r14), %rsi
incq %rsi
leaq 0x28(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0xa0(%rsp), %rdi
leaq 0x8(%rsp), %rcx
callq 0xa390
movslq 0x9c8(%r14), %rsi
incq %rsi
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0xa9c6
movq 0xad0(%r14), %rax
movslq %ebp, %rcx
movq %rcx, 0x10(%rsp)
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rbp
addq $0x8, %rbp
movq 0x10(%rbp), %rdx
cmpq %rbp, %rdx
je 0x10c4d
movq 0xa0(%rsp), %rbx
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %r15
movabsq $-0x8000000000000000, %r13 # imm = 0x8000000000000000
leaq 0x3f(%r13), %r12
movq %rdx, 0x18(%rsp)
movq %rdx, %rax
movslq 0x20(%rax), %rcx
leal 0x3f(%rcx), %edx
testq %rcx, %rcx
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
movq %rcx, %rsi
andq %r12, %rsi
xorl %edi, %edi
cmpq %r13, %rsi
setbe %dil
movl $0x1, %esi
shlq %cl, %rsi
leaq (%rbx,%rdx,8), %rdx
orq %rsi, -0x8(%rdx,%rdi,8)
movss (%r15,%rcx,4), %xmm0
addss 0x659b(%rip), %xmm0     # 0x170bc
movss %xmm0, (%r15,%rcx,4)
movq %rax, %rdi
callq 0x33c0
cmpq %rbp, %rax
jne 0x10ae0
movq 0x18(%rsp), %rax
cmpq %rbp, %rax
je 0x10c4d
movq 0xa20(%r14), %r13
movq %rbp, 0x98(%rsp)
movq %rax, 0x18(%rsp)
movslq 0x20(%rax), %rbp
cmpl $0x0, (%r13,%rbp,4)
jle 0x10c32
leaq (,%rbp,8), %rax
leaq (%rax,%rax,2), %r15
xorl %ebx, %ebx
movq 0x9d8(%r14), %rax
movq (%rax,%r15), %rax
movslq (%rax,%rbx,4), %rax
leal 0x3f(%rax), %ecx
movl %eax, 0x8(%rsp)
movq 0x9f0(%r14), %rdx
movq (%rdx,%r15), %rdx
xorps %xmm0, %xmm0
cvtss2sd (%rdx,%rbx,4), %xmm0
testq %rax, %rax
movq 0x28(%rsp), %rdx
addsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%rdx,%rax,8)
cmovnsl %eax, %ecx
sarl $0x6, %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq 0xa0(%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 0x10c21
movq 0x70(%rsp), %rcx
movq 0x80(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x10c0b
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x70(%rsp)
jmp 0x10c21
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x14304
movq 0xa20(%r14), %r13
incq %rbx
movslq (%r13,%rbp,4), %rax
cmpq %rax, %rbx
jl 0x10b74
movq 0x18(%rsp), %rdi
callq 0x33c0
movq 0x98(%rsp), %rbp
cmpq %rbp, %rax
jne 0x10b51
movq 0x50(%rsp), %rax
cmpq %rax, 0x70(%rsp)
movq 0x10(%rsp), %rbx
je 0x10e79
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
leaq 0x3f(%rcx), %rbp
leaq 0x8(%rsp), %r12
movslq (%rax), %r13
movq 0x60(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x10c8c
addq $0x4, %rax
jmp 0x10cb9
movq 0x58(%rsp), %rdi
callq 0x3340
movq 0x68(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x68(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x60(%rsp)
leal 0x3f(%r13), %ecx
testl %r13d, %r13d
cmovnsl %r13d, %ecx
sarl $0x6, %ecx
movslq %ecx, %rdx
shlq $0x3, %rdx
addq 0xa0(%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, 0x50(%rsp)
movq -0x8(%rdx,%rsi,8), %rcx
btq %r13, %rcx
jb 0x10e6e
movq 0x28(%rsp), %r8
xorps %xmm0, %xmm0
cvtsd2ss (%r8,%r13,8), %xmm0
cmpb $0x1, 0xb20(%r14)
jne 0x10d4a
cvtss2sd %xmm0, %xmm0
movq 0xae0(%r14), %r8
leaq (,%r13,2), %r9
addq %r13, %r9
movq (%r8,%r9,8), %r8
mulsd (%r8,%rbx,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0xab8(%r14), %r8
ucomiss (%r8,%r13,4), %xmm0
jb 0x10e6e
leaq -0x8(,%rsi,8), %rsi
orq %rdi, %rcx
movq %rcx, (%rdx,%rsi)
movq 0x20(%rsp), %rcx
movq (%rcx,%rbx,8), %rcx
movss (%rcx,%r13,4), %xmm0
addss 0x633a(%rip), %xmm0     # 0x170bc
movss %xmm0, (%rcx,%r13,4)
movq 0xa20(%r14), %rcx
cmpl $0x0, (%rcx,%r13,4)
jle 0x10e6e
leaq (,%r13,2), %rbx
addq %r13, %rbx
xorl %r15d, %r15d
movq 0x9d8(%r14), %rax
movq (%rax,%rbx,8), %rax
movslq (%rax,%r15,4), %rax
leal 0x3f(%rax), %edx
testq %rax, %rax
movl %eax, 0x8(%rsp)
cmovnsl %eax, %edx
sarl $0x6, %edx
movslq %edx, %rdx
shlq $0x3, %rdx
addq 0xa0(%rsp), %rdx
movq %rax, %rsi
andq %rbp, %rsi
xorl %edi, %edi
movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000
cmpq %r8, %rsi
setbe %dil
movq -0x8(%rdx,%rdi,8), %rdx
btq %rax, %rdx
jb 0x10e1d
movq 0x9f0(%r14), %rdx
movq (%rdx,%rbx,8), %rdx
xorps %xmm0, %xmm0
cvtss2sd (%rdx,%r15,4), %xmm0
movq 0x28(%rsp), %rdx
addsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%rdx,%rax,8)
movq 0x70(%rsp), %rdx
movq 0x80(%rsp), %rsi
addq $-0x4, %rsi
cmpq %rsi, %rdx
je 0x10e40
movl %eax, (%rdx)
addq $0x4, %rdx
movq %rdx, 0x70(%rsp)
jmp 0x10e54
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x14304
movq 0xa20(%r14), %rcx
incq %r15
movslq (%rcx,%r13,4), %rax
cmpq %rax, %r15
jl 0x10da8
movq 0x50(%rsp), %rax
movq 0x10(%rsp), %rbx
cmpq %rax, 0x70(%rsp)
jne 0x10c75
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x10e88
callq 0x3340
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x10eb1
callq 0x3340
movq $0x0, 0xa0(%rsp)
movl $0x0, 0xa8(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x12ae2
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x10eeb
movq %rax, %rbx
jmp 0x10f09
jmp 0x10ed9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x10eeb
callq 0x3340
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x10f09
callq 0x3340
movq $0x0, 0xa0(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x12ae2
movq %rbx, %rdi
callq 0x35c0
nop