// File: /workspace/github_cpp_makefile_star2_O2/bonetblai[P]mdp-engine/ctp3/../engine/aot.h
// Function: Online::Policy::AOT::aot_t<state_t>::recompute_delta(Online::Policy::AOT::state_node_t<state_t>*) const
void recompute_delta(state_node_t<T> *root) const {
        assert(!root->is_goal_);
        assert(!root->is_dead_end_);

        std::deque<state_node_t<T>*> s_queue;
        bool expanding_from_s_queue = true;
        std::deque<action_node_t<T>*> a_queue;
        bool expanding_from_a_queue = false;

        root->delta_ = std::numeric_limits<float>::max();
        root->in_best_policy_ = true;
        s_queue.push_back(root);

        while( !s_queue.empty() || !a_queue.empty() ) {
            // expand from the state queue
            if( expanding_from_s_queue ) {
                while( !s_queue.empty() ) {
                    state_node_t<T> *s_node = s_queue.back();
                    s_queue.pop_back();
                    s_node->in_queue_ = false;
                    recompute_delta(s_node, a_queue);
                }
                expanding_from_s_queue = false;
                expanding_from_a_queue = true;
            }

            // expand from the action queue
            if( expanding_from_a_queue ) {
                while( !a_queue.empty() ) {
                    action_node_t<T> *a_node = a_queue.back();
                    a_queue.pop_back();
                    recompute_delta(a_node, s_queue);
                }
                expanding_from_a_queue = false;
                expanding_from_s_queue = true;
            }
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rsi, 0x8(%rsp)
cmpb $0x1, 0x88(%rsi)
je 0x1a0bd
movq %rsi, %r14
cmpb $0x1, 0x89(%rsi)
je 0x1a0dc
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1a90a
leaq 0x60(%rsp), %rdi
callq 0x1ab06
movl $0x7f7fffff, 0xc(%r14)  # imm = 0x7F7FFFFF
movb $0x1, 0x14(%r14)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1a484
movl $0x200, %r13d           # imm = 0x200
leaq 0x60(%rsp), %r14
leaq 0x10(%rsp), %r15
movq 0x40(%rsp), %rax
cmpq 0x20(%rsp), %rax
jne 0x1a010
movq 0x90(%rsp), %rax
cmpq 0x70(%rsp), %rax
je 0x1a098
movq 0x40(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x1a084
cmpq 0x48(%rsp), %rax
jne 0x1a02f
movq 0x58(%rsp), %rax
movq -0x8(%rax), %rax
addq %r13, %rax
movq -0x8(%rax), %r12
movq %r15, %rdi
callq 0x1a4a6
movb $0x0, 0x15(%r12)
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1a4be
jmp 0x1a010
cmpq 0x98(%rsp), %rax
jne 0x1a06a
movq 0xa8(%rsp), %rax
movq -0x8(%rax), %rax
addq %r13, %rax
movq -0x8(%rax), %r12
movq %r14, %rdi
callq 0x1a762
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1a77a
movq 0x90(%rsp), %rax
cmpq 0x70(%rsp), %rax
jne 0x1a051
jmp 0x19ff1
leaq 0x60(%rsp), %rdi
callq 0x1b1a0
leaq 0x10(%rsp), %rdi
callq 0x1b1c6
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x854f(%rip), %rdi      # 0x22613
leaq 0x787e(%rip), %rsi      # 0x21949
leaq 0x8551(%rip), %rcx      # 0x22623
movl $0x321, %edx            # imm = 0x321
callq 0x51b0
leaq 0x85a1(%rip), %rdi      # 0x22684
leaq 0x785f(%rip), %rsi      # 0x21949
leaq 0x8532(%rip), %rcx      # 0x22623
movl $0x322, %edx            # imm = 0x322
callq 0x51b0
jmp 0x1a104
movq %rax, %rbx
jmp 0x1a111
jmp 0x1a104
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x1b1a0
leaq 0x10(%rsp), %rdi
callq 0x1b1c6
movq %rbx, %rdi
callq 0x5410
nop