// File: /workspace/github_cpp_makefile_star2_O3/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 $0x5b8, %rsp            # imm = 0x5B8
movl %edx, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
cmpb $0x1, 0x30c(%rdi)
jne 0x29a4c
movq %rdi, %r14
movl %r8d, 0x1c(%rsp)
movq %rsi, 0x20(%rsp)
addq $0x310, %rdi            # imm = 0x310
leaq 0x60(%r14), %rsi
movq %rdi, 0x28(%rsp)
callq 0x2f16c
leaq 0x508(%r14), %r13
movq 0x510(%r14), %rsi
movq 0x518(%r14), %rdx
movq %r13, %rdi
callq 0x15b96
xorl %ebx, %ebx
movq %rbx, 0x520(%r14)
leaq 0x538(%r14), %rdi
movq 0x540(%r14), %rsi
movq 0x548(%r14), %rdx
movq %rdi, 0x30(%rsp)
callq 0x24590
movq %rbx, 0x550(%r14)
movq 0x8(%r14), %rax
movq (%rax), %rbp
movq %rax, %r12
testq %rbp, %rbp
jne 0x29786
movq %rax, %r12
movq 0x8(%r12), %rbp
addq $0x8, %r12
testq %rbp, %rbp
je 0x29778
movq 0x10(%r14), %rcx
cmpq (%rax,%rcx,8), %rbp
je 0x2985f
leaq 0x370(%r14), %r15
leaq 0x58(%rsp), %rbx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x5d14
movl (%rax), %eax
leaq 0x8(%rbp), %rsi
movl %eax, 0x50(%rsp)
movq %rbx, %rdi
callq 0x6112
movl 0x50(%rsp), %eax
movl %eax, 0x300(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, 0x308(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x318(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
leaq 0x300(%rsp), %rdx
callq 0x1d500
movq 0x308(%rsp), %rdi
testq %rdi, %rdi
je 0x29822
movq 0x318(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x29839
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x20(%rbp), %rbp
testq %rbp, %rbp
jne 0x2984d
movq 0x8(%r12), %rbp
addq $0x8, %r12
jmp 0x2983d
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
cmpq (%rax,%rcx,8), %rbp
jne 0x297a0
movq 0x38(%r14), %rax
movq (%rax), %r13
movq %rax, %r12
testq %r13, %r13
jne 0x2987f
movq %rax, %r12
movq 0x8(%r12), %r13
addq $0x8, %r12
testq %r13, %r13
je 0x29871
movq 0x40(%r14), %rcx
cmpq (%rax,%rcx,8), %r13
je 0x29920
leaq 0x370(%r14), %rbx
leaq 0x58(%rsp), %rbp
leaq 0x308(%rsp), %r15
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5d14
movl (%rax), %eax
leaq 0x8(%r13), %rsi
movl %eax, 0x50(%rsp)
movq %rbp, %rdi
callq 0x16312
movl 0x50(%rsp), %eax
movl %eax, 0x300(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2d1b2
leaq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
leaq 0x300(%rsp), %rdx
callq 0x2e402
movq %r15, %rdi
callq 0x15650
movq %rbp, %rdi
callq 0x15650
movq 0x2b0(%r13), %r13
testq %r13, %r13
jne 0x29912
movq 0x8(%r12), %r13
addq $0x8, %r12
jmp 0x29902
movq 0x38(%r14), %rax
movq 0x40(%r14), %rcx
cmpq (%rax,%rcx,8), %r13
jne 0x298a1
leaq 0x370(%r14), %r15
leaq 0x18(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5d14
movl (%rax), %eax
movl %eax, (%rbx)
leaq 0x14(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x5d14
movl (%rax), %edx
movl %edx, (%r12)
movl (%rbx), %esi
movq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x2e916
xorl %eax, %eax
leaq 0x300(%rsp), %rdx
movq %rax, 0x10(%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movl (%rbx), %esi
movq %r13, %rdi
callq 0x2ee54
movl 0x14(%rsp), %esi
leaq 0x50(%rsp), %rdx
movq %r13, %rdi
callq 0x2ee54
movq 0x318(%r14), %rax
subq 0x310(%r14), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %ecx # imm = 0xAAAAAAAB
movl 0x1c(%rsp), %edx
cmpl %edx, %ecx
movl %edx, %eax
cmovll %ecx, %eax
cmpl $-0x1, %edx
cmovel %ecx, %eax
testl %eax, %eax
movq 0x20(%rsp), %r12
jle 0x29a08
movl %eax, %r15d
xorl %ebx, %ebx
movq 0x300(%rsp), %rax
movl (%rax,%rbx,4), %r8d
movq 0x50(%rsp), %rax
movl (%rax,%rbx,4), %r9d
cmpl %r9d, %r8d
je 0x29a00
movl 0x18(%rsp), %edx
movl 0x14(%rsp), %ecx
movq %r12, (%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x29aea
incq %rbx
cmpq %rbx, %r15
jne 0x299d0
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
movq %r13, %rdi
callq 0x2e844
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x29a2f
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0x29a4c
movq 0x310(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29a60
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x29a7a
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0x29ae2
movq 0x310(%rsp), %rsi
jmp 0x29ada
movq %rax, %rbx
jmp 0x29aa1
movq %rax, %rbx
movq %r15, %rdi
callq 0x15650
movq %rbp, %rdi
callq 0x15650
jmp 0x29ae2
movq %rax, %rbx
movq 0x308(%rsp), %rdi
testq %rdi, %rdi
je 0x29acb
movq 0x318(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x29ae2
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x23b0