// File: /workspace/github_cpp_makefile_star2_O2/fjamour[P]icentral/src/qube.cc
// Function: muc_t::compute_bc_inc(std::tr1::unordered_map<unsigned int, double, std::tr1::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, double>>>&, unsigned int, unsigned int, int)
void muc_t::compute_bc_inc(tr1_map_t(double)& bc_map,
                        node_id_t src,
                        node_id_t dst,
                        int max_iter)
{
    if(!valid)
        return;

    muc_fast_subgraph.fill_graph(muc_subgraph);
    tmp_conn_vertex_map.clear();
    tmp_subgraph_map.clear();
    for(conn_vert_map_t::iterator it = conn_vertex_map.begin();
            it != conn_vertex_map.end();
            ++it) {
        node_id_t new_v = muc_fast_subgraph.outin_label_map[it->first];
        tmp_conn_vertex_map.insert(make_pair(new_v, it->second));
    }
    for(subgraph_map_t::iterator it = subgraph_map.begin();
            it != subgraph_map.end();
            ++it) {
        node_id_t new_v = muc_fast_subgraph.outin_label_map[it->first];
        tmp_subgraph_map.insert(make_pair(new_v, it->second));
    }
    
    src = muc_fast_subgraph.outin_label_map[src];
    dst = muc_fast_subgraph.outin_label_map[dst];
    
    //bc_map will have for each vertex in the muc it's betweenness centrality
    muc_fast_subgraph.remove_edge(src, dst);
    vector<int> d_src_vec, d_dst_vec;
    muc_fast_subgraph.find_sssp(src, d_src_vec);
    muc_fast_subgraph.find_sssp(dst, d_dst_vec);
    
    //this must be commented in general.. if it's there it makes bc_map contain deltas
    //bcc_subgraph.i_fill_map<double>(bc_map, 0);
    if(max_iter == -1)
        max_iter = muc_fast_subgraph.nodes_vec.size();
    else
        max_iter = min(max_iter, (int)muc_fast_subgraph.nodes_vec.size());
    for(int i = 0; i < max_iter; ++i) {
        node_id_t s = i;
        if(d_src_vec[s] != d_dst_vec[s]) {
            i_iteration(s, 
                    src, 
                    dst, 
                    d_src_vec[s], 
                    d_dst_vec[s], 
                    bc_map);
        }
    }
    muc_fast_subgraph.insert_edge(src, dst);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5c8, %rsp            # imm = 0x5C8
movl %edx, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
cmpb $0x1, 0x30c(%rdi)
jne 0x218ea
movq %rdi, %r14
movl %r8d, 0x2c(%rsp)
movq %rsi, 0x30(%rsp)
addq $0x310, %rdi            # imm = 0x310
leaq 0x60(%r14), %rsi
movq %rdi, 0x38(%rsp)
callq 0x26736
leaq 0x508(%r14), %rbp
movq %rbp, %rdi
callq 0x11adc
leaq 0x538(%r14), %rdi
movq %rdi, 0x40(%rsp)
callq 0x1d646
movq %r14, %rdi
callq 0x22d80
movq %rax, %rsi
leaq 0x18(%rsp), %rax
movq %rsi, (%rax)
movq %rdx, 0x8(%rax)
leaq 0x370(%r14), %r13
leaq 0x68(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0x310(%rsp), %rbx
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
cmpq (%rax,%rcx,8), %rsi
je 0x21743
movq %r13, %rdi
callq 0x46f8
movl (%rax), %eax
movq 0x18(%rsp), %rsi
addq $0x8, %rsi
movl %eax, 0x60(%rsp)
movq %r15, %rdi
callq 0x4ba0
movl 0x60(%rsp), %eax
movl %eax, 0x310(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, 0x318(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x328(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x18366
leaq 0x318(%rsp), %rdi
callq 0x56ec
movq %r15, %rdi
callq 0x56ec
leaq 0x18(%rsp), %rdi
callq 0x25d38
movq 0x18(%rsp), %rsi
jmp 0x216aa
leaq 0x30(%r14), %rdi
callq 0x22fae
movq %rax, %rsi
leaq 0x18(%rsp), %rax
movq %rsi, (%rax)
movq %rdx, 0x8(%rax)
leaq 0x68(%rsp), %rbp
leaq 0x310(%rsp), %r15
leaq 0x60(%rsp), %r12
leaq 0x48(%rsp), %rbx
movq 0x38(%r14), %rax
movq 0x40(%r14), %rcx
cmpq (%rax,%rcx,8), %rsi
je 0x217e0
movq %r13, %rdi
callq 0x46f8
movl (%rax), %eax
movq 0x18(%rsp), %rsi
addq $0x8, %rsi
movl %eax, 0x60(%rsp)
movq %rbp, %rdi
callq 0x12204
movq %r15, %rdi
movq %r12, %rsi
callq 0x22db2
movq %rbx, %rdi
movq 0x40(%rsp), %rsi
movq %r15, %rdx
callq 0x25d4c
leaq 0x318(%rsp), %rdi
callq 0x1173e
movq %rbp, %rdi
callq 0x1173e
leaq 0x18(%rsp), %rdi
callq 0x25fc8
movq 0x18(%rsp), %rsi
jmp 0x21772
leaq 0x14(%rsp), %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x46f8
movl (%rax), %eax
movl %eax, (%rbx)
leaq 0x10(%rsp), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x46f8
movl (%rax), %edx
movl %edx, (%r15)
movl (%rbx), %esi
movq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0x2615e
xorps %xmm0, %xmm0
leaq 0x310(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
movaps %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movl (%rbx), %esi
movq %r13, %rdi
callq 0x26540
movl 0x10(%rsp), %esi
leaq 0x60(%rsp), %rdx
movq %r13, %rdi
callq 0x26540
movq 0x318(%r14), %rax
subq 0x310(%r14), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movl 0x2c(%rsp), %ecx
cmpl %ecx, %eax
movl %ecx, %r15d
cmovll %eax, %r15d
cmpl $-0x1, %ecx
cmovel %eax, %r15d
xorl %ebx, %ebx
testl %r15d, %r15d
cmovlel %ebx, %r15d
movq 0x30(%rsp), %r12
cmpq %rbx, %r15
je 0x218c3
movq 0x310(%rsp), %rax
movl (%rax,%rbx,4), %r8d
movq 0x60(%rsp), %rax
movl (%rax,%rbx,4), %r9d
cmpl %r9d, %r8d
je 0x218be
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %ecx
movq %r12, (%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x2195a
incq %rbx
jmp 0x21889
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movq %r13, %rdi
callq 0x260cc
leaq 0x60(%rsp), %rdi
callq 0x5720
leaq 0x310(%rsp), %rdi
callq 0x5720
addq $0x5c8, %rsp            # imm = 0x5C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x218fe
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x5720
leaq 0x310(%rsp), %rdi
callq 0x5720
jmp 0x21951
movq %rax, %rbx
jmp 0x2192f
movq %rax, %rbx
leaq 0x318(%rsp), %rdi
callq 0x1173e
movq %rbp, %rdi
callq 0x1173e
jmp 0x21951
movq %rax, %rbx
leaq 0x318(%rsp), %rdi
callq 0x56ec
movq %r15, %rdi
callq 0x56ec
movq %rbx, %rdi
callq 0x23d0
nop