// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movdqa %xmm0, 0x40(%rsp)
movl %r9d, %ebp
movl %r8d, %r13d
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, (%rsp)
callq 0xfd1c
testb %al, %al
jne 0x11838
movd %r13d, %xmm0
movd %r12d, %xmm2
punpckldq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movd %r15d, %xmm0
movd %r14d, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
punpcklqdq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0]
movd 0xa0(%rsp), %xmm0
movd 0x98(%rsp), %xmm2
punpckldq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movd 0x90(%rsp), %xmm0
movd %ebp, %xmm3
punpckldq %xmm0, %xmm3    # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
punpcklqdq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0]
movdqa %xmm3, %xmm2
pcmpgtd %xmm1, %xmm2
movdqa %xmm2, %xmm4
pandn %xmm3, %xmm4
movdqa %xmm1, %xmm0
pand %xmm2, %xmm0
por %xmm4, %xmm0
movdqa %xmm3, %xmm4
pand %xmm2, %xmm4
pandn %xmm1, %xmm2
por %xmm4, %xmm2
movdqa 0x4296f(%rip), %xmm4    # 0x54150
movdqa %xmm1, %xmm5
pcmpgtd %xmm3, %xmm5
psubd %xmm3, %xmm1
pxor %xmm5, %xmm1
psubd %xmm1, %xmm5
pxor %xmm3, %xmm3
pcmpgtd %xmm0, %xmm3
pand %xmm0, %xmm3
paddd %xmm5, %xmm3
movq (%rsp), %rax
movdqu (%rax), %xmm1
pcmpeqd %xmm5, %xmm5
movdqa %xmm2, %xmm6
pxor %xmm5, %xmm6
paddd %xmm1, %xmm6
pcmpgtd %xmm2, %xmm1
pandn %xmm6, %xmm1
paddd %xmm3, %xmm1
psubd %xmm5, %xmm1
pcmpgtd %xmm1, %xmm4
movmskps %xmm4, %eax
testl %eax, %eax
je 0x1184b
movq (%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movaps 0x428ce(%rip), %xmm2    # 0x54120
movaps 0x40(%rsp), %xmm5
andps %xmm5, %xmm2
pxor %xmm3, %xmm3
cmpless %xmm5, %xmm3
movq (%rsp), %rsi
movl (%rsi), %ecx
movl 0x4(%rsi), %eax
movd %xmm1, %edx
movslq %edx, %rdi
movq %rcx, %rdx
subq %rdi, %rdx
movq %rdx, 0x38(%rsp)
pshufd $0x55, %xmm1, %xmm4     # xmm4 = xmm1[1,1,1,1]
movd %xmm4, %r13d
movl %eax, %edx
subl %r13d, %edx
imulq %rcx, %rdx
movq %rdx, 0x28(%rsp)
imulq %rcx, %rax
pshufd $0xee, %xmm1, %xmm4     # xmm4 = xmm1[2,3,2,3]
movd %xmm4, %r8d
movl 0x8(%rsi), %edx
movl %edx, %r15d
movl %r8d, 0x10(%rsp)
subl %r8d, %edx
imulq %rax, %rdx
movq %rdx, 0x20(%rsp)
movd %xmm0, %edx
xorl %r8d, %r8d
testl %edx, %edx
cmovlel %r8d, %edx
andps %xmm5, %xmm3
addq 0x18(%rsi), %rdx
pshufd $0x55, %xmm0, %xmm4     # xmm4 = xmm0[1,1,1,1]
movd %xmm4, %esi
testl %esi, %esi
cmovlel %r8d, %esi
movss 0x4293a(%rip), %xmm5    # 0x54220
imulq %rcx, %rsi
pshufd $0xee, %xmm0, %xmm4     # xmm4 = xmm0[2,3,2,3]
movd %xmm4, %ecx
movaps %xmm5, %xmm4
testl %ecx, %ecx
cmovlel %r8d, %ecx
subss %xmm3, %xmm4
imulq %rax, %rcx
addq %rsi, %rcx
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movd %xmm0, %esi
testl %esi, %esi
cmovlel %r8d, %esi
imulq %rax, %r15
imulq %rsi, %r15
addq %rcx, %r15
addq %rdx, %r15
movzbl 0xa8(%rsp), %ebp
cvtsi2ss %ebp, %xmm3
pshufd $0xff, %xmm1, %xmm0     # xmm0 = xmm1[3,3,3,3]
movd %xmm0, 0xc(%rsp)
movq %rdi, %r12
movl %edi, %ebx
mulss %xmm2, %xmm3
movss %xmm4, 0x1c(%rsp)
movss %xmm3, 0x18(%rsp)
cmpl 0xc(%rsp), %r8d
je 0x11838
xorl %eax, %eax
movq %r8, 0x30(%rsp)
cmpl 0x10(%rsp), %eax
je 0x119f1
movl %eax, 0x14(%rsp)
xorl %r14d, %r14d
cmpl %r13d, %r14d
je 0x119dc
movaps 0x40(%rsp), %xmm0
ucomiss %xmm5, %xmm0
jae 0x119a6
xorl %eax, %eax
cmpl %eax, %ebx
je 0x119cf
movzbl (%r15,%rax), %ecx
cvtsi2ss %ecx, %xmm0
mulss %xmm4, %xmm0
addss %xmm3, %xmm0
cvttss2si %xmm0, %ecx
movb %cl, (%r15,%rax)
incq %rax
jmp 0x11984
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x4280
movss 0x18(%rsp), %xmm3
movss 0x1c(%rsp), %xmm4
movss 0x42859(%rip), %xmm5    # 0x54220
movq (%rsp), %rax
movl (%rax), %eax
jmp 0x119d4
addq 0x38(%rsp), %r15
addq %rax, %r15
incl %r14d
jmp 0x11973
addq 0x28(%rsp), %r15
movl 0x14(%rsp), %eax
incl %eax
movq 0x30(%rsp), %r8
jmp 0x11962
addq 0x20(%rsp), %r15
incl %r8d
jmp 0x11950