// File: /workspace/github_cpp_makefile_star2_O3/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>*, std::deque<Online::Policy::AOT::action_node_t<state_t>*, std::allocator<Online::Policy::AOT::action_node_t<state_t>*>>&) const
void recompute_delta(state_node_t<T> *s_node,
                         std::deque<action_node_t<T>*> &a_queue) const {
        assert(!s_node->is_goal_);
        assert(!s_node->is_dead_end_);
        if( s_node->is_leaf() ) {
            // insert tip node into priority queue
            if( !s_node->is_dead_end_ && !s_node->is_goal_ && (s_node->depth_ < horizon_) ) {
                insert_into_priority_queue(s_node);
            }
        } else {
            assert(!s_node->children_.empty());
            float best_value = s_node->value_;
            if( s_node->in_best_policy_ ) {
                assert(s_node->delta_ >= 0);

                // compute Delta
                float Delta = std::numeric_limits<float>::max();
                for( int i = 0, isz = s_node->children_.size(); i < isz; ++i ) {
                    action_node_t<T> *a_node = s_node->children_[i];
                    if( a_node->value_ != best_value ) {
                        float d = a_node->value_ - best_value;
                        Delta = Utils::min(Delta, d);
                    }
                }

                // compute delta
                for( int i = 0, isz = s_node->children_.size(); i < isz; ++i ) {
                    action_node_t<T> *a_node = s_node->children_[i];
                    if( a_node->value_ == best_value ) {
                        a_node->delta_ = Utils::min(s_node->delta_, Delta);
                        a_node->in_best_policy_ = true;
                        assert(a_node->delta_ >= 0);
                    } else {
                        a_node->delta_ = best_value - a_node->value_;
                        a_node->in_best_policy_ = false;
                        assert(a_node->delta_ <= 0);
                    }
                    a_queue.push_back(a_node);
                }
            } else {
                assert(s_node->delta_ <= 0);
                for( int i = 0, isz = s_node->children_.size(); i < isz; ++i ) {
                    action_node_t<T> *a_node = s_node->children_[i];
                    a_node->delta_ = s_node->delta_ + best_value - a_node->value_;
                    a_node->in_best_policy_ = false;
                    assert(a_node->delta_ <= 0);
                    a_queue.push_back(a_node);
                }
            }
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
cmpb $0x1, 0x88(%rsi)
je 0x2420a
movq %rsi, %rbx
cmpb $0x1, 0x89(%rsi)
je 0x24229
movq 0xa8(%rbx), %rax
movq 0xb0(%rbx), %r12
cmpq %r12, %rax
je 0x240f4
movq %rdx, %r14
movss 0x8(%rbx), %xmm2
movss 0xc(%rbx), %xmm0
cmpb $0x1, 0x14(%rbx)
movss %xmm2, 0x4(%rsp)
xorps %xmm1, %xmm1
jne 0x24118
ucomiss %xmm1, %xmm0
jb 0x24248
subq %rax, %r12
shrq $0x3, %r12
testl %r12d, %r12d
jle 0x2419f
movl %r12d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movss 0x7003(%rip), %xmm3     # 0x2b014
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movss 0x8(%rsi), %xmm0
movaps %xmm0, %xmm1
subss %xmm2, %xmm1
minss %xmm3, %xmm1
cmpneqss %xmm2, %xmm0
andps %xmm0, %xmm1
andnps %xmm3, %xmm0
orps %xmm1, %xmm0
movaps %xmm0, %xmm3
incq %rdx
cmpq %rdx, %rcx
jne 0x24013
testl %r12d, %r12d
jle 0x2419f
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
xorps %xmm4, %xmm4
leaq 0x8(%rsp), %r15
movq 0xa8(%rbx), %rax
movq (%rax,%r13,8), %rax
movq %rax, 0x8(%rsp)
movss 0x8(%rax), %xmm0
ucomiss %xmm0, %xmm2
jne 0x24091
movss 0xc(%rbx), %xmm0
minss %xmm3, %xmm0
movss %xmm0, 0xc(%rax)
movb $0x1, 0x14(%rax)
ucomiss %xmm4, %xmm0
jae 0x240aa
jmp 0x241cc
movaps %xmm2, %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0xc(%rax)
movb $0x0, 0x14(%rax)
ucomiss %xmm4, %xmm1
ja 0x241eb
movq 0x30(%r14), %rcx
movq 0x40(%r14), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
je 0x240c5
movq %rax, (%rcx)
addq $0x8, 0x30(%r14)
jmp 0x240e3
movq %r14, %rdi
movq %r15, %rsi
movaps %xmm3, 0x10(%rsp)
callq 0x24934
xorps %xmm4, %xmm4
movaps 0x10(%rsp), %xmm3
movss 0x4(%rsp), %xmm2
incq %r13
cmpq %r13, %r12
jne 0x2405b
jmp 0x2419f
movl 0x8c(%rbx), %eax
cmpl 0x34(%rdi), %eax
jae 0x2419f
movq %rbx, %rsi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x233bc
ucomiss %xmm1, %xmm0
ja 0x24267
subq %rax, %r12
shrq $0x3, %r12
testl %r12d, %r12d
jle 0x2419f
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
movq 0xa8(%rbx), %rax
movq (%rax,%r13,8), %rax
movq %rax, 0x8(%rsp)
movss 0xc(%rbx), %xmm0
addss %xmm2, %xmm0
subss 0x8(%rax), %xmm0
movss %xmm0, 0xc(%rax)
movb $0x0, 0x14(%rax)
ucomiss %xmm1, %xmm0
ja 0x241ad
movq 0x30(%r14), %rcx
movq 0x40(%r14), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
je 0x24183
movq %rax, (%rcx)
addq $0x8, 0x30(%r14)
jmp 0x24197
movq %r14, %rdi
movq %r15, %rsi
callq 0x24934
xorps %xmm1, %xmm1
movss 0x4(%rsp), %xmm2
incq %r13
cmpq %r13, %r12
jne 0x2413c
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x95fd(%rip), %rdi      # 0x2d7b1
leaq 0x87ce(%rip), %rsi      # 0x2c989
leaq 0x952e(%rip), %rcx      # 0x2d6f0
movl $0x373, %edx            # imm = 0x373
callq 0x51c0
leaq 0x95ca(%rip), %rdi      # 0x2d79d
leaq 0x87af(%rip), %rsi      # 0x2c989
leaq 0x950f(%rip), %rcx      # 0x2d6f0
movl $0x365, %edx            # imm = 0x365
callq 0x51c0
leaq 0x95bf(%rip), %rdi      # 0x2d7b1
leaq 0x8790(%rip), %rsi      # 0x2c989
leaq 0x94f0(%rip), %rcx      # 0x2d6f0
movl $0x369, %edx            # imm = 0x369
callq 0x51c0
leaq 0x94cd(%rip), %rdi      # 0x2d6de
leaq 0x8771(%rip), %rsi      # 0x2c989
leaq 0x94d1(%rip), %rcx      # 0x2d6f0
movl $0x348, %edx            # imm = 0x348
callq 0x51c0
leaq 0x9543(%rip), %rdi      # 0x2d773
leaq 0x8752(%rip), %rsi      # 0x2c989
leaq 0x94b2(%rip), %rcx      # 0x2d6f0
movl $0x349, %edx            # imm = 0x349
callq 0x51c0
leaq 0x953a(%rip), %rdi      # 0x2d789
leaq 0x8733(%rip), %rsi      # 0x2c989
leaq 0x9493(%rip), %rcx      # 0x2d6f0
movl $0x353, %edx            # imm = 0x353
callq 0x51c0
leaq 0x9557(%rip), %rdi      # 0x2d7c5
leaq 0x8714(%rip), %rsi      # 0x2c989
leaq 0x9474(%rip), %rcx      # 0x2d6f0
movl $0x36e, %edx            # imm = 0x36E
callq 0x51c0