// 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*)>::_update(unsigned int, bal::avl_tree_insertion_point_t const&)
inline void _update(const container_offset_t offset, const insertion_point_t& insertion_point) {
            _assert_level_1(this->insertion_point_is_valid(insertion_point));
            this->insertion_point_invalidate();
            
            container_offset_t* const p_item = _bti_item(this->data_, offset);
            
            if (insertion_point.kind == btipkCurrent) {
                _assert_level_0(insertion_point.offset != CONTAINER_END);
                _assert_level_0(insertion_point.container_offset != CONTAINER_END);
                const container_offset_t* const p_original_item = _bti_item(this->data_, insertion_point.offset);
                _update_parent(insertion_point.offset, offset);
                _bti_item_right_offset(p_item) = _bti_item_right_offset(p_original_item);
                if (_bti_item_right_offset(p_item) != CONTAINER_END) {
                    _bti_parent_offset(this->data_, _bti_item_right_offset(p_item)) = offset;
                };
                _bti_item_left_offset(p_item) = _bti_item_left_offset(p_original_item);
                if (_bti_item_left_offset(p_item) != CONTAINER_END) {
                    _bti_parent_offset(this->data_, _bti_item_left_offset(p_item)) = offset;
                };
            } else if (insertion_point.kind == btipkRoot) {
                _assert_level_1(insertion_point.offset != CONTAINER_END);
                
                if (insertion_point.offset >= this->instances_.size_) {
                    this->instances_.append(CONTAINER_END, insertion_point.offset - this->instances_.size_ + 1);
                };
                container_offset_t* const p_offset = this->instances_.data_ + insertion_point.offset;
                _assert_level_1(*p_offset == CONTAINER_END);
                *p_offset = offset;
                _bti_item_parent_offset(p_item) = CONTAINER_END;
                _bti_item_right_offset(p_item) = CONTAINER_END;
                _bti_item_left_offset(p_item) = CONTAINER_END;
            } else {
                _assert_level_0(insertion_point.container_offset == CONTAINER_END);
                _assert_level_1(insertion_point.offset < this->size_);
                _bti_item_parent_offset(p_item) = insertion_point.offset;
                container_offset_t* const p_parent = _bti_item(this->data_, insertion_point.offset);
                if (insertion_point.kind == btipkLeft) {
                    _bti_item_right_offset(p_item) = CONTAINER_END;
                    _bti_item_left_offset(p_item) = _bti_item_left_offset(p_parent);
                    if (_bti_item_left_offset(p_item) != CONTAINER_END) {
                        _assert_level_2(_bti_parent_offset(this->data_, _bti_item_left_offset(p_item)) == _bti_item_parent_offset(p_item));
                        _bti_parent_offset(this->data_, _bti_item_left_offset(p_item)) = offset;
                    };
                    _bti_item_left_offset(p_parent) = offset;
                } else if (insertion_point.kind == btipkRight) {
                    _bti_item_left_offset(p_item) = CONTAINER_END;
                    _bti_item_right_offset(p_item) = _bti_item_right_offset(p_parent);
                    if (_bti_item_right_offset(p_item) != CONTAINER_END) {
                        _assert_level_2(_bti_parent_offset(this->data_, _bti_item_right_offset(p_item)) == _bti_item_parent_offset(p_item));
                        _bti_parent_offset(this->data_, _bti_item_right_offset(p_item)) = offset;
                    };
                    _bti_item_right_offset(p_parent) = offset;
                } else {
                    _assert_level_0(false);
                };
            };
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r14
movq (%rdi), %rax
movq %rdx, %rsi
callq *0x8(%rax)
testb %al, %al
je 0xfea3
movq %r14, %rdi
callq 0x100fc
movq 0x8(%r14), %r13
movl %r12d, %ebx
movl 0x8(%r15), %edx
testl %edx, %edx
je 0xfdb0
cmpl $0x3, %edx
jne 0xfe05
movl %r12d, -0x2c(%rbp)
movl 0xc(%r15), %r12d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r12
je 0xfec2
cmpl $-0x1, (%r15)
je 0xff1f
movq %r14, %rdi
movl %r12d, %esi
movl -0x2c(%rbp), %r15d
movl %r15d, %edx
callq 0x1012c
movl 0x4(%r13,%r12,4), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %ecx, 0x4(%r13,%rbx,4)
cmpq %rax, %rcx
je 0xfd8e
movq 0x8(%r14), %rdx
movl %r15d, (%rdx,%rcx,4)
movl 0x8(%r13,%r12,4), %ecx
movl %ecx, 0x8(%r13,%rbx,4)
cmpq %rax, %rcx
je 0xfe94
movq 0x8(%r14), %rax
movl -0x2c(%rbp), %edx
movl %edx, (%rax,%rcx,4)
jmp 0xfe94
movl %r12d, -0x2c(%rbp)
movl 0xc(%r15), %eax
cmpl $-0x1, %eax
je 0xfee1
leaq 0x30(%r14), %r12
movl %eax, %edx
subl 0x38(%r14), %edx
jb 0xfdde
incl %edx
pushq $-0x1
popq %rsi
movq %r12, %rdi
callq 0x10204
movl 0xc(%r15), %eax
movq (%r12), %rcx
movl %eax, %eax
cmpl $-0x1, (%rcx,%rax,4)
jne 0xff3e
movl -0x2c(%rbp), %edx
movl %edx, (%rcx,%rax,4)
orq $-0x1, (%r13,%rbx,4)
orl $-0x1, 0x8(%r13,%rbx,4)
jmp 0xfe94
cmpl $-0x1, (%r15)
jne 0xff00
movl 0xc(%r15), %ecx
cmpl 0x10(%r14), %ecx
jae 0xff5d
movl %ecx, (%r13,%rbx,4)
movl 0xc(%r15), %eax
cmpl $0x2, %edx
je 0xfe65
cmpl $0x1, %edx
jne 0xff7c
orl $-0x1, 0x4(%r13,%rbx,4)
movl 0x8(%r13,%rax,4), %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %edx, 0x8(%r13,%rbx,4)
cmpq %rsi, %rdx
je 0xfe5e
cmpl %ecx, (%r13,%rdx,4)
jne 0xff9b
movl %r12d, (%r13,%rdx,4)
movl %r12d, 0x8(%r13,%rax,4)
jmp 0xfe94
orl $-0x1, 0x8(%r13,%rbx,4)
movl 0x4(%r13,%rax,4), %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %edx, 0x4(%r13,%rbx,4)
cmpq %rsi, %rdx
je 0xfe8f
cmpl %ecx, (%r13,%rdx,4)
jne 0xffba
movl %r12d, (%r13,%rdx,4)
movl %r12d, 0x4(%r13,%rax,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x23853(%rip), %rdi     # 0x336fd
leaq 0x2387c(%rip), %rsi     # 0x3372d
leaq 0x23893(%rip), %rcx     # 0x3374b
movl $0xfd, %edx
callq 0xc180
leaq 0x239bc(%rip), %rdi     # 0x33885
leaq 0x2385d(%rip), %rsi     # 0x3372d
leaq 0x23874(%rip), %rcx     # 0x3374b
movl $0x103, %edx            # imm = 0x103
callq 0xc180
leaq 0x2399d(%rip), %rdi     # 0x33885
leaq 0x2383e(%rip), %rsi     # 0x3372d
leaq 0x23855(%rip), %rcx     # 0x3374b
movl $0x110, %edx            # imm = 0x110
callq 0xc180
leaq 0x239f3(%rip), %rdi     # 0x338fa
leaq 0x2381f(%rip), %rsi     # 0x3372d
leaq 0x23836(%rip), %rcx     # 0x3374b
movl $0x11c, %edx            # imm = 0x11C
callq 0xc180
leaq 0x23987(%rip), %rdi     # 0x338ad
leaq 0x23800(%rip), %rsi     # 0x3372d
leaq 0x23817(%rip), %rcx     # 0x3374b
movl $0x104, %edx            # imm = 0x104
callq 0xc180
leaq 0x2399a(%rip), %rdi     # 0x338df
leaq 0x237e1(%rip), %rsi     # 0x3372d
leaq 0x237f8(%rip), %rcx     # 0x3374b
movl $0x116, %edx            # imm = 0x116
callq 0xc180
leaq 0x239c8(%rip), %rdi     # 0x3392c
leaq 0x237c2(%rip), %rsi     # 0x3372d
leaq 0x237d9(%rip), %rcx     # 0x3374b
movl $0x11d, %edx            # imm = 0x11D
callq 0xc180
leaq 0x29e38(%rip), %rdi     # 0x39dbb
leaq 0x237a3(%rip), %rsi     # 0x3372d
leaq 0x237ba(%rip), %rcx     # 0x3374b
movl $0x131, %edx            # imm = 0x131
callq 0xc180
leaq 0x239af(%rip), %rdi     # 0x33951
leaq 0x23784(%rip), %rsi     # 0x3372d
leaq 0x2379b(%rip), %rcx     # 0x3374b
movl $0x124, %edx            # imm = 0x124
callq 0xc180
leaq 0x239ca(%rip), %rdi     # 0x3398b
leaq 0x23765(%rip), %rsi     # 0x3372d
leaq 0x2377c(%rip), %rcx     # 0x3374b
movl $0x12c, %edx            # imm = 0x12C
callq 0xc180
nop