// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movl %r9d, 0x10(%rsp)
movq %r8, 0x18(%rsp)
movq %rcx, %r15
movl %esi, %ebp
movq %rdi, %r13
movb 0x31c16(%rip), %al      # 0x3d310
testb %al, %al
movq %rdx, 0x8(%rsp)
je 0xb84a
cmpl $0x0, (%r13)
jle 0xb723
xorl %eax, %eax
movl $0x7fffffff, (%rdx,%rax,4) # imm = 0x7FFFFFFF
incq %rax
movslq (%r13), %rcx
cmpq %rcx, %rax
jl 0xb710
movslq %ebp, %rax
movl $0x0, (%rdx,%rax,4)
movl %eax, %eax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x31bb2(%rip), %rdi     # 0x3d2f0
callq 0x9f58
movq 0x31ba6(%rip), %rax     # 0x3d2f0
cmpq 0x31ba7(%rip), %rax     # 0x3d2f8
je 0xb83b
movslq (%rax), %rbp
movl 0x4(%rax), %ebx
leaq 0x31b8c(%rip), %rdi     # 0x3d2f0
callq 0x9fde
movq 0x8(%rsp), %r8
movl %ebx, 0x14(%rsp)
cmpl (%r8,%rbp,4), %ebx
movq 0x18(%rsp), %rdi
jg 0xb743
movq 0x28(%r13), %rax
leaq (,%rbp,2), %r14
addq %rbp, %r14
movq 0x8(%rax,%r14,8), %r12
subq (%rax,%r14,8), %r12
shrq $0x2, %r12
testl %r12d, %r12d
jle 0xb743
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movq 0x28(%r13), %rax
movq (%rax,%r14,8), %rax
movslq (%rax,%rbx,4), %rcx
movl %ecx, %edx
movl $0x1, %eax
shll %cl, %eax
sarl $0x5, %edx
movslq %edx, %rdx
movl (%r15,%rdx,4), %esi
btl %ecx, %esi
jae 0xb7d2
testl %eax, (%rdi,%rdx,4)
jne 0xb82a
jmp 0xb7d9
cmpb $0x0, 0x10(%rsp)
je 0xb82a
movq 0x10(%r13), %rax
shlq $0x4, %rcx
movl 0x4(%rax,%rcx), %edx
cmpl %edx, %ebp
jne 0xb7ec
movl (%rax,%rcx), %edx
movl 0x8(%rax,%rcx), %eax
addl 0x14(%rsp), %eax
movslq %edx, %rcx
cmpl (%r8,%rcx,4), %eax
jge 0xb82a
movl %eax, (%r8,%rcx,4)
shlq $0x20, %rax
movl %ecx, %ecx
orq %rax, %rcx
movq %rcx, 0x20(%rsp)
leaq 0x31ada(%rip), %rdi     # 0x3d2f0
leaq 0x20(%rsp), %rsi
callq 0x9f58
movq 0x8(%rsp), %r8
movq 0x18(%rsp), %rdi
incq %rbx
cmpq %rbx, %r12
jne 0xb7a7
jmp 0xb743
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5553
movq 0x8(%rsp), %rdx
jmp 0xb707
nop