// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq %rdi, %r14
cmpb $0x1, 0x32(%rdi)
jne 0x14640
leaq 0x38(%r14), %rdi
movq %rbx, %rsi
callq 0x14bfe
testq %rax, %rax
je 0x14640
movl 0x78(%rax), %ebp
jmp 0x14838
incl 0x20(%r14)
andq $0x0, 0x40(%rsp)
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
movl %eax, %ebp
cmpb $0x0, 0x31(%r14)
cltq
pushq $0x1
popq %rsi
cmovneq %rax, %rsi
leaq 0x10(%rsp), %rdi
callq 0xa3aa
leaq 0x38(%r14), %rax
movq %rax, 0x48(%rsp)
movss 0xb97f(%rip), %xmm0     # 0x20014
xorl %edx, %edx
leaq 0x30(%rsp), %r12
movss %xmm0, 0x8(%rsp)
movl %edx, 0x50(%rsp)
cmpl %ebp, %edx
jge 0x147be
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x30(%rax)
testb %al, %al
je 0x147b3
movb 0x30(%r14), %r15b
movq 0x8(%r14), %rdi
movl 0x50(%rsp), %edx
movq (%rdi), %rax
movq %rbx, %rsi
movq %r12, %rcx
callq *0x60(%rax)
movss 0xb931(%rip), %xmm1     # 0x20014
testb %r15b, %r15b
jne 0x146eb
xorps %xmm1, %xmm1
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
cqto
pushq $0x78
popq %rcx
idivq %rcx
movq %rax, %r13
xorl %r15d, %r15d
subq $0x1, %r13
jb 0x14754
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x1472e
movss %xmm1, 0xc(%rsp)
movq 0x30(%rsp), %rsi
addq %r15, %rsi
movq (%rdi), %rax
callq *0x20(%rax)
movss 0xc(%rsp), %xmm1
jmp 0x14731
xorps %xmm0, %xmm0
cmpb $0x1, 0x30(%r14)
jne 0x1473e
minss %xmm0, %xmm1
jmp 0x1474e
movq 0x30(%rsp), %rax
mulss 0x70(%rax,%r15), %xmm0
addss %xmm0, %xmm1
addq $0x78, %r15
jmp 0x14703
movss %xmm1, 0xc(%rsp)
movq 0x8(%r14), %rdi
movl 0x50(%rsp), %edx
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x48(%rax)
addss 0xc(%rsp), %xmm0
ucomiss 0x8(%rsp), %xmm0
ja 0x147b3
jae 0x14791
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x1478b
movq %rax, 0x18(%rsp)
movss %xmm0, 0x8(%rsp)
cmpb $0x0, 0x31(%r14)
jne 0x147a4
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x147b3
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x8804
movl 0x50(%rsp), %edx
incl %edx
jmp 0x146a2
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x147ce
movss 0x10(%rax), %xmm0
jmp 0x147d1
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%r14)
movq 0x18(%rsp), %rdi
subq 0x10(%rsp), %rdi
shrq $0x2, %rdi
callq 0xb503
movl %eax, %eax
movq 0x10(%rsp), %rcx
movl (%rcx,%rax,4), %ebp
cmpb $0x1, 0x32(%r14)
jne 0x14824
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0xa4d8
leaq 0x50(%rsp), %rsi
movl %ebp, 0x70(%rsi)
movq 0x48(%rsp), %rdi
callq 0x14cd4
leaq 0x50(%rsp), %rdi
callq 0x8e90
leaq 0x10(%rsp), %rdi
callq 0x85dc
leaq 0x30(%rsp), %rdi
callq 0xb53c
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x8e90
jmp 0x1486a
jmp 0x14867
jmp 0x14867
jmp 0x14867
jmp 0x14867
jmp 0x14867
jmp 0x14867
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x85dc
leaq 0x30(%rsp), %rdi
callq 0xb53c
movq %rbx, %rdi
callq 0x5410