// File: /workspace/github_cpp_makefile_star2_O3/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 $0x98, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
movq %rdx, %rsi
callq *0x30(%rax)
movq 0x10(%r15), %rax
leaq 0x2be9e(%rip), %rcx     # 0x3c1a0
leaq 0x88(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
movq %rdx, 0x40(%rbx)
leaq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rcx)
movq %rcx, (%rcx)
xorl %eax, %eax
movq %rax, 0x10(%rcx)
movq 0x8(%r15), %rcx
leaq 0x58(%rsp), %r12
movq %rcx, -0x30(%r12)
movq %rbx, -0x28(%r12)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%r12)
movups %xmm0, -0x10(%r12)
movq %r12, 0x8(%r12)
movq %r12, (%r12)
movq %rax, 0x10(%r12)
leaq 0x70(%rsp), %rbp
movq %rbp, 0x8(%rbp)
movq %rbp, (%rbp)
movq %rax, 0x10(%rbp)
leaq 0x40(%rsp), %rdi
movq %r14, 0x20(%rsp)
movq %r14, %rsi
callq 0x10dea
leaq 0x28(%rsp), %rdi
callq 0x10514
leaq 0x28(%rsp), %r14
cmpq %r12, 0x58(%rsp)
je 0x103d7
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x11218
movq %r13, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %r13, %rdx
callq 0x109cc
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x10d84
movq %r14, %rdi
callq 0x10514
jmp 0x10389
movss 0x1c(%r15), %xmm0
addss 0x1ac23(%rip), %xmm0    # 0x2b008
movss %xmm0, (%rsp)
movss (%rsp), %xmm0
ucomiss 0x1c(%r15), %xmm0
jbe 0x10480
movq 0x70(%rsp), %r13
xorps %xmm0, %xmm0
cmpq %rbp, %r13
je 0x10463
movss %xmm0, (%rsp)
leaq 0x10(%r13), %rsi
movq 0x80(%r13), %rax
movss (%rax), %xmm0
movss %xmm0, 0x4(%rsp)
movq %rbx, %rdi
callq 0xf8b0
shrq $0x20, %rax
movd %eax, %xmm0
subss 0x4(%rsp), %xmm0
movq 0x80(%r13), %rcx
movl %eax, (%rcx)
incl 0x50(%rbx)
andps 0x1ac66(%rip), %xmm0    # 0x2b0b0
movss (%rsp), %xmm1
maxss %xmm0, %xmm1
movss %xmm1, (%rsp)
movq (%r13), %r13
cmpq %rbp, %r13
jne 0x1040c
jmp 0x10468
movss %xmm0, (%rsp)
movq %r14, %rdi
callq 0x10514
cmpq %r12, 0x58(%rsp)
je 0x103ea
jmp 0x10389
movq $0x0, 0x40(%rbx)
movq %rbp, %rdi
callq 0x11218
movq %r12, %rdi
callq 0x11218
leaq 0x40(%rsp), %rdi
callq 0x112f0
leaq 0x8(%rsp), %rdi
callq 0x11218
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x104c4
jmp 0x104c4
jmp 0x104c4
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x10dc6
leaq 0x8(%rsp), %rdi
callq 0x11218
movq %rbx, %rdi
callq 0x5410
nop