// 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>>::push(Online::Policy::AOT::node_t<state_t>*&)
std::pair<bool, bool> push(T &element) {
        if( max_size_ < capacity_ ) {
            container_t *container = allocate_container(element);
            push_max(1 + max_size_, container);
            ++max_size_;
            assert(check());
            return std::make_pair(true, false);
        } else {
            unsigned min = min_array_[1];
            if( max_cmpfn_(max_array_[min]->element_, element) ) {
                min_array_[1] = min_array_[min_size_];
                max_array_[min_array_[1]]->xref_ = 1;
                --min_size_;
                if( min_size_ > 0 ) {
                    heapify_min(1);
                }

                remove_from_max(min);
                assert(pool_ != 0);
                removed_element_ = pool_->element_;

                assert(max_size_ < capacity_);
                push(element);
                return std::make_pair(true, true);
            } else {
                return std::make_pair(false, false);
            }
        }
    }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movl 0x18(%rcx), %eax
cmpl 0x4(%rcx), %eax
jae 0x4761a
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x477e0
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
movl 0x18(%rdi), %esi
addl $0x1, %esi
movq 0x28(%rsp), %rdx
callq 0x478b0
movq 0x10(%rsp), %rdi
movl 0x18(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x18(%rdi)
callq 0x465d0
testb $0x1, %al
jne 0x475d6
jmp 0x475d8
jmp 0x475f7
leaq 0x17163(%rip), %rdi     # 0x5e742
leaq 0x17164(%rip), %rsi     # 0x5e74a
movl $0x13b, %edx            # imm = 0x13B
leaq 0x17535(%rip), %rcx     # 0x5eb27
callq 0x6220
movb $0x1, 0x27(%rsp)
movb $0x0, 0x26(%rsp)
leaq 0x27(%rsp), %rdi
leaq 0x26(%rsp), %rsi
callq 0x47a30
movw %ax, 0x46(%rsp)
jmp 0x477c0
movq 0x10(%rsp), %rdi
addq $0x40, %rdi
movl $0x1, %esi
callq 0x465b0
movq 0x10(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x20(%rsp)
addq $0x20, %rdi
movl 0x20(%rsp), %eax
movl %eax, %esi
callq 0x46590
movq 0x10(%rsp), %rdi
movq (%rax), %rax
movq (%rax), %rsi
movq 0x30(%rsp), %rax
movq (%rax), %rdx
callq 0x47a60
testb $0x1, %al
jne 0x47668
jmp 0x477a2
movq 0x10(%rsp), %rax
movq %rax, %rdi
addq $0x40, %rdi
movl 0x38(%rax), %eax
movl %eax, %esi
callq 0x465b0
movq 0x10(%rsp), %rdi
movl (%rax), %eax
movl %eax, 0x4(%rsp)
addq $0x40, %rdi
movl $0x1, %esi
callq 0x465b0
movl 0x4(%rsp), %ecx
movq 0x10(%rsp), %rdi
movl %ecx, (%rax)
movq %rdi, %rax
addq $0x20, %rax
movq %rax, 0x8(%rsp)
addq $0x40, %rdi
movl $0x1, %esi
callq 0x465b0
movq 0x8(%rsp), %rdi
movl (%rax), %eax
movl %eax, %esi
callq 0x46590
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq (%rcx), %rcx
movl $0x1, 0x8(%rcx)
movl 0x38(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x38(%rax)
cmpl $0x0, 0x38(%rax)
jbe 0x476fa
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x47ac0
movq 0x10(%rsp), %rdi
movl 0x20(%rsp), %esi
callq 0x47e20
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x47716
jmp 0x47735
leaq 0x1756a(%rip), %rdi     # 0x5ec87
leaq 0x17026(%rip), %rsi     # 0x5e74a
movl $0x148, %edx            # imm = 0x148
leaq 0x173f7(%rip), %rcx     # 0x5eb27
callq 0x6220
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
movq (%rax), %rax
movq %rax, 0x10(%rcx)
movl 0x18(%rcx), %eax
cmpl 0x4(%rcx), %eax
jae 0x4774f
jmp 0x4776e
leaq 0x1753c(%rip), %rdi     # 0x5ec92
leaq 0x16fed(%rip), %rsi     # 0x5e74a
movl $0x14b, %edx            # imm = 0x14B
leaq 0x173be(%rip), %rcx     # 0x5eb27
callq 0x6220
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x47570
movw %ax, 0x1e(%rsp)
movb $0x1, 0x1d(%rsp)
movb $0x1, 0x1c(%rsp)
leaq 0x1d(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x47a30
movw %ax, 0x46(%rsp)
jmp 0x477c0
movb $0x0, 0x1b(%rsp)
movb $0x0, 0x1a(%rsp)
leaq 0x1b(%rsp), %rdi
leaq 0x1a(%rsp), %rsi
callq 0x47a30
movw %ax, 0x46(%rsp)
movw 0x46(%rsp), %ax
addq $0x48, %rsp
retq
nopw (%rax,%rax)