// File: /workspace/github_cpp_makefile_star2_O1/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 0x2602b
movq %rsi, %rbx
cmpb $0x1, 0x89(%rsi)
je 0x2604a
movq 0xa8(%rbx), %rax
cmpq 0xb0(%rbx), %rax
je 0x25e51
movq 0xa8(%rbx), %rax
movq 0xb0(%rbx), %r12
cmpq %r12, %rax
je 0x26069
movq %rdx, %r14
movss 0x8(%rbx), %xmm2
movss 0xc(%rbx), %xmm0
cmpb $0x1, 0x14(%rbx)
movss %xmm2, 0x4(%rsp)
xorps %xmm1, %xmm1
jne 0x25e75
ucomiss %xmm1, %xmm0
jb 0x26088
subq %rax, %r12
shrq $0x3, %r12
testl %r12d, %r12d
jle 0x25f09
movl %r12d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movss 0x71f7(%rip), %xmm0     # 0x2d014
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movss 0x8(%rsi), %xmm3
movaps %xmm3, %xmm1
subss %xmm2, %xmm1
minss %xmm0, %xmm1
cmpneqss %xmm2, %xmm3
andps %xmm3, %xmm1
andnps %xmm0, %xmm3
orps %xmm1, %xmm3
incq %rdx
movaps %xmm3, %xmm0
cmpq %rdx, %rcx
jne 0x25e1f
jmp 0x25f11
movl 0x8c(%rbx), %eax
cmpl 0x34(%rdi), %eax
jae 0x25fc0
movq %rbx, %rsi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x25192
ucomiss %xmm1, %xmm0
ja 0x260a7
subq %rax, %r12
shrq $0x3, %r12
testl %r12d, %r12d
jle 0x25fc0
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 0x25fce
movq 0x30(%r14), %rcx
movq 0x40(%r14), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
je 0x25ee8
movq %rax, (%rcx)
addq $0x8, 0x30(%r14)
jmp 0x25efc
movq %r14, %rdi
movq %r15, %rsi
callq 0x2677a
xorps %xmm1, %xmm1
movss 0x4(%rsp), %xmm2
incq %r13
cmpq %r13, %r12
jne 0x25e9d
jmp 0x25fc0
movss 0x7103(%rip), %xmm3     # 0x2d014
testl %r12d, %r12d
jle 0x25fc0
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
xorps %xmm4, %xmm4
leaq 0x8(%rsp), %r15
movaps %xmm3, 0x10(%rsp)
movq 0xa8(%rbx), %rax
movq (%rax,%r13,8), %rax
movq %rax, 0x8(%rsp)
movss 0x8(%rax), %xmm0
ucomiss %xmm0, %xmm2
jne 0x25f67
movss 0xc(%rbx), %xmm0
minss %xmm3, %xmm0
movss %xmm0, 0xc(%rax)
movb $0x1, 0x14(%rax)
ucomiss %xmm4, %xmm0
jae 0x25f80
jmp 0x25fed
movaps %xmm2, %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0xc(%rax)
movb $0x0, 0x14(%rax)
ucomiss %xmm4, %xmm1
ja 0x2600c
movq 0x30(%r14), %rcx
movq 0x40(%r14), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
je 0x25f9b
movq %rax, (%rcx)
addq $0x8, 0x30(%r14)
jmp 0x25fb4
movq %r14, %rdi
movq %r15, %rsi
callq 0x2677a
xorps %xmm4, %xmm4
movaps 0x10(%rsp), %xmm3
movss 0x4(%rsp), %xmm2
incq %r13
cmpq %r13, %r12
jne 0x25f31
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x9853(%rip), %rdi      # 0x2f828
leaq 0x8a09(%rip), %rsi      # 0x2e9e5
leaq 0x9769(%rip), %rcx      # 0x2f74c
movl $0x373, %edx            # imm = 0x373
callq 0x61c0
leaq 0x9820(%rip), %rdi      # 0x2f814
leaq 0x89ea(%rip), %rsi      # 0x2e9e5
leaq 0x974a(%rip), %rcx      # 0x2f74c
movl $0x365, %edx            # imm = 0x365
callq 0x61c0
leaq 0x9815(%rip), %rdi      # 0x2f828
leaq 0x89cb(%rip), %rsi      # 0x2e9e5
leaq 0x972b(%rip), %rcx      # 0x2f74c
movl $0x369, %edx            # imm = 0x369
callq 0x61c0
leaq 0x9708(%rip), %rdi      # 0x2f73a
leaq 0x89ac(%rip), %rsi      # 0x2e9e5
leaq 0x970c(%rip), %rcx      # 0x2f74c
movl $0x348, %edx            # imm = 0x348
callq 0x61c0
leaq 0x977e(%rip), %rdi      # 0x2f7cf
leaq 0x898d(%rip), %rsi      # 0x2e9e5
leaq 0x96ed(%rip), %rcx      # 0x2f74c
movl $0x349, %edx            # imm = 0x349
callq 0x61c0
leaq 0x9775(%rip), %rdi      # 0x2f7e5
leaq 0x896e(%rip), %rsi      # 0x2e9e5
leaq 0x96ce(%rip), %rcx      # 0x2f74c
movl $0x350, %edx            # imm = 0x350
callq 0x61c0
leaq 0x9771(%rip), %rdi      # 0x2f800
leaq 0x894f(%rip), %rsi      # 0x2e9e5
leaq 0x96af(%rip), %rcx      # 0x2f74c
movl $0x353, %edx            # imm = 0x353
callq 0x61c0
leaq 0x978e(%rip), %rdi      # 0x2f83c
leaq 0x8930(%rip), %rsi      # 0x2e9e5
leaq 0x9690(%rip), %rcx      # 0x2f74c
movl $0x36e, %edx            # imm = 0x36E
callq 0x61c0