// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movb %cl, %al
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movl %edx, -0x2c(%rbp)
andb $0x1, %al
movb %al, -0x2d(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0x23ad4
movq -0x88(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
jmp 0x23add
movl -0x2c(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq -0x88(%rbp), %rcx
movl -0x8c(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl (%rcx), %eax
jbe 0x23bd6
movl $0x4008, %edi           # imm = 0x4008
callq 0x4190
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0xb0(%rbp)
movl (%rax), %ecx
movl %ecx, -0xa8(%rbp)
movl 0x4(%rax), %ecx
movl %ecx, -0xa4(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
callq 0x24290
movq %rax, -0x98(%rbp)
jmp 0x23b3d
movq -0x98(%rbp), %r9
movq -0xa0(%rbp), %r8
movl -0xa4(%rbp), %ecx
movl -0xa8(%rbp), %edx
movq -0xb0(%rbp), %rdi
movq -0x28(%rbp), %rax
movl (%rax), %esi
movl 0x4(%rax), %r10d
movl 0x8(%rax), %r11d
movl 0xc(%rax), %ebx
movq 0x18(%rax), %r14
movl -0x34(%rbp), %r15d
movq %rsp, %rax
movl %r15d, 0x28(%rax)
movq %r14, 0x20(%rax)
movl %ebx, 0x18(%rax)
movl %r11d, 0x10(%rax)
movl %r10d, 0x8(%rax)
movl %esi, (%rax)
leaq 0x202cf(%rip), %rsi     # 0x43e65
xorl %eax, %eax
callq 0x8cd0
jmp 0x23b9f
movq -0xb0(%rbp), %rdi
leaq 0x2c03b(%rip), %rsi     # 0x4fbe8
leaq -0x1ad74(%rip), %rdx    # 0x8e40
callq 0x4600
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x4270
jmp 0x24280
movq -0x88(%rbp), %rcx
movl (%rcx), %eax
addl $0x1, %eax
movl %eax, (%rcx)
movl 0x4(%rcx), %ecx
movb $0x0, -0x61(%rbp)
movb $0x0, -0x79(%rbp)
cmpl %ecx, %eax
jbe 0x23d21
movq -0x88(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x23c1b
movq -0x88(%rbp), %rcx
movl 0x4(%rcx), %eax
shll %eax
movl %eax, 0x4(%rcx)
movl %eax, -0xb4(%rbp)
jmp 0x23c34
movq -0x88(%rbp), %rax
movl $0x10, 0x4(%rax)
movl $0x10, %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, %eax
movq %rax, -0xc8(%rbp)
movl $0x20, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0xd0(%rbp)
callq 0x4040
movq -0xd0(%rbp), %rdx
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, -0x58(%rbp)
movq %rdx, -0x60(%rbp)
movb $0x1, -0x61(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0xc0(%rbp)
cmpq $0x0, %rax
je 0x23d11
movq -0xc0(%rbp), %rax
movq -0xc8(%rbp), %rdx
shlq $0x5, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0xe0(%rbp)
movq %rax, -0xd8(%rbp)
movq -0xc0(%rbp), %rax
movq -0xd8(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
movq %rax, -0x70(%rbp)
movq %rdi, -0x78(%rbp)
movb $0x1, -0x79(%rbp)
callq 0x23430
jmp 0x23cf3
movq -0xe0(%rbp), %rcx
movq -0xe8(%rbp), %rax
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0xd8(%rbp)
jne 0x23ccb
movq -0xc0(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x23d2c
xorl %eax, %eax
movq %rax, -0xf0(%rbp)
jmp 0x23d2c
movq -0x88(%rbp), %rax
movq -0xf0(%rbp), %rcx
movq %rcx, -0x50(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x23e64
movq -0x88(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x8(%rax)
testb $0x1, -0x2d(%rbp)
je 0x23e4b
movq -0x28(%rbp), %rdi
callq 0x242a0
cmpq $0x0, %rax
je 0x23e4b
movq -0x88(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %edx
movq 0x8(%rax), %rcx
movl %edx, (%rcx)
movq -0x28(%rbp), %rcx
movl 0x4(%rcx), %edx
movq 0x8(%rax), %rcx
movl %edx, 0x4(%rcx)
movq -0x28(%rbp), %rcx
movl 0x8(%rcx), %edx
movq 0x8(%rax), %rcx
movl %edx, 0x8(%rcx)
movq -0x28(%rbp), %rcx
movl 0xc(%rcx), %edx
movq 0x8(%rax), %rcx
movl %edx, 0xc(%rcx)
movq 0x8(%rax), %rcx
movb $0x1, 0x10(%rcx)
movq -0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x18(%rax)
jmp 0x23e5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x79(%rbp)
jne 0x23de3
jmp 0x23e31
movq -0x70(%rbp), %rcx
movq %rcx, -0x100(%rbp)
movq -0x78(%rbp), %rax
cmpq %rax, %rcx
movq %rax, -0xf8(%rbp)
je 0x23e2f
movq -0xf8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x108(%rbp)
callq 0x23230
movq -0x100(%rbp), %rcx
movq -0x108(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0xf8(%rbp)
jne 0x23dfe
jmp 0x23e31
testb $0x1, -0x61(%rbp)
jne 0x23e39
jmp 0x23e46
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x46b0
jmp 0x24280
movq -0x88(%rbp), %rax
movq -0x28(%rbp), %rsi
movq 0x8(%rax), %rdi
callq 0x242c0
jmp 0x2426b
cmpq $0x0, -0x50(%rbp)
je 0x240de
cmpl $0x0, -0x34(%rbp)
je 0x23e92
movq -0x88(%rbp), %rax
movq -0x50(%rbp), %rdi
movq 0x8(%rax), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
shlq $0x5, %rdx
callq 0x42c0
movq -0x88(%rbp), %rcx
movl -0x34(%rbp), %eax
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x23ee1
movq -0x88(%rbp), %rax
movq -0x50(%rbp), %rdi
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rdi
addq $0x20, %rdi
movq 0x8(%rax), %rsi
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rsi
movl (%rax), %eax
subl $0x1, %eax
subl -0x34(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x5, %rdx
callq 0x42c0
testb $0x1, -0x2d(%rbp)
je 0x23f8d
movq -0x28(%rbp), %rdi
callq 0x242a0
cmpq $0x0, %rax
je 0x23f8d
movq -0x28(%rbp), %rax
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb $0x1, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
jmp 0x2400d
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x0, 0xc(%rax)
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x0, 0x4(%rax)
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
movq -0x50(%rbp), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq $0x0, 0x18(%rax)
movq -0x28(%rbp), %rsi
movq -0x50(%rbp), %rdi
movl -0x34(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x242c0
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rdi
movl (%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x41c0
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, %rax
je 0x240ca
movq -0x110(%rbp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, -0x128(%rbp)
movq -0x8(%rcx), %rdx
movq %rdx, -0x120(%rbp)
shlq $0x5, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0x118(%rbp)
je 0x240af
movq -0x118(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x130(%rbp)
callq 0x23230
movq -0x110(%rbp), %rcx
movq -0x130(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x118(%rbp)
jne 0x2407e
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
shlq $0x5, %rsi
addq $0x8, %rsi
callq 0x46b0
movq -0x88(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x24269
movq -0x88(%rbp), %rcx
movl -0x34(%rbp), %eax
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x2412d
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rdi
addq $0x20, %rdi
movq 0x8(%rax), %rsi
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rsi
movl (%rax), %eax
subl $0x1, %eax
subl -0x34(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x5, %rdx
callq 0x45e0
testb $0x1, -0x2d(%rbp)
je 0x241e0
movq -0x28(%rbp), %rdi
callq 0x242a0
cmpq $0x0, %rax
je 0x241e0
movq -0x88(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %edx
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %esi
shlq $0x5, %rsi
addq %rsi, %rcx
movl %edx, (%rcx)
movq -0x28(%rbp), %rcx
movl 0x4(%rcx), %edx
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %esi
shlq $0x5, %rsi
addq %rsi, %rcx
movl %edx, 0x4(%rcx)
movq -0x28(%rbp), %rcx
movl 0x8(%rcx), %edx
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %esi
shlq $0x5, %rsi
addq %rsi, %rcx
movl %edx, 0x8(%rcx)
movq -0x28(%rbp), %rcx
movl 0xc(%rcx), %edx
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %esi
shlq $0x5, %rsi
addq %rsi, %rcx
movl %edx, 0xc(%rcx)
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
movb $0x1, 0x10(%rcx)
movq -0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x8(%rax), %rax
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
jmp 0x24267
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
movl $0x0, 0xc(%rcx)
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
movl $0x0, 0x8(%rcx)
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
movl $0x0, 0x4(%rcx)
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
movl $0x0, (%rcx)
movq 0x8(%rax), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
movq $0x0, 0x18(%rcx)
movq -0x28(%rbp), %rsi
movq 0x8(%rax), %rdi
movl -0x34(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x242c0
jmp 0x24269
jmp 0x2426b
movq -0x88(%rbp), %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x4620
nopl (%rax)