// File: /workspace/github_cpp_makefile_star2_O2/bonetblai[P]mdp-engine/ctp3/../engine/online_rtdp.h
// Function: Online::Policy::RTDP::finite_horizon_lrtdp_t<state_t>::lrtdp_trial(Online::Policy::RTDP::node_t<state_t> const&, Online::Policy::RTDP::data_t*) const
void lrtdp_trial(const node_t<T> &root, data_t *root_dptr) const {
        // set up queue of visited nodes (for labeling)
        std::vector<std::pair<T, data_t*> > visited;
        if( labeling_ ) {
            visited.reserve(horizon_);
            visited.push_back(std::make_pair(root.state(), root_dptr));
        }

#ifdef DEBUG
        std::cout << "lrtdp_trial: new trial" << std::endl;
#endif

        // lrtdp trial
        node_t<T> node(root);
        data_t *dptr = root_dptr;
        bool node_is_dead_end = dead_end(node);
        while( !labeled(dptr) && !terminal(node) && !node_is_dead_end ) {
#ifdef DEBUG
            std::cout << "lrtdp_trial: state=" << node.state()
                      << ", depth=" << node.depth()
                      << ", dptr=" << dptr << std::endl;
#endif
            std::pair<float, Problem::action_t> p = best_q_value(node).first;
            Problem::action_t best_action = p.second;
            update_value(node, p.first);
            node.set_state(problem_.sample(node.state(), best_action).first);
            node.set_depth(1 + node.depth());
            node_is_dead_end = dead_end(node);
            dptr = table_.get_data_ptr(node);
            if( labeling_ ) visited.push_back(std::make_pair(node.state(), dptr));
        }

#ifdef DEBUG
        std::cout << "lrtdp_trial: end state=" << node.state()
                  << ", depth=" << node.depth()
                  << ", dptr=" << dptr << std::endl;
#endif

        if( !labeled(dptr) ) {
            dptr->value_ = node_is_dead_end ? problem_.dead_end_value() : 0;
            if( labeling_ ) dptr->labeled_ = true;
        }

        // try labeling nodes in reverse visited order
        for( unsigned depth = visited.size(); depth > 0; --depth ) {
            node_t<T> node(visited[depth - 1].first, depth - 1);
            data_t *dptr = visited[depth - 1].second;
            bool has_label = labeled(dptr) || try_label(node, dptr);
#ifdef DEBUG
            std::cout << "lrtdp_trial: labeling: state=" << node.state()
                      << ", dptr=" << dptr
                      << std::endl;
#endif
            if( !has_label ) break;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
andq $0x0, 0x10(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, (%rsp)
cmpb $0x1, 0x38(%rdi)
jne 0x1d8a8
movl 0x30(%rbx), %esi
movq %rsp, %rdi
callq 0x1e144
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0xa4d8
leaq 0x18(%rsp), %rsi
movq %r14, 0x70(%rsi)
movq %rsp, %rdi
callq 0x1e50c
leaq 0x18(%rsp), %rdi
callq 0x8e90
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x1dfc6
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
leaq 0x18(%rsp), %rsi
callq *0x28(%rax)
movl %eax, %ebp
leaq 0x40(%rbx), %r15
leaq 0x18(%rsp), %r12
leaq 0x90(%rsp), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d81c
testb %al, %al
jne 0x1d9a0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1e1da
orb %bpl, %al
testb $0x1, %al
jne 0x1d9a0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1e1f2
movq %rax, %r14
movd %r14d, %xmm0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1e2c6
shrq $0x20, %r14
movq 0x8(%rbx), %rsi
movq %r13, %rdi
movq %r12, %rdx
movl %r14d, %ecx
callq 0xb318
movq %r12, %rdi
movq %r13, %rsi
callq 0xa8c8
movq %r13, %rdi
callq 0x8e90
incl 0x88(%rsp)
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x28(%rax)
movl %eax, %ebp
movq %r15, %rdi
movq %r12, %rsi
callq 0x1d7ee
movq %rax, %r14
cmpb $0x1, 0x38(%rbx)
jne 0x1d8d7
movq %r13, %rdi
movq %r12, %rsi
callq 0xa4d8
movq %r14, 0x100(%rsp)
movq %rsp, %rdi
movq %r13, %rsi
callq 0x1e50c
movq %r13, %rdi
callq 0x8e90
jmp 0x1d8d7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d81c
testb %al, %al
jne 0x1d9d2
pxor %xmm0, %xmm0
testb $0x1, %bpl
je 0x1d9c2
movq 0x8(%rbx), %rax
movd 0xc(%rax), %xmm0
movd %xmm0, (%r14)
cmpb $0x1, 0x38(%rbx)
jne 0x1d9d2
movb $0x1, 0x4(%r14)
movq 0x8(%rsp), %rax
subq (%rsp), %rax
pushq $0x78
popq %rcx
cqto
idivq %rcx
movl %eax, %r12d
decq %r12
leaq 0x90(%rsp), %r14
cmpq $-0x1, %r12
je 0x1da59
movl %r12d, %eax
imulq $0x78, %rax, %r15
movq (%rsp), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0xa4d8
movl %r12d, 0x100(%rsp)
movq (%rsp), %rax
movq 0x70(%rax,%r15), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1d81c
testb %al, %al
je 0x1da37
movq %r14, %rdi
callq 0x8e90
jmp 0x1da54
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1e312
movl %eax, %ebp
movq %r14, %rdi
callq 0x8e90
testb %bpl, %bpl
je 0x1da59
decq %r12
jmp 0x1d9f1
leaq 0x18(%rsp), %rdi
callq 0x8e90
movq %rsp, %rdi
callq 0x1e392
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1daaa
jmp 0x1da85
jmp 0x1da85
jmp 0x1daaa
movq %rax, %rbx
jmp 0x1dab7
jmp 0x1da94
jmp 0x1daaa
jmp 0x1da94
jmp 0x1daaa
jmp 0x1daaa
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x8e90
jmp 0x1daad
jmp 0x1daaa
jmp 0x1daaa
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x8e90
movq %rsp, %rdi
callq 0x1e392
movq %rbx, %rdi
callq 0x5410
nop