// 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*)>::_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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
movq -0x18(%rbp), %rsi
movq (%rdi), %rax
callq *0x8(%rax)
testb $0x1, %al
jne 0x1525b
jmp 0x1525d
jmp 0x1527c
leaq 0x484ba(%rip), %rdi     # 0x5d71e
leaq 0x484e3(%rip), %rsi     # 0x5d74e
movl $0xfd, %edx
leaq 0x484f5(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movq -0x40(%rbp), %rdi
callq 0x158d0
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x3, 0x8(%rax)
jne 0x15386
movq -0x18(%rbp), %rax
cmpl $-0x1, 0xc(%rax)
je 0x152b5
jmp 0x152d4
leaq 0x485ea(%rip), %rdi     # 0x5d8a6
leaq 0x4848b(%rip), %rsi     # 0x5d74e
movl $0x103, %edx            # imm = 0x103
leaq 0x4849d(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movq -0x18(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x152df
jmp 0x152fe
leaq 0x485e8(%rip), %rdi     # 0x5d8ce
leaq 0x48461(%rip), %rsi     # 0x5d74e
movl $0x104, %edx            # imm = 0x104
leaq 0x48473(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movq -0x40(%rbp), %rdi
movq 0x8(%rdi), %rax
movq -0x18(%rbp), %rcx
movl 0xc(%rcx), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
movl -0xc(%rbp), %edx
callq 0x15920
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
je 0x15354
movq -0x40(%rbp), %rax
movl -0xc(%rbp), %edx
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
je 0x15381
movq -0x40(%rbp), %rax
movl -0xc(%rbp), %edx
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x15623
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x15463
movq -0x18(%rbp), %rax
cmpl $-0x1, 0xc(%rax)
je 0x153a0
jmp 0x153bf
leaq 0x484ff(%rip), %rdi     # 0x5d8a6
leaq 0x483a0(%rip), %rsi     # 0x5d74e
movl $0x110, %edx            # imm = 0x110
leaq 0x483b2(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
cmpl 0x38(%rcx), %eax
jb 0x153f1
movq -0x40(%rbp), %rax
movq %rax, %rdi
addq $0x30, %rdi
movq -0x18(%rbp), %rcx
movl 0xc(%rcx), %edx
subl 0x38(%rax), %edx
addl $0x1, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15a70
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0xc(%rcx), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0x15416
jmp 0x15435
leaq 0x484e3(%rip), %rdi     # 0x5d900
leaq 0x4832a(%rip), %rsi     # 0x5d74e
movl $0x116, %edx            # imm = 0x116
leaq 0x4833c(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movl -0xc(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
jmp 0x15621
movq -0x18(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0x1546e
jmp 0x1548d
leaq 0x484a6(%rip), %rdi     # 0x5d91b
leaq 0x482d2(%rip), %rsi     # 0x5d74e
movl $0x11c, %edx            # imm = 0x11C
leaq 0x482e4(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
cmpl 0x10(%rcx), %eax
jae 0x1549f
jmp 0x154be
leaq 0x484a7(%rip), %rdi     # 0x5d94d
leaq 0x482a1(%rip), %rsi     # 0x5d74e
movl $0x11d, %edx            # imm = 0x11D
leaq 0x482b3(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
movl 0xc(%rcx), %edx
movq -0x20(%rbp), %rcx
movl %edx, (%rcx)
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0xc(%rcx), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x15575
movq -0x20(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
je 0x15566
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x15532
jmp 0x15551
leaq 0x48439(%rip), %rdi     # 0x5d972
leaq 0x4820e(%rip), %rsi     # 0x5d74e
movl $0x124, %edx            # imm = 0x124
leaq 0x48220(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movq -0x40(%rbp), %rax
movl -0xc(%rbp), %edx
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x1561f
movq -0x18(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x155fe
movq -0x20(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x4(%rax)
je 0x155f2
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x155be
jmp 0x155dd
leaq 0x483e7(%rip), %rdi     # 0x5d9ac
leaq 0x48182(%rip), %rsi     # 0x5d74e
movl $0x12c, %edx            # imm = 0x12C
leaq 0x48194(%rip), %rcx     # 0x5d76c
callq 0xd1c0
movq -0x40(%rbp), %rax
movl -0xc(%rbp), %edx
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x1561d
leaq 0x4e862(%rip), %rdi     # 0x63e67
leaq 0x48142(%rip), %rsi     # 0x5d74e
movl $0x131, %edx            # imm = 0x131
leaq 0x48154(%rip), %rcx     # 0x5d76c
callq 0xd1c0
jmp 0x1561f
jmp 0x15621
jmp 0x15623
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)