// File: vsklad[P]cgen/./bal/bal/binarytreeindex.hpp
// Function: bal::AvlTreesIndex<unsigned int, true, &int bal::compare_clauses<false>(unsigned int const*, unsigned int const*), &unsigned int bal::clause_index_variable_id<false>(unsigned int const*)>::find(unsigned int const*, bal::avl_tree_insertion_point_t&) const
inline void find(const CONTAINER_DATA_T* const p_object, insertion_point_t &insertion_point) const {
            this->insertion_point_init(insertion_point);
            insertion_point.container_offset = CONTAINER_END;
            // take the root element from the instance
            const container_offset_t instance_offset = instance_determiner(p_object);
            container_offset_t offset = instance_offset < this->instances_.size_ ?
                                            this->instances_.data_[instance_offset] : CONTAINER_END;
            if (offset != CONTAINER_END) {
                while (true) {
                    const container_offset_t* const p_item = _bti_item(this->data_, offset);
                    int result = comparator(p_object, _bti_item_container_item(p_item));
                    if (result > 0) {
                        if (_bti_item_right_offset(p_item) == CONTAINER_END) {
                            insertion_point.kind = btipkRight;
                            insertion_point.offset = offset;
                            return;
                        };
                        offset = _bti_item_right_offset(p_item);
                    } else if (result < 0) {
                        if (_bti_item_left_offset(p_item) == CONTAINER_END) {
                            insertion_point.kind = btipkLeft;
                            insertion_point.offset = offset;
                            return;
                        };
                        offset = _bti_item_left_offset(p_item);
                    } else {
                        insertion_point.kind = btipkCurrent;
                        insertion_point.offset = offset;
                        insertion_point.container_offset = _bti_item_container_offset(p_item, offset);
                        return;
                    };
                };
            } else {
                insertion_point.kind = btipkRoot;
                insertion_point.offset = instance_offset;
            };
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq -0x18(%rbp), %rsi
callq 0x15780
movq -0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
callq 0x157a0
movq -0x38(%rbp), %rcx
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x38(%rcx), %eax
jae 0x1568a
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
jmp 0x15694
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x3c(%rbp)
jmp 0x15694
movl -0x3c(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $-0x1, -0x20(%rbp)
je 0x1575d
jmp 0x156a6
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x20(%rbp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0xc, %rsi
callq 0x157d0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x15703
movq -0x28(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
jne 0x156f7
movq -0x18(%rbp), %rax
movl $0x2, 0x8(%rax)
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x15772
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x20(%rbp)
jmp 0x15758
cmpl $0x0, -0x2c(%rbp)
jge 0x15736
movq -0x28(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
jne 0x1572a
movq -0x18(%rbp), %rax
movl $0x1, 0x8(%rax)
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x15772
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x20(%rbp)
jmp 0x15756
movq -0x18(%rbp), %rax
movl $0x3, 0x8(%rax)
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x15772
jmp 0x15758
jmp 0x156a6
movq -0x18(%rbp), %rax
movl $0x0, 0x8(%rax)
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)