// File: /workspace/github_cpp_makefile_star2_O3/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImgList<unsigned char>::insert(cimg_library::CImg<unsigned 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, %r14
movq %rdi, %rbx
cmpl $-0x1, %edx
movl (%rdi), %r13d
cmovel %r13d, %r12d
cmpl %r12d, %r13d
jb 0x14f70
movl %ecx, 0x4(%rsp)
leal 0x1(%r13), %ecx
movl %ecx, (%rbx)
movl 0x4(%rbx), %eax
cmpl %eax, %ecx
jbe 0x14de1
movq %r14, 0x10(%rsp)
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %r14d
cmovnel %ecx, %r14d
movl %r14d, 0x4(%rbx)
movq %r14, %rbp
shlq $0x5, %rbp
leaq 0x8(%rbp), %rdi
callq 0x4040
movq %rax, %r15
movq %r14, (%rax)
testl %r14d, %r14d
je 0x14d50
leaq 0x20(%r15), %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, %rbp
jne 0x14d35
addq $0x8, %r15
leaq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rbx), %rbp
testq %rbp, %rbp
movq 0x10(%rsp), %r14
je 0x14e46
testl %r12d, %r12d
je 0x14d86
movl %r12d, %edx
shlq $0x5, %rdx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4440
movl %r13d, %edx
subl %r12d, %edx
je 0x14da9
movl %r12d, %esi
shlq $0x5, %rsi
leaq (%r15,%rsi), %rdi
addq $0x20, %rdi
addq %rbp, %rsi
shlq $0x5, %rdx
callq 0x4440
movq 0x18(%r14), %rsi
cmpb $0x0, 0x4(%rsp)
je 0x14ecc
testq %rsi, %rsi
je 0x14eca
movl %r12d, %eax
shlq $0x5, %rax
movups (%r14), %xmm0
movups %xmm0, (%r15,%rax)
movb $0x1, 0x10(%r15,%rax)
movq %rsi, 0x18(%r15,%rax)
jmp 0x14f06
leaq 0x8(%rbx), %rbp
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x14e4d
movl %r12d, %r15d
subl %r12d, %r13d
je 0x14e15
movq %r15, %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rsi
leaq (%rax,%rcx), %rdi
addq $0x20, %rdi
shlq $0x5, %r13
movq %r13, %rdx
callq 0x48c0
cmpb $0x0, 0x4(%rsp)
je 0x14e7a
movq 0x18(%r14), %rcx
movq (%rbp), %rax
testq %rcx, %rcx
je 0x14e7e
shlq $0x5, %r15
movups (%r14), %xmm0
movups %xmm0, (%rax,%r15)
movb $0x1, 0x10(%rax,%r15)
movq %rcx, 0x18(%rax,%r15)
jmp 0x14f5e
movq 0x8(%rsp), %rbp
jmp 0x14e50
xorl %r15d, %r15d
movq %r15, (%rbp)
movq 0x18(%r14), %rsi
cmpb $0x0, 0x4(%rsp)
je 0x14eae
testq %rsi, %rsi
je 0x14eac
movups (%r14), %xmm0
movups %xmm0, (%r15)
movb $0x1, 0x10(%r15)
movq %rsi, 0x18(%r15)
jmp 0x14f5e
movq (%rbp), %rax
shlq $0x5, %r15
leaq (%rax,%r15), %rdi
movq $0x0, 0x18(%rax,%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%r15)
movq 0x18(%r14), %rsi
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r8d
movl 0xc(%r14), %r9d
jmp 0x14ec0
xorl %esi, %esi
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r8d
movl 0xc(%r14), %r9d
movq %r15, %rdi
callq 0x14476
jmp 0x14f5e
xorl %esi, %esi
movl %r12d, %eax
shlq $0x5, %rax
leaq (%r15,%rax), %rdi
movq $0x0, 0x18(%r15,%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%r15,%rax)
movl (%r14), %edx
movl 0x4(%r14), %ecx
movl 0x8(%r14), %r8d
movl 0xc(%r14), %r9d
callq 0x14476
movq 0x8(%rbx), %rbp
movl (%rbx), %r13d
decl %r13d
movl %r13d, %edx
shlq $0x5, %rdx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x4290
movq 0x8(%rsp), %r13
movq (%r13), %r14
testq %r14, %r14
je 0x14f5a
movq -0x8(%r14), %r12
addq $-0x8, %r14
testq %r12, %r12
je 0x14f52
shlq $0x5, %r12
cmpb $0x0, -0x8(%r14,%r12)
jne 0x14f4c
movq (%r14,%r12), %rdi
testq %rdi, %rdi
je 0x14f4c
callq 0x4690
addq $-0x20, %r12
jne 0x14f36
movq %r14, %rdi
callq 0x4690
movq %r15, (%r13)
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 0x4210
movq %rax, %r15
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movq 0x8(%rbx), %r8
movl (%r14), %r10d
movl 0x4(%r14), %r11d
movl 0x8(%r14), %ebx
movl 0xc(%r14), %r13d
leaq 0x79303(%rip), %rsi     # 0x8e29f
leaq 0x65864(%rip), %r9      # 0x7a807
movq %rax, %rdi
xorl %eax, %eax
pushq %r12
pushq 0x18(%r14)
pushq %r13
pushq %rbx
pushq %r11
pushq %r10
callq 0xc16a
addq $0x30, %rsp
leaq 0x92c8b(%rip), %rsi     # 0xa7c50
movq 0x93004(%rip), %rdx     # 0xa7fd0
movq %r15, %rdi
callq 0x4910
movq %rax, %rbx
movq %r15, %rdi
callq 0x43c0
movq %rbx, %rdi
callq 0x4960
nop