// File: /workspace/github_cpp_makefile_star2_O3/fjamour[P]icentral/src/bc.cc
// Function: brandes_iter(graph_t&, unsigned int, std::vector<double, std::allocator<double>>&)
void brandes_iter(graph_t& graph_in,
        node_id_t s,
        vector<double>& bc_vec)
{
    stack<node_id_t> S;
    vector<vector<node_id_t> > P;
    vector<int> path_cnt_vec;
    vector<int> dist_vec;
    queue<node_id_t> Q;
    vector<double> pair_dep_vec;

    P.resize(graph_in.size());
    path_cnt_vec.resize(graph_in.size());
    fill(path_cnt_vec.begin(), path_cnt_vec.end(), 0);
    path_cnt_vec[s] = 1;
    dist_vec.resize(graph_in.size());
    fill(dist_vec.begin(), dist_vec.end(), -1);
    dist_vec[s] = 0;
    pair_dep_vec.resize(graph_in.size());
    fill(pair_dep_vec.begin(), pair_dep_vec.end(), 0.0);

    Q.push(s);

    while (!Q.empty()) {
        node_id_t v = Q.front();
        Q.pop();
        S.push(v);
        vector<node_id_t> nbr_vec = graph_in.get_nbrs(v);
        for (int nbr_idx = 0; nbr_idx < nbr_vec.size(); ++nbr_idx) {
            node_id_t w = nbr_vec[nbr_idx];
            if (dist_vec[w] < 0) {
                Q.push(w);
                dist_vec[w] = dist_vec[v] + 1;
            }
            if (dist_vec[w] == dist_vec[v] + 1) {
                path_cnt_vec[w] += path_cnt_vec[v];
                P[w].push_back(v);
            }
        }
    }

    while (!S.empty()) {
        node_id_t w = S.top();
        S.pop();
        for (int idx = 0; idx < P[w].size(); ++idx) {
            node_id_t v = P[w][idx];
            pair_dep_vec[v] += (((double) path_cnt_vec[v] / path_cnt_vec[w]) * (1 + pair_dep_vec[w]));
        }
        if (w != s) {
            bc_vec[w] += pair_dep_vec[w];
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdx, %r12
movq %rdi, %r14
movl %esi, 0x8(%rsp)
xorpd %xmm0, %xmm0
leaq 0x100(%rsp), %rdi
movapd %xmm0, 0x40(%rdi)
movapd %xmm0, 0x30(%rdi)
movapd %xmm0, 0x20(%rdi)
movapd %xmm0, 0x10(%rdi)
movapd %xmm0, (%rdi)
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x6ad0
movq %rbx, 0x90(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movq %rbx, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
movq %rbx, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
leaq 0xa0(%rsp), %rdi
movapd %xmm0, 0x40(%rdi)
movapd %xmm0, 0x30(%rdi)
movapd %xmm0, 0x20(%rdi)
movapd %xmm0, 0x10(%rdi)
movapd %xmm0, (%rdi)
xorl %esi, %esi
callq 0x6ad0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq %r14, %rdi
callq 0x1dfcc
leaq 0x80(%rsp), %rdi
movq %rax, %rsi
callq 0x5e32
movq %r14, %rdi
callq 0x1dfcc
leaq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0xd848
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %rdx
cmpq %rdx, %r15
je 0xac41
subq %r15, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2110
movl 0x8(%rsp), %eax
movl $0x1, (%r15,%rax,4)
movq %r14, %rdi
callq 0x1dfcc
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0xd848
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %rdx
cmpq %rdx, %r15
je 0xac8d
subq %r15, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movq %r15, %rdi
movl $0xff, %esi
callq 0x2110
movl 0x8(%rsp), %eax
movl $0x0, (%r15,%rax,4)
movq %r14, %rdi
callq 0x1dfcc
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x5be8
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
cmpq %rdx, %rdi
je 0xacd3
subq %rdi, %rdx
addq $-0x8, %rdx
andq $-0x8, %rdx
addq $0x8, %rdx
xorl %esi, %esi
callq 0x2110
movq 0xd0(%rsp), %rcx
movq 0xe0(%rsp), %rax
addq $-0x4, %rax
cmpq %rax, %rcx
movq %r12, 0xf8(%rsp)
je 0xad08
movl 0x8(%rsp), %eax
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0xd0(%rsp)
jmp 0xad22
leaq 0xa0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x75be
movq 0xd0(%rsp), %rcx
movq 0xb0(%rsp), %rax
cmpq %rax, %rcx
je 0xaf0c
leaq 0x4(%rsp), %r12
leaq 0x68(%rsp), %r13
leaq 0xa0(%rsp), %rbp
leaq 0xc(%rsp), %r15
movl (%rax), %ecx
movl %ecx, 0x4(%rsp)
movq 0xc0(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xad67
addq $0x4, %rax
jmp 0xada8
movq 0xb8(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2250
movq 0xc8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0xc8(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0xb8(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0xc0(%rsp)
movq %rax, 0xb0(%rsp)
movq 0x130(%rsp), %rax
movq 0x140(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xaddd
movl 0x4(%rsp), %esi
movl %esi, (%rax)
addq $0x4, %rax
movq %rax, 0x130(%rsp)
jmp 0xadf1
leaq 0x100(%rsp), %rdi
movq %r12, %rsi
callq 0x75be
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0x1dc78
movq %r13, %rdi
movq %rax, %rsi
callq 0x6112
movq 0x68(%rsp), %rdi
cmpq %rdi, 0x70(%rsp)
je 0xaee4
xorl %ebx, %ebx
movl (%rdi,%rbx,4), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rcx
movl (%rcx,%rax,4), %edx
testl %edx, %edx
jns 0xae79
movq 0xd0(%rsp), %rcx
movq 0xe0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0xae52
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0xd0(%rsp)
jmp 0xae5d
movq %rbp, %rdi
movq %r15, %rsi
callq 0x75be
movl 0x4(%rsp), %eax
movq 0x30(%rsp), %rcx
movl (%rcx,%rax,4), %eax
incl %eax
movl 0xc(%rsp), %edx
movl %eax, (%rcx,%rdx,4)
movl 0xc(%rsp), %eax
movl (%rcx,%rax,4), %edx
movl 0x4(%rsp), %esi
movl (%rcx,%rsi,4), %ecx
incl %ecx
cmpl %ecx, %edx
jne 0xaec7
movq 0x50(%rsp), %rcx
movl (%rcx,%rsi,4), %edx
addl %edx, (%rcx,%rax,4)
movl 0xc(%rsp), %eax
movq 0x80(%rsp), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xaebf
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0xaec7
movq %r12, %rdx
callq 0x6f14
incq %rbx
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %rbx, %rax
ja 0xae16
testq %rdi, %rdi
je 0xaef6
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xb0(%rsp), %rax
cmpq %rax, 0xd0(%rsp)
jne 0xad4a
movq 0x130(%rsp), %rax
cmpq 0x110(%rsp), %rax
movq 0xf8(%rsp), %r14
je 0xb048
movq 0x138(%rsp), %rdi
movl $0x1fc, %ebx            # imm = 0x1FC
movsd 0x250f1(%rip), %xmm3    # 0x30030
cmpq %rdi, %rax
je 0xaf4d
movl -0x4(%rax), %ebp
addq $-0x4, %rax
jmp 0xafa4
movq 0x148(%rsp), %rax
movq -0x8(%rax), %rax
movl 0x1fc(%rax), %ebp
movl $0x200, %esi            # imm = 0x200
callq 0x2250
movsd 0x250bf(%rip), %xmm3    # 0x30030
movq 0x148(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x148(%rsp)
movq -0x8(%rax), %rdi
movq %rdi, 0x138(%rsp)
leaq 0x200(%rdi), %rax
movq %rax, 0x140(%rsp)
leaq (%rdi,%rbx), %rax
movq %rax, 0x130(%rsp)
movl %ebp, %ecx
movq 0x80(%rsp), %rsi
leaq (%rcx,%rcx,2), %r8
movq (%rsi,%r8,8), %rdx
movq 0x8(%rsi,%r8,8), %rsi
subq %rdx, %rsi
je 0xb01d
sarq $0x2, %rsi
movq 0x50(%rsp), %r8
xorps %xmm0, %xmm0
cvtsi2sdl (%r8,%rcx,4), %xmm0
movq 0x10(%rsp), %r9
cmpq $0x1, %rsi
adcq $0x0, %rsi
xorl %r10d, %r10d
movl (%rdx,%r10,4), %r11d
xorps %xmm1, %xmm1
cvtsi2sdl (%r8,%r11,4), %xmm1
divsd %xmm0, %xmm1
movsd (%r9,%rcx,8), %xmm2
addsd %xmm3, %xmm2
mulsd %xmm1, %xmm2
addsd (%r9,%r11,8), %xmm2
movsd %xmm2, (%r9,%r11,8)
incq %r10
cmpq %r10, %rsi
jne 0xafea
cmpl 0x8(%rsp), %ecx
je 0xb03a
movq 0x10(%rsp), %rdx
movsd (%rdx,%rcx,8), %xmm0
movq (%r14), %rdx
addsd (%rdx,%rcx,8), %xmm0
movsd %xmm0, (%rdx,%rcx,8)
cmpq 0x110(%rsp), %rax
jne 0xaf3f
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xb05f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0xa0(%rsp), %rdi
callq 0x690a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xb083
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xb09a
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x80(%rsp), %rdi
callq 0x6034
leaq 0x100(%rsp), %rdi
callq 0x690a
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xb129
jmp 0xb0cf
jmp 0xb0cf
movq %rax, %rbx
jmp 0xb0ee
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0xb0ee
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xb105
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0xa0(%rsp), %rdi
callq 0x690a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xb129
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xb140
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x80(%rsp), %rdi
callq 0x6034
leaq 0x100(%rsp), %rdi
callq 0x690a
movq %rbx, %rdi
callq 0x23b0