// File: vsklad[P]cgen/./bal/bal/binarytreeindex.hpp
// Function: bal::BinaryTreesIndexInstanceOffsetIterator<unsigned int, bal::avl_tree_insertion_point_t, true>::next()
inline container_offset_t next() {
            if (item_offset_ != CONTAINER_END) {
                if (_bti_right_offset(index_.data_, item_offset_) != CONTAINER_END) {
                    // there is a right element - move one right then the deepest leftmost element
                    item_offset_ = _bti_right_offset(index_.data_, item_offset_);
                    while (item_offset_ != CONTAINER_END && _bti_left_offset(index_.data_, item_offset_) != CONTAINER_END) {
                        item_offset_ = _bti_left_offset(index_.data_, item_offset_);
                    };
                } else {
                    // no right element, move up as long as we come from right
                    // if coming from right and reached the root - its the end
                    while (item_offset_ != CONTAINER_END) {
                        container_offset_t parent_offset = _bti_parent_offset(index_.data_, item_offset_);
                        if (parent_offset != CONTAINER_END && _bti_right_offset(index_.data_, parent_offset) == item_offset_) {
                            item_offset_ = parent_offset;
                        } else {
                            item_offset_ = parent_offset;
                            break;
                        };
                    };
                };
            };
            return item_offset_ == CONTAINER_END ? CONTAINER_END : _bti_container_offset(index_.data_, item_offset_);
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $-0x1, 0xc(%rax)
je 0x19529
movq -0x18(%rbp), %rcx
movq (%rcx), %rax
movq 0x8(%rax), %rax
movl 0xc(%rcx), %ecx
cmpl $-0x1, 0x4(%rax,%rcx,4)
je 0x194ce
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rcx), %rcx
movl 0xc(%rax), %edx
movl 0x4(%rcx,%rdx,4), %ecx
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpl $-0x1, 0xc(%rcx)
movb %al, -0x19(%rbp)
je 0x194ac
movq -0x18(%rbp), %rcx
movq (%rcx), %rax
movq 0x8(%rax), %rax
movl 0xc(%rcx), %ecx
cmpl $-0x1, 0x8(%rax,%rcx,4)
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x194b5
jmp 0x194cc
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq 0x8(%rcx), %rcx
movl 0xc(%rax), %edx
movl 0x8(%rcx,%rdx,4), %ecx
movl %ecx, 0xc(%rax)
jmp 0x19484
jmp 0x19527
jmp 0x194d0
movq -0x18(%rbp), %rax
cmpl $-0x1, 0xc(%rax)
je 0x19525
movq -0x18(%rbp), %rcx
movq (%rcx), %rax
movq 0x8(%rax), %rax
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
je 0x19517
movq -0x18(%rbp), %rcx
movq (%rcx), %rax
movq 0x8(%rax), %rax
movl -0xc(%rbp), %edx
movl 0x4(%rax,%rdx,4), %eax
cmpl 0xc(%rcx), %eax
jne 0x19517
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x19523
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x19525
jmp 0x194d0
jmp 0x19527
jmp 0x19529
movq -0x18(%rbp), %rax
cmpl $-0x1, 0xc(%rax)
jne 0x1953d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x20(%rbp)
jmp 0x19547
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
popq %rbp
retq
nopl (%rax)