// File: vsklad[P]cgen/./bal/bal/linkedlistindex.hpp
// Function: bal::SimpleLinkedListsIndex<unsigned int>::append(unsigned int, unsigned int)
inline void append(const container_size_t instance_offset, const container_size_t container_offset) {
            if (instance_offset >= this->instances_.size_) {
                this->instances_.append(CONTAINER_END, instance_offset - this->instances_.size_ + 1);
                this->instances_last_.append(CONTAINER_END, instance_offset - instances_last_.size_ + 1);
            };
            
            this->reserve(1); // size_ is the valid offset for the new item
            this->data_[this->size_] = { CONTAINER_END, container_offset };
            if (this->instances_.data_[instance_offset] == CONTAINER_END) {
                // the instance list is empty
                assert(instances_last_.data_[instance_offset] == CONTAINER_END);
                this->instances_.data_[instance_offset] = this->size_;
            } else {
                // after the last item
                assert(instances_last_.data_[instance_offset] != CONTAINER_END);
                this->data_[instances_last_.data_[instance_offset]].next_offset = this->size_;
            }
            instances_last_.data_[instance_offset] = this->size_;
            this->size_++;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x38(%rcx), %eax
jb 0x1ac6e
movq -0x20(%rbp), %rax
movq %rax, %rdi
addq $0x30, %rdi
movl -0xc(%rbp), %edx
subl 0x38(%rax), %edx
addl $0x1, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15a70
movq -0x20(%rbp), %rax
movq %rax, %rdi
addq $0x60, %rdi
movl -0xc(%rbp), %edx
subl 0x68(%rax), %edx
addl $0x1, %edx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x15a70
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f1f0
movq -0x20(%rbp), %rax
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl -0x10(%rbp), %ecx
movl %ecx, -0x14(%rbp)
movq 0x8(%rax), %rcx
movl 0x10(%rax), %edx
movq -0x18(%rbp), %rsi
movq %rsi, (%rcx,%rdx,8)
movq 0x30(%rax), %rax
movl -0xc(%rbp), %ecx
cmpl $-0x1, (%rax,%rcx,4)
jne 0x1acf2
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movl -0xc(%rbp), %ecx
cmpl $-0x1, (%rax,%rcx,4)
jne 0x1acc0
jmp 0x1acdf
leaq 0x45929(%rip), %rdi     # 0x605f0
leaq 0x4595a(%rip), %rsi     # 0x60628
movl $0xb9, %edx
leaq 0x4596c(%rip), %rcx     # 0x60646
callq 0xd1c0
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
movq 0x30(%rax), %rax
movl -0xc(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x1ad3c
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movl -0xc(%rbp), %ecx
cmpl $-0x1, (%rax,%rcx,4)
je 0x1ad05
jmp 0x1ad24
leaq 0x459c3(%rip), %rdi     # 0x606cf
leaq 0x45915(%rip), %rsi     # 0x60628
movl $0xbd, %edx
leaq 0x45927(%rip), %rcx     # 0x60646
callq 0xd1c0
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %edx
movq 0x8(%rcx), %rax
movq 0x60(%rcx), %rcx
movl -0xc(%rbp), %esi
movl (%rcx,%rsi,4), %ecx
movl %edx, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %esi
movq 0x60(%rax), %rcx
movl -0xc(%rbp), %edx
movl %esi, (%rcx,%rdx,4)
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)