// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl 0x5c(%rdi), %eax
movl %eax, 0x4(%rdx)
orl $-0x1, (%rdx)
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rsi), %eax
decl %eax
movl 0x4(%rsi,%rax,4), %eax
shrl %eax
decl %eax
cmpl 0x38(%rdi), %eax
jae 0x1005e
movq %rdi, %r15
movq 0x30(%rdi), %rcx
movl %eax, %edx
movl (%rcx,%rdx,4), %ecx
cmpl $-0x1, %ecx
je 0x1005e
movq %rsi, %r14
movl %ecx, %r12d
movq 0x8(%r15), %rax
movl %ecx, %ecx
leaq (%rax,%rcx,4), %r13
leaq (%rax,%rcx,4), %rsi
addq $0xc, %rsi
movq %r14, %rdi
callq 0x10091
testl %eax, %eax
jle 0x1004a
movl 0x4(%r13), %ecx
cmpl $-0x1, %ecx
jne 0x1001e
jmp 0x10067
jns 0x10074
movl 0x8(%r13), %ecx
cmpl $-0x1, %ecx
jne 0x1001e
movl $0x1, 0x8(%rbx)
jmp 0x1006e
andl $0x0, 0x8(%rbx)
movl %eax, 0xc(%rbx)
jmp 0x10082
movl $0x2, 0x8(%rbx)
movl %r12d, 0xc(%rbx)
jmp 0x10082
movl $0x3, 0x8(%rbx)
movl %r12d, 0xc(%rbx)
movl %r12d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq