// File: /workspace/github_cpp_makefile_star2_O3/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 0xd848
movq 0x8(%r12), %rsi
subq (%r12), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
leaq 0x20(%rsp), %rdi
callq 0x1527c
movq %r12, 0x58(%rsp)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
cmpq %rdx, %rdi
je 0x1e318
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 0x1e345
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 0x6ad0
movl 0x4(%rsp), %eax
movq 0x40(%rsp), %rcx
movl $0x0, (%rcx,%rax,4)
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rax
addq $-0x4, %rax
cmpq %rax, %rcx
je 0x1e3a4
movl 0x4(%rsp), %eax
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x90(%rsp)
jmp 0x1e3bb
leaq 0x60(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x75be
movq 0x90(%rsp), %rcx
movq 0x70(%rsp), %rax
cmpq %rax, %rcx
je 0x1e503
leaq 0x60(%rsp), %r13
movq %rsp, %rbp
movl (%rax), %r12d
movq 0x80(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x1e3eb
addq $0x4, %rax
jmp 0x1e426
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 0x1e503
leaq (%r12,%r12,2), %rsi
shlq $0x3, %rsi
addq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x6112
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
cmpq %rdi, %rax
je 0x1e4de
xorl %r15d, %r15d
movl (%rdi,%r15,4), %ecx
movl %ecx, (%rsp)
movq 0x40(%rsp), %rdx
cmpl $-0x1, (%rdx,%rcx,4)
jne 0x1e4c7
movl (%rdx,%r12,4), %esi
incl %esi
movl %esi, (%rdx,%rcx,4)
movl (%rsp), %ecx
movq 0x20(%rsp), %rdx
movl %r12d, (%rdx,%rcx,4)
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x1e4b2
movl (%rsp), %edx
movl %edx, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x90(%rsp)
jmp 0x1e4c7
movq %r13, %rdi
movq %rbp, %rsi
callq 0x75be
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
incq %r15
movq %rax, %rcx
subq %rdi, %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
ja 0x1e45f
movq 0x58(%rsp), %r15
testq %rdi, %rdi
je 0x1e4f0
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x70(%rsp), %rax
cmpq %rax, 0x90(%rsp)
jne 0x1e3d1
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
cmpq %rax, %rsi
je 0x1e516
movq %rax, 0x8(%rbx)
movq %rax, %rsi
movl %r14d, 0x8(%rsp)
movl %r14d, %eax
movq 0x20(%rsp), %rcx
cmpl $-0x1, (%rcx,%rax,4)
je 0x1e56d
leaq 0x8(%rsp), %r15
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x1e545
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x1e550
movq %rbx, %rdi
movq %r15, %rdx
callq 0x6f14
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
movl (%rcx,%rax,4), %r14d
movl %r14d, 0x8(%rsp)
cmpl $-0x1, (%rcx,%r14,4)
jne 0x1e52e
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x1e580
movl %r14d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x1e58d
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x6f14
leaq 0x60(%rsp), %rdi
callq 0x690a
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1e5ae
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1e5c5
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 0x1e5e4
jmp 0x1e5e4
jmp 0x1e5dd
movq %rax, %rbx
jmp 0x1e60d
jmp 0x1e5e4
movq %rax, %rbx
jmp 0x1e603
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1e603
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x60(%rsp), %rdi
callq 0x690a
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1e624
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1e63b
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x23b0
nop