// File: /workspace/github_cpp_makefile_star2_O2/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 0x26406(%rip), %rcx     # 0x341a0
leaq 0x88(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
movq %rdx, 0x40(%rbx)
leaq 0x10(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
movq 0x8(%r15), %rax
leaq 0x58(%rsp), %rbp
movq %rax, -0x30(%rbp)
movq %rbx, -0x28(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rbp)
movups %xmm0, -0x10(%rbp)
movq %rbp, 0x8(%rbp)
movq %rbp, (%rbp)
andq $0x0, 0x10(%rbp)
leaq 0x70(%rsp), %r13
movq %r13, 0x8(%r13)
movq %r13, (%r13)
andq $0x0, 0x10(%r13)
leaq 0x40(%rsp), %rdi
movq %r14, 0x8(%rsp)
movq %r14, %rsi
callq 0xe522
leaq 0x28(%rsp), %rdi
callq 0xdf64
leaq 0x28(%rsp), %r12
cmpq %rbp, 0x58(%rsp)
je 0xde55
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xe242
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0xe25a
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0xe4be
movq %r12, %rdi
callq 0xdf64
jmp 0xde1a
movss 0x1c(%r15), %xmm0
addss 0x121a9(%rip), %xmm0    # 0x2000c
movss %xmm0, (%rsp)
movss (%rsp), %xmm0
ucomiss 0x1c(%r15), %xmm0
jbe 0xdee9
xorps %xmm0, %xmm0
movss %xmm0, (%rsp)
movq %r13, %r14
movq (%r14), %r14
cmpq %r13, %r14
je 0xded5
leaq 0x10(%r14), %rsi
movq 0x80(%r14), %rax
movss (%rax), %xmm0
movss %xmm0, 0x4(%rsp)
movq %rbx, %rdi
callq 0xd74c
shrq $0x20, %rax
movd %eax, %xmm0
subss 0x4(%rsp), %xmm0
andps 0x121a7(%rip), %xmm0    # 0x20060
movss (%rsp), %xmm1
maxss %xmm0, %xmm1
movss %xmm1, (%rsp)
movq 0x80(%r14), %rcx
movl %eax, (%rcx)
incl 0x50(%rbx)
jmp 0xde7f
movq %r12, %rdi
callq 0xdf64
cmpq %rbp, 0x58(%rsp)
je 0xde68
jmp 0xde1a
andq $0x0, 0x40(%rbx)
leaq 0x28(%rsp), %rdi
callq 0xe4fe
leaq 0x10(%rsp), %rdi
callq 0xe98e
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdf1a
jmp 0xdf1a
jmp 0xdf1a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xe4fe
leaq 0x10(%rsp), %rdi
callq 0xe98e
movq %rbx, %rdi
callq 0x5410
nop