// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<unsigned char>::RGBtoYCbCr()
CImg<T>& RGBtoYCbCr() {
      if (_spectrum!=3)
        throw CImgInstanceException(_cimg_instance
                                    "RGBtoYCbCr(): Instance is not a RGB image.",
                                    cimg_instance);

      T *p1 = data(0,0,0,0), *p2 = data(0,0,0,1), *p3 = data(0,0,0,2);
      for (unsigned long N = (unsigned long)_width*_height*_depth; N; --N) {
        const Tfloat
          R = (Tfloat)*p1,
          G = (Tfloat)*p2,
          B = (Tfloat)*p3,
          Y = (66*R + 129*G + 25*B + 128)/256 + 16,
          Cb = (-38*R - 74*G + 112*B + 128)/256 + 128,
          Cr = (112*R - 94*G - 18*B + 128)/256 + 128;
        *(p1++) = (T)(Y<0?0:(Y>255?255:Y));
        *(p2++) = (T)(Cb<0?0:(Cb>255?255:Cb));
        *(p3++) = (T)(Cr<0?0:(Cr>255?255:Cr));
      }
      return *this;
    }

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpl $0x3, 0xc(%rax)
je 0xb3779
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0x60(%rsp), %rax
movq %rcx, 0x30(%rsp)
movl (%rax), %ecx
movl %ecx, 0x38(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x3c(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0x40(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0x44(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0x48(%rsp)
movb 0x10(%rax), %dl
leaq 0x352f7(%rip), %rcx     # 0xe89d2
leaq 0x163ff(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x50(%rsp)
callq 0x1c2e0
movq %rax, 0x58(%rsp)
jmp 0xb36fa
movl 0x44(%rsp), %r9d
movl 0x40(%rsp), %r8d
movl 0x3c(%rsp), %ecx
movl 0x38(%rsp), %edx
movq 0x30(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %r10
movq 0x58(%rsp), %r11
movq %rsp, %rax
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0x394be(%rip), %rsi     # 0xecbf3
xorl %eax, %eax
callq 0x11fd0
jmp 0xb373e
movq 0x30(%rsp), %rdi
leaq 0x4c3fe(%rip), %rsi     # 0xffb48
leaq -0xa1541(%rip), %rdx    # 0x12210
callq 0x5920
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
callq 0x53a0
jmp 0xb3b09
movq 0x60(%rsp), %rdi
xorl %r8d, %r8d
movl %r8d, %esi
movl %r8d, %edx
movl %r8d, %ecx
callq 0x21a70
movq 0x60(%rsp), %rdi
movq %rax, 0x98(%rsp)
xorl %ecx, %ecx
movl $0x1, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x21a70
movq 0x60(%rsp), %rdi
movq %rax, 0x90(%rsp)
xorl %ecx, %ecx
movl $0x2, %r8d
movl %ecx, %esi
movl %ecx, %edx
callq 0x21a70
movq 0x60(%rsp), %rcx
movq %rax, 0x88(%rsp)
movl (%rcx), %eax
movl 0x4(%rcx), %edx
imulq %rdx, %rax
movl 0x8(%rcx), %ecx
imulq %rcx, %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
je 0xb3afc
movq 0x98(%rsp), %rax
movzbl (%rax), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x7c(%rsp)
movq 0x90(%rsp), %rax
movzbl (%rax), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x78(%rsp)
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x74(%rsp)
movss 0x7c(%rsp), %xmm1
movss 0x14958(%rip), %xmm0    # 0xc81a4
mulss 0x78(%rsp), %xmm0
movss 0x14946(%rip), %xmm2    # 0xc81a0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss 0x74(%rsp), %xmm0
movss 0x1492c(%rip), %xmm2    # 0xc819c
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x148fc(%rip), %xmm1    # 0xc817c
addss %xmm1, %xmm0
movss 0x148f4(%rip), %xmm1    # 0xc8180
divss %xmm1, %xmm0
movss 0x14900(%rip), %xmm1    # 0xc8198
addss %xmm1, %xmm0
movss %xmm0, 0x70(%rsp)
movss 0x7c(%rsp), %xmm1
movss 0x148e4(%rip), %xmm0    # 0xc8194
mulss 0x78(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss 0x148c5(%rip), %xmm2    # 0xc8190
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss 0x74(%rsp), %xmm0
movss 0x148a7(%rip), %xmm2    # 0xc8188
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x1488b(%rip), %xmm1    # 0xc817c
addss %xmm1, %xmm0
movss 0x14883(%rip), %xmm1    # 0xc8180
divss %xmm1, %xmm0
movss 0x14873(%rip), %xmm1    # 0xc817c
addss %xmm1, %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0x7c(%rsp), %xmm1
movss 0x1486b(%rip), %xmm0    # 0xc818c
mulss 0x78(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss 0x1484c(%rip), %xmm2    # 0xc8188
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss 0x74(%rsp), %xmm0
movss 0x14832(%rip), %xmm2    # 0xc8184
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x1481a(%rip), %xmm1    # 0xc817c
addss %xmm1, %xmm0
movss 0x14812(%rip), %xmm1    # 0xc8180
divss %xmm1, %xmm0
movss 0x14802(%rip), %xmm1    # 0xc817c
addss %xmm1, %xmm0
movss %xmm0, 0x68(%rsp)
xorps %xmm0, %xmm0
ucomiss 0x70(%rsp), %xmm0
jbe 0xb3999
xorps %xmm0, %xmm0
movss %xmm0, 0x2c(%rsp)
jmp 0xb39d4
movss 0x70(%rsp), %xmm0
movss 0x1478d(%rip), %xmm1    # 0xc8134
ucomiss %xmm1, %xmm0
jbe 0xb39bc
movss 0x14780(%rip), %xmm0    # 0xc8134
movss %xmm0, 0x28(%rsp)
jmp 0xb39c8
movss 0x70(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x28(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
cvttss2si %xmm0, %eax
movb %al, %cl
movq 0x98(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x98(%rsp)
movb %cl, (%rax)
xorps %xmm0, %xmm0
ucomiss 0x6c(%rsp), %xmm0
jbe 0xb3a0e
xorps %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
jmp 0xb3a49
movss 0x6c(%rsp), %xmm0
movss 0x14718(%rip), %xmm1    # 0xc8134
ucomiss %xmm1, %xmm0
jbe 0xb3a31
movss 0x1470b(%rip), %xmm0    # 0xc8134
movss %xmm0, 0x20(%rsp)
jmp 0xb3a3d
movss 0x6c(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x20(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x24(%rsp), %xmm0
cvttss2si %xmm0, %eax
movb %al, %cl
movq 0x90(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x90(%rsp)
movb %cl, (%rax)
xorps %xmm0, %xmm0
ucomiss 0x68(%rsp), %xmm0
jbe 0xb3a83
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
jmp 0xb3abe
movss 0x68(%rsp), %xmm0
movss 0x146a3(%rip), %xmm1    # 0xc8134
ucomiss %xmm1, %xmm0
jbe 0xb3aa6
movss 0x14696(%rip), %xmm0    # 0xc8134
movss %xmm0, 0x18(%rsp)
jmp 0xb3ab2
movss 0x68(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
cvttss2si %xmm0, %eax
movb %al, %cl
movq 0x88(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x88(%rsp)
movb %cl, (%rax)
movq 0x80(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0xb37f0
movq 0x60(%rsp), %rax
addq $0xb8, %rsp
retq
movq 0xa8(%rsp), %rdi
callq 0x5970
nopw %cs:(%rax,%rax)