// File: bonetblai[P]mdp-engine/race/./race.h
// Function: problem_t::problem_t(grid_t&, float, float)
problem_t(grid_t &grid, float p = 1.0, float dead_end_value = 1e3)
      : Problem::problem_t<state_t>(DISCOUNT, dead_end_value),
        grid_(grid), p_(p), rows_(grid.rows()), cols_(grid.cols()),
        init_(std::numeric_limits<short>::max(), std::numeric_limits<short>::max(),
              std::numeric_limits<short>::max(), std::numeric_limits<short>::max()) {
        for( size_t i = 0; i < grid_.starts().size(); ++i ) {
            size_t s = grid_.start(i);
            inits_.push_back(state_t(s / cols_, s % cols_));
        }
        for( size_t i = 0; i < grid_.goals().size(); ++i ) {
            size_t s = grid_.goal(i);
            goals_.push_back(state_t(s / cols_, s % cols_));
        }
        for( size_t i = 0; i < 9; ++i )
            ecache_[i] = new ecache_t[rows_*cols_];
    }

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movss %xmm0, 0x134(%rsp)
movss %xmm1, 0x130(%rsp)
movq 0x140(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
movss 0x130(%rsp), %xmm1
movss 0x4d12e(%rip), %xmm0    # 0x55008
callq 0xbf40
movq 0xa0(%rsp), %rax
leaq 0x6dd22(%rip), %rcx     # 0x75c10
movq %rcx, (%rax)
movq 0x138(%rsp), %rcx
movq %rcx, 0x18(%rax)
movss 0x134(%rsp), %xmm0
movss %xmm0, 0x20(%rax)
addq $0x28, %rax
movq %rax, 0xa8(%rsp)
movq 0x138(%rsp), %rdi
callq 0xbf90
movl %eax, 0xb4(%rsp)
jmp 0x7f2d
movq 0xa0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movl 0xb4(%rsp), %edx
movslq %edx, %rdx
movq %rdx, (%rcx)
addq $0x30, %rax
movq %rax, 0x90(%rsp)
movq 0x138(%rsp), %rdi
callq 0xbfa0
movl %eax, 0x9c(%rsp)
jmp 0x7f6c
movq 0xa0(%rsp), %rax
movq 0x90(%rsp), %rcx
movl 0x9c(%rsp), %edx
movslq %edx, %rdx
movq %rdx, (%rcx)
addq $0x38, %rax
movq %rax, 0x88(%rsp)
callq 0xbfb0
movw %ax, 0x82(%rsp)
callq 0xbfb0
movw %ax, 0x84(%rsp)
callq 0xbfb0
movw %ax, 0x86(%rsp)
callq 0xbfb0
movw 0x82(%rsp), %si
movw 0x84(%rsp), %dx
movw 0x86(%rsp), %cx
movq 0x88(%rsp), %rdi
movswl %si, %esi
movswl %dx, %edx
movswl %cx, %ecx
movswl %ax, %r8d
callq 0xbfc0
jmp 0x7ff5
movq 0xa0(%rsp), %rdi
addq $0x40, %rdi
movq %rdi, 0x70(%rsp)
callq 0xc010
movq 0xa0(%rsp), %rdi
addq $0x58, %rdi
movq %rdi, 0x78(%rsp)
callq 0xc010
movq $0x0, 0x118(%rsp)
movq 0xa0(%rsp), %rax
movq 0x118(%rsp), %rcx
movq %rcx, 0x68(%rsp)
movq 0x18(%rax), %rsi
leaq 0x100(%rsp), %rdi
callq 0xc020
jmp 0x8055
leaq 0x100(%rsp), %rdi
callq 0xc050
movq %rax, 0x60(%rsp)
leaq 0x100(%rsp), %rdi
callq 0xc070
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rax
cmpq %rcx, %rax
jae 0x818b
movq 0xa0(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x118(%rsp), %rsi
callq 0xc0d0
movl %eax, 0x5c(%rsp)
jmp 0x80a6
movq 0xa0(%rsp), %rcx
movl 0x5c(%rsp), %eax
cltq
movq %rax, 0xf8(%rsp)
movq %rcx, %rax
addq $0x40, %rax
movq %rax, 0x50(%rsp)
movq 0xf8(%rsp), %rax
movq 0x30(%rcx), %rcx
xorl %r8d, %r8d
movl %r8d, %edx
divq %rcx
movl %eax, %ecx
movl %edx, %eax
movswl %cx, %esi
movswl %ax, %edx
leaq 0xf0(%rsp), %rdi
movl %r8d, %ecx
callq 0xbfc0
jmp 0x80f9
movq 0x50(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0xc100
jmp 0x810d
leaq 0xf0(%rsp), %rdi
callq 0xc130
movq 0x118(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x118(%rsp)
jmp 0x802d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
jmp 0x83e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
jmp 0x83c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xc130
jmp 0x83c0
movq $0x0, 0xe8(%rsp)
movq 0xa0(%rsp), %rax
movq 0xe8(%rsp), %rcx
movq %rcx, 0x48(%rsp)
movq 0x18(%rax), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xc140
jmp 0x81bf
leaq 0xd0(%rsp), %rdi
callq 0xc050
movq %rax, 0x40(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xc070
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jae 0x82c3
movq 0xa0(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0xe8(%rsp), %rsi
callq 0xc170
movl %eax, 0x3c(%rsp)
jmp 0x8210
movq 0xa0(%rsp), %rcx
movl 0x3c(%rsp), %eax
cltq
movq %rax, 0xc8(%rsp)
movq %rcx, %rax
addq $0x58, %rax
movq %rax, 0x30(%rsp)
movq 0xc8(%rsp), %rax
movq 0x30(%rcx), %rcx
xorl %r8d, %r8d
movl %r8d, %edx
divq %rcx
movl %eax, %ecx
movl %edx, %eax
movswl %cx, %esi
movswl %ax, %edx
leaq 0xc0(%rsp), %rdi
movl %r8d, %ecx
callq 0xbfc0
jmp 0x8263
movq 0x30(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0xc100
jmp 0x8277
leaq 0xc0(%rsp), %rdi
callq 0xc130
movq 0xe8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xe8(%rsp)
jmp 0x8197
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xc130
jmp 0x83c0
movq $0x0, 0xb8(%rsp)
cmpq $0x9, 0xb8(%rsp)
jae 0x83b8
movq 0xa0(%rsp), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rcx
imulq %rcx, %rax
movq %rax, 0x20(%rsp)
movl $0x38, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
movq $-0x1, %rax
cmovbq %rax, %rdi
testb %cl, %cl
cmovneq %rax, %rdi
callq 0x6030
movq %rax, 0x28(%rsp)
jmp 0x8326
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0x18(%rsp)
cmpq $0x0, %rax
je 0x8385
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
imulq $0x38, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xc1a0
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
addq $0x38, %rax
cmpq %rcx, %rax
movq %rax, 0x10(%rsp)
jne 0x8360
movq 0xa0(%rsp), %rax
movq 0x18(%rsp), %rdx
movq 0xb8(%rsp), %rcx
movq %rdx, 0x70(%rax,%rcx,8)
movq 0xb8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xb8(%rsp)
jmp 0x82cf
addq $0x148, %rsp            # imm = 0x148
retq
movq 0x78(%rsp), %rdi
callq 0xc1b0
movq 0x70(%rsp), %rdi
callq 0xc1b0
movq 0x88(%rsp), %rdi
callq 0xc130
movq 0xa0(%rsp), %rdi
callq 0xd1a0
movq 0x128(%rsp), %rdi
callq 0x6530
nopl (%rax,%rax)