// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<unsigned char>::draw_rectangle(int, int, int, int, int, int, int, int, unsigned char, float)
CImg<T>& draw_rectangle(const int x0, const int y0, const int z0, const int c0,
                            const int x1, const int y1, const int z1, const int c1,
                            const T val, const float opacity=1) {
      if (is_empty()) return *this;
      const bool bx = (x0<x1), by = (y0<y1), bz = (z0<z1), bc = (c0<c1);
      const int
        nx0 = bx?x0:x1, nx1 = bx?x1:x0,
        ny0 = by?y0:y1, ny1 = by?y1:y0,
        nz0 = bz?z0:z1, nz1 = bz?z1:z0,
        nc0 = bc?c0:c1, nc1 = bc?c1:c0;
      const int
        lX = (1 + nx1 - nx0) + (nx1>=width()?width() - 1 - nx1:0) + (nx0<0?nx0:0),
        lY = (1 + ny1 - ny0) + (ny1>=height()?height() - 1 - ny1:0) + (ny0<0?ny0:0),
        lZ = (1 + nz1 - nz0) + (nz1>=depth()?depth() - 1 - nz1:0) + (nz0<0?nz0:0),
        lC = (1 + nc1 - nc0) + (nc1>=spectrum()?spectrum() - 1 - nc1:0) + (nc0<0?nc0:0);
      const unsigned long
        offX = (unsigned long)_width - lX,
        offY = (unsigned long)_width*(_height - lY),
        offZ = (unsigned long)_width*_height*(_depth - lZ);
      const float nopacity = cimg::abs(opacity), copacity = 1 - cimg::max(opacity,0);
      T *ptrd = data(nx0<0?0:nx0,ny0<0?0:ny0,nz0<0?0:nz0,nc0<0?0:nc0);
      if (lX>0 && lY>0 && lZ>0 && lC>0)
        for (int v = 0; v<lC; ++v) {
          for (int z = 0; z<lZ; ++z) {
            for (int y = 0; y<lY; ++y) {
              if (opacity>=1) {
                if (sizeof(T)!=1) { for (int x = 0; x<lX; ++x) *(ptrd++) = val; ptrd+=offX; }
                else { std::memset(ptrd,(int)val,lX); ptrd+=_width; }
              } else { for (int x = 0; x<lX; ++x) { *ptrd = (T)(nopacity*val + *ptrd*copacity); ++ptrd; } ptrd+=offX; }
            }
            ptrd+=offY;
          }
          ptrd+=offZ;
        }
      return *this;
    }

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movb 0x158(%rsp), %al
movl 0x150(%rsp), %eax
movl 0x148(%rsp), %eax
movl 0x140(%rsp), %eax
movq %rdi, 0x128(%rsp)
movl %esi, 0x124(%rsp)
movl %edx, 0x120(%rsp)
movl %ecx, 0x11c(%rsp)
movl %r8d, 0x118(%rsp)
movl %r9d, 0x114(%rsp)
movss %xmm0, 0x110(%rsp)
movq 0x128(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x1f750
testb $0x1, %al
jne 0x23d54
jmp 0x23d69
movq 0x90(%rsp), %rax
movq %rax, 0x130(%rsp)
jmp 0x24536
movl 0x124(%rsp), %eax
cmpl 0x114(%rsp), %eax
setl %al
andb $0x1, %al
movb %al, 0x10f(%rsp)
movl 0x120(%rsp), %eax
cmpl 0x140(%rsp), %eax
setl %al
andb $0x1, %al
movb %al, 0x10e(%rsp)
movl 0x11c(%rsp), %eax
cmpl 0x148(%rsp), %eax
setl %al
andb $0x1, %al
movb %al, 0x10d(%rsp)
movl 0x118(%rsp), %eax
cmpl 0x150(%rsp), %eax
setl %al
andb $0x1, %al
movb %al, 0x10c(%rsp)
testb $0x1, 0x10f(%rsp)
je 0x23deb
movl 0x124(%rsp), %eax
movl %eax, 0x8c(%rsp)
jmp 0x23df9
movl 0x114(%rsp), %eax
movl %eax, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
movl %eax, 0x108(%rsp)
testb $0x1, 0x10f(%rsp)
je 0x23e21
movl 0x114(%rsp), %eax
movl %eax, 0x88(%rsp)
jmp 0x23e2f
movl 0x124(%rsp), %eax
movl %eax, 0x88(%rsp)
movl 0x88(%rsp), %eax
movl %eax, 0x104(%rsp)
testb $0x1, 0x10e(%rsp)
je 0x23e57
movl 0x120(%rsp), %eax
movl %eax, 0x84(%rsp)
jmp 0x23e65
movl 0x140(%rsp), %eax
movl %eax, 0x84(%rsp)
movl 0x84(%rsp), %eax
movl %eax, 0x100(%rsp)
testb $0x1, 0x10e(%rsp)
je 0x23e8d
movl 0x140(%rsp), %eax
movl %eax, 0x80(%rsp)
jmp 0x23e9b
movl 0x120(%rsp), %eax
movl %eax, 0x80(%rsp)
movl 0x80(%rsp), %eax
movl %eax, 0xfc(%rsp)
testb $0x1, 0x10d(%rsp)
je 0x23ec0
movl 0x11c(%rsp), %eax
movl %eax, 0x7c(%rsp)
jmp 0x23ecb
movl 0x148(%rsp), %eax
movl %eax, 0x7c(%rsp)
movl 0x7c(%rsp), %eax
movl %eax, 0xf8(%rsp)
testb $0x1, 0x10d(%rsp)
je 0x23eed
movl 0x148(%rsp), %eax
movl %eax, 0x78(%rsp)
jmp 0x23ef8
movl 0x11c(%rsp), %eax
movl %eax, 0x78(%rsp)
movl 0x78(%rsp), %eax
movl %eax, 0xf4(%rsp)
testb $0x1, 0x10c(%rsp)
je 0x23f1a
movl 0x118(%rsp), %eax
movl %eax, 0x74(%rsp)
jmp 0x23f25
movl 0x150(%rsp), %eax
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
movl %eax, 0xf0(%rsp)
testb $0x1, 0x10c(%rsp)
je 0x23f47
movl 0x150(%rsp), %eax
movl %eax, 0x70(%rsp)
jmp 0x23f52
movl 0x118(%rsp), %eax
movl %eax, 0x70(%rsp)
movq 0x90(%rsp), %rdi
movl 0x70(%rsp), %eax
movl %eax, 0xec(%rsp)
movl 0x104(%rsp), %eax
addl $0x1, %eax
subl 0x108(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x104(%rsp), %eax
movl %eax, 0x6c(%rsp)
callq 0x173f0
movl %eax, %ecx
movl 0x6c(%rsp), %eax
cmpl %ecx, %eax
jl 0x23fb1
movq 0x90(%rsp), %rdi
callq 0x173f0
subl $0x1, %eax
subl 0x104(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x23fb9
xorl %eax, %eax
movl %eax, 0x64(%rsp)
jmp 0x23fb9
movl 0x68(%rsp), %eax
movl 0x64(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0x60(%rsp)
cmpl $0x0, 0x108(%rsp)
jge 0x23fde
movl 0x108(%rsp), %eax
movl %eax, 0x5c(%rsp)
jmp 0x23fe6
xorl %eax, %eax
movl %eax, 0x5c(%rsp)
jmp 0x23fe6
movq 0x90(%rsp), %rdi
movl 0x60(%rsp), %eax
movl 0x5c(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0xe8(%rsp)
movl 0xfc(%rsp), %eax
addl $0x1, %eax
subl 0x100(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0xfc(%rsp), %eax
movl %eax, 0x58(%rsp)
callq 0x17400
movl %eax, %ecx
movl 0x58(%rsp), %eax
cmpl %ecx, %eax
jl 0x2404b
movq 0x90(%rsp), %rdi
callq 0x17400
subl $0x1, %eax
subl 0xfc(%rsp), %eax
movl %eax, 0x50(%rsp)
jmp 0x24053
xorl %eax, %eax
movl %eax, 0x50(%rsp)
jmp 0x24053
movl 0x54(%rsp), %eax
movl 0x50(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0x4c(%rsp)
cmpl $0x0, 0x100(%rsp)
jge 0x24078
movl 0x100(%rsp), %eax
movl %eax, 0x48(%rsp)
jmp 0x24080
xorl %eax, %eax
movl %eax, 0x48(%rsp)
jmp 0x24080
movq 0x90(%rsp), %rdi
movl 0x4c(%rsp), %eax
movl 0x48(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0xe4(%rsp)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
subl 0xf8(%rsp), %eax
movl %eax, 0x40(%rsp)
movl 0xf4(%rsp), %eax
movl %eax, 0x44(%rsp)
callq 0x20220
movl %eax, %ecx
movl 0x44(%rsp), %eax
cmpl %ecx, %eax
jl 0x240e5
movq 0x90(%rsp), %rdi
callq 0x20220
subl $0x1, %eax
subl 0xf4(%rsp), %eax
movl %eax, 0x3c(%rsp)
jmp 0x240ed
xorl %eax, %eax
movl %eax, 0x3c(%rsp)
jmp 0x240ed
movl 0x40(%rsp), %eax
movl 0x3c(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0x38(%rsp)
cmpl $0x0, 0xf8(%rsp)
jge 0x24112
movl 0xf8(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x2411a
xorl %eax, %eax
movl %eax, 0x34(%rsp)
jmp 0x2411a
movq 0x90(%rsp), %rdi
movl 0x38(%rsp), %eax
movl 0x34(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0xe0(%rsp)
movl 0xec(%rsp), %eax
addl $0x1, %eax
subl 0xf0(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0xec(%rsp), %eax
movl %eax, 0x30(%rsp)
callq 0x20350
movl %eax, %ecx
movl 0x30(%rsp), %eax
cmpl %ecx, %eax
jl 0x2417f
movq 0x90(%rsp), %rdi
callq 0x20350
subl $0x1, %eax
subl 0xec(%rsp), %eax
movl %eax, 0x28(%rsp)
jmp 0x24187
xorl %eax, %eax
movl %eax, 0x28(%rsp)
jmp 0x24187
movl 0x2c(%rsp), %eax
movl 0x28(%rsp), %ecx
addl %ecx, %eax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0xf0(%rsp)
jge 0x241ac
movl 0xf0(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x241b4
xorl %eax, %eax
movl %eax, 0x20(%rsp)
jmp 0x241b4
movq 0x90(%rsp), %rcx
movl 0x24(%rsp), %eax
movl 0x20(%rsp), %edx
addl %edx, %eax
movl %eax, 0xdc(%rsp)
movl (%rcx), %eax
movslq 0xe8(%rsp), %rdx
subq %rdx, %rax
movq %rax, 0xd0(%rsp)
movl (%rcx), %eax
movl 0x4(%rcx), %edx
subl 0xe4(%rsp), %edx
movl %edx, %edx
imulq %rdx, %rax
movq %rax, 0xc8(%rsp)
movl (%rcx), %eax
movl 0x4(%rcx), %edx
imulq %rdx, %rax
movl 0x8(%rcx), %ecx
subl 0xe0(%rsp), %ecx
movl %ecx, %ecx
imulq %rcx, %rax
movq %rax, 0xc0(%rsp)
movss 0x110(%rsp), %xmm0
callq 0x1f3d0
movss %xmm0, 0xbc(%rsp)
movl $0x0, 0xb4(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0xb4(%rsp), %rsi
callq 0x1f3f0
movaps %xmm0, %xmm1
movss 0xa3ec1(%rip), %xmm0    # 0xc8120
subss %xmm1, %xmm0
movss %xmm0, 0xb8(%rsp)
cmpl $0x0, 0x108(%rsp)
jge 0x2427e
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
jmp 0x24289
movl 0x108(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x18(%rsp)
cmpl $0x0, 0x100(%rsp)
jge 0x242a3
xorl %eax, %eax
movl %eax, 0x14(%rsp)
jmp 0x242ae
movl 0x100(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
cmpl $0x0, 0xf8(%rsp)
jge 0x242c8
xorl %eax, %eax
movl %eax, 0xc(%rsp)
jmp 0x242d3
movl 0xf8(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
cmpl $0x0, 0xf0(%rsp)
jge 0x242ed
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x242f8
movl 0xf0(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x8(%rsp), %ecx
movl 0x10(%rsp), %edx
movl 0x18(%rsp), %esi
movq 0x90(%rsp), %rdi
movl 0x4(%rsp), %r8d
callq 0x21a70
movq %rax, 0xa8(%rsp)
cmpl $0x0, 0xe8(%rsp)
jle 0x24526
cmpl $0x0, 0xe4(%rsp)
jle 0x24526
cmpl $0x0, 0xe0(%rsp)
jle 0x24526
cmpl $0x0, 0xdc(%rsp)
jle 0x24526
movl $0x0, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jge 0x24524
movl $0x0, 0xa0(%rsp)
movl 0xa0(%rsp), %eax
cmpl 0xe0(%rsp), %eax
jge 0x244f6
movl $0x0, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
cmpl 0xe4(%rsp), %eax
jge 0x244c8
movss 0x110(%rsp), %xmm0
movss 0xa3d5c(%rip), %xmm1    # 0xc8120
ucomiss %xmm1, %xmm0
jb 0x2440d
movq 0xa8(%rsp), %rdi
movzbl 0x158(%rsp), %eax
movslq 0xe8(%rsp), %rdx
movzbl %al, %esi
callq 0x52a0
movq 0x90(%rsp), %rax
movl (%rax), %ecx
movq 0xa8(%rsp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
jmp 0x244b0
movl $0x0, 0x98(%rsp)
movl 0x98(%rsp), %eax
cmpl 0xe8(%rsp), %eax
jge 0x24498
movss 0xbc(%rsp), %xmm0
movzbl 0x158(%rsp), %eax
cvtsi2ss %eax, %xmm2
movq 0xa8(%rsp), %rax
movzbl (%rax), %eax
cvtsi2ss %eax, %xmm1
movss 0xb8(%rsp), %xmm3
mulss %xmm3, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movb %al, %cl
movq 0xa8(%rsp), %rax
movb %cl, (%rax)
movq 0xa8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xa8(%rsp)
movl 0x98(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x98(%rsp)
jmp 0x24418
movq 0xd0(%rsp), %rax
addq 0xa8(%rsp), %rax
movq %rax, 0xa8(%rsp)
jmp 0x244b2
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x2439f
movq 0xc8(%rsp), %rax
addq 0xa8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0x24380
movq 0xc0(%rsp), %rax
addq 0xa8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x24361
jmp 0x24526
movq 0x90(%rsp), %rax
movq %rax, 0x130(%rsp)
movq 0x130(%rsp), %rax
addq $0x138, %rsp            # imm = 0x138
retq
nopw %cs:(%rax,%rax)