// File: /workspace/github_cpp_makefile_star2_O1/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 $0x118, %rsp            # imm = 0x118
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
pxor %xmm0, %xmm0
movdqa %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
cmpb $0x1, 0x38(%rdi)
jne 0x2999b
movl 0x30(%rbx), %esi
movq %rsp, %rdi
callq 0x2a3de
pxor %xmm0, %xmm0
leaq 0xa0(%rsp), %rdi
movdqu %xmm0, 0x34(%rdi)
movdqu %xmm0, 0x24(%rdi)
movdqu %xmm0, 0x14(%rdi)
movdqu %xmm0, 0x4(%rdi)
xorl %eax, %eax
movq %rax, 0x44(%rdi)
movb $0x1, 0x5c(%rdi)
movq %rax, 0x60(%rdi)
movq %r15, %rsi
callq 0xd546
leaq 0xa0(%rsp), %rsi
movq %r14, 0x70(%rsi)
movq %rsp, %rdi
callq 0x2a81a
cmpb $0x0, 0xfc(%rsp)
pxor %xmm0, %xmm0
jne 0x2999b
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x2999b
callq 0x6340
pxor %xmm0, %xmm0
leaq 0xa0(%rsp), %rdi
movdqu %xmm0, 0x34(%rdi)
movdqu %xmm0, 0x24(%rdi)
movdqu %xmm0, 0x14(%rdi)
movdqu %xmm0, 0x4(%rdi)
xorl %eax, %eax
movq %rax, 0x44(%rdi)
movb $0x1, 0x5c(%rdi)
movq %rax, 0x60(%rdi)
movq %r15, %rsi
callq 0xd546
movl 0x70(%r15), %eax
leaq 0xa0(%rsp), %rsi
movl %eax, 0x70(%rsi)
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
testq %r14, %r14
je 0x29b38
movl %eax, %ebp
leaq 0x40(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x2c(%rsp), %r15
leaq 0xa0(%rsp), %r12
leaq 0x28(%rsp), %r13
cmpb $0x0, 0x4(%r14)
jne 0x29b57
movl 0x110(%rsp), %ecx
movb $0x1, %al
cmpl 0x30(%rbx), %ecx
jae 0x29a32
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x20(%rax)
orb %bpl, %al
testb $0x1, %al
jne 0x29b57
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2a4a6
movq %rax, %r14
movd %r14d, %xmm0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2a586
shrq $0x20, %r14
movq 0x8(%rbx), %rsi
movq %r13, %rdi
movq %r12, %rdx
movl %r14d, %ecx
callq 0xe0cc
movq %r12, %rdi
movq %r13, %rsi
callq 0xd546
cmpb $0x0, 0x84(%rsp)
jne 0x29a98
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x29a98
callq 0x6340
incl 0x110(%rsp)
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x28(%rax)
movl %eax, %ebp
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x298ae
movq %rax, %r14
cmpb $0x1, 0x38(%rbx)
jne 0x29b2f
pxor %xmm0, %xmm0
movdqu %xmm0, 0x30(%r15)
movdqu %xmm0, 0x20(%r15)
movdqu %xmm0, 0x10(%r15)
movdqu %xmm0, (%r15)
xorl %eax, %eax
movq %rax, 0x40(%r15)
movb $0x1, 0x84(%rsp)
movq %rax, 0x88(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0xd546
movq %r14, 0x98(%rsp)
movq %rsp, %rdi
movq %r13, %rsi
callq 0x2a81a
cmpb $0x0, 0x84(%rsp)
jne 0x29b2f
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x29b2f
callq 0x6340
testq %r14, %r14
jne 0x29a0c
leaq 0x63f8(%rip), %rdi      # 0x2ff37
leaq 0x63fb(%rip), %rsi      # 0x2ff41
leaq 0x640c(%rip), %rcx      # 0x2ff59
movl $0x13d, %edx            # imm = 0x13D
callq 0x61c0
cmpb $0x0, 0x4(%r14)
jne 0x29b81
pxor %xmm0, %xmm0
testb $0x1, %bpl
je 0x29b71
movq 0x8(%rbx), %rax
movd 0xc(%rax), %xmm0
movd %xmm0, (%r14)
cmpb $0x1, 0x38(%rbx)
jne 0x29b81
movb $0x1, 0x4(%r14)
movq 0x8(%rsp), %rax
subq (%rsp), %rax
shrq $0x3, %rax
imull $0xeeeeeeef, %eax, %r12d # imm = 0xEEEEEEEF
testl %r12d, %r12d
je 0x29c6d
decl %r12d
xorl %r13d, %r13d
leaq 0x28(%rsp), %r14
movl %r12d, %eax
imulq $0x78, %rax, %rbp
movq (%rsp), %rsi
addq %rbp, %rsi
movq %r13, 0x40(%r15)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x30(%r15)
movdqu %xmm0, 0x20(%r15)
movdqu %xmm0, 0x10(%r15)
movdqu %xmm0, (%r15)
movb $0x1, 0x84(%rsp)
movq %r13, 0x88(%rsp)
movq %r14, %rdi
callq 0xd546
movl %r12d, 0x98(%rsp)
movq (%rsp), %rax
movq 0x70(%rax,%rbp), %rdx
testq %rdx, %rdx
je 0x29b38
cmpb $0x0, 0x4(%rdx)
je 0x29c31
cmpb $0x0, 0x84(%rsp)
jne 0x29c2a
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x29c2a
callq 0x6340
testl %r12d, %r12d
jne 0x29c65
jmp 0x29c6d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a5fa
movl %eax, %ebp
cmpb $0x0, 0x84(%rsp)
jne 0x29c5a
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x29c5a
callq 0x6340
testl %r12d, %r12d
setne %al
testb %bpl, %al
je 0x29c6d
decl %r12d
jmp 0x29ba9
cmpb $0x0, 0xfc(%rsp)
jne 0x29c89
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x29c89
callq 0x6340
movq %rsp, %rdi
callq 0x2a678
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29cdf
jmp 0x29cab
jmp 0x29cab
jmp 0x29cdf
movq %rax, %rbx
jmp 0x29cfe
jmp 0x29cba
jmp 0x29cdf
jmp 0x29cdf
jmp 0x29cba
jmp 0x29cdf
movq %rax, %rbx
cmpb $0x0, 0x84(%rsp)
jne 0x29ce2
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x29ce2
callq 0x6340
jmp 0x29ce2
jmp 0x29cdf
jmp 0x29cdf
movq %rax, %rbx
cmpb $0x0, 0xfc(%rsp)
jne 0x29cfe
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x29cfe
callq 0x6340
movq %rsp, %rdi
callq 0x2a678
movq %rbx, %rdi
callq 0x6410