// File: /workspace/github_cpp_makefile_star2_O3/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 0x14bc4
movq %rbx, 0x8(%rsp)
leaq 0x2d8(%rbx), %rdi
movq %r15, 0x130(%rsp)
movq %r15, %rsi
callq 0x2f16c
xorps %xmm0, %xmm0
leaq 0x100(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, 0x80(%rsp)
movq %r14, %rdi
callq 0x142f4
leaq 0x140(%rsp), %r12
movl $0x0, (%r12)
xorl %eax, %eax
movq %rax, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
movq %rax, 0x20(%r12)
movq 0x100(%rsp), %rsi
cmpq %rsi, 0x108(%rsp)
je 0xed7f
xorl %r14d, %r14d
leaq 0x138(%rsp), %rbx
xorl %r15d, %r15d
addq %r14, %rsi
movq %rbx, %rdi
callq 0x1295c
incq %r15
movq 0x100(%rsp), %rsi
movq 0x108(%rsp), %rax
subq %rsi, %rax
sarq $0x2, %rax
addq $0x4, %r14
cmpq %r15, %rax
ja 0xed51
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax), %r14
movq %rax, %rbp
testq %r14, %r14
jne 0xeda3
movq %rax, %rbp
movq 0x8(%rbp), %r14
addq $0x8, %rbp
testq %r14, %r14
je 0xed96
movq 0x8(%rsp), %rcx
movq 0x40(%rcx), %rcx
cmpq (%rax,%rcx,8), %r14
je 0xf28c
leaq 0x90(%rsp), %r13
movq 0x148(%rsp), %rsi
testq %rsi, %rsi
je 0xf262
movl (%r14), %ebx
movq %r12, %rdi
movq %rdi, %rax
movq %rsi, %rcx
movl 0x20(%rsi), %edx
xorl %esi, %esi
cmpl %ebx, %edx
setb %sil
movq %rcx, %rdi
cmovbq %rax, %rdi
movq 0x10(%rcx,%rsi,8), %rsi
testq %rsi, %rsi
jne 0xedd5
cmpq %r12, %rdi
je 0xf262
cmpl %ebx, %edx
cmovbq %rax, %rcx
cmpl 0x20(%rcx), %ebx
jb 0xf262
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
xorl %eax, %eax
movq %rax, 0x70(%rsp)
movq %rax, 0x38(%rsp)
movl %eax, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movl %eax, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rdi
callq 0x1dfcc
leaq 0x38(%rsp), %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x96c4
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %r12
movl 0x50(%rsp), %r15d
cmpq %r12, %rdi
je 0xee74
movq %r12, %rdx
subq %rdi, %rdx
xorl %esi, %esi
callq 0x2110
jmp 0xee77
movq %rdi, %r12
testl %r15d, %r15d
je 0xee93
negb %r15b
movq $-0x1, %rax
movl %r15d, %ecx
shrq %cl, %rax
notq %rax
andq %rax, (%r12)
movq 0x38(%rsp), %rax
movl %ebx, %edx
movl $0x1, %esi
movl %ebx, %ecx
shlq %cl, %rsi
shrl $0x6, %edx
orq %rsi, (%rax,%rdx,8)
movq 0x80(%rsp), %rdi
movl %ebx, %esi
callq 0x1dc78
leaq 0xe8(%rsp), %rdi
movq %rax, %rsi
callq 0x6112
movq 0xe8(%rsp), %rax
cmpq %rax, 0xf0(%rsp)
je 0xf17d
xorl %r12d, %r12d
movl (%rax,%r12,4), %edx
movl %edx, 0x118(%rsp)
movq 0x130(%rsp), %rdi
movl %ebx, %esi
callq 0x1c5fe
testb %al, %al
jne 0xf15a
movl 0x118(%rsp), %eax
movq 0x38(%rsp), %rcx
movl %eax, %edx
shrl $0x6, %edx
movq (%rcx,%rdx,8), %rcx
btq %rax, %rcx
jb 0xf15a
movl $0x0, 0x14(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x6ad0
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xef91
movl 0x118(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0xc0(%rsp)
jmp 0xefb0
movq %r13, %rdi
leaq 0x118(%rsp), %rsi
callq 0x75be
movl 0x118(%rsp), %ecx
movq 0xc0(%rsp), %rax
movq 0x38(%rsp), %rdx
movl %ecx, %esi
movl $0x1, %edi
shlq %cl, %rdi
shrl $0x6, %esi
orq %rdi, (%rdx,%rsi,8)
cmpq 0xa0(%rsp), %rax
je 0xf126
movq 0xc8(%rsp), %rdi
cmpq %rdi, %rax
je 0xefeb
movl -0x4(%rax), %r15d
addq $-0x4, %rax
jmp 0xf03f
movq 0xd8(%rsp), %rax
movq -0x8(%rax), %rax
movl 0x1fc(%rax), %r15d
movl $0x200, %esi            # imm = 0x200
callq 0x2250
movq 0xd8(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0xd8(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0xc8(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0xd0(%rsp)
movl $0x1fc, %ecx            # imm = 0x1FC
addq %rcx, %rax
movq %rax, 0xc0(%rsp)
incl 0x14(%rsp)
movq 0x80(%rsp), %rdi
movl %r15d, %esi
callq 0x1dc78
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x6112
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
cmpq %rdi, %rax
je 0xf107
xorl %r15d, %r15d
movl (%rdi,%r15,4), %ecx
movl %ecx, 0x8c(%rsp)
movq 0x38(%rsp), %rdx
movl $0x1, %esi
shlq %cl, %rsi
movl %ecx, %r8d
shrl $0x6, %r8d
movq (%rdx,%r8,8), %r9
btq %rcx, %r9
jb 0xf0f1
orq %rsi, %r9
movq %r9, (%rdx,%r8,8)
movq 0xc0(%rsp), %rdx
movq 0xd0(%rsp), %rsi
addq $-0x4, %rsi
cmpq %rsi, %rdx
je 0xf0d7
movl %ecx, (%rdx)
addq $0x4, %rdx
movq %rdx, 0xc0(%rsp)
jmp 0xf0f1
movq %r13, %rdi
leaq 0x8c(%rsp), %rsi
callq 0x75be
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
incq %r15
movq %rax, %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
ja 0xf07e
testq %rdi, %rdi
je 0xf119
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xc0(%rsp), %rax
jmp 0xefc6
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0xf143
movl 0x14(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rsp)
jmp 0xf152
leaq 0x60(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x12a6a
movq %r13, %rdi
callq 0x690a
incq %r12
movq 0xe8(%rsp), %rax
movq 0xf0(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
ja 0xeee3
movl %ebx, 0x18(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
callq 0x7afc
movl 0x18(%rsp), %eax
movl %eax, 0x90(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, 0x98(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0xa8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x118(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq 0x12b46
leaq 0x140(%rsp), %r12
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0xf200
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xf217
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0xf234
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xf24b
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xf262
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x20(%r14), %r14
testq %r14, %r14
jne 0xf275
movq 0x8(%rbp), %r14
addq $0x8, %rbp
jmp 0xf266
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rax
movq 0x40(%rcx), %rcx
cmpq (%rax,%rcx,8), %r14
jne 0xedbe
leaq 0x14(%rsp), %rax
leaq 0x60(%rsp), %r10
leaq 0x90(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x118(%rsp), %r9
movl $0xa, %esi
pushq %rax
pushq %r10
callq 0x6748
addq $0x10, %rsp
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rbx
movq %rax, %r12
testq %rbx, %rbx
jne 0xf2ee
movq %rax, %r12
movq 0x8(%r12), %rbx
addq $0x8, %r12
testq %rbx, %rbx
je 0xf2e0
movq 0x8(%rsp), %rcx
movq 0x10(%rcx), %rcx
cmpq (%rax,%rcx,8), %rbx
je 0xf3d0
movq 0x8(%rsp), %rax
leaq 0x338(%rax), %r14
leaq 0x20(%rsp), %r15
leaq 0x90(%rsp), %r13
leaq 0x38(%rsp), %rbp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5d14
movl (%rax), %eax
leaq 0x8(%rbx), %rsi
movl %eax, 0x18(%rsp)
movq %r15, %rdi
callq 0x7afc
movl 0x18(%rsp), %eax
movl %eax, 0x38(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, 0x40(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x12b46
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf38e
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xf3a5
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
jne 0xf3b9
movq 0x8(%r12), %rbx
addq $0x8, %r12
jmp 0xf3a9
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
cmpq (%rax,%rcx,8), %rbx
jne 0xf31f
leaq 0x90(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x12742
leaq 0x90(%rsp), %rdi
callq 0x6858
leaq 0x138(%rsp), %rdi
callq 0x128ba
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0xf419
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf4c2
jmp 0xf4d7
movq %rax, %rbx
jmp 0xf579
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0xf45d
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xf510
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0xf510
jmp 0xf4df
jmp 0xf481
movq %rax, %rbx
jmp 0xf52d
jmp 0xf4e4
jmp 0xf4df
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf4a7
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xf4c5
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0xf4c5
jmp 0xf4c2
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x6858
jmp 0xf56c
movq %rax, %rbx
jmp 0xf56c
movq %rax, %rbx
jmp 0xf510
movq %rax, %rbx
jmp 0xf503
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xf503
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x90(%rsp), %rdi
callq 0x690a
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0xf52d
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xf555
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq $0x0, 0x38(%rsp)
movl $0x0, 0x40(%rsp)
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xf56c
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x138(%rsp), %rdi
callq 0x128ba
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0xf596
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x23b0