// File: /workspace/github_cpp_makefile_star2_O2/bonetblai[P]mdp-engine/ctp3/./graph.h
// Function: CTP::graph_t::dijkstra(int, int*, unsigned int const*, unsigned int const*, bool) const
void dijkstra(int source,
                  int *distances,
                  const unsigned *k_bitmap,
                  const unsigned *b_bitmap,
                  bool optimistic = false) const {

        static std::priority_queue<std::pair<int, int>,
                                   std::vector<std::pair<int, int> >,
                                   open_list_cmp> queue;

        // initialization
        for( int node = 0; node < num_nodes_; ++node )
            distances[node] = INT_MAX;

        // Dijsktra's
        distances[source] = 0;
        queue.push(std::make_pair(source, 0));
        while( !queue.empty() ) {
            std::pair<int, int> p = queue.top();
            queue.pop();
            if( p.second <= distances[p.first] ) {
                for( int i = 0, isz = at_[p.first].size(); i < isz; ++i ) {
                    int idx = at_[p.first][i];
                    if( good(idx, k_bitmap, b_bitmap, optimistic) ) {
                        const edge_t &edge = edge_list_[idx];
                        int cost = p.second + edge.cost_;
                        int next = p.first == edge.to_ ? edge.from_ : edge.to_;
                        if( cost < distances[next] ) {
                            distances[next] = cost;
                            queue.push(std::make_pair(next, cost));
                        }
                    }
                }
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %r13d
movq %r8, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %r12
movb 0x2b675(%rip), %al      # 0x35310
testb %al, %al
je 0x9ddc
xorl %eax, %eax
movslq (%r12), %rcx
cmpq %rcx, %rax
jge 0x9cbf
movq 0x8(%rsp), %rcx
movl $0x7fffffff, (%rcx,%rax,4) # imm = 0x7FFFFFFF
incq %rax
jmp 0x9ca5
movslq %ebp, %rax
movq 0x8(%rsp), %rcx
andl $0x0, (%rcx,%rax,4)
movl %eax, %eax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x2b614(%rip), %rdi     # 0x352f0
callq 0x8552
movzbl %r13b, %r13d
movq 0x2b604(%rip), %rax     # 0x352f0
cmpq 0x2b605(%rip), %rax     # 0x352f8
je 0x9dcd
movslq (%rax), %rbx
movl 0x4(%rax), %ebp
leaq 0x2b5ea(%rip), %rdi     # 0x352f0
callq 0x8568
movq 0x8(%rsp), %rax
movq %rbx, 0x18(%rsp)
movl %ebp, 0x14(%rsp)
cmpl (%rax,%rbx,4), %ebp
jg 0x9ce5
movq 0x28(%r12), %rax
imulq $0x18, 0x18(%rsp), %r14
movq 0x8(%rax,%r14), %rbx
subq (%rax,%r14), %rbx
shrq $0x2, %rbx
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x9ce5
movq 0x28(%r12), %rax
movq (%rax,%r14), %rax
movl (%rax,%r15,4), %ebp
movq %r12, %rdi
movl %ebp, %esi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
movl %r13d, %r8d
callq 0x9664
testb %al, %al
je 0x9dc5
movslq %ebp, %rax
movq 0x10(%r12), %rcx
shlq $0x4, %rax
movl 0x4(%rcx,%rax), %edx
cmpl %edx, 0x18(%rsp)
jne 0x9d89
movl (%rcx,%rax), %edx
movl 0x8(%rcx,%rax), %eax
addl 0x14(%rsp), %eax
movslq %edx, %rcx
movq 0x8(%rsp), %rdx
cmpl (%rdx,%rcx,4), %eax
jge 0x9dc5
movq 0x8(%rsp), %rdx
movl %eax, (%rdx,%rcx,4)
shlq $0x20, %rax
movl %ecx, %ecx
orq %rax, %rcx
movq %rcx, 0x20(%rsp)
leaq 0x2b535(%rip), %rdi     # 0x352f0
leaq 0x20(%rsp), %rsi
callq 0x8552
incq %r15
jmp 0x9d43
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b52d(%rip), %rdi     # 0x35310
callq 0x5430
testl %eax, %eax
je 0x9ca3
xorps %xmm0, %xmm0
movups %xmm0, 0x2b4f6(%rip)    # 0x352f0
andq $0x0, 0x2b4fe(%rip)     # 0x35300
leaq 0x2b4e7(%rip), %rsi     # 0x352f0
leaq -0x1890(%rip), %rdi     # 0x8580
leaq 0x2b439(%rip), %rdx     # 0x35250
callq 0x5240
leaq 0x2b4ed(%rip), %rdi     # 0x35310
callq 0x51a0
jmp 0x9ca3
nop