// File: /workspace/github_cpp_makefile_star2_O3/fjamour[P]icentral/src/bc.cc
// Function: brandes_betweenness_centrality(graph_t&)
vector<double> brandes_betweenness_centrality(graph_t& graph_in)
{
    vector<double> bc_vec;
    bc_vec.resize(graph_in.size());
    fill(bc_vec.begin(), bc_vec.end(), 0.0);
    
    for(node_id_t s = 0; s < graph_in.size(); ++s) {
        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;
        
        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;
        
        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);
                }
            }
        }
        vector<double> pair_dep_vec;
        pair_dep_vec.resize(graph_in.size());
        fill(pair_dep_vec.begin(), pair_dep_vec.end(), 0.0);
        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];
            }
        }
    }
    for(node_id_t i = 0; i < bc_vec.size(); ++i) {
        bc_vec[i] = bc_vec[i]/2;
    }
    return bc_vec;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rsi, %rdi
movq %rbx, 0x28(%rsp)
callq 0x1dfcc
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5be8
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
cmpq %rdx, %rdi
je 0xa3c2
subq %rdi, %rdx
addq $-0x8, %rdx
andq $-0x8, %rdx
addq $0x8, %rdx
xorl %esi, %esi
callq 0x2110
leaq 0x70(%rsp), %r12
leaq 0x10(%rsp), %rbp
leaq 0x4(%rsp), %r13
leaq 0xc(%rsp), %r15
xorl %ebx, %ebx
movl %ebx, 0x8(%rsp)
movq %r14, %rdi
callq 0x1dfcc
movl %ebx, %ecx
cmpq %rcx, %rax
jbe 0xa944
xorpd %xmm0, %xmm0
movapd %xmm0, 0x120(%rsp)
movapd %xmm0, 0x110(%rsp)
movapd %xmm0, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
movapd %xmm0, 0xe0(%rsp)
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
callq 0x6ad0
xorpd %xmm0, %xmm0
movapd %xmm0, 0xc0(%rsp)
xorl %eax, %eax
movq %rax, 0xd0(%rsp)
movq %rax, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
movq %rax, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, 0xb0(%rsp)
movapd %xmm0, 0xa0(%rsp)
movapd %xmm0, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x6ad0
movq %r14, %rdi
callq 0x1dfcc
leaq 0xc0(%rsp), %rdi
movq %rax, %rsi
callq 0x5e32
movq %r14, %rdi
callq 0x1dfcc
leaq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0xd848
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %rdx
cmpq %rdx, %rbx
je 0xa4e5
subq %rbx, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2110
movl 0x8(%rsp), %eax
movl $0x1, (%rbx,%rax,4)
movq %r14, %rdi
callq 0x1dfcc
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0xd848
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rdx
cmpq %rdx, %rbx
je 0xa530
subq %rbx, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movq %rbx, %rdi
movl $0xff, %esi
callq 0x2110
movl 0x8(%rsp), %eax
movl $0x0, (%rbx,%rax,4)
movq 0xa0(%rsp), %rcx
movq 0xb0(%rsp), %rax
addq $-0x4, %rax
cmpq %rax, %rcx
je 0xa568
movl 0x8(%rsp), %eax
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0xa0(%rsp)
jmp 0xa57d
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x75be
movq 0xa0(%rsp), %rcx
movq 0x80(%rsp), %rax
cmpq %rax, %rcx
je 0xa750
movl (%rax), %ecx
movl %ecx, 0x4(%rsp)
movq 0x90(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xa5ab
addq $0x4, %rax
jmp 0xa5ec
movq 0x88(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2250
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)
movq %rax, 0x80(%rsp)
movq 0x110(%rsp), %rax
movq 0x120(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xa621
movl 0x4(%rsp), %esi
movl %esi, (%rax)
addq $0x4, %rax
movq %rax, 0x110(%rsp)
jmp 0xa635
leaq 0xe0(%rsp), %rdi
movq %r13, %rsi
callq 0x75be
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0x1dc78
movq %rbp, %rdi
movq %rax, %rsi
callq 0x6112
movq 0x10(%rsp), %rdi
cmpq %rdi, 0x18(%rsp)
je 0xa728
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 0xa6bd
movq 0xa0(%rsp), %rcx
movq 0xb0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0xa696
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0xa0(%rsp)
jmp 0xa6a1
movq %r12, %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 0xa70b
movq 0x50(%rsp), %rcx
movl (%rcx,%rsi,4), %edx
addl %edx, (%rcx,%rax,4)
movl 0xc(%rsp), %eax
movq 0xc0(%rsp), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xa703
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0xa70b
movq %r13, %rdx
callq 0x6f14
incq %rbx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %rbx, %rax
ja 0xa65a
testq %rdi, %rdi
je 0xa73a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x80(%rsp), %rax
cmpq %rax, 0xa0(%rsp)
jne 0xa58e
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq %r14, %rdi
callq 0x1dfcc
movq %rbp, %rdi
movq %rax, %rsi
callq 0x5be8
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
cmpq %rdx, %rdi
je 0xa79b
subq %rdi, %rdx
addq $-0x8, %rdx
andq $-0x8, %rdx
addq $0x8, %rdx
xorl %esi, %esi
callq 0x2110
movq 0x110(%rsp), %rax
cmpq 0xf0(%rsp), %rax
je 0xa8d2
movq 0x118(%rsp), %rdi
cmpq %rdi, %rax
je 0xa7c7
movl -0x4(%rax), %ebx
addq $-0x4, %rax
jmp 0xa81a
movq 0x128(%rsp), %rax
movq -0x8(%rax), %rax
movl 0x1fc(%rax), %ebx
movl $0x200, %esi            # imm = 0x200
callq 0x2250
movq 0x128(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x128(%rsp)
movq -0x8(%rax), %rdi
movq %rdi, 0x118(%rsp)
leaq 0x200(%rdi), %rax
movq %rax, 0x120(%rsp)
movl $0x1fc, %eax            # imm = 0x1FC
addq %rdi, %rax
movq %rax, 0x110(%rsp)
movl %ebx, %eax
movq 0xc0(%rsp), %rdx
leaq (%rax,%rax,2), %rsi
movq (%rdx,%rsi,8), %rcx
movq 0x8(%rdx,%rsi,8), %rdx
subq %rcx, %rdx
movsd 0x257ec(%rip), %xmm3    # 0x30030
je 0xa89a
sarq $0x2, %rdx
movq 0x50(%rsp), %rsi
xorps %xmm0, %xmm0
cvtsi2sdl (%rsi,%rax,4), %xmm0
movq 0x10(%rsp), %r8
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %r9d, %r9d
movl (%rcx,%r9,4), %r10d
xorps %xmm1, %xmm1
cvtsi2sdl (%rsi,%r10,4), %xmm1
divsd %xmm0, %xmm1
movsd (%r8,%rax,8), %xmm2
addsd %xmm3, %xmm2
mulsd %xmm1, %xmm2
addsd (%r8,%r10,8), %xmm2
movsd %xmm2, (%r8,%r10,8)
incq %r9
cmpq %r9, %rdx
jne 0xa867
cmpl 0x8(%rsp), %eax
je 0xa8bc
movq 0x10(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
addsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
movq 0x110(%rsp), %rax
cmpq 0xf0(%rsp), %rax
jne 0xa7b9
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa8e9
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %r12, %rdi
callq 0x690a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xa908
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xa91f
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0xc0(%rsp), %rdi
callq 0x6034
leaq 0xe0(%rsp), %rdi
callq 0x690a
movl 0x8(%rsp), %ebx
incl %ebx
jmp 0xa3d8
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rcx
subq %rdi, %rcx
je 0xa97b
sarq $0x3, %rcx
xorl %edx, %edx
movsd 0x256d5(%rip), %xmm0    # 0x30038
movsd (%rdi,%rdx,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rdi,%rdx,8)
incq %rdx
movl %edx, %esi
cmpq %rsi, %rcx
ja 0xa963
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa996
movq %rax, %r14
jmp 0xa9ca
jmp 0xa996
movq %rax, %r14
jmp 0xaa12
jmp 0xa9a6
jmp 0xa9a1
jmp 0xa9a1
movq %rax, %r14
jmp 0xa9c0
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa9c0
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x70(%rsp), %rdi
callq 0x690a
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xa9e1
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xa9f8
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0xc0(%rsp), %rdi
callq 0x6034
leaq 0xe0(%rsp), %rdi
callq 0x690a
movq 0x28(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xaa2b
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2250
movq %r14, %rdi
callq 0x23b0