// File: /workspace/github_cpp_makefile_star2_O1/fjamour[P]icentral/src/graph_t.cc
// Function: graph_t::get_shortest_path(unsigned int, unsigned int, std::vector<unsigned int, std::allocator<unsigned int>>&)
void graph_t::get_shortest_path(
        node_id_t src,
        node_id_t dst,
        vector<node_id_t>& out_path)
{
    //do a BFS from dst to src and store path
    vector<int>         dist_vec;
    vector<node_id_t>   parent_vec;
    dist_vec.resize(size());
    parent_vec.resize(size());
    fill(dist_vec.begin(), dist_vec.end(), -1);
    fill(parent_vec.begin(), parent_vec.end(), -1);
    
    queue<node_id_t> q;
    dist_vec[dst] = 0;
    q.push(dst);
    while(!q.empty()) {
        node_id_t node = q.front(); q.pop();
        if(node == src)
            break;
        vector<node_id_t> nbr_vec = get_nbrs(node);
        for(int i = 0; i < nbr_vec.size(); ++i) {
            node_id_t nbr_id = nbr_vec[i];
            if(dist_vec[nbr_id] == -1) {
                dist_vec[nbr_id] = dist_vec[node] + 1;
                parent_vec[nbr_id] = node;
                q.push(nbr_id);
            }
        }
    }
    //fill the output path vector:
    out_path.clear();
    node_id_t nd = src;
    while(parent_vec[nd] != -1) {
        out_path.push_back(nd);
        nd = parent_vec[nd];
    }
    out_path.push_back(nd);//insert dst
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, %rbx
movq %rdi, %r12
movl %edx, 0x4(%rsp)
xorl %eax, %eax
leaq 0x40(%rsp), %rdi
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq %rax, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq 0x8(%r12), %rax
subq (%r12), %rax
movl %esi, %r14d
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rax
movq %rax, %rsi
callq 0xd7da
movq 0x8(%r12), %rsi
subq (%r12), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
leaq 0x20(%rsp), %rdi
callq 0x1537c
movq %r12, 0x58(%rsp)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
cmpq %rdx, %rdi
je 0x1e4ae
subq %rdi, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movl $0xff, %esi
callq 0x2110
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rdx
cmpq %rdx, %rdi
movq 0x58(%rsp), %r15
je 0x1e4db
subq %rdi, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movl $0xff, %esi
callq 0x2110
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x6b50
movl 0x4(%rsp), %eax
movq 0x40(%rsp), %rcx
movl $0x0, (%rcx,%rax,4)
movq 0x90(%rsp), %rax
movq 0xa0(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x1e53a
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x90(%rsp)
jmp 0x1e549
leaq 0x60(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x7644
leaq 0x60(%rsp), %r13
movq %rsp, %rbp
movq 0x70(%rsp), %rax
cmpq %rax, 0x90(%rsp)
je 0x1e682
movl (%rax), %r12d
movq 0x80(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x1e57e
addq $0x4, %rax
jmp 0x1e5b9
movq 0x78(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2250
movq 0x88(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x88(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x78(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x80(%rsp)
movq %rax, 0x70(%rsp)
cmpl %r14d, %r12d
je 0x1e682
leaq (%r12,%r12,2), %rsi
shlq $0x3, %rsi
addq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x61a0
movq 0x8(%rsp), %rdi
cmpq %rdi, 0x10(%rsp)
je 0x1e667
xorl %r15d, %r15d
movl (%rdi,%r15,4), %eax
movl %eax, (%rsp)
movq 0x40(%rsp), %rcx
cmpl $-0x1, (%rcx,%rax,4)
jne 0x1e649
movl (%rcx,%r12,4), %edx
incl %edx
movl %edx, (%rcx,%rax,4)
movl (%rsp), %eax
movq 0x20(%rsp), %rcx
movl %r12d, (%rcx,%rax,4)
movq 0x90(%rsp), %rax
movq 0xa0(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x1e63e
movl (%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x90(%rsp)
jmp 0x1e649
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7644
incq %r15
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %r15, %rax
ja 0x1e5eb
movq 0x58(%rsp), %r15
testq %rdi, %rdi
je 0x1e679
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
cmpl %r14d, %r12d
jne 0x1e551
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x1e68f
movq %rax, 0x8(%rbx)
movl %r14d, 0x8(%rsp)
movl %r14d, %eax
movq 0x20(%rsp), %rcx
cmpl $-0x1, (%rcx,%rax,4)
je 0x1e6e2
leaq 0x8(%rsp), %r15
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x1e6be
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x1e6c9
movq %rbx, %rdi
movq %r15, %rdx
callq 0x6f98
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
movl (%rcx,%rax,4), %r14d
movl %r14d, 0x8(%rsp)
cmpl $-0x1, (%rcx,%r14,4)
jne 0x1e6a7
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x1e6f9
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x1e706
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x6f98
leaq 0x60(%rsp), %rdi
callq 0x6998
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1e727
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1e73e
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e75d
jmp 0x1e75d
jmp 0x1e756
movq %rax, %rbx
jmp 0x1e786
jmp 0x1e75d
movq %rax, %rbx
jmp 0x1e77c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1e77c
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x60(%rsp), %rdi
callq 0x6998
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1e79d
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1e7b4
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x23b0