// File: /workspace/github_cpp_makefile_star2_O3/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 0x27b6d
movl 0x30(%rbx), %esi
movq %rsp, %rdi
callq 0x285ce
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 0xc30a
leaq 0xa0(%rsp), %rsi
movq %r14, 0x70(%rsi)
movq %rsp, %rdi
callq 0x28a1c
cmpb $0x0, 0xfc(%rsp)
pxor %xmm0, %xmm0
jne 0x27b6d
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x27b6d
callq 0x5340
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 0xc30a
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 0x27d0d
movl %eax, %ebp
leaq 0x40(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x2c(%rsp), %r15
leaq 0xa0(%rsp), %r12
leaq 0x28(%rsp), %r13
movb 0x4(%r14), %cl
testb %cl, %cl
jne 0x27d2c
movl 0x110(%rsp), %eax
cmpl 0x30(%rbx), %eax
jae 0x27d2c
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x20(%rax)
orb %bpl, %al
testb $0x1, %al
jne 0x27d32
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2869c
movq %rax, %r14
movd %r14d, %xmm0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x28778
shrq $0x20, %r14
movq 0x8(%rbx), %rsi
movq %r13, %rdi
movq %r12, %rdx
movl %r14d, %ecx
callq 0xcea2
movq %r12, %rdi
movq %r13, %rsi
callq 0xc30a
cmpb $0x0, 0x84(%rsp)
jne 0x27c6d
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x27c6d
callq 0x5340
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 0x27a84
movq %rax, %r14
cmpb $0x1, 0x38(%rbx)
jne 0x27d04
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 0xc30a
movq %r14, 0x98(%rsp)
movq %rsp, %rdi
movq %r13, %rsi
callq 0x28a1c
cmpb $0x0, 0x84(%rsp)
jne 0x27d04
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x27d04
callq 0x5340
testq %r14, %r14
jne 0x27bde
leaq 0x61ac(%rip), %rdi      # 0x2dec0
leaq 0x61af(%rip), %rsi      # 0x2deca
leaq 0x61c0(%rip), %rcx      # 0x2dee2
movl $0x13d, %edx            # imm = 0x13D
callq 0x51c0
leaq 0x4(%r14), %rax
jmp 0x27d3a
leaq 0x4(%r14), %rax
movb 0x4(%r14), %cl
testb $0x1, %cl
jne 0x27d60
pxor %xmm0, %xmm0
testb $0x1, %bpl
je 0x27d52
movq 0x8(%rbx), %rcx
movd 0xc(%rcx), %xmm0
movd %xmm0, (%r14)
cmpb $0x1, 0x38(%rbx)
jne 0x27d60
movb $0x1, (%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rax
subq %rsi, %rax
shrq $0x3, %rax
imull $0xeeeeeeef, %eax, %r12d # imm = 0xEEEEEEEF
testl %r12d, %r12d
je 0x27e4f
decl %r12d
xorl %r13d, %r13d
leaq 0x28(%rsp), %r14
movl %r12d, %eax
imulq $0x78, %rax, %rbp
addq %rbp, %rsi
pxor %xmm0, %xmm0
movdqu %xmm0, 0x30(%r15)
movdqu %xmm0, 0x20(%r15)
movdqu %xmm0, 0x10(%r15)
movdqu %xmm0, (%r15)
movq %r13, 0x40(%r15)
movb $0x1, 0x84(%rsp)
movq %r13, 0x88(%rsp)
movq %r14, %rdi
callq 0xc30a
movl %r12d, 0x98(%rsp)
movq (%rsp), %rax
movq 0x70(%rax,%rbp), %rdx
testq %rdx, %rdx
je 0x27d0d
cmpb $0x0, 0x4(%rdx)
je 0x27e0f
cmpb $0x0, 0x84(%rsp)
jne 0x27e08
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x27e08
callq 0x5340
testl %r12d, %r12d
jne 0x27e43
jmp 0x27e4f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x287e8
movl %eax, %ebp
cmpb $0x0, 0x84(%rsp)
jne 0x27e38
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x27e38
callq 0x5340
testl %r12d, %r12d
setne %al
testb %bpl, %al
je 0x27e4f
movq (%rsp), %rsi
decl %r12d
jmp 0x27d8b
cmpb $0x0, 0xfc(%rsp)
jne 0x27e6b
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x27e6b
callq 0x5340
movq %rsp, %rdi
callq 0x28876
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27ec1
jmp 0x27e8d
jmp 0x27e8d
jmp 0x27ec1
movq %rax, %rbx
jmp 0x27ee0
jmp 0x27e9c
jmp 0x27ec1
jmp 0x27e9c
jmp 0x27ec1
jmp 0x27ec1
movq %rax, %rbx
cmpb $0x0, 0x84(%rsp)
jne 0x27ec4
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x27ec4
callq 0x5340
jmp 0x27ec4
jmp 0x27ec1
jmp 0x27ec1
movq %rax, %rbx
cmpb $0x0, 0xfc(%rsp)
jne 0x27ee0
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x27ee0
callq 0x5340
movq %rsp, %rdi
callq 0x28876
movq %rbx, %rdi
callq 0x5410