// File: /workspace/github_cpp_makefile_star2_O1/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>::draw_image(int, int, int, int, cimg_library::CImg<double> const&, float)
CImg<T>& draw_image(const int x0, const int y0, const int z0, const int c0,
                        const CImg<T>& sprite, const float opacity=1) {
      if (is_empty() || !sprite) return *this;
      if (is_overlapped(sprite)) return draw_image(x0,y0,z0,c0,+sprite,opacity);
      if (x0==0 && y0==0 && z0==0 && c0==0 && is_sameXYZC(sprite) && opacity>=1 && !is_shared())
        return assign(sprite,false);
      const bool bx = (x0<0), by = (y0<0), bz = (z0<0), bc = (c0<0);
      const int
        lX = sprite.width() - (x0 + sprite.width()>width()?x0 + sprite.width() - width():0) + (bx?x0:0),
        lY = sprite.height() - (y0 + sprite.height()>height()?y0 + sprite.height() - height():0) + (by?y0:0),
        lZ = sprite.depth() - (z0 + sprite.depth()>depth()?z0 + sprite.depth() - depth():0) + (bz?z0:0),
        lC = sprite.spectrum() - (c0 + sprite.spectrum()>spectrum()?c0 + sprite.spectrum() - spectrum():0) + (bc?c0:0);
      const T
        *ptrs = sprite._data -
        (bx?x0:0) -
        (by?y0*sprite.width():0) -
        (bz?z0*sprite.width()*sprite.height():0) -
        (bc?c0*sprite.width()*sprite.height()*sprite.depth():0);
      const unsigned long
        offX = (unsigned long)_width - lX,
        soffX = (unsigned long)sprite._width - lX,
        offY = (unsigned long)_width*(_height - lY),
        soffY = (unsigned long)sprite._width*(sprite._height - lY),
        offZ = (unsigned long)_width*_height*(_depth - lZ),
        soffZ = (unsigned long)sprite._width*sprite._height*(sprite._depth - lZ),
        slX = lX*sizeof(T);
      const float nopacity = cimg::abs(opacity), copacity = 1 - cimg::max(opacity,0);
      if (lX>0 && lY>0 && lZ>0 && lC>0) {
        T *ptrd = data(x0<0?0:x0,y0<0?0:y0,z0<0?0:z0,c0<0?0:c0);
        for (int v = 0; v<lC; ++v) {
          for (int z = 0; z<lZ; ++z) {
            if (opacity>=1)
              for (int y = 0; y<lY; ++y) { std::memcpy(ptrd,ptrs,slX); ptrd+=_width; ptrs+=sprite._width; }
            else for (int y = 0; y<lY; ++y) {
                for (int x = 0; x<lX; ++x) { *ptrd = (T)(nopacity*(*(ptrs++)) + *ptrd*copacity); ++ptrd; }
                ptrd+=offX; ptrs+=soffX;
              }
            ptrd+=offY; ptrs+=soffY;
          }
          ptrd+=offZ; ptrs+=soffZ;
        }
      }
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movdqa %xmm0, 0x60(%rsp)
movq %rdi, %rbp
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x38d70
movl %edx, %r13d
movdqu (%rbp), %xmm0
pxor %xmm1, %xmm1
pcmpeqd %xmm0, %xmm1
movmskps %xmm1, %edx
testb %dl, %dl
jne 0x38d70
movq 0x18(%r9), %r15
testq %r15, %r15
je 0x38d70
movq %rsi, 0x20(%rsp)
movq %rcx, 0x8(%rsp)
movq %r8, 0x10(%rsp)
movd %xmm0, %r11d
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
movd %xmm1, %ecx
movq %rcx, 0x28(%rsp)
imulq %r11, %rcx
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movd %xmm0, %r10d
movl 0xc(%rbp), %r8d
movq %r10, 0x40(%rsp)
imulq %r8, %r10
imulq %rcx, %r10
movl (%r9), %ebx
movl 0x4(%r9), %esi
movq %rsi, %r14
imulq %rbx, %r14
movl 0x8(%r9), %edi
movl 0xc(%r9), %r12d
leaq (%rax,%r10,8), %r10
cmpq %r15, %r10
jbe 0x38a13
movq %rdi, %r10
imulq %r12, %r10
imulq %r14, %r10
leaq (%r15,%r10,8), %r10
cmpq %r10, %rax
jae 0x38a13
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movq %r9, %rsi
xorl %edx, %edx
callq 0x38e0e
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %edx
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %r8
movq %r15, %r9
movdqa 0x60(%rsp), %xmm0
callq 0x388ec
movq %rax, %rbp
cmpb $0x0, 0x98(%rsp)
jne 0x38d70
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x38d70
callq 0x4680
jmp 0x38d70
movq %r12, 0x18(%rsp)
movl %r13d, %r10d
movq 0x20(%rsp), %r12
orl %r12d, %r10d
movq 0x8(%rsp), %rdx
orl %edx, %r10d
orl 0x10(%rsp), %r10d
je 0x38d85
movq %r14, 0x48(%rsp)
movq %r9, 0x78(%rsp)
leal (%rbx,%r12), %r9d
xorl %r10d, %r10d
movq %r11, 0x58(%rsp)
movl %r11d, %r14d
subl %r9d, %r14d
cmovgel %r10d, %r14d
movl %r12d, %r9d
sarl $0x1f, %r9d
andl %r12d, %r9d
movq %rbx, 0x50(%rsp)
addl %ebx, %r14d
addl %r9d, %r14d
leal (%rsi,%r13), %r11d
movq 0x28(%rsp), %rbx
movl %ebx, %r12d
subl %r11d, %r12d
cmovgel %r10d, %r12d
leal (%rdi,%rdx), %ebx
movq 0x40(%rsp), %rdx
movl %edx, %r11d
subl %ebx, %r11d
cmovgel %r10d, %r11d
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %rdx
addl %edx, %ebx
subl %ebx, %r8d
cmovgel %r10d, %r8d
testl %r14d, %r14d
jle 0x38d70
movq %rbp, 0x30(%rsp)
movl %r13d, %ebx
sarl $0x1f, %ebx
movl %ebx, %edx
andl %r13d, %edx
addl %esi, %edx
addl %r12d, %edx
testl %edx, %edx
jle 0x38d6b
movl %edx, 0x3c(%rsp)
movq 0x8(%rsp), %rdx
movl %edx, %r10d
sarl $0x1f, %r10d
movl %r10d, %ebp
andl %edx, %ebp
addl %edi, %ebp
addl %r11d, %ebp
movl %ebp, 0x4(%rsp)
testl %ebp, %ebp
jle 0x38d6b
movq 0x10(%rsp), %rdx
movl %edx, %r11d
sarl $0x1f, %r11d
movl %r11d, %r12d
andl %edx, %r12d
movq 0x18(%rsp), %rbp
addl %r12d, %ebp
addl %r8d, %ebp
movq %rbp, %r8
testl %r8d, %r8d
jle 0x38d6b
movq %r8, 0x18(%rsp)
movl %edi, %r8d
subl 0x4(%rsp), %r8d
movq 0x48(%rsp), %r12
imulq %r8, %r12
movq %r12, 0x48(%rsp)
movl %esi, %r12d
movq 0x50(%rsp), %r8
imull %r8d, %esi
imull %edx, %edi
imull %esi, %edi
andl %edi, %r11d
movslq %r9d, %rdi
shlq $0x3, %rdi
subq %rdi, %r15
movl %r8d, %edi
imull %r13d, %edi
andl %edi, %ebx
movslq %ebx, %rdi
shlq $0x3, %rdi
subq %rdi, %r15
movq 0x8(%rsp), %r9
imull %r9d, %esi
andl %esi, %r10d
movq %rdx, %rbp
movslq %r14d, %rdx
movq 0x28(%rsp), %rsi
movl 0x3c(%rsp), %ebx
subl %ebx, %esi
movq 0x58(%rsp), %rdi
imulq %rdi, %rsi
movq %rsi, 0x28(%rsp)
subl %ebx, %r12d
imulq %r8, %r12
movq %r12, 0x80(%rsp)
movslq %r10d, %rsi
movl %ebx, %r10d
shlq $0x3, %rsi
subq %rsi, %r15
movq 0x40(%rsp), %rbx
movl %ebx, %esi
subl 0x4(%rsp), %esi
imulq %rcx, %rsi
movq %rsi, 0x70(%rsp)
shlq $0x3, %rdx
movslq %r11d, %rsi
shlq $0x3, %rsi
subq %rsi, %r15
xorl %r11d, %r11d
movq 0x20(%rsp), %rsi
testl %esi, %esi
cmovlel %r11d, %esi
testl %r13d, %r13d
cmovlel %r11d, %r13d
leaq (%rax,%rsi,8), %rax
testl %r9d, %r9d
cmovlel %r11d, %r9d
testl %ebp, %ebp
movl $0x0, 0x38(%rsp)
cmovlel %r11d, %ebp
imulq %rdi, %r13
leaq (%rax,%r13,8), %rax
imulq %rcx, %r9
leaq (%rax,%r9,8), %rax
movq %rdx, %r12
imulq %rcx, %rbx
imulq %rbp, %rbx
leaq (%rax,%rbx,8), %r13
pxor %xmm0, %xmm0
movaps 0x60(%rsp), %xmm2
cmpless %xmm2, %xmm0
andps %xmm2, %xmm0
movss 0x3867c(%rip), %xmm1    # 0x712b0
subss %xmm0, %xmm1
movaps 0x384e1(%rip), %xmm0    # 0x71120
andps %xmm2, %xmm0
xorps %xmm2, %xmm2
cvtss2sd %xmm0, %xmm2
cvtss2sd %xmm1, %xmm3
shlq $0x3, %rdi
subq %rdx, %rdi
movq %rdi, 0x58(%rsp)
shlq $0x3, %r8
subq %rdx, %r8
movq %r8, 0x50(%rsp)
movsd %xmm2, 0x8(%rsp)
movsd %xmm3, 0x20(%rsp)
movq 0x78(%rsp), %rbp
xorl %eax, %eax
movl %eax, 0x10(%rsp)
movaps 0x60(%rsp), %xmm0
ucomiss 0x38628(%rip), %xmm0    # 0x712b0
jae 0x38ce3
xorl %eax, %eax
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %r8
xorl %esi, %esi
movq %r13, %rcx
movq %r15, %r9
movsd (%rcx), %xmm0
mulsd %xmm3, %xmm0
movsd (%r9), %xmm1
mulsd %xmm2, %xmm1
addq $0x8, %r9
addsd %xmm0, %xmm1
movsd %xmm1, (%rcx)
addq $0x8, %rcx
incl %esi
cmpl %r14d, %esi
jl 0x38c9e
leaq (%rcx,%rdi), %r13
leaq (%r9,%r8), %r15
incl %eax
cmpl %r10d, %eax
jl 0x38c96
addq %rdi, %rcx
addq %r8, %r9
movq %r9, %r15
movq %rcx, %r13
jmp 0x38d12
xorl %ebx, %ebx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4430
movl 0x3c(%rsp), %r10d
movq 0x30(%rsp), %rax
movl (%rax), %eax
leaq (%r13,%rax,8), %r13
movl (%rbp), %eax
leaq (%r15,%rax,8), %r15
incl %ebx
cmpl %r10d, %ebx
jl 0x38ce5
movq 0x28(%rsp), %rax
leaq (%r13,%rax,8), %r13
movq 0x80(%rsp), %rax
leaq (%r15,%rax,8), %r15
movl 0x10(%rsp), %eax
incl %eax
cmpl 0x4(%rsp), %eax
movsd 0x8(%rsp), %xmm2
movsd 0x20(%rsp), %xmm3
jl 0x38c78
movq 0x70(%rsp), %rax
leaq (%r13,%rax,8), %r13
movq 0x48(%rsp), %rax
leaq (%r15,%rax,8), %r15
movl 0x38(%rsp), %eax
incl %eax
movl %eax, 0x38(%rsp)
cmpl 0x18(%rsp), %eax
jl 0x38c76
movq 0x30(%rsp), %rbp
movq %rbp, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movaps 0x60(%rsp), %xmm0
ucomiss 0x3851f(%rip), %xmm0    # 0x712b0
jb 0x38a36
cmpl %ebx, %r11d
jne 0x38a36
cmpl %esi, 0x28(%rsp)
jne 0x38a36
cmpl %edi, 0x40(%rsp)
jne 0x38a36
cmpl 0x18(%rsp), %r8d
jne 0x38a36
cmpb $0x0, 0x10(%rbp)
jne 0x38a36
movq %rbp, %rdi
movq %r9, %rsi
xorl %edx, %edx
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb088
movq %rax, %rbx
cmpb $0x0, 0x98(%rsp)
jne 0x38e06
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x38e06
callq 0x4680
movq %rbx, %rdi
callq 0x4950