// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<unsigned char>& cimg_library::CImg<unsigned char>::_draw_text<unsigned char, unsigned char, unsigned char>(int, int, char const*, unsigned char const*, unsigned char const*, float, cimg_library::CImgList<unsigned char> const&, bool)
CImg<T>& _draw_text(const int x0, const int y0,
                        const char *const text,
                        const tc1 *const foreground_color, const tc2 *const background_color,
                        const float opacity, const CImgList<t>& font,
                        const bool is_native_font) {
      if (!text) return *this;
      if (!font)
        throw CImgArgumentException(_cimg_instance
                                    "draw_text(): Empty specified font.",
                                    cimg_instance);

      const unsigned int text_length = (unsigned int)std::strlen(text);
      const bool _is_empty = is_empty();
      if (_is_empty) {
        // If needed, pre-compute necessary size of the image
        int x = 0, y = 0, w = 0;
        unsigned char c = 0;
        for (unsigned int i = 0; i<text_length; ++i) {
          c = text[i];
          switch (c) {
          case '\n' : y+=font[0]._height; if (x>w) w = x; x = 0; break;
          case '\t' : x+=4*font[' ']._width; break;
          default : if (c<font._width) x+=font[c]._width;
          }
        }
        if (x!=0 || c=='\n') {
          if (x>w) w=x;
          y+=font[0]._height;
        }
        assign(x0+w,y0+y,1,is_native_font?1:font[0]._spectrum,0);
      }

      int x = x0, y = y0;
      for (unsigned int i = 0; i<text_length; ++i) {
        const unsigned char c = text[i];
        switch (c) {
        case '\n' : y+=font[0]._height; x = x0; break;
        case '\t' : x+=4*font[' ']._width; break;
        default : if (c<font._width) {
            CImg<T> letter = font[c];
            if (letter) {
              if (is_native_font && _spectrum>letter._spectrum) letter.resize(-100,-100,1,_spectrum,0,2);
              const unsigned int cmin = cimg::min(_spectrum,letter._spectrum);
              if (foreground_color)
                for (unsigned int c = 0; c<cmin; ++c)
                  if (foreground_color[c]!=1) letter.get_shared_channel(c)*=foreground_color[c];
              if (c+256<font.width()) { // Letter has mask.
                if (background_color)
                  for (unsigned int c = 0; c<cmin; ++c)
                    draw_rectangle(x,y,0,c,x+letter._width-1,y+letter._height-1,0,c,background_color[c],opacity);
                draw_image(x,y,letter,font[c+256],opacity,(T)255);
              } else draw_image(x,y,letter,opacity); // Letter has no mask.
              x+=letter._width;
            }
          }
        }
      }
      return *this;
    }

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movb 0x158(%rsp), %al
movq 0x150(%rsp), %r10
movq %rdi, 0x138(%rsp)
movl %esi, 0x134(%rsp)
movl %edx, 0x130(%rsp)
movq %rcx, 0x128(%rsp)
movq %r8, 0x120(%rsp)
movq %r9, 0x118(%rsp)
movss %xmm0, 0x114(%rsp)
andb $0x1, %al
movb %al, 0x113(%rsp)
movq 0x138(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x128(%rsp)
jne 0x19116
movq 0x80(%rsp), %rax
movq %rax, 0x140(%rsp)
jmp 0x198df
movq 0x150(%rsp), %rdi
callq 0x228b0
cmpq $0x0, %rax
jne 0x19213
movl $0x4008, %edi           # imm = 0x4008
callq 0x5240
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x50(%rsp)
movl (%rax), %ecx
movl %ecx, 0x58(%rsp)
movl 0x4(%rax), %ecx
movl %ecx, 0x5c(%rsp)
movl 0x8(%rax), %ecx
movl %ecx, 0x60(%rsp)
movl 0xc(%rax), %ecx
movl %ecx, 0x64(%rsp)
movq 0x18(%rax), %rcx
movq %rcx, 0x68(%rsp)
movb 0x10(%rax), %dl
leaq 0xcf85d(%rip), %rcx     # 0xe89d2
leaq 0xb0965(%rip), %rax     # 0xc9ae1
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x70(%rsp)
callq 0x1c2e0
movq %rax, 0x78(%rsp)
jmp 0x19194
movl 0x64(%rsp), %r9d
movl 0x60(%rsp), %r8d
movl 0x5c(%rsp), %ecx
movl 0x58(%rsp), %edx
movq 0x50(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %r10
movq 0x78(%rsp), %r11
movq %rsp, %rax
movq %r11, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rsi, (%rax)
leaq 0xcefea(%rip), %rsi     # 0xe81b9
xorl %eax, %eax
callq 0x12220
jmp 0x191d8
movq 0x50(%rsp), %rdi
leaq 0xe697c(%rip), %rsi     # 0xffb60
leaq -0x6d8b(%rip), %rdx     # 0x12460
callq 0x5920
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
callq 0x53a0
jmp 0x198ef
movq 0x128(%rsp), %rdi
callq 0x5210
movq 0x80(%rsp), %rdi
movl %eax, 0x100(%rsp)
callq 0x1f750
andb $0x1, %al
movb %al, 0xff(%rsp)
testb $0x1, 0xff(%rsp)
je 0x19455
movl $0x0, 0xf8(%rsp)
movl $0x0, 0xf4(%rsp)
movl $0x0, 0xf0(%rsp)
movb $0x0, 0xef(%rsp)
movl $0x0, 0xe8(%rsp)
movl 0xe8(%rsp), %eax
cmpl 0x100(%rsp), %eax
jae 0x19393
movq 0x128(%rsp), %rax
movl 0xe8(%rsp), %ecx
movb (%rax,%rcx), %al
movb %al, 0xef(%rsp)
movzbl 0xef(%rsp), %eax
movl %eax, 0x4c(%rsp)
subl $0x9, %eax
je 0x19313
jmp 0x192bf
movl 0x4c(%rsp), %eax
subl $0xa, %eax
jne 0x19339
jmp 0x192ca
movq 0x150(%rsp), %rdi
callq 0x228b0
movl 0x4(%rax), %eax
addl 0xf4(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0xf8(%rsp), %eax
cmpl 0xf0(%rsp), %eax
jle 0x19306
movl 0xf8(%rsp), %eax
movl %eax, 0xf0(%rsp)
movl $0x0, 0xf8(%rsp)
jmp 0x1937b
movq 0x150(%rsp), %rdi
callq 0x228b0
movl 0x400(%rax), %eax
shll $0x2, %eax
addl 0xf8(%rsp), %eax
movl %eax, 0xf8(%rsp)
jmp 0x1937b
movzbl 0xef(%rsp), %eax
movq 0x150(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x19379
movq 0x150(%rsp), %rdi
callq 0x228b0
movzbl 0xef(%rsp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
addl 0xf8(%rsp), %eax
movl %eax, 0xf8(%rsp)
jmp 0x1937b
jmp 0x1937d
movl 0xe8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe8(%rsp)
jmp 0x1927f
cmpl $0x0, 0xf8(%rsp)
jne 0x193aa
movzbl 0xef(%rsp), %eax
cmpl $0xa, %eax
jne 0x193e6
movl 0xf8(%rsp), %eax
cmpl 0xf0(%rsp), %eax
jle 0x193c8
movl 0xf8(%rsp), %eax
movl %eax, 0xf0(%rsp)
movq 0x150(%rsp), %rdi
callq 0x228b0
movl 0x4(%rax), %eax
addl 0xf4(%rsp), %eax
movl %eax, 0xf4(%rsp)
movl 0x134(%rsp), %eax
addl 0xf0(%rsp), %eax
movl %eax, 0x44(%rsp)
movl 0x130(%rsp), %eax
addl 0xf4(%rsp), %eax
movl %eax, 0x48(%rsp)
testb $0x1, 0x113(%rsp)
je 0x1941f
movl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x19433
movq 0x150(%rsp), %rdi
callq 0x228b0
movl 0xc(%rax), %eax
movl %eax, 0x40(%rsp)
movl 0x48(%rsp), %edx
movl 0x44(%rsp), %esi
movq 0x80(%rsp), %rdi
movl 0x40(%rsp), %r8d
movl $0x1, %ecx
xorl %r9d, %r9d
callq 0x1c150
movl 0x134(%rsp), %eax
movl %eax, 0xe4(%rsp)
movl 0x130(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl $0x0, 0xdc(%rsp)
movl 0xdc(%rsp), %eax
cmpl 0x100(%rsp), %eax
jae 0x198cf
movq 0x128(%rsp), %rax
movl 0xdc(%rsp), %ecx
movb (%rax,%rcx), %al
movb %al, 0xdb(%rsp)
movzbl 0xdb(%rsp), %eax
movl %eax, 0x3c(%rsp)
subl $0x9, %eax
je 0x194f8
jmp 0x194bc
movl 0x3c(%rsp), %eax
subl $0xa, %eax
jne 0x19521
jmp 0x194c7
movq 0x150(%rsp), %rdi
callq 0x228b0
movl 0x4(%rax), %eax
addl 0xe0(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0x134(%rsp), %eax
movl %eax, 0xe4(%rsp)
jmp 0x198b7
movq 0x150(%rsp), %rdi
callq 0x228b0
movl 0x400(%rax), %eax
shll $0x2, %eax
addl 0xe4(%rsp), %eax
movl %eax, 0xe4(%rsp)
jmp 0x198b7
movzbl 0xdb(%rsp), %eax
movq 0x150(%rsp), %rcx
cmpl (%rcx), %eax
jae 0x198b5
movq 0x150(%rsp), %rdi
callq 0x228b0
movq %rax, %rsi
movzbl 0xdb(%rsp), %eax
shlq $0x5, %rax
addq %rax, %rsi
leaq 0xb8(%rsp), %rdi
callq 0x17070
leaq 0xb8(%rsp), %rdi
callq 0x19990
cmpq $0x0, %rax
je 0x19897
testb $0x1, 0x113(%rsp)
je 0x195f4
movq 0x80(%rsp), %rax
movl 0xc(%rax), %eax
cmpl 0xc4(%rsp), %eax
jbe 0x195f4
movq 0x80(%rsp), %rax
movl 0xc(%rax), %r8d
movq %rsp, %rax
movl $0x2, (%rax)
leaq 0xb8(%rsp), %rdi
movl $0xffffff9c, %edx       # imm = 0xFFFFFF9C
movl $0x1, %ecx
xorl %r9d, %r9d
xorps %xmm3, %xmm3
movl %edx, %esi
movaps %xmm3, %xmm0
movaps %xmm3, %xmm1
movaps %xmm3, %xmm2
callq 0x15920
jmp 0x195d9
jmp 0x195f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
jmp 0x198a6
movq 0x80(%rsp), %rdi
addq $0xc, %rdi
leaq 0xc4(%rsp), %rsi
callq 0x23ba0
movl %eax, 0x38(%rsp)
jmp 0x19613
movl 0x38(%rsp), %eax
movl %eax, 0xb4(%rsp)
cmpq $0x0, 0x120(%rsp)
je 0x196f8
movl $0x0, 0xb0(%rsp)
movl 0xb0(%rsp), %eax
cmpl 0xb4(%rsp), %eax
jae 0x196f6
movq 0x120(%rsp), %rax
movl 0xb0(%rsp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0x196de
movq 0x120(%rsp), %rax
movl 0xb0(%rsp), %ecx
movl %ecx, %edx
movb (%rax,%rcx), %al
movb %al, 0x37(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x23be0
jmp 0x19693
movb 0x37(%rsp), %al
movzbl %al, %esi
leaq 0x90(%rsp), %rdi
callq 0x23c20
jmp 0x196a9
leaq 0x90(%rsp), %rdi
callq 0x15650
jmp 0x196de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x15650
jmp 0x198a6
jmp 0x196e0
movl 0xb0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb0(%rsp)
jmp 0x19638
jmp 0x196f8
movzbl 0xdb(%rsp), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, 0x2c(%rsp)
movq 0x150(%rsp), %rdi
callq 0x23cd0
movl %eax, 0x30(%rsp)
jmp 0x1971c
movl 0x2c(%rsp), %eax
movl 0x30(%rsp), %ecx
cmpl %ecx, %eax
jge 0x19852
cmpq $0x0, 0x118(%rsp)
je 0x197ea
movl $0x0, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
cmpl 0xb4(%rsp), %eax
jae 0x197e8
movq 0x80(%rsp), %rdi
movl 0xe4(%rsp), %esi
movl 0xe0(%rsp), %edx
movl 0x8c(%rsp), %eax
movl %eax, %r10d
movl %r10d, %r8d
movl 0xb8(%rsp), %ecx
movl 0xbc(%rsp), %eax
movl %ecx, %r9d
movl %esi, %ecx
leal -0x1(%rcx,%r9), %r9d
movl %eax, %ecx
movl %edx, %eax
leal -0x1(%rax,%rcx), %ecx
movq 0x118(%rsp), %rax
movzbl (%rax,%r10), %r10d
movss 0x114(%rsp), %xmm0
movq %rsp, %rax
movl %r10d, 0x18(%rax)
movl %r8d, 0x10(%rax)
movl %ecx, (%rax)
movl $0x0, 0x8(%rax)
xorl %ecx, %ecx
callq 0x23ce0
jmp 0x197d0
jmp 0x197d2
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x19746
jmp 0x197ea
movl 0xe4(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0xe0(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x150(%rsp), %rdi
callq 0x228b0
movq 0x80(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x28(%rsp), %edx
movzbl 0xdb(%rsp), %ecx
shll $0x5, %ecx
leaq 0x2000(%rax,%rcx), %r8
movss 0x114(%rsp), %xmm0
leaq 0xb8(%rsp), %rcx
movss 0xae8eb(%rip), %xmm1    # 0xc8134
callq 0x24550
jmp 0x19850
jmp 0x19882
movq 0x80(%rsp), %rdi
movl 0xe4(%rsp), %esi
movl 0xe0(%rsp), %edx
movss 0x114(%rsp), %xmm0
leaq 0xb8(%rsp), %rcx
callq 0x173b0
jmp 0x19880
jmp 0x19882
movl 0xb8(%rsp), %eax
addl 0xe4(%rsp), %eax
movl %eax, 0xe4(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x15650
jmp 0x198b5
leaq 0xb8(%rsp), %rdi
callq 0x15650
jmp 0x198ef
jmp 0x198b7
jmp 0x198b9
movl 0xdc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xdc(%rsp)
jmp 0x1947c
movq 0x80(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x140(%rsp), %rax
addq $0x148, %rsp            # imm = 0x148
retq
movq 0x108(%rsp), %rdi
callq 0x5970
nopl (%rax)