// File: bonetblai[P]mdp-engine/ctp3/../engine/bdd_priority_queue.h
// Function: std::bdd_priority_queue<Online::Policy::AOT::node_t<state_t>*, Online::Policy::AOT::min_priority_t<state_t>, Online::Policy::AOT::max_priority_t<state_t>>::heapify_max(unsigned int)
void heapify_max(unsigned index) {
        assert((index > 0) && (index <= max_size_));
        unsigned left = index << 1, right = 1 + left, largest = 0;

        if( (left <= max_size_) && max_cmpfn_(max_array_[index]->element_, max_array_[left]->element_) ) {
            largest = left;
        } else {
            largest = index;
        }
        if( (right <= max_size_) && max_cmpfn_(max_array_[largest]->element_, max_array_[right]->element_) ) {
            largest = right;
        }

        if( largest != index ) {
            container_t *tmp = max_array_[largest];
            max_array_[largest] = max_array_[index];
            max_array_[index] = tmp;
            min_array_[max_array_[largest]->xref_] = largest;
            min_array_[max_array_[index]->xref_] = index;
            heapify_max(largest);
        }
    }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movl %esi, 0x6c(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x48(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x6c(%rsp)
movb %al, 0x57(%rsp)
jbe 0x48b97
movq 0x48(%rsp), %rcx
movl 0x6c(%rsp), %eax
cmpl 0x18(%rcx), %eax
setbe %al
movb %al, 0x57(%rsp)
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0x48ba1
jmp 0x48ba3
jmp 0x48bc2
leaq 0x16912(%rip), %rdi     # 0x5f4bc
leaq 0x15b99(%rip), %rsi     # 0x5e74a
movl $0xbb, %edx
leaq 0x16923(%rip), %rcx     # 0x5f4e0
callq 0x6220
movq 0x48(%rsp), %rcx
movl 0x6c(%rsp), %eax
shll %eax
movl %eax, 0x68(%rsp)
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
movl $0x0, 0x60(%rsp)
movl 0x68(%rsp), %eax
cmpl 0x18(%rcx), %eax
ja 0x48c45
movq 0x48(%rsp), %rdi
addq $0x20, %rdi
movl 0x6c(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x48(%rsp), %rdi
movq (%rax), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
addq $0x20, %rdi
movl 0x68(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq (%rax), %rax
movq (%rax), %rdx
callq 0x47a60
testb $0x1, %al
jne 0x48c3b
jmp 0x48c45
movl 0x68(%rsp), %eax
movl %eax, 0x60(%rsp)
jmp 0x48c4d
movl 0x6c(%rsp), %eax
movl %eax, 0x60(%rsp)
movq 0x48(%rsp), %rcx
movl 0x64(%rsp), %eax
cmpl 0x18(%rcx), %eax
ja 0x48cb1
movq 0x48(%rsp), %rdi
addq $0x20, %rdi
movl 0x60(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x48(%rsp), %rdi
movq (%rax), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
addq $0x20, %rdi
movl 0x64(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq (%rax), %rax
movq (%rax), %rdx
callq 0x47a60
testb $0x1, %al
jne 0x48ca9
jmp 0x48cb1
movl 0x64(%rsp), %eax
movl %eax, 0x60(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x6c(%rsp), %eax
je 0x48dc7
movq 0x48(%rsp), %rdi
addq $0x20, %rdi
movl 0x60(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x48(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x58(%rsp)
addq $0x20, %rdi
movl 0x6c(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x48(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x8(%rsp)
addq $0x20, %rdi
movl 0x60(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x8(%rsp), %rcx
movq 0x48(%rsp), %rdi
movq %rcx, (%rax)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x20, %rdi
movl 0x6c(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x10(%rsp), %rcx
movq 0x48(%rsp), %rdi
movq %rcx, (%rax)
movl 0x60(%rsp), %eax
movl %eax, 0x24(%rsp)
movq %rdi, %rax
addq $0x40, %rax
movq %rax, 0x18(%rsp)
addq $0x20, %rdi
movl 0x60(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x18(%rsp), %rdi
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
callq 0x465b0
movl 0x24(%rsp), %ecx
movq 0x48(%rsp), %rdi
movl %ecx, (%rax)
movl 0x6c(%rsp), %eax
movl %eax, 0x34(%rsp)
movq %rdi, %rax
addq $0x40, %rax
movq %rax, 0x28(%rsp)
addq $0x20, %rdi
movl 0x6c(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x28(%rsp), %rdi
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, %esi
callq 0x465b0
movl 0x34(%rsp), %ecx
movq 0x48(%rsp), %rdi
movl %ecx, (%rax)
movl 0x60(%rsp), %esi
callq 0x48b60
addq $0x78, %rsp
retq
nopl (%rax)