// File: fjamour[P]icentral/src/bicon.cc
// Function: graph_t::find_edge_bcc_subgraph(graph_hash_t&, unsigned int, unsigned int)
void graph_t::find_edge_bcc_subgraph(graph_hash_t& bcc, node_id_t src, node_id_t dst)
{
    node_id_t u;
    vector<int> color_vec;
    vector<int> low_vec;
    vector<int> d_vec;
    vector<node_id_t> pred_vec;
    stack<edge_t> edge_stack;
    int time;
    
    color_vec.resize(size());
    low_vec.resize(size());
    d_vec.resize(size());
    pred_vec.resize(size());
    fill(color_vec.begin(), color_vec.end(), 0);
    fill(low_vec.begin(), low_vec.end(), -1);
    fill(d_vec.begin(), d_vec.end(), -1);
    fill(pred_vec.begin(), pred_vec.end(), -1);
    
    //(src, dst) needs to be the first edge to recurse from
    //IMP: explain this clearly
    //Jun 16, 2014.. I have no idea why!
    for(int i = 0; i < nodes_vec[src].nbrs_vec.size(); ++i) {
        if(nodes_vec[src].nbrs_vec[i] == dst) {
            nodes_vec[src].nbrs_vec[i] = nodes_vec[src].nbrs_vec[0];
            nodes_vec[src].nbrs_vec[0] = dst;
        }
    }
    
    i_edge_bcc_dfs_visitor(src,
                    color_vec,
                    low_vec,
                    d_vec,
                    pred_vec,
                    edge_stack,
                    time);
      
    while(!edge_stack.empty()) {
        edge_t e = edge_stack.top();
        edge_stack.pop();
        bcc.insert_edge(e.first, e.second);
    }
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x1c0(%rsp)
movq %rsi, 0x1b8(%rsp)
movl %edx, 0x1b4(%rsp)
movl %ecx, 0x1b0(%rsp)
movq 0x1c0(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x190(%rsp), %rdi
callq 0xfc40
leaq 0x178(%rsp), %rdi
callq 0xfc40
leaq 0x160(%rsp), %rdi
callq 0xfc40
leaq 0x148(%rsp), %rdi
callq 0xfcd0
leaq 0xf8(%rsp), %rdi
callq 0x416c0
jmp 0x40a35
movq 0x78(%rsp), %rdi
callq 0x56b40
movq %rax, 0x70(%rsp)
jmp 0x40a46
movq 0x70(%rsp), %rsi
leaq 0x190(%rsp), %rdi
callq 0x2cfc0
jmp 0x40a5a
movq 0x78(%rsp), %rdi
callq 0x56b40
movq %rax, 0x68(%rsp)
jmp 0x40a6b
movq 0x68(%rsp), %rsi
leaq 0x178(%rsp), %rdi
callq 0x2cfc0
jmp 0x40a7f
movq 0x78(%rsp), %rdi
callq 0x56b40
movq %rax, 0x60(%rsp)
jmp 0x40a90
movq 0x60(%rsp), %rsi
leaq 0x160(%rsp), %rdi
callq 0x2cfc0
jmp 0x40aa4
movq 0x78(%rsp), %rdi
callq 0x56b40
movq %rax, 0x58(%rsp)
jmp 0x40ab5
movq 0x58(%rsp), %rsi
leaq 0x148(%rsp), %rdi
callq 0x415e0
jmp 0x40ac9
leaq 0x190(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x109f0
movq 0x50(%rsp), %rdi
movq %rax, 0xe0(%rsp)
callq 0x10a20
movq %rax, 0xd8(%rsp)
movl $0x0, 0xd4(%rsp)
movq 0xe0(%rsp), %rdi
movq 0xd8(%rsp), %rsi
leaq 0xd4(%rsp), %rdx
callq 0x21f20
jmp 0x40b1f
leaq 0x178(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x109f0
movq 0x48(%rsp), %rdi
movq %rax, 0xc8(%rsp)
callq 0x10a20
movq %rax, 0xc0(%rsp)
movl $0xffffffff, 0xbc(%rsp) # imm = 0xFFFFFFFF
movq 0xc8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
leaq 0xbc(%rsp), %rdx
callq 0x21f20
jmp 0x40b75
leaq 0x160(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x109f0
movq 0x40(%rsp), %rdi
movq %rax, 0xb0(%rsp)
callq 0x10a20
movq %rax, 0xa8(%rsp)
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
leaq 0xa4(%rsp), %rdx
callq 0x21f20
jmp 0x40bcb
leaq 0x148(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x10cf0
movq 0x38(%rsp), %rdi
movq %rax, 0x98(%rsp)
callq 0x10d20
movq %rax, 0x90(%rsp)
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
leaq 0x8c(%rsp), %rdx
callq 0x41680
jmp 0x40c21
movl $0x0, 0x88(%rsp)
movq 0x78(%rsp), %rdi
movslq 0x88(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x1b4(%rsp), %eax
movl %eax, %esi
callq 0x42020
movq %rax, %rdi
callq 0xfd50
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x40d6e
movq 0x78(%rsp), %rdi
movl 0x1b4(%rsp), %eax
movl %eax, %esi
callq 0x42020
movq %rax, %rdi
movslq 0x88(%rsp), %rsi
callq 0xfbc0
movl (%rax), %eax
cmpl 0x1b0(%rsp), %eax
jne 0x40d56
movq 0x78(%rsp), %rdi
movl 0x1b4(%rsp), %eax
movl %eax, %esi
callq 0x42020
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xfbc0
movq 0x78(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x28(%rsp)
movl 0x1b4(%rsp), %eax
movl %eax, %esi
callq 0x42020
movq %rax, %rdi
movslq 0x88(%rsp), %rsi
callq 0xfbc0
movl 0x28(%rsp), %ecx
movq 0x78(%rsp), %rdi
movl %ecx, (%rax)
movl 0x1b0(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x1b4(%rsp), %eax
movl %eax, %esi
callq 0x42020
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xfbc0
movl 0x2c(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x40d56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x40e77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x416f0
jmp 0x40e77
jmp 0x40d58
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
jmp 0x40c2c
movq 0x78(%rsp), %rdi
movl 0x1b4(%rsp), %esi
movq %rsp, %rax
leaq 0xe8(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0xf8(%rsp), %rcx
movq %rcx, (%rax)
leaq 0x190(%rsp), %rdx
leaq 0x178(%rsp), %rcx
leaq 0x160(%rsp), %r8
leaq 0x148(%rsp), %r9
callq 0x40ec0
jmp 0x40dbb
jmp 0x40dbd
leaq 0xf8(%rsp), %rdi
callq 0x42040
movb %al, 0x27(%rsp)
jmp 0x40dd0
movb 0x27(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x40ddc
jmp 0x40e2e
leaq 0xf8(%rsp), %rdi
callq 0x41e20
movq %rax, 0x18(%rsp)
jmp 0x40df0
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x80(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x41e60
jmp 0x40e0f
movq 0x1b8(%rsp), %rdi
movl 0x80(%rsp), %esi
movl 0x84(%rsp), %edx
callq 0x52420
jmp 0x40e2c
jmp 0x40dbd
leaq 0xf8(%rsp), %rdi
callq 0x416f0
leaq 0x148(%rsp), %rdi
callq 0x10520
leaq 0x160(%rsp), %rdi
callq 0xfc70
leaq 0x178(%rsp), %rdi
callq 0xfc70
leaq 0x190(%rsp), %rdi
callq 0xfc70
addq $0x1c8, %rsp            # imm = 0x1C8
retq
leaq 0x148(%rsp), %rdi
callq 0x10520
leaq 0x160(%rsp), %rdi
callq 0xfc70
leaq 0x178(%rsp), %rdi
callq 0xfc70
leaq 0x190(%rsp), %rdi
callq 0xfc70
movq 0xf0(%rsp), %rdi
callq 0x9cf0
nopl (%rax,%rax)