// File: /workspace/github_cpp_makefile_star2_O2/fjamour[P]icentral/src/bcc_delta.cc
// Function: graph_t::find_edge_bcc(bcc_delta_t&, unsigned int, unsigned int)
void graph_t::find_edge_bcc(bcc_delta_t&  bcc,
                                node_id_t src,
                                node_id_t dst)
{
    //a. find the bcc subgraph
    //b. find the articulation points in bcc
    //c. find the sizes of the subgraphs connected to each art point
    find_edge_bcc_subgraph(bcc.bcc_subgraph, src, dst);
    bcc.bcc_fast_subgraph.fill_graph(bcc.bcc_subgraph);
    vector<node_id_t> art_pt_vec;
    find_art_points(art_pt_vec);
    set<node_id_t> art_pt_set;
    for(int i = 0; i < art_pt_vec.size(); ++i) {
        art_pt_set.insert(art_pt_vec[i]);
    }
    
    graph_hash_t::nodes_map_t::iterator it;
    for(it = bcc.bcc_subgraph.nodes_map.begin();
        it != bcc.bcc_subgraph.nodes_map.end();
        ++it) {
        node_id_t v = it->first;
        if(art_pt_set.find(v) != art_pt_set.end()) {
            // the node is an articulation point and it belongs to the bcc
            // of interest, so it must be added to the art point of this bcc
            // along with the sizes of the subgraphs it connects the bcc to
            vector<int> subgraph_sz_vec;
            vector<bool> visited_vec;
            visited_vec.resize(size());
            fill(visited_vec.begin(), visited_vec.end(), false);
            visited_vec[v] = true;
            vector<node_id_t> v_nbr_vec = get_nbrs(v);
            for(int i = 0; i < v_nbr_vec.size(); ++i) {
                node_id_t u = v_nbr_vec[i];
                if(!bcc.bcc_subgraph.has_edge(v, u) && !visited_vec[u]) {
                    //do a dfs from this guy to figure out the size
                    //of the connected component connected to the bcc through v
                    //and this edge
                    int cnt = 0;
                    stack<node_id_t> S;
                    S.push(u);
                    visited_vec[u] = true;
                    while(!S.empty()) {
                        node_id_t vv = S.top();
                        S.pop();
                        cnt++;
                        vector<node_id_t> nbr_vec = get_nbrs(vv);
                        for(int i = 0; i < nbr_vec.size(); ++i) {
                            node_id_t nbr = nbr_vec[i];
                            if(!visited_vec[nbr]) {
                                visited_vec[nbr] = true;
                                S.push(nbr);
                            }
                        }
                    }
                    subgraph_sz_vec.push_back(cnt);
                }
            }
            bcc.art_pt_map.insert(make_pair(v, subgraph_sz_vec));
        }
    }
    
    //fix art_pt_map
    bcc_delta_t::art_pt_map_t new_art_pt_map;
    for(bcc_delta_t::art_pt_map_t::iterator it = bcc.art_pt_map.begin();
            it != bcc.art_pt_map.end();
            ++it) {
        node_id_t new_v = bcc.bcc_fast_subgraph.outin_label_map[it->first];
        new_art_pt_map.insert(make_pair(new_v, it->second));
    }
    bcc.art_pt_map = new_art_pt_map;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rsi), %r15
movq %r15, %rsi
callq 0x10eea
movq %rbx, 0x10(%rsp)
leaq 0x2d8(%rbx), %rdi
movq %r15, 0x68(%rsp)
movq %r15, %rsi
callq 0x26736
xorps %xmm0, %xmm0
leaq 0x100(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq %r14, 0x18(%rsp)
movq %r14, %rdi
callq 0x107dc
leaq 0x140(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
xorl %r14d, %r14d
leaq 0x138(%rsp), %rbx
xorl %r15d, %r15d
movq 0x100(%rsp), %rsi
movq 0x108(%rsp), %rax
subq %rsi, %rax
sarq $0x2, %rax
cmpq %r15, %rax
jbe 0xc4db
addq %r14, %rsi
movq %rbx, %rdi
callq 0xf450
incq %r15
addq $0x4, %r14
jmp 0xc4ab
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq 0x68(%rsp), %rdi
callq 0xb11c
leaq 0xa0(%rsp), %rcx
movq %rax, (%rcx)
movq %rdx, 0x8(%rcx)
leaq 0x40(%rsp), %r13
leaq 0xb0(%rsp), %rbp
leaq 0x20(%rsp), %r14
leaq 0x8(%rsp), %rbx
movq 0x10(%rsp), %r15
movq 0x38(%r15), %rcx
movq 0x40(%r15), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0xc7fa
movl (%rax), %eax
movl %eax, 0x4(%rsp)
leaq 0x138(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0xf5a2
leaq 0x140(%rsp), %rcx
cmpq %rcx, %rax
je 0xc7e0
andq $0x0, 0x80(%rsp)
andq $0x0, 0x40(%rsp)
andl $0x0, 0x48(%rsp)
andq $0x0, 0x50(%rsp)
andl $0x0, 0x58(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
andq $0x0, 0x60(%rsp)
movq 0x18(%rsp), %rdi
callq 0x18d3c
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x80be
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rdx
movl 0x58(%rsp), %ecx
movb $0x0, 0xb0(%rsp)
xorl %esi, %esi
movq %rbp, %r8
callq 0x864b
movl 0x4(%rsp), %esi
movq %r13, %rdi
callq 0x4b82
orq %rdx, (%rax)
movl 0x4(%rsp), %esi
movq 0x18(%rsp), %rdi
callq 0x18b4c
leaq 0x88(%rsp), %rdi
movq %rax, %rsi
callq 0x4ba0
xorl %r15d, %r15d
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
jbe 0xc747
movl (%rax,%r15,4), %edx
movl %edx, 0x120(%rsp)
movl 0x4(%rsp), %esi
movq 0x68(%rsp), %rdi
callq 0x177f8
testb %al, %al
jne 0xc73f
movl 0x120(%rsp), %esi
movq %r13, %rdi
callq 0x4b82
testq %rdx, (%rax)
jne 0xc73f
andl $0x0, 0xc(%rsp)
movq %rbp, %rdi
callq 0x766a
movq %rbp, %rdi
leaq 0x120(%rsp), %rsi
callq 0x62da
movl 0x120(%rsp), %esi
movq %r13, %rdi
callq 0x4b82
orq %rdx, (%rax)
movq 0xe0(%rsp), %rax
cmpq 0xc0(%rsp), %rax
je 0xc728
cmpq 0xe8(%rsp), %rax
jne 0xc6a6
movq 0xf8(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movl -0x4(%rax), %r12d
movq %rbp, %rdi
callq 0x85f6
incl 0xc(%rsp)
movq 0x18(%rsp), %rdi
movl %r12d, %esi
callq 0x18b4c
movq %r14, %rdi
movq %rax, %rsi
callq 0x4ba0
xorl %r12d, %r12d
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0xc71b
movl (%rax,%r12,4), %esi
movl %esi, 0x8(%rsp)
movq %r13, %rdi
callq 0x4b82
testq %rdx, (%rax)
jne 0xc716
movl 0x8(%rsp), %esi
movq %r13, %rdi
callq 0x4b82
orq %rdx, (%rax)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x62da
incq %r12
jmp 0xc6d1
movq %r14, %rdi
callq 0x56ec
jmp 0xc672
leaq 0x70(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0xf140
movq %rbp, %rdi
callq 0x5280
incq %r15
jmp 0xc5ea
movl 0x4(%rsp), %eax
movl %eax, 0x20(%rsp)
leaq 0x28(%rsp), %r12
movq %r12, %rdi
leaq 0x70(%rsp), %rsi
callq 0x6766
movl 0x20(%rsp), %eax
movl %eax, 0xb0(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, 0xb8(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0xc8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
andq $0x0, 0x10(%r12)
leaq 0x120(%rsp), %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
movq %rbp, %rdx
callq 0xf6b6
leaq 0xb8(%rsp), %rdi
callq 0x5720
movq %r12, %rdi
callq 0x5720
leaq 0x88(%rsp), %rdi
callq 0x56ec
movq %r13, %rdi
callq 0x4e52
leaq 0x70(%rsp), %rdi
callq 0x5720
leaq 0xa0(%rsp), %rdi
callq 0xbdd6
movq 0xa0(%rsp), %rax
jmp 0xc51b
leaq 0xb0(%rsp), %rdi
pushq $0xa
popq %rsi
leaq 0x40(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x70(%rsp), %r8
callq 0x510a
movq %r15, %rdi
callq 0xf10e
movq %rax, %rsi
leaq 0x88(%rsp), %rbx
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
addq $0x338, %r15            # imm = 0x338
leaq 0x70(%rsp), %r12
leaq 0xb0(%rsp), %r13
leaq 0x40(%rsp), %rbp
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
cmpq (%rax,%rcx,8), %rsi
je 0xc8e7
movq %r15, %rdi
callq 0x46f8
movl (%rax), %eax
movq 0x88(%rsp), %rsi
addq $0x8, %rsi
movl %eax, 0x20(%rsp)
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x6766
movl 0x20(%rsp), %eax
movl %eax, 0x40(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, 0x48(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0xf6b6
leaq 0x48(%rsp), %rdi
callq 0x5720
movq %r14, %rdi
callq 0x5720
movq %rbx, %rdi
callq 0xf43c
movq 0x88(%rsp), %rsi
jmp 0xc84c
leaq 0xb0(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0xf25a
leaq 0xb0(%rsp), %rdi
callq 0x51d2
leaq 0x138(%rsp), %rdi
callq 0xf3b0
leaq 0x100(%rsp), %rdi
callq 0x56ec
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc964
jmp 0xc964
jmp 0xc98f
jmp 0xc98f
movq %rax, %rbx
jmp 0xc9f9
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5720
movq %r12, %rdi
callq 0x5720
jmp 0xc9cb
jmp 0xc9a3
jmp 0xc996
jmp 0xc996
jmp 0xc964
movq %rax, %rbx
jmp 0xc97e
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x5720
movq %r14, %rdi
callq 0x5720
leaq 0xb0(%rsp), %rdi
callq 0x51d2
jmp 0xc9ec
jmp 0xc98f
movq %rax, %rbx
jmp 0xc9ec
jmp 0xc996
movq %rax, %rbx
jmp 0xc9d8
jmp 0xc9a8
jmp 0xc9a3
jmp 0xc9a8
jmp 0xc9a3
movq %rax, %rbx
jmp 0xc9cb
movq %rax, %rbx
jmp 0xc9be
jmp 0xc9b1
jmp 0xc9b1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x56ec
leaq 0xb0(%rsp), %rdi
callq 0x5280
leaq 0x88(%rsp), %rdi
callq 0x56ec
leaq 0x40(%rsp), %rdi
callq 0x4e52
leaq 0x70(%rsp), %rdi
callq 0x5720
leaq 0x138(%rsp), %rdi
callq 0xf3b0
leaq 0x100(%rsp), %rdi
callq 0x56ec
movq %rbx, %rdi
callq 0x23d0