// File: 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:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movq %rdx, 0x120(%rsp)
movq 0x130(%rsp), %rdi
movq %rdi, 0x50(%rsp)
movq 0x120(%rsp), %rsi
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
movq 0x50(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x110(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x20c30
movq 0x48(%rsp), %rsi
movq 0x120(%rsp), %rdi
callq 0x20c70
leaq 0xf8(%rsp), %rdi
callq 0x24840
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x120(%rsp), %rdx
leaq 0x98(%rsp), %rdi
callq 0x24850
jmp 0x24477
movq 0x128(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x248b0
jmp 0x2448e
leaq 0x98(%rsp), %rdi
callq 0x248e0
jmp 0x2449d
movq $0x0, 0x80(%rsp)
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x24f10
movq %rax, 0x40(%rsp)
jmp 0x244d1
movq 0x40(%rsp), %rdi
callq 0x24f20
xorb $-0x1, %al
testb $0x1, %al
jne 0x244e6
jmp 0x2457b
leaq 0xf8(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x24f40
movq 0x38(%rsp), %rdx
movq 0x128(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x24f70
jmp 0x24514
leaq 0x98(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x25420
jmp 0x2452b
leaq 0x98(%rsp), %rdi
callq 0x248e0
jmp 0x2453a
jmp 0x244bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
jmp 0x2475e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x255f0
jmp 0x2475e
movq 0x50(%rsp), %rax
movss 0x1c(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x38abf(%rip), %xmm0    # 0x5d050
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x7c(%rsp)
movq 0x50(%rsp), %rax
movss 0x7c(%rsp), %xmm0
ucomiss 0x1c(%rax), %xmm0
jbe 0x2471e
movl $0x0, 0x7c(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x254d0
movq %rax, 0x30(%rsp)
jmp 0x245d0
movq 0x30(%rsp), %rdi
callq 0x254e0
movq %rax, 0x70(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x254d0
movq %rax, 0x28(%rsp)
jmp 0x245f3
movq 0x28(%rsp), %rdi
callq 0x25530
movq %rax, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x25510
testb $0x1, %al
jne 0x2461a
jmp 0x246e5
leaq 0x70(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x25560
movq 0x70(%rax), %rdi
callq 0x22fc0
movq 0x10(%rsp), %rdi
movss %xmm0, 0x64(%rsp)
movq 0x120(%rsp), %rax
movq %rax, 0x18(%rsp)
callq 0x25560
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x22eb0
movq %rax, 0x20(%rsp)
jmp 0x24663
movq 0x20(%rsp), %rax
movq %rax, 0x5c(%rsp)
movss 0x7c(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x60(%rsp), %xmm0
movss 0x64(%rsp), %xmm1
subss %xmm1, %xmm0
callq 0x22fa0
movaps %xmm0, %xmm1
movss 0x8(%rsp), %xmm0
callq 0x25590
movss %xmm0, 0xc(%rsp)
jmp 0x246a4
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x7c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x25560
movq 0x70(%rax), %rdi
movss 0x60(%rsp), %xmm0
callq 0x22fd0
movq 0x120(%rsp), %rdi
callq 0x22ff0
leaq 0x70(%rsp), %rdi
callq 0x255d0
jmp 0x245df
leaq 0x98(%rsp), %rdi
callq 0x248e0
jmp 0x246f4
leaq 0x98(%rsp), %rdi
callq 0x24f10
movq %rax, (%rsp)
jmp 0x24707
movq (%rsp), %rdi
callq 0x24f20
testb $0x1, %al
jne 0x24719
jmp 0x244a9
jmp 0x2459f
movq 0x120(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20c70
leaq 0x98(%rsp), %rdi
callq 0x255f0
leaq 0xf8(%rsp), %rdi
callq 0x25630
leaq 0x110(%rsp), %rdi
callq 0x21630
addq $0x138, %rsp            # imm = 0x138
retq
leaq 0xf8(%rsp), %rdi
callq 0x25630
leaq 0x110(%rsp), %rdi
callq 0x21630
movq 0x90(%rsp), %rdi
callq 0x6520
nopw %cs:(%rax,%rax)
nop