// File: /workspace/github_cpp_makefile_star2_O2/fjamour[P]icentral/src/qube.cc
// Function: graph_t::insert_edge_update_muc(unsigned int, unsigned int)
void graph_t::insert_edge_update_muc(node_id_t src, node_id_t dst)
{
    muc_id_t src_muc_id = node_to_muc_vec[src];
    muc_id_t dst_muc_id = node_to_muc_vec[dst];
    if(src_muc_id == dst_muc_id) {
        //case 1: both @src and @dst are in the same muc
        //        then just update the graph and the muc graph
        //just update the muc and the graph
        muc_vec[src_muc_id].muc_subgraph.insert_edge(src, dst);
        insert_edge(src, dst);
    } else {
        //case 2: @src and @dst are not in the same muc
        muc_t new_muc;
        vector<node_id_t> shortest_path;
        get_shortest_path(src, dst, shortest_path);
        new_muc.id = muc_vec.size();
        merge_muc_muc(new_muc, muc_vec[dst_muc_id]);
        merge_muc_muc(new_muc, muc_vec[src_muc_id]);
        for(int i = 0; i < shortest_path.size(); ++i) {
            muc_id_t node_muc_id = node_to_muc_vec[shortest_path[i]];
            if(node_muc_id != new_muc.id) {
                merge_muc_muc(new_muc, muc_vec[node_muc_id]);
            }
        }
        new_muc.muc_subgraph.insert_edge(src, dst);
        //cout << endl << endl;
        //new_muc.muc_subgraph.print_graph();
        muc_vec.push_back(new_muc);
        insert_edge(src, dst);
        //TODO updating the connection vertices must be done in a much faster way!
        find_conn_verts();
        find_muc_subgraphs(new_muc.id);
    }   
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x588, %rsp            # imm = 0x588
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, %eax
movq 0x18(%rdi), %rcx
movl (%rcx,%rax,4), %r15d
movl %edx, %eax
movl (%rcx,%rax,4), %r12d
cmpl %r12d, %r15d
jne 0x209db
movq 0x60(%rbx), %rax
imulq $0x568, %r15, %rcx      # imm = 0x568
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x1756e
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
addq $0x588, %rsp            # imm = 0x588
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x18b56
leaq 0x20(%rsp), %rdi
callq 0x1f76c
xorps %xmm0, %xmm0
movq %rsp, %rcx
movaps %xmm0, (%rcx)
andq $0x0, 0x10(%rcx)
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x18f80
movq 0x60(%rbx), %rcx
movq 0x68(%rbx), %rax
subq %rcx, %rax
movl $0x568, %esi            # imm = 0x568
cqto
idivq %rsi
leaq 0x20(%rsp), %rsi
movl %eax, 0x308(%rsi)
imulq $0x568, %r12, %rdx      # imm = 0x568
addq %rcx, %rdx
movq %rbx, %rdi
callq 0x2083c
imulq $0x568, %r15, %rdx      # imm = 0x568
addq 0x60(%rbx), %rdx
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x2083c
leaq 0x60(%rbx), %r15
xorl %r13d, %r13d
leaq 0x20(%rsp), %r12
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x20a9a
movl (%rax,%r13,4), %eax
movq 0x18(%rbx), %rcx
movl (%rcx,%rax,4), %eax
cmpl 0x328(%rsp), %eax
je 0x20a95
imulq $0x568, %rax, %rdx      # imm = 0x568
addq 0x60(%rbx), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2083c
incq %r13
jmp 0x20a56
leaq 0x80(%rsp), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x1756e
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x22d34
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x18b56
movq %rbx, %rdi
callq 0x1fc1c
movl 0x328(%rsp), %esi
movq %rbx, %rdi
callq 0x1fdd0
movq %rsp, %rdi
callq 0x56ec
leaq 0x20(%rsp), %rdi
callq 0x1d5de
addq $0x588, %rsp            # imm = 0x588
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x20b03
movq %rax, %rbx
movq %rsp, %rdi
callq 0x56ec
leaq 0x20(%rsp), %rdi
callq 0x1d5de
movq %rbx, %rdi
callq 0x23d0