// File: /workspace/github_cpp_makefile_star2_O1/bonetblai[P]mdp-engine/ctp3/../engine/base_policies.h
// Function: Online::Policy::base_greedy_t<state_t>::operator()(state_t const&) const
virtual Problem::action_t operator()(const T &s) const {
        typename Hash::generic_hash_map_t<T, Problem::action_t>::const_iterator it = caching_ ? cache_.find(s) : cache_.end();
        if( it == cache_.end() ) {
            ++policy_t<T>::decisions_;
            std::vector<std::pair<T, float> > outcomes;
            std::vector<Problem::action_t> best_actions;
            int nactions = problem_.number_actions(s);
            float best_value = std::numeric_limits<float>::max();
            best_actions.reserve(random_ties_ ? nactions : 1);
            for( Problem::action_t a = 0; a < nactions; ++a ) {
                if( problem_.applicable(s, a) ) {
                    float value = optimistic_ ? std::numeric_limits<float>::max() : 0;
                    problem_.next(s, a, outcomes);
                    for( size_t i = 0, isz = outcomes.size(); i < isz; ++i ) {
                        float hval = heuristic_ == 0 ? 0 : heuristic_->value(outcomes[i].first);
                        if( optimistic_ )
                            value = hval < value ? hval : value;
                        else
                            value += outcomes[i].second * hval;
                    }
                    value += problem_.cost(s, a);

                    if( value <= best_value ) {
                        if( value < best_value ) {
                            best_value = value;
                            best_actions.clear();
                        }
                        if( random_ties_ || best_actions.empty() )
                            best_actions.push_back(a);
                    }
                }
            }
            policy_t<T>::heuristic_time_ = heuristic_ == 0 ? 0 : heuristic_->eval_time();
            Problem::action_t action = best_actions[Random::random(best_actions.size())];
            if( caching_ ) cache_.insert(std::make_pair(s, action));
            return action;
        } else {
            //std::cout << "BASE: cached result: state=" << s << ", action=" << it->second << std::endl;
            return it->second;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0x32(%rdi)
jne 0x1c655
leaq 0x38(%rbx), %rdi
movq %r14, %rsi
callq 0x1cd0c
jmp 0x1c657
xorl %eax, %eax
testq %rax, %rax
je 0x1c664
movl 0x78(%rax), %ebp
jmp 0x1c8d5
incl 0x20(%rbx)
xorl %eax, %eax
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x10(%rax)
movl %eax, %ebp
cmpb $0x0, 0x31(%rbx)
cltq
movl $0x1, %esi
cmovneq %rax, %rsi
leaq 0x10(%rsp), %rdi
callq 0xd076
movl $0x0, 0x50(%rsp)
testl %ebp, %ebp
jle 0x1c80d
xorl %edx, %edx
movss 0x10952(%rip), %xmm0    # 0x2d014
leaq 0x30(%rsp), %r15
movss %xmm0, 0x8(%rsp)
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x30(%rax)
testb %al, %al
je 0x1c7fb
movb 0x30(%rbx), %r12b
movq 0x8(%rbx), %rdi
movl 0x50(%rsp), %edx
movq (%rdi), %rax
movq %r14, %rsi
movq %r15, %rcx
callq *0x60(%rax)
movss 0x10912(%rip), %xmm1    # 0x2d014
testb %r12b, %r12b
jne 0x1c70a
xorps %xmm1, %xmm1
movq 0x38(%rsp), %r13
subq 0x30(%rsp), %r13
je 0x1c780
sarq $0x3, %r13
movabsq $-0x1111111111111111, %rax # imm = 0xEEEEEEEEEEEEEEEF
imulq %rax, %r13
cmpq $0x1, %r13
adcq $0x0, %r13
xorl %r12d, %r12d
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x1c758
movss %xmm1, 0xc(%rsp)
movq 0x30(%rsp), %rsi
addq %r12, %rsi
movq (%rdi), %rax
callq *0x20(%rax)
movss 0xc(%rsp), %xmm1
jmp 0x1c75b
xorps %xmm0, %xmm0
cmpb $0x1, 0x30(%rbx)
jne 0x1c767
minss %xmm0, %xmm1
jmp 0x1c777
movq 0x30(%rsp), %rax
mulss 0x70(%rax,%r12), %xmm0
addss %xmm0, %xmm1
addq $0x78, %r12
decq %r13
jne 0x1c733
movss %xmm1, 0xc(%rsp)
movq 0x8(%rbx), %rdi
movl 0x50(%rsp), %edx
movq (%rdi), %rax
movq %r14, %rsi
callq *0x48(%rax)
addss 0xc(%rsp), %xmm0
ucomiss 0x8(%rsp), %xmm0
ja 0x1c7fb
jae 0x1c7bd
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x1c7b7
movq %rax, 0x18(%rsp)
movss %xmm0, 0x8(%rsp)
cmpb $0x0, 0x31(%rbx)
jne 0x1c7cf
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x1c7fb
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x1c7ec
movl 0x50(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x1c7fb
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0xb4a0
movl 0x50(%rsp), %edx
incl %edx
movl %edx, 0x50(%rsp)
cmpl %ebp, %edx
jl 0x1c6cd
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x1c81d
movss 0x10(%rax), %xmm0
jmp 0x1c820
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rbx)
movq 0x18(%rsp), %r15
subq 0x10(%rsp), %r15
shrq $0x2, %r15
cmpl $0x1, %r15d
je 0x1c84e
testl %r15d, %r15d
je 0x1c8e9
callq 0x6200
xorl %edx, %edx
divl %r15d
jmp 0x1c850
xorl %edx, %edx
movq 0x10(%rsp), %rax
movl (%rax,%rdx,4), %ebp
cmpb $0x1, 0x32(%rbx)
jne 0x1c8bc
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movups %xmm0, 0x34(%rdi)
movups %xmm0, 0x24(%rdi)
movups %xmm0, 0x14(%rdi)
movups %xmm0, 0x4(%rdi)
xorl %eax, %eax
movq %rax, 0x44(%rdi)
movb $0x1, 0x5c(%rdi)
movq %rax, 0x60(%rdi)
movq %r14, %rsi
callq 0xd546
addq $0x38, %rbx
leaq 0x50(%rsp), %rsi
movl %ebp, 0x70(%rsi)
movq %rbx, %rdi
callq 0x1cdf4
cmpb $0x0, 0xac(%rsp)
jne 0x1c8bc
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1c8bc
callq 0x6340
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1c8cb
callq 0x6260
leaq 0x30(%rsp), %rdi
callq 0xe35c
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10d30(%rip), %rdi     # 0x2d620
leaq 0x10d31(%rip), %rsi     # 0x2d628
leaq 0x10d3d(%rip), %rcx     # 0x2d63b
movl $0x3a, %edx
callq 0x61c0
movq %rax, %rbx
cmpb $0x0, 0xac(%rsp)
jne 0x1c936
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1c936
callq 0x6340
jmp 0x1c936
jmp 0x1c933
jmp 0x1c933
jmp 0x1c933
jmp 0x1c933
jmp 0x1c933
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1c945
callq 0x6260
leaq 0x30(%rsp), %rdi
callq 0xe35c
movq %rbx, %rdi
callq 0x6410
nop