// File: /workspace/github_cpp_makefile_star2_O3/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 0x1581c
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdi), %rax
movl %esi, %ecx
movl 0x8(%rdx), %edx
cmpl $0x1, %edx
je 0x15643
cmpl $0x2, %edx
je 0x1560d
cmpl $0x3, %edx
jne 0x15677
movl 0xc(%r15), %edx
movl 0x8(%rax,%rcx,4), %esi
cmpl %esi, %edx
jne 0x156dd
cmpl $-0x1, %edx
je 0x1585a
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 0x155c8
cmpl %edx, (%rax,%r8,4)
jne 0x15890
movl %ebx, (%rax,%r8,4)
movl 0x4(%rax,%rdx,4), %r8d
movl %r8d, 0x4(%rax,%rcx,4)
cmpq %rdi, %r8
je 0x155e5
cmpl %edx, (%rax,%r8,4)
jne 0x158a7
movl %ebx, (%rax,%r8,4)
cmpl $-0x1, %esi
je 0x15751
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %ebx, %edi
movq %rcx, %r8
movl 0x4(%rax,%rcx,4), %ecx
movl %ecx, %ebx
cmpq %rdx, %rcx
jne 0x155f3
movl %esi, 0x4(%rax,%r8,4)
jmp 0x1574e
movl 0xc(%r15), %edx
cmpl %ebx, %edx
jne 0x156a3
cmpl $-0x1, 0x4(%rax,%rcx,4)
je 0x15751
leaq 0x2e273(%rip), %rdi     # 0x4389e
leaq 0x2c0fb(%rip), %rsi     # 0x4172d
leaq 0x2e109(%rip), %rcx     # 0x43742
movl $0x16d, %edx            # imm = 0x16D
callq 0xb180
movl 0xc(%r15), %edx
movl 0x8(%rax,%rcx,4), %esi
cmpl %ebx, %edx
jne 0x156c1
cmpl $-0x1, %esi
je 0x15751
leaq 0x2e21c(%rip), %rdi     # 0x4387b
leaq 0x2c0c7(%rip), %rsi     # 0x4172d
leaq 0x2e0d5(%rip), %rcx     # 0x43742
movl $0x15f, %edx            # imm = 0x15F
callq 0xb180
movl %edx, %ecx
xorl $0x3, %ecx
movl 0xc(%r15), %eax
movl %eax, %esi
xorl %ebx, %esi
orl %ecx, %esi
je 0x1583b
movl %eax, %eax
testl %edx, %edx
je 0x1575c
cmpl %ebx, %eax
jne 0x157fb
jmp 0x157d8
cmpl 0x8(%rax,%rcx,4), %edx
jne 0x157a0
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x17014
cmpl %esi, %edx
jne 0x157ba
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x16d34
cmpl 0x4(%rax,%rcx,4), %edx
jne 0x157f7
cmpl $-0x1, %edx
je 0x158be
movl 0x8(%rax,%rdx,4), %r8d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %r8d, 0x8(%rax,%rcx,4)
cmpq %rdi, %r8
je 0x15712
cmpl %edx, (%rax,%r8,4)
jne 0x158dd
movl %ebx, (%rax,%r8,4)
movl 0x4(%rax,%rdx,4), %r8d
movl %r8d, 0x4(%rax,%rcx,4)
cmpq %rdi, %r8
je 0x1572f
cmpl %edx, (%rax,%r8,4)
jne 0x158fc
movl %ebx, (%rax,%r8,4)
cmpl $-0x1, %esi
je 0x15751
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %ebx, %edi
movq %rcx, %r8
movl 0x8(%rax,%rcx,4), %ecx
movl %ecx, %ebx
cmpq %rdx, %rcx
jne 0x15739
movl %esi, 0x8(%rax,%r8,4)
movl %edi, (%rax,%rsi,4)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl 0x38(%r14), %eax
setb %dl
movq 0x30(%r14), %rcx
movl (%rcx,%rax,4), %ecx
cmpl %ebx, %ecx
sete %sil
andb %dl, %sil
cmpb $0x1, %sil
je 0x15871
cmpl %ecx, %eax
jne 0x157fb
leaq 0x2e25a(%rip), %rdi     # 0x439e2
leaq 0x2bf9e(%rip), %rsi     # 0x4172d
leaq 0x2dfac(%rip), %rcx     # 0x43742
movl $0x182, %edx            # imm = 0x182
callq 0xb180
cmpl 0x4(%rax,%rcx,4), %edx
jne 0x157d4
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x17184
cmpl 0x4(%rax,%rcx,4), %edx
jne 0x157d4
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x16ea4
cmpl %ebx, %edx
jne 0x157fb
leaq 0x2e1bd(%rip), %rdi     # 0x4399c
leaq 0x2bf47(%rip), %rsi     # 0x4172d
leaq 0x2df55(%rip), %rcx     # 0x43742
movl $0x181, %edx            # imm = 0x181
callq 0xb180
cmpl %ebx, %edx
je 0x1583b
movq %r14, %rdi
movl %ebx, %esi
callq 0x172f4
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10908
leaq 0x2c072(%rip), %rdi     # 0x41895
leaq 0x2bf03(%rip), %rsi     # 0x4172d
leaq 0x2df11(%rip), %rcx     # 0x43742
movl $0x150, %edx            # imm = 0x150
callq 0xb180
leaq 0x2e07f(%rip), %rdi     # 0x438c1
leaq 0x2bee4(%rip), %rsi     # 0x4172d
leaq 0x2def2(%rip), %rcx     # 0x43742
movl $0x17b, %edx            # imm = 0x17B
callq 0xb180
leaq 0x2e1ef(%rip), %rdi     # 0x43a50
leaq 0x2bec5(%rip), %rsi     # 0x4172d
leaq 0x2e1ff(%rip), %rcx     # 0x43a6e
jmp 0x158d3
leaq 0x2e092(%rip), %rdi     # 0x4390a
leaq 0x2beae(%rip), %rsi     # 0x4172d
leaq 0x2debc(%rip), %rcx     # 0x43742
movl $0x17e, %edx            # imm = 0x17E
callq 0xb180
leaq 0x2e33e(%rip), %rdi     # 0x43bd5
leaq 0x2be8f(%rip), %rsi     # 0x4172d
leaq 0x2e1c9(%rip), %rcx     # 0x43a6e
jmp 0x158f2
leaq 0x2e362(%rip), %rdi     # 0x43c10
leaq 0x2be78(%rip), %rsi     # 0x4172d
leaq 0x2e1b2(%rip), %rcx     # 0x43a6e
jmp 0x15911
leaq 0x2e18b(%rip), %rdi     # 0x43a50
leaq 0x2be61(%rip), %rsi     # 0x4172d
leaq 0x2e378(%rip), %rcx     # 0x43c4b
movl $0xd2, %edx
callq 0xb180
leaq 0x2e2f1(%rip), %rdi     # 0x43bd5
leaq 0x2be42(%rip), %rsi     # 0x4172d
leaq 0x2e359(%rip), %rcx     # 0x43c4b
movl $0xd9, %edx
callq 0xb180
leaq 0x2e30d(%rip), %rdi     # 0x43c10
leaq 0x2be23(%rip), %rsi     # 0x4172d
leaq 0x2e33a(%rip), %rcx     # 0x43c4b
movl $0xde, %edx
callq 0xb180
nop