// File: /workspace/github_cpp_makefile_star2_O1/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, 0x4(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, %r15
movl %esi, %ebp
movq %rdi, %r13
movb 0x32a30(%rip), %al      # 0x3f310
testb %al, %al
movq %rdx, 0x8(%rsp)
je 0xca90
cmpl $0x0, (%r13)
jle 0xc909
xorl %eax, %eax
movl $0x7fffffff, (%rdx,%rax,4) # imm = 0x7FFFFFFF
incq %rax
movslq (%r13), %rcx
cmpq %rcx, %rax
jl 0xc8f6
movslq %ebp, %rax
movl $0x0, (%rdx,%rax,4)
movl %eax, %eax
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x329cc(%rip), %rdi     # 0x3f2f0
callq 0xb0e6
movq 0x329c0(%rip), %rax     # 0x3f2f0
cmpq 0x329c1(%rip), %rax     # 0x3f2f8
je 0xca81
movl 0x4(%rsp), %ecx
movl %ecx, %r9d
xorb $0x1, %r9b
movb %r9b, 0x3(%rsp)
movslq (%rax), %r14
movl 0x4(%rax), %ebx
leaq 0x32996(%rip), %rdi     # 0x3f2f0
callq 0xb16e
movb 0x3(%rsp), %r9b
movq 0x8(%rsp), %r8
cmpl (%r8,%r14,4), %ebx
movq 0x10(%rsp), %rdi
jg 0xca6d
movq %r14, %r11
movq 0x28(%r13), %rax
leaq (%r14,%r14,2), %rbp
movq 0x8(%rax,%rbp,8), %r12
subq (%rax,%rbp,8), %r12
shrq $0x2, %r12
testl %r12d, %r12d
jle 0xca6d
movl %ebx, %r10d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movq %r12, 0x20(%rsp)
movq 0x28(%r13), %rax
movq (%rax,%rbp,8), %rax
movslq (%rax,%r14,4), %rcx
movl %ecx, %eax
sarl $0x5, %eax
movl $0x1, %edx
shll %cl, %edx
movslq %eax, %rsi
movl (%r15,%rsi,4), %eax
btl %ecx, %eax
setae %al
jae 0xc9e1
testl %edx, (%rdi,%rsi,4)
sete %dl
movl %edx, %esi
orb %r9b, %sil
je 0xc9e8
jmp 0xc9ea
cmpb $0x0, 0x4(%rsp)
je 0xca61
movl %eax, %edx
testb %dl, %dl
je 0xca61
movq 0x10(%r13), %rax
shlq $0x4, %rcx
movl 0x4(%rax,%rcx), %edx
cmpl %edx, %r11d
jne 0xca02
movl (%rax,%rcx), %edx
movl 0x8(%rax,%rcx), %eax
addl %r10d, %eax
movslq %edx, %rcx
cmpl (%r8,%rcx,4), %eax
jge 0xca61
movl %eax, (%r8,%rcx,4)
shlq $0x20, %rax
movl %ecx, %ecx
orq %rax, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x328c5(%rip), %rdi     # 0x3f2f0
leaq 0x18(%rsp), %rsi
movl %r10d, %ebx
movq %r13, %r12
movq %r15, %r13
movq %r11, %r15
callq 0xb0e6
movq %r15, %r11
movq %r13, %r15
movq %r12, %r13
movq 0x20(%rsp), %r12
movl %ebx, %r10d
movb 0x3(%rsp), %r9b
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %rdi
incq %r14
cmpq %r14, %r12
jne 0xc9ab
movq 0x3287c(%rip), %rax     # 0x3f2f0
cmpq 0x3287d(%rip), %rax     # 0x3f2f8
jne 0xc94d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6561
movq 0x8(%rsp), %rdx
jmp 0xc8ed
nop