// File: /workspace/github_cpp_makefile_star2_O1/bonetblai[P]mdp-engine/ctp3/../engine/improved_lao.h
// Function: Algorithm::improved_lao_t<state_t>::solve(state_t const&, Problem::hash_t<state_t>&) const
virtual void solve(const T &s, Problem::hash_t<T> &hash) const {
        reset_stats(hash);
        Heuristic::wrapper_t<T> eval_function(heuristic_);
        hash.set_eval_function(&eval_function);

        typedef typename std::list<std::pair<T, Hash::data_t*> > pair_list;
        typedef typename pair_list::const_iterator const_list_iterator;
        pair_list visited;

        policy_graph_t graph(problem_, hash);
        graph.add_root(s);
        graph.recompute();

        size_t iterations = 0;

      loop:
        ++iterations;
        while( !graph.tips().empty() ) {
            visited.clear();
            graph.postorder_dfs(s, visited);
            graph.update(visited);
            graph.recompute();
        }

        // convergence test
        float residual = 1.0 + epsilon_;
        while( residual > epsilon_ ) {
            residual = 0.0;
            for( const_list_iterator si = graph.nodes().begin(); si != graph.nodes().end(); ++si ) {
                float hv = si->second->value();
                std::pair<Problem::action_t, float> p = hash.best_q_value(si->first);
                residual = Utils::max(residual, (float)fabs(p.second - hv));
                si->second->update(p.second);
                hash.inc_updates();
            }
            graph.recompute();
            if( !graph.tips().empty() ) goto loop;
        }
        hash.set_eval_function(0);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
movq %rdx, %rsi
callq *0x30(%rax)
movq 0x10(%r15), %rax
leaq 0x2ca64(%rip), %rcx     # 0x3dff0
leaq 0x98(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
movq %rdx, 0x40(%rbx)
leaq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rcx)
movq %rcx, (%rcx)
xorl %eax, %eax
movq %rax, 0x10(%rcx)
movq 0x8(%r15), %rcx
leaq 0x68(%rsp), %r13
movq %rcx, -0x30(%r13)
movq %rbx, -0x28(%r13)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%r13)
movups %xmm0, -0x10(%r13)
movq %r13, 0x8(%r13)
movq %r13, (%r13)
movq %rax, 0x10(%r13)
leaq 0x80(%rsp), %rbp
movq %rbp, 0x8(%rbp)
movq %rbp, (%rbp)
movq %rax, 0x10(%rbp)
leaq 0x50(%rsp), %rdi
movq %r14, 0x30(%rsp)
movq %r14, %rsi
callq 0x120b6
leaq 0x38(%rsp), %rdi
callq 0x117c4
leaq 0x38(%rsp), %r14
cmpq %r13, 0x68(%rsp)
je 0x1165e
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x124c4
movq %r12, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
movq %r14, %rdi
movq 0x30(%rsp), %rsi
movq %r12, %rdx
callq 0x11c98
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0x12050
movq %r14, %rdi
callq 0x117c4
jmp 0x11610
movss 0x1c(%r15), %xmm0
addss 0x1b99c(%rip), %xmm0    # 0x2d008
movss %xmm0, 0x8(%rsp)
movss 0x8(%rsp), %xmm0
movss 0x1c(%r15), %xmm1
movss %xmm0, 0x10(%rsp)
movss %xmm1, 0xc(%rsp)
ucomiss %xmm1, %xmm0
jbe 0x11720
movq 0x80(%rsp), %r12
xorps %xmm0, %xmm0
cmpq %rbp, %r12
je 0x11705
movss %xmm0, 0x8(%rsp)
leaq 0x10(%r12), %rsi
movq 0x80(%r12), %rax
movss (%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq %rbx, %rdi
callq 0x10b16
shrq $0x20, %rax
movd %eax, %xmm0
subss 0x14(%rsp), %xmm0
movq 0x80(%r12), %rcx
movl %eax, (%rcx)
incl 0x50(%rbx)
andps 0x1b9b6(%rip), %xmm0    # 0x2d0a0
movss 0x8(%rsp), %xmm1
maxss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
movq (%r12), %r12
cmpq %rbp, %r12
jne 0x116a9
jmp 0x1170b
movss %xmm0, 0x8(%rsp)
movq %r14, %rdi
callq 0x117c4
cmpq %r13, 0x68(%rsp)
je 0x11672
jmp 0x11728
movq $0x0, 0x40(%rbx)
movss 0x10(%rsp), %xmm0
ucomiss 0xc(%rsp), %xmm0
ja 0x11610
movq %rbp, %rdi
callq 0x124c4
movq %r13, %rdi
callq 0x124c4
leaq 0x50(%rsp), %rdi
callq 0x1259c
leaq 0x18(%rsp), %rdi
callq 0x124c4
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11775
jmp 0x11775
jmp 0x11775
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x12092
leaq 0x18(%rsp), %rdi
callq 0x124c4
movq %rbx, %rdi
callq 0x6410