// File: /workspace/github_cpp_makefile_star2_O3/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
movaps %xmm0, 0x60(%rsp)
movl %edx, %r13d
movq %rdi, %r12
movq 0x18(%rdi), %rax
testq %rax, %rax
sete %r10b
movl (%rdi), %edx
movl 0x4(%rdi), %ebx
testl %edx, %edx
sete %dil
orb %r10b, %dil
testl %ebx, %ebx
sete %r11b
movl 0x8(%r12), %ebp
testl %ebp, %ebp
sete %r10b
orb %r11b, %r10b
orb %dil, %r10b
movl 0xc(%r12), %edi
testl %edi, %edi
sete %r11b
orb %r10b, %r11b
jne 0x370cc
movq 0x18(%r9), %r15
testq %r15, %r15
je 0x370cc
movq %rsi, 0x10(%rsp)
movq %rcx, (%rsp)
movq %r8, 0x8(%rsp)
movl %edx, %r11d
movl %ebx, %edx
movl %ebp, %esi
movl %edi, %r8d
movq %rdx, 0x28(%rsp)
imulq %r11, %rdx
movq %rdx, %rcx
movq %rsi, 0x20(%rsp)
imulq %rsi, %rcx
movq %rcx, %r10
imulq %r8, %r10
movl (%r9), %ebx
movl 0x4(%r9), %esi
movq %rsi, %r14
imulq %rbx, %r14
movl 0x8(%r9), %edi
movl 0xc(%r9), %ebp
leaq (%rax,%r10,8), %r10
cmpq %r15, %r10
jbe 0x36d76
movq %rdi, %r10
imulq %rbp, %r10
imulq %r14, %r10
leaq (%r15,%r10,8), %r10
cmpq %r10, %rax
jae 0x36d76
leaq 0x88(%rsp), %r15
movq %r15, %rdi
movq %r9, %rsi
xorl %edx, %edx
callq 0x3716c
movq %r12, %rdi
movq 0x10(%rsp), %rsi
movl %r13d, %edx
movq (%rsp), %rcx
movq 0x8(%rsp), %r8
movq %r15, %r9
movaps 0x60(%rsp), %xmm0
callq 0x36c40
movq %rax, %r12
cmpb $0x0, 0x98(%rsp)
jne 0x370cc
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x370cc
callq 0x4690
jmp 0x370cc
movq %rbp, 0x18(%rsp)
movl %r13d, %r10d
orl 0x10(%rsp), %r10d
orl (%rsp), %r10d
movq 0x8(%rsp), %rbp
orl %ebp, %r10d
je 0x370e1
movq %rdx, 0x70(%rsp)
movq %r14, 0x40(%rsp)
movq %r9, 0x78(%rsp)
movq 0x10(%rsp), %rdx
leal (%rbx,%rdx), %r9d
xorl %r10d, %r10d
movq %r11, 0x50(%rsp)
movl %r11d, %r14d
subl %r9d, %r14d
cmovgel %r10d, %r14d
movl %edx, %r9d
sarl $0x1f, %r9d
andl %edx, %r9d
movq %rbx, 0x48(%rsp)
addl %ebx, %r14d
addl %r9d, %r14d
leal (%rsi,%r13), %r11d
movq 0x28(%rsp), %rbx
subl %r11d, %ebx
cmovgel %r10d, %ebx
movq %rbp, %rdx
movq (%rsp), %r11
leal (%rdi,%r11), %ebp
movq 0x20(%rsp), %r11
subl %ebp, %r11d
cmovgel %r10d, %r11d
movq 0x18(%rsp), %rbp
addl %edx, %ebp
subl %ebp, %r8d
cmovgel %r10d, %r8d
testl %r14d, %r14d
jle 0x370cc
movl %r13d, %r10d
sarl $0x1f, %r10d
movl %r10d, %edx
andl %r13d, %edx
addl %esi, %edx
addl %ebx, %edx
movl %edx, 0x3c(%rsp)
testl %edx, %edx
jle 0x370cc
movq (%rsp), %rdx
movl %edx, %ebx
sarl $0x1f, %ebx
movl %ebx, %ebp
andl %edx, %ebp
addl %edi, %ebp
addl %r11d, %ebp
movl %ebp, 0x38(%rsp)
testl %ebp, %ebp
jle 0x370cc
movq %r12, 0x58(%rsp)
movq 0x8(%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 0x370c7
movq %r8, 0x18(%rsp)
movl %edi, %r8d
movq %rdx, %rbp
movl 0x38(%rsp), %edx
subl %edx, %r8d
movq 0x40(%rsp), %r12
imulq %r8, %r12
movq %r12, 0x40(%rsp)
movl %esi, %r12d
movq 0x48(%rsp), %r8
imull %r8d, %esi
imull %ebp, %edi
imull %esi, %edi
andl %edi, %r11d
movslq %r9d, %rdi
shlq $0x3, %rdi
subq %rdi, %r15
movl %r8d, %edi
imull %r13d, %edi
andl %edi, %r10d
movslq %r10d, %rdi
shlq $0x3, %rdi
subq %rdi, %r15
movq (%rsp), %rbp
imull %ebp, %esi
andl %esi, %ebx
movslq %ebx, %rsi
shlq $0x3, %rsi
subq %rsi, %r15
movslq %r14d, %rbx
movq 0x28(%rsp), %rsi
movl 0x3c(%rsp), %r9d
subl %r9d, %esi
movq 0x50(%rsp), %rdi
imulq %rdi, %rsi
movq %rsi, 0x28(%rsp)
subl %r9d, %r12d
imulq %r8, %r12
movq %r12, 0x80(%rsp)
movq 0x20(%rsp), %rsi
subl %edx, %esi
movq 0x70(%rsp), %r10
imulq %r10, %rsi
movq %rsi, 0x20(%rsp)
shlq $0x3, %rbx
movslq %r11d, %rsi
shlq $0x3, %rsi
subq %rsi, %r15
xorl %edx, %edx
movq 0x10(%rsp), %rsi
testl %esi, %esi
cmovlel %edx, %esi
testl %r13d, %r13d
cmovlel %edx, %r13d
testl %ebp, %ebp
cmovlel %edx, %ebp
leaq (%rax,%rsi,8), %rax
movq 0x8(%rsp), %rsi
testl %esi, %esi
movl $0x0, 0x34(%rsp)
cmovlel %edx, %esi
imulq %rdi, %r13
leaq (%rax,%r13,8), %rax
imulq %r10, %rbp
movq %rbx, %r12
leaq (%rax,%rbp,8), %rax
imulq %rsi, %rcx
leaq (%rax,%rcx,8), %r13
xorps %xmm0, %xmm0
movaps 0x60(%rsp), %xmm2
cmpless %xmm2, %xmm0
andps %xmm2, %xmm0
movss 0x3731e(%rip), %xmm1    # 0x6e2b0
subss %xmm0, %xmm1
movaps 0x37183(%rip), %xmm0    # 0x6e120
andps %xmm2, %xmm0
xorps %xmm2, %xmm2
cvtss2sd %xmm0, %xmm2
cvtss2sd %xmm1, %xmm3
shlq $0x3, %rdi
subq %rbx, %rdi
movq %rdi, 0x50(%rsp)
shlq $0x3, %r8
subq %rbx, %r8
movq %r8, 0x48(%rsp)
movsd %xmm2, 0x10(%rsp)
movsd %xmm3, 0x8(%rsp)
movq 0x78(%rsp), %rbp
xorl %eax, %eax
movl %eax, (%rsp)
movaps 0x60(%rsp), %xmm0
ucomiss 0x372cb(%rip), %xmm0    # 0x6e2b0
jae 0x37040
xorl %eax, %eax
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
xorl %esi, %esi
movq %r13, %rcx
movq %r15, %r10
movsd (%rcx), %xmm0
mulsd %xmm3, %xmm0
movsd (%r10), %xmm1
mulsd %xmm2, %xmm1
addq $0x8, %r10
addsd %xmm0, %xmm1
movsd %xmm1, (%rcx)
addq $0x8, %rcx
incl %esi
cmpl %r14d, %esi
jl 0x36ffb
leaq (%rcx,%rdi), %r13
leaq (%r10,%r8), %r15
incl %eax
cmpl %r9d, %eax
jl 0x36ff3
addq %rdi, %rcx
addq %r8, %r10
movq %r10, %r15
movq %rcx, %r13
jmp 0x3706f
xorl %ebx, %ebx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4440
movl 0x3c(%rsp), %r9d
movq 0x58(%rsp), %rax
movl (%rax), %eax
leaq (%r13,%rax,8), %r13
movl (%rbp), %eax
leaq (%r15,%rax,8), %r15
incl %ebx
cmpl %r9d, %ebx
jl 0x37042
movq 0x28(%rsp), %rax
leaq (%r13,%rax,8), %r13
movq 0x80(%rsp), %rax
leaq (%r15,%rax,8), %r15
movl (%rsp), %eax
incl %eax
cmpl 0x38(%rsp), %eax
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm3
jl 0x36fd6
movq 0x20(%rsp), %rax
leaq (%r13,%rax,8), %r13
movq 0x40(%rsp), %rax
leaq (%r15,%rax,8), %r15
movl 0x34(%rsp), %eax
incl %eax
movl %eax, 0x34(%rsp)
cmpl 0x18(%rsp), %eax
jl 0x36fd4
movq 0x58(%rsp), %r12
movq %r12, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movaps 0x60(%rsp), %xmm0
ucomiss 0x371c3(%rip), %xmm0    # 0x6e2b0
jb 0x36d95
cmpl %ebx, %r11d
jne 0x36d95
cmpl %esi, 0x28(%rsp)
jne 0x36d95
cmpl %edi, 0x20(%rsp)
jne 0x36d95
cmpl 0x18(%rsp), %r8d
jne 0x36d95
cmpb $0x0, 0x10(%r12)
jne 0x36d95
movq %r12, %rdi
movq %r9, %rsi
xorl %edx, %edx
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb00c
movq %rax, %rbx
cmpb $0x0, 0x98(%rsp)
jne 0x37164
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x37164
callq 0x4690
movq %rbx, %rdi
callq 0x4960