// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/ctp3/../engine/online_rtdp.h
// Function: Online::Policy::RTDP::finite_horizon_lrtdp_t<state_t>::best_action(Online::Policy::RTDP::node_t<state_t> const&, bool) const
Problem::action_t best_action(const node_t<T> &node, bool random_ties) const {
        std::vector<Problem::action_t> actions;
        int nactions = problem_.number_actions(node.state());
        float best_value = std::numeric_limits<float>::max();
        actions.reserve(random_ties ? nactions : 1);
        for( Problem::action_t a = 0; a < nactions; ++a ) {
            if( problem_.applicable(node.state(), a) ) {
                std::pair<float, bool> p = q_value(node, a);
                if( p.first <= best_value ) {
                    if( p.first < best_value ) {
                        best_value = p.first;
                        actions.clear();
                    }
                    if( random_ties || actions.empty() )
                        actions.push_back(a);
                }
            }
        }
        assert(!actions.empty());
        assert(actions.size() == 1);
        return actions[Random::random(actions.size())];
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x8(%rdi), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movl %eax, %ebp
cltq
testb %bl, %bl
movl $0x1, %esi
cmovneq %rax, %rsi
leaq 0x10(%rsp), %rdi
callq 0xbe32
movl $0x0, 0x4(%rsp)
testl %ebp, %ebp
jle 0x28018
xorl %edx, %edx
movss 0x30c0(%rip), %xmm0     # 0x2b014
leaq 0x10(%rsp), %r12
leaq 0x4(%rsp), %r13
movss %xmm0, 0xc(%rsp)
movq 0x8(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x30(%rax)
testb %al, %al
je 0x27fb4
movl 0x4(%rsp), %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x28c9e
movd %eax, %xmm0
movd %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
movaps %xmm1, %xmm0
jb 0x27ff1
movq 0x18(%rsp), %rax
jbe 0x27fbc
movq 0x10(%rsp), %rsi
cmpq %rsi, %rax
je 0x27fc7
movq %rsi, 0x18(%rsp)
jmp 0x27fca
movss 0xc(%rsp), %xmm0
jmp 0x27ff1
movq %rax, %rsi
movss %xmm0, 0x8(%rsp)
jmp 0x27fca
movq %rax, %rsi
testb %bl, %bl
jne 0x27fd5
cmpq %rsi, 0x10(%rsp)
jne 0x27feb
cmpq 0x20(%rsp), %rsi
je 0x28005
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
movss 0x8(%rsp), %xmm0
movl 0x4(%rsp), %edx
incl %edx
movl %edx, 0x4(%rsp)
cmpl %ebp, %edx
jl 0x27f5e
jmp 0x28018
movq %r12, %rdi
movq %r13, %rdx
callq 0xa316
movss 0x8(%rsp), %xmm0
jmp 0x27ff1
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x28048
subq %rdi, %rax
cmpq $0x4, %rax
jne 0x28067
movl (%rdi), %ebx
callq 0x5260
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6009(%rip), %rdi      # 0x2e058
leaq 0x5e74(%rip), %rsi      # 0x2deca
leaq 0x600c(%rip), %rcx      # 0x2e069
movl $0xf7, %edx
callq 0x51c0
leaq 0x607d(%rip), %rdi      # 0x2e0eb
leaq 0x5e55(%rip), %rsi      # 0x2deca
leaq 0x5fed(%rip), %rcx      # 0x2e069
movl $0xf8, %edx
callq 0x51c0
jmp 0x2808c
jmp 0x2808c
jmp 0x2808c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2809e
callq 0x5260
movq %rbx, %rdi
callq 0x5410