// File: /workspace/github_cpp_makefile_star2_O2/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 $0x148, %rsp            # imm = 0x148
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, 0xc(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x766a
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
movapd %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movapd %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x4a40
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq %r14, %rdi
callq 0x18d3c
leaq 0x70(%rsp), %rdi
movq %rax, %rsi
callq 0x4874
movq %r14, %rdi
callq 0x18d3c
leaq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0xafb8
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
movq %rax, %rdx
cmpq %rcx, %rdx
je 0x9144
andl $0x0, (%rdx)
addq $0x4, %rdx
jmp 0x9136
movl 0xc(%rsp), %ecx
movl $0x1, (%rax,%rcx,4)
movq %r14, %rdi
callq 0x18d3c
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0xafb8
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rax, %rdx
cmpq %rcx, %rdx
je 0x917f
orl $-0x1, (%rdx)
addq $0x4, %rdx
jmp 0x9171
movl 0xc(%rsp), %ecx
andl $0x0, (%rax,%rcx,4)
movq %r14, %rdi
callq 0x18d3c
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x45f0
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq %rcx, %rax
je 0x91b5
andq $0x0, (%rax)
addq $0x8, %rax
jmp 0x91a6
leaq 0xf8(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x62da
movq %rbx, 0x88(%rsp)
leaq 0xf8(%rsp), %r15
leaq 0x8(%rsp), %r13
leaq 0x90(%rsp), %rbp
leaq 0x4(%rsp), %rbx
movq 0x108(%rsp), %rax
cmpq %rax, 0x128(%rsp)
je 0x92d0
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq %r15, %rdi
callq 0x650e
leaq 0xa8(%rsp), %rdi
movq %r13, %rsi
callq 0x62da
movl 0x8(%rsp), %esi
movq %r14, %rdi
callq 0x18b4c
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4ba0
xorl %r12d, %r12d
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0x92c3
movl (%rax,%r12,4), %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rsp), %rcx
movl (%rcx,%rax,4), %edx
testl %edx, %edx
jns 0x928e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x62da
movl 0x8(%rsp), %eax
movq 0x30(%rsp), %rcx
movl (%rcx,%rax,4), %eax
incl %eax
movl 0x4(%rsp), %edx
movl %eax, (%rcx,%rdx,4)
movl 0x4(%rsp), %eax
movl (%rcx,%rax,4), %edx
movl 0x8(%rsp), %esi
movl (%rcx,%rsi,4), %ecx
incl %ecx
cmpl %ecx, %edx
jne 0x92bb
movq 0x50(%rsp), %rcx
movl (%rcx,%rsi,4), %edx
addl %edx, (%rcx,%rax,4)
movl 0x4(%rsp), %eax
imulq $0x18, %rax, %rdi
addq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x478c
incq %r12
jmp 0x9237
movq %rbp, %rdi
callq 0x56ec
jmp 0x91e9
movl $0x200, %r14d           # imm = 0x200
leaq 0xa8(%rsp), %rbx
movq 0x88(%rsp), %r12
movq 0xd8(%rsp), %rax
cmpq 0xb8(%rsp), %rax
je 0x93b1
cmpq 0xe0(%rsp), %rax
jne 0x9315
movq 0xf0(%rsp), %rax
movq -0x8(%rax), %rax
addq %r14, %rax
movl -0x4(%rax), %r15d
movq %rbx, %rdi
callq 0x85f6
movq 0x70(%rsp), %rcx
imulq $0x18, %r15, %rdx
movq (%rcx,%rdx), %rax
movq 0x8(%rcx,%rdx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movq 0x50(%rsp), %rdx
movq 0x10(%rsp), %rsi
xorl %edi, %edi
movsd 0x1ecf2(%rip), %xmm2    # 0x28040
cmpq %rdi, %rcx
je 0x9386
movl (%rax,%rdi,4), %r8d
cvtsi2sdl (%rdx,%r8,4), %xmm0
cvtsi2sdl (%rdx,%r15,4), %xmm1
divsd %xmm1, %xmm0
movsd (%rsi,%r15,8), %xmm1
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm1
addsd (%rsi,%r8,8), %xmm1
movsd %xmm1, (%rsi,%r8,8)
incq %rdi
jmp 0x934e
cmpl 0xc(%rsp), %r15d
je 0x92e6
movq 0x10(%rsp), %rax
movsd (%rax,%r15,8), %xmm0
movq (%r12), %rax
addsd (%rax,%r15,8), %xmm0
movsd %xmm0, (%rax,%r15,8)
jmp 0x92e6
leaq 0x10(%rsp), %rdi
callq 0x5754
leaq 0xf8(%rsp), %rdi
callq 0x5280
leaq 0x30(%rsp), %rdi
callq 0x5720
leaq 0x50(%rsp), %rdi
callq 0x5720
leaq 0x70(%rsp), %rdi
callq 0x4a1e
leaq 0xa8(%rsp), %rdi
callq 0x5280
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x943a
jmp 0x940e
jmp 0x940e
movq %rax, %rbx
jmp 0x9423
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x56ec
leaq 0x10(%rsp), %rdi
callq 0x5754
leaq 0xf8(%rsp), %rdi
callq 0x5280
leaq 0x30(%rsp), %rdi
callq 0x5720
leaq 0x50(%rsp), %rdi
callq 0x5720
leaq 0x70(%rsp), %rdi
callq 0x4a1e
leaq 0xa8(%rsp), %rdi
callq 0x5280
movq %rbx, %rdi
callq 0x23d0