// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./CImg.h
// Function: cimg_library::CImgList<char>::insert(cimg_library::CImg<char> const&, unsigned int, bool)
CImgList<T>& insert(const CImg<T>& img, const unsigned int pos=~0U, const bool is_shared=false) {
      const unsigned int npos = pos==~0U?_width:pos;
      if (npos>_width)
        throw CImgArgumentException(_cimglist_instance
                                    "insert(): Invalid insertion request of specified image (%u,%u,%u,%u,%p) at position %u.",
                                    cimglist_instance,
                                    img._width,img._height,img._depth,img._spectrum,img._data,npos);
      CImg<T> *const new_data = (++_width>_allocated_width)?new CImg<T>[_allocated_width?(_allocated_width<<=1):(_allocated_width=16)]:0;
      if (!_data) { // Insert new element into empty list.
        _data = new_data;
        if (is_shared && img) {
          _data->_width = img._width; _data->_height = img._height; _data->_depth = img._depth; _data->_spectrum = img._spectrum;
          _data->_is_shared = true; _data->_data = img._data;
        } else *_data = img;
      }
      else {
        if (new_data) { // Insert with re-allocation.
          if (npos) std::memcpy(new_data,_data,sizeof(CImg<T>)*npos);
          if (npos!=_width-1) std::memcpy(new_data+npos+1,_data+npos,sizeof(CImg<T>)*(_width-1-npos));
          if (is_shared && img) {
            new_data[npos]._width = img._width; new_data[npos]._height = img._height; new_data[npos]._depth = img._depth;
            new_data[npos]._spectrum = img._spectrum; new_data[npos]._is_shared = true; new_data[npos]._data = img._data;
          } else {
            new_data[npos]._width = new_data[npos]._height = new_data[npos]._depth = new_data[npos]._spectrum = 0; new_data[npos]._data = 0;
            new_data[npos] = img;
          }
          std::memset(_data,0,sizeof(CImg<T>)*(_width-1));
          delete[] _data;
          _data = new_data;
        } else { // Insert without re-allocation.
          if (npos!=_width-1) std::memmove(_data+npos+1,_data+npos,sizeof(CImg<T>)*(_width-1-npos));
          if (is_shared && img) {
            _data[npos]._width = img._width; _data[npos]._height = img._height; _data[npos]._depth = img._depth; _data[npos]._spectrum = img._spectrum;
            _data[npos]._is_shared = true; _data[npos]._data = img._data;
          } else {
            _data[npos]._width = _data[npos]._height = _data[npos]._depth = _data[npos]._spectrum = 0; _data[npos]._data = 0;
            _data[npos] = img;
          }
        }
      }
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r12d
movq %rsi, %rbp
movq %rdi, %rbx
cmpl $-0x1, %edx
movl (%rdi), %r13d
cmovel %r13d, %r12d
cmpl %r12d, %r13d
jb 0x18ada
movl %ecx, %r14d
leal 0x1(%r13), %ecx
movl %ecx, (%rbx)
movl 0x4(%rbx), %eax
cmpl %eax, %ecx
movq %rbp, 0x10(%rsp)
jbe 0x18882
movl %r14d, 0xc(%rsp)
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %ebp
cmovnel %ecx, %ebp
movl %ebp, 0x4(%rbx)
movq %rbp, %r14
shlq $0x5, %r14
leaq 0x8(%r14), %rdi
callq 0x3040
movq %rbp, (%rax)
leaq 0x8(%rax), %r15
testl %ebp, %ebp
je 0x1887b
addq $0x20, %rax
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movq $0x0, (%rax,%rcx)
movups %xmm0, -0x18(%rax,%rcx)
movb $0x0, -0x8(%rax,%rcx)
addq $0x20, %rcx
cmpq %rcx, %r14
jne 0x18860
movl 0xc(%rsp), %r14d
jmp 0x18885
xorl %r15d, %r15d
movq 0x8(%rbx), %rbp
testq %rbp, %rbp
je 0x1892c
testq %r15, %r15
je 0x18a25
movl %r14d, 0xc(%rsp)
movl %r12d, %r14d
testl %r12d, %r12d
je 0x188ba
movq %r14, %rdx
shlq $0x5, %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3220
subl %r12d, %r13d
je 0x188e0
movq %r14, %rax
shlq $0x5, %rax
leaq (%r15,%rax), %rdi
addq $0x20, %rdi
addq %rax, %rbp
shlq $0x5, %r13
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3220
cmpb $0x0, 0xc(%rsp)
movq 0x10(%rsp), %r9
je 0x18973
movq 0x18(%r9), %rax
testq %rax, %rax
je 0x18973
movl (%r9), %ecx
shlq $0x5, %r14
movl %ecx, (%r15,%r14)
movl 0x4(%r9), %ecx
movl %ecx, 0x4(%r15,%r14)
movl 0x8(%r9), %ecx
movl %ecx, 0x8(%r15,%r14)
movl 0xc(%r9), %ecx
movl %ecx, 0xc(%r15,%r14)
movb $0x1, 0x10(%r15,%r14)
movq %rax, 0x18(%r15,%r14)
jmp 0x189a4
movq %r15, 0x8(%rbx)
testb %r14b, %r14b
movq 0x10(%rsp), %rdi
je 0x18a0c
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x18a0c
movl (%rdi), %ecx
movl %ecx, (%r15)
movl 0x4(%rdi), %ecx
movl %ecx, 0x4(%r15)
movl 0x8(%rdi), %ecx
movl %ecx, 0x8(%r15)
movl 0xc(%rdi), %ecx
movl %ecx, 0xc(%r15)
movb $0x1, 0x10(%r15)
movq %rax, 0x18(%r15)
jmp 0x18ac8
shlq $0x5, %r14
leaq (%r15,%r14), %rdi
movq $0x0, 0x18(%r15,%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r15,%r14)
movq 0x18(%r9), %rsi
movl (%r9), %edx
movl 0x4(%r9), %ecx
movl 0x8(%r9), %r8d
movl 0xc(%r9), %r9d
callq 0x18b50
movq 0x8(%rbx), %rdi
movl (%rbx), %edx
decl %edx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x3150
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x18a03
movq -0x8(%r14), %r12
addq $-0x8, %r14
testq %r12, %r12
je 0x189f0
movq %r12, %r13
shlq $0x5, %r13
cmpb $0x0, -0x8(%r14,%r13)
jne 0x189ea
movq (%r14,%r13), %rdi
testq %rdi, %rdi
je 0x189ea
callq 0x3380
addq $-0x20, %r13
jne 0x189d4
shlq $0x5, %r12
orq $0x8, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3540
movq %r15, 0x8(%rbx)
jmp 0x18ac8
movq 0x18(%rdi), %rsi
movl (%rdi), %edx
movl 0x4(%rdi), %ecx
movl 0x8(%rdi), %r8d
movl 0xc(%rdi), %r9d
movq %r15, %rdi
jmp 0x18ac3
subl %r12d, %r13d
je 0x18a49
movl %r12d, %eax
shlq $0x5, %rax
leaq (%rax,%rbp), %rsi
leaq (%rax,%rbp), %rdi
addq $0x20, %rdi
shlq $0x5, %r13
movq %r13, %rdx
callq 0x3490
testb %r14b, %r14b
movq 0x10(%rsp), %r9
je 0x18a91
movq 0x18(%r9), %rax
testq %rax, %rax
je 0x18a91
movl (%r9), %ecx
movq 0x8(%rbx), %rdx
movl %r12d, %esi
shlq $0x5, %rsi
movl %ecx, (%rdx,%rsi)
movl 0x4(%r9), %ecx
movl %ecx, 0x4(%rdx,%rsi)
movl 0x8(%r9), %ecx
movl %ecx, 0x8(%rdx,%rsi)
movl 0xc(%r9), %ecx
movl %ecx, 0xc(%rdx,%rsi)
movb $0x1, 0x10(%rdx,%rsi)
movq %rax, 0x18(%rdx,%rsi)
jmp 0x18ac8
movq 0x8(%rbx), %rax
movl %r12d, %ecx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rdi
movq $0x0, 0x18(%rax,%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%rcx)
movq 0x18(%r9), %rsi
movl (%r9), %edx
movl 0x4(%r9), %ecx
movl 0x8(%r9), %r8d
movl 0xc(%r9), %r9d
callq 0x18b50
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x3110
movq %rax, %r15
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
movl (%rbp), %r10d
movl 0x4(%rbp), %r11d
movl 0x8(%rbp), %ebx
movl 0xc(%rbp), %r14d
leaq 0x162c1(%rip), %rsi     # 0x2edc7
leaq 0x14b36(%rip), %r9      # 0x2d643
movq %rax, %rdi
xorl %eax, %eax
pushq %r12
pushq 0x18(%rbp)
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
callq 0x641a
addq $0x30, %rsp
leaq 0x21162(%rip), %rsi     # 0x39c90
movq 0x214a3(%rip), %rdx     # 0x39fd8
movq %r15, %rdi
callq 0x34b0
movq %rax, %rbx
movq %r15, %rdi
callq 0x31e0
movq %rbx, %rdi
callq 0x34d0