// File: /workspace/github_cpp_makefile_star2_O1/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 container_offset, const insertion_point_t& insertion_point) {
            const container_offset_t offset = contains_data_itself ? container_offset : _find_container_offset(container_offset);
            _assert_level_0(offset != CONTAINER_END);
            container_offset_t* const p_item = _bti_item(this->data_, offset);
            
            if (insertion_point.kind == btipkCurrent) {
                if (insertion_point.offset == _bti_item_left_offset(p_item)) {
                    _merge_or_swap_child<true, true>(offset);
                    return;
                };
                if (insertion_point.offset == _bti_item_right_offset(p_item)) {
                    _merge_or_swap_child<true, false>(offset);
                    return;
                };
            } else if (insertion_point.kind == btipkLeft) {
                if (insertion_point.offset == offset) {
                    // inserting a child of the item to be removed - simple replacement, nothing to do
                    _assert_level_1(_bti_item_left_offset(p_item) == CONTAINER_END);
                    return;
                };
                if (insertion_point.offset == _bti_item_left_offset(p_item)) {
                    _merge_or_swap_child<false, true, true>(offset);
                    return;
                };
                if (insertion_point.offset == _bti_item_right_offset(p_item)) {
                    _merge_or_swap_child<false, false, true>(offset);
                    return;
                };
            } else if (insertion_point.kind == btipkRight) {
                if (insertion_point.offset == offset) {
                    // inserting a child of the item to be removed - simple replacement, nothing to do
                    _assert_level_1(_bti_item_right_offset(p_item) == CONTAINER_END);
                    return;
                };
                if (insertion_point.offset == _bti_item_left_offset(p_item)) {
                    _merge_or_swap_child<false, true, false>(offset);
                    return;
                };
                if (insertion_point.offset == _bti_item_right_offset(p_item)) {
                    _merge_or_swap_child<false, false, false>(offset);
                    return;
                };
            };
                
            // check inserting instead of the item to be removed - no changes - should never happen
            _assert_level_2(insertion_point.kind != btipkCurrent || insertion_point.offset != offset);
            _assert_level_2(insertion_point.kind != btipkRoot ||
                            insertion_point.offset >= this->instances_.size_ ||
                            this->instances_.data_[insertion_point.offset] != offset);
            
            // cannot append to the deleted item
            _assert_level_0(insertion_point.kind == btipkRoot || insertion_point.offset != offset);
            _assert_level_0(insertion_point.kind != btipkRoot || insertion_point.offset != this->instances_.data_[insertion_point.offset]);
            
            _remove(offset);
            _update(offset, insertion_point);
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $-0x1, %esi
je 0x16c77
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdi), %rax
movl %esi, %ecx
movl 0x8(%rdx), %esi
cmpl $0x1, %esi
je 0x16aeb
cmpl $0x2, %esi
je 0x16ab9
cmpl $0x3, %esi
jne 0x16c0a
movl 0xc(%r15), %r8d
movl 0x8(%rax,%rcx,4), %edx
cmpl %edx, %r8d
jne 0x16b59
cmpl $-0x1, %edx
je 0x16d12
movl 0x4(%rax,%rcx,4), %esi
movl 0x8(%rax,%rdx,4), %r8d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %r8d, 0x8(%rax,%rcx,4)
cmpq %rdi, %r8
je 0x16a71
cmpl %edx, (%rax,%r8,4)
jne 0x16d29
movl %ebx, (%rax,%r8,4)
movl 0x4(%rax,%rdx,4), %r8d
movl %r8d, 0x4(%rax,%rcx,4)
cmpq %rdi, %r8
je 0x16a8e
cmpl %edx, (%rax,%r8,4)
jne 0x16d40
movl %ebx, (%rax,%r8,4)
cmpl $-0x1, %esi
je 0x16bcb
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %ebx, %edi
movq %rcx, %r8
movl 0x4(%rax,%rcx,4), %ecx
movl %ecx, %ebx
cmpq %rdx, %rcx
jne 0x16a9c
movl %esi, 0x4(%rax,%r8,4)
movl %edi, (%rax,%rsi,4)
jmp 0x16bcb
movl 0xc(%r15), %edx
cmpl %ebx, %edx
jne 0x16b1f
cmpl $-0x1, 0x4(%rax,%rcx,4)
je 0x16bcb
leaq 0x2edbb(%rip), %rdi     # 0x4588e
leaq 0x2cc63(%rip), %rsi     # 0x4373d
leaq 0x2ec51(%rip), %rcx     # 0x45732
movl $0x16d, %edx            # imm = 0x16D
callq 0xc180
movl 0xc(%r15), %edx
movl 0x8(%rax,%rcx,4), %edi
cmpl %ebx, %edx
jne 0x16b3d
cmpl $-0x1, %edi
je 0x16bcb
leaq 0x2ed64(%rip), %rdi     # 0x4586b
leaq 0x2cc2f(%rip), %rsi     # 0x4373d
leaq 0x2ec1d(%rip), %rcx     # 0x45732
movl $0x15f, %edx            # imm = 0x15F
callq 0xc180
cmpl 0x8(%rax,%rcx,4), %edx
jne 0x16bd6
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1857c
cmpl %edi, %edx
jne 0x16bf0
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1829c
movl 0x4(%rax,%rcx,4), %edi
cmpl %edi, %r8d
jne 0x16c0a
cmpl $-0x1, %edi
je 0x16d57
movl 0x8(%rax,%rdi,4), %r8d
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %r8d, 0x8(%rax,%rcx,4)
cmpq %rsi, %r8
je 0x16b91
cmpl %edi, (%rax,%r8,4)
jne 0x16d76
movl %ebx, (%rax,%r8,4)
movl 0x4(%rax,%rdi,4), %r8d
movl %r8d, 0x4(%rax,%rcx,4)
cmpq %rsi, %r8
je 0x16bae
cmpl %edi, (%rax,%r8,4)
jne 0x16d95
movl %ebx, (%rax,%r8,4)
cmpl $-0x1, %edx
je 0x16bcb
movl %ebx, %edi
movq %rcx, %r8
movl 0x8(%rax,%rcx,4), %ecx
movl %ecx, %ebx
cmpq %rsi, %rcx
jne 0x16bb3
movl %edx, 0x8(%rax,%r8,4)
movl %edi, (%rax,%rdx,4)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl 0x4(%rax,%rcx,4), %edx
jne 0x16c0a
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x186ec
cmpl 0x4(%rax,%rcx,4), %edx
jne 0x16c0a
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1840c
movl %esi, %ecx
xorl $0x3, %ecx
movl 0xc(%r15), %eax
movl %eax, %edx
xorl %ebx, %edx
orl %ecx, %edx
je 0x16c96
movl %eax, %eax
testl %esi, %esi
jne 0x16c34
cmpl 0x38(%r14), %eax
jae 0x16c34
movq 0x30(%r14), %rcx
cmpl %ebx, (%rcx,%rax,4)
je 0x16cd4
cmpl %ebx, %eax
sete %cl
testl %esi, %esi
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x16cb5
testl %esi, %esi
jne 0x16c56
movq 0x30(%r14), %rcx
cmpl (%rcx,%rax,4), %eax
je 0x16cf3
movq %r14, %rdi
movl %ebx, %esi
callq 0x1885c
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x11cb8
leaq 0x2cc27(%rip), %rdi     # 0x438a5
leaq 0x2cab8(%rip), %rsi     # 0x4373d
leaq 0x2eaa6(%rip), %rcx     # 0x45732
movl $0x150, %edx            # imm = 0x150
callq 0xc180
leaq 0x2ec14(%rip), %rdi     # 0x458b1
leaq 0x2ca99(%rip), %rsi     # 0x4373d
leaq 0x2ea87(%rip), %rcx     # 0x45732
movl $0x17b, %edx            # imm = 0x17B
callq 0xc180
leaq 0x2ecd0(%rip), %rdi     # 0x4598c
leaq 0x2ca7a(%rip), %rsi     # 0x4373d
leaq 0x2ea68(%rip), %rcx     # 0x45732
movl $0x181, %edx            # imm = 0x181
callq 0xc180
leaq 0x2ec1f(%rip), %rdi     # 0x458fa
leaq 0x2ca5b(%rip), %rsi     # 0x4373d
leaq 0x2ea49(%rip), %rcx     # 0x45732
movl $0x17e, %edx            # imm = 0x17E
callq 0xc180
leaq 0x2ecd8(%rip), %rdi     # 0x459d2
leaq 0x2ca3c(%rip), %rsi     # 0x4373d
leaq 0x2ea2a(%rip), %rcx     # 0x45732
movl $0x182, %edx            # imm = 0x182
callq 0xc180
leaq 0x2ed27(%rip), %rdi     # 0x45a40
leaq 0x2ca1d(%rip), %rsi     # 0x4373d
leaq 0x2ed37(%rip), %rcx     # 0x45a5e
jmp 0x16d6c
leaq 0x2ee95(%rip), %rdi     # 0x45bc5
leaq 0x2ca06(%rip), %rsi     # 0x4373d
leaq 0x2ed20(%rip), %rcx     # 0x45a5e
jmp 0x16d8b
leaq 0x2eeb9(%rip), %rdi     # 0x45c00
leaq 0x2c9ef(%rip), %rsi     # 0x4373d
leaq 0x2ed09(%rip), %rcx     # 0x45a5e
jmp 0x16daa
leaq 0x2ece2(%rip), %rdi     # 0x45a40
leaq 0x2c9d8(%rip), %rsi     # 0x4373d
leaq 0x2eecf(%rip), %rcx     # 0x45c3b
movl $0xd2, %edx
callq 0xc180
leaq 0x2ee48(%rip), %rdi     # 0x45bc5
leaq 0x2c9b9(%rip), %rsi     # 0x4373d
leaq 0x2eeb0(%rip), %rcx     # 0x45c3b
movl $0xd9, %edx
callq 0xc180
leaq 0x2ee64(%rip), %rdi     # 0x45c00
leaq 0x2c99a(%rip), %rsi     # 0x4373d
leaq 0x2ee91(%rip), %rcx     # 0x45c3b
movl $0xde, %edx
callq 0xc180