// File: /workspace/github_cpp_makefile_star2_O1/srajangarg[P]raytracer/src/core/stb_image.hpp
// Function: stbi__tga_load(stbi__context*, int*, int*, int*, int)
static stbi_uc *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
   //   read in the TGA header stuff
   int tga_offset = stbi__get8(s);
   int tga_indexed = stbi__get8(s);
   int tga_image_type = stbi__get8(s);
   int tga_is_RLE = 0;
   int tga_palette_start = stbi__get16le(s);
   int tga_palette_len = stbi__get16le(s);
   int tga_palette_bits = stbi__get8(s);
   int tga_x_origin = stbi__get16le(s);
   int tga_y_origin = stbi__get16le(s);
   int tga_width = stbi__get16le(s);
   int tga_height = stbi__get16le(s);
   int tga_bits_per_pixel = stbi__get8(s);
   int tga_comp, tga_rgb16=0;
   int tga_inverted = stbi__get8(s);
   // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?)
   //   image data
   unsigned char *tga_data;
   unsigned char *tga_palette = NULL;
   int i, j;
   unsigned char raw_data[4];
   int RLE_count = 0;
   int RLE_repeating = 0;
   int read_next_pixel = 1;

   //   do a tiny bit of precessing
   if ( tga_image_type >= 8 )
   {
      tga_image_type -= 8;
      tga_is_RLE = 1;
   }
   tga_inverted = 1 - ((tga_inverted >> 5) & 1);

   //   If I'm paletted, then I'll use the number of bits from the palette
   if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16);
   else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16);

   if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency
      return stbi__errpuc("bad format", "Can't find out TGA pixelformat");

   //   tga info
   *x = tga_width;
   *y = tga_height;
   if (comp) *comp = tga_comp;

   tga_data = (unsigned char*)stbi__malloc( (size_t)tga_width * tga_height * tga_comp );
   if (!tga_data) return stbi__errpuc("outofmem", "Out of memory");

   // skip to the data's starting position (offset usually = 0)
   stbi__skip(s, tga_offset );

   if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) {
      for (i=0; i < tga_height; ++i) {
         int row = tga_inverted ? tga_height -i - 1 : i;
         stbi_uc *tga_row = tga_data + row*tga_width*tga_comp;
         stbi__getn(s, tga_row, tga_width * tga_comp);
      }
   } else  {
      //   do I need to load a palette?
      if ( tga_indexed)
      {
         //   any data to skip? (offset usually = 0)
         stbi__skip(s, tga_palette_start );
         //   load the palette
         tga_palette = (unsigned char*)stbi__malloc( tga_palette_len * tga_comp );
         if (!tga_palette) {
            STBI_FREE(tga_data);
            return stbi__errpuc("outofmem", "Out of memory");
         }
         if (tga_rgb16) {
            stbi_uc *pal_entry = tga_palette;
            STBI_ASSERT(tga_comp == STBI_rgb);
            for (i=0; i < tga_palette_len; ++i) {
               stbi__tga_read_rgb16(s, pal_entry);
               pal_entry += tga_comp;
            }
         } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) {
               STBI_FREE(tga_data);
               STBI_FREE(tga_palette);
               return stbi__errpuc("bad palette", "Corrupt TGA");
         }
      }
      //   load the data
      for (i=0; i < tga_width * tga_height; ++i)
      {
         //   if I'm in RLE mode, do I need to get a RLE stbi__pngchunk?
         if ( tga_is_RLE )
         {
            if ( RLE_count == 0 )
            {
               //   yep, get the next byte as a RLE command
               int RLE_cmd = stbi__get8(s);
               RLE_count = 1 + (RLE_cmd & 127);
               RLE_repeating = RLE_cmd >> 7;
               read_next_pixel = 1;
            } else if ( !RLE_repeating )
            {
               read_next_pixel = 1;
            }
         } else
         {
            read_next_pixel = 1;
         }
         //   OK, if I need to read a pixel, do it now
         if ( read_next_pixel )
         {
            //   load however much data we did have
            if ( tga_indexed )
            {
               // read in index, then perform the lookup
               int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s);
               if ( pal_idx >= tga_palette_len ) {
                  // invalid index
                  pal_idx = 0;
               }
               pal_idx *= tga_comp;
               for (j = 0; j < tga_comp; ++j) {
                  raw_data[j] = tga_palette[pal_idx+j];
               }
            } else if(tga_rgb16) {
               STBI_ASSERT(tga_comp == STBI_rgb);
               stbi__tga_read_rgb16(s, raw_data);
            } else {
               //   read in the data raw
               for (j = 0; j < tga_comp; ++j) {
                  raw_data[j] = stbi__get8(s);
               }
            }
            //   clear the reading flag for the next pixel
            read_next_pixel = 0;
         } // end of reading a pixel

         // copy data
         for (j = 0; j < tga_comp; ++j)
           tga_data[i*tga_comp+j] = raw_data[j];

         //   in case we're in RLE mode, keep counting down
         --RLE_count;
      }
      //   do I need to invert the image?
      if ( tga_inverted )
      {
         for (j = 0; j*2 < tga_height; ++j)
         {
            int index1 = j * tga_width * tga_comp;
            int index2 = (tga_height - 1 - j) * tga_width * tga_comp;
            for (i = tga_width * tga_comp; i > 0; --i)
            {
               unsigned char temp = tga_data[index1];
               tga_data[index1] = tga_data[index2];
               tga_data[index2] = temp;
               ++index1;
               ++index2;
            }
         }
      }
      //   clear my palette, if I had one
      if ( tga_palette != NULL )
      {
         STBI_FREE( tga_palette );
      }
   }

   // swap RGB - if the source data was RGB16, it already is in the right order
   if (tga_comp >= 3 && !tga_rgb16)
   {
      unsigned char* tga_pixel = tga_data;
      for (i=0; i < tga_width * tga_height; ++i)
      {
         unsigned char temp = tga_pixel[0];
         tga_pixel[0] = tga_pixel[2];
         tga_pixel[2] = temp;
         tga_pixel += tga_comp;
      }
   }

   // convert to target component count
   if (req_comp && req_comp != tga_comp)
      tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height);

   //   the things I do to get rid of an error message, and yet keep
   //   Microsoft's C compilers happy... [8^(
   tga_palette_start = tga_palette_len = tga_palette_bits =
         tga_x_origin = tga_y_origin = 0;
   //   OK, done
   return tga_data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r8d, 0x7c(%rsp)
movq %rcx, %rbx
movq %rdx, 0x18(%rsp)
movq %rsi, %r15
movq %rdi, %r14
movq 0xb8(%rdi), %rax
cmpq 0xc0(%rdi), %rax
jb 0x1c0dc
cmpl $0x0, 0x30(%r14)
je 0x1c0ac
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r13
movl 0x34(%r14), %edx
movq %r13, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c0b6
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c0d5
movl $0x0, 0x40(%rsp)
jmp 0x1c0ee
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movzbl (%rax), %eax
movl %eax, 0x40(%rsp)
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x1c15c
cmpl $0x0, 0x30(%r14)
je 0x1c131
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r13
movl 0x34(%r14), %edx
movq %r13, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c136
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c155
xorl %r12d, %r12d
jmp 0x1c16e
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
cmpb $0x0, (%rax)
setne %r12b
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x1c1e1
cmpl $0x0, 0x30(%r14)
je 0x1c1b1
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r13
movl 0x34(%r14), %edx
movq %r13, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c1bb
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c1da
movl $0x0, 0x2c(%rsp)
jmp 0x1c1f2
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %al
movl %eax, 0x2c(%rsp)
movq %r14, %rdi
callq 0x15be7
movl %eax, 0x58(%rsp)
movq %r14, %rdi
callq 0x15be7
movl %eax, 0x4c(%rsp)
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x1c277
cmpl $0x0, 0x30(%r14)
je 0x1c24d
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r13
movl 0x34(%r14), %edx
movq %r13, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c251
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c270
xorl %ebp, %ebp
jmp 0x1c285
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %bpl
movq %r14, %rdi
callq 0x15be7
movq %r14, %rdi
callq 0x15be7
movq %r14, %rdi
callq 0x15be7
movl %eax, %r13d
movq %r14, %rdi
callq 0x15be7
movl %eax, 0x8(%rsp)
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
movl %r12d, 0x28(%rsp)
jb 0x1c32f
cmpl $0x0, 0x30(%r14)
je 0x1c2f7
movl %r13d, %r12d
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r13
movl 0x34(%r14), %edx
movq %r13, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c301
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c320
movl $0x0, 0x24(%rsp)
jmp 0x1c340
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
movl %r12d, %r13d
movl 0x28(%rsp), %r12d
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %al
movl %eax, 0x24(%rsp)
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x1c3b8
cmpl $0x0, 0x30(%r14)
je 0x1c386
movl %r13d, %r12d
movq 0x28(%r14), %rdi
leaq 0x38(%r14), %r13
movl 0x34(%r14), %edx
movq %r13, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c38a
movq %r13, 0xb8(%r14)
cltq
addq %r13, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c3a9
movb $0x1, %al
jmp 0x1c3c9
movl $0x0, 0x30(%r14)
movq %r13, 0xb8(%r14)
leaq 0x39(%r14), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
movl %r12d, %r13d
movl 0x28(%rsp), %r12d
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
testb $0x20, (%rax)
sete %al
movb %al, 0x7(%rsp)
testb %r12b, %r12b
movl %r13d, 0x10(%rsp)
je 0x1c3fc
movzbl %bpl, %eax
movb $0x1, %cl
movl %ecx, 0xc(%rsp)
cmpl $0x17, %eax
jg 0x1c43d
leal -0xf(%rax), %ecx
cmpl $0x2, %ecx
jb 0x1c45b
cmpl $0x8, %eax
je 0x1c479
jmp 0x1c483
movzbl 0x24(%rsp), %eax
movb $0x1, %cl
movl %ecx, 0xc(%rsp)
cmpl $0xf, %eax
jle 0x1c451
cmpl $0x20, %eax
je 0x1c46d
cmpl $0x18, %eax
je 0x1c46d
cmpl $0x10, %eax
jne 0x1c483
movl 0x2c(%rsp), %edx
movzbl %dl, %eax
leal -0x8(%rax), %ecx
cmpb $0x8, %dl
cmovbl %eax, %ecx
xorl %ebp, %ebp
cmpl $0x3, %ecx
sete %al
jne 0x1c45b
movb %al, %bpl
xorl $0x3, %ebp
jmp 0x1c47e
cmpl $0x18, %eax
je 0x1c447
cmpl $0x20, %eax
jne 0x1c483
shrb $0x3, %bpl
movzbl %bpl, %ebp
jmp 0x1c47e
cmpl $0x8, %eax
je 0x1c479
cmpl $0xf, %eax
jne 0x1c483
movl $0x3, %ebp
movb $0x1, %r13b
movl $0x0, 0xc(%rsp)
jmp 0x1c488
movl 0x24(%rsp), %eax
shrb $0x3, %al
movzbl %al, %ebp
jmp 0x1c47e
movl $0x1, %ebp
xorl %r13d, %r13d
jmp 0x1c488
xorl %r13d, %r13d
xorl %ebp, %ebp
testl %ebp, %ebp
je 0x1c55e
movl 0x10(%rsp), %eax
movl %eax, (%r15)
movl 0x8(%rsp), %eax
movq 0x18(%rsp), %rcx
movl %eax, (%rcx)
testq %rbx, %rbx
je 0x1c4a9
movl %ebp, (%rbx)
movl 0x8(%rsp), %eax
movl %eax, %ebx
imull 0x10(%rsp), %ebx
movl %ebp, %r15d
movq %r15, %rdi
imulq %rbx, %rdi
callq 0x4400
testq %rax, %rax
je 0x1c9e7
movq %rbx, 0x68(%rsp)
movq %rax, 0x30(%rsp)
cmpb $0x8, 0x2c(%rsp)
setae %bl
movq %r14, %rdi
movl 0x40(%rsp), %esi
callq 0x1e25e
movl 0x28(%rsp), %ecx
movl %ecx, %eax
orb %r13b, %al
orb %bl, %al
movl %ebp, 0x18(%rsp)
movq %r15, 0x60(%rsp)
je 0x1c56a
testb %cl, %cl
je 0x1c5bf
movq %r14, %rdi
movl 0x58(%rsp), %esi
callq 0x1e25e
movl %ebp, %r15d
movl 0x4c(%rsp), %ebx
imull %ebx, %r15d
movq %r15, %rdi
callq 0x4400
testq %rax, %rax
je 0x1c9dd
cmpb $0x0, 0xc(%rsp)
je 0x1ca0d
movq %r14, %rdi
movq %rax, %rsi
movl %r15d, %edx
movq %rax, %rbx
callq 0x20499
testl %eax, %eax
je 0x1caa0
movq 0x30(%rsp), %r15
movq %rbx, %rax
jmp 0x1c5c6
leaq 0x11260(%rip), %rax     # 0x2d7c5
jmp 0x1c9ee
movl %r13d, 0x48(%rsp)
cmpl $0x0, 0x8(%rsp)
movb 0x7(%rsp), %r13b
movq 0x30(%rsp), %r12
je 0x1c974
movl 0x10(%rsp), %ebp
imull 0x18(%rsp), %ebp
movl 0x8(%rsp), %ebx
decl %ebx
xorl %r15d, %r15d
testb %r13b, %r13b
movl %r15d, %eax
cmovnel %ebx, %eax
imull %ebp, %eax
movslq %eax, %rsi
addq %r12, %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x20499
incl %r15d
addl $-0x1, %ebx
jb 0x1c596
jmp 0x1c974
xorl %eax, %eax
movq 0x30(%rsp), %r15
movq %rax, 0x50(%rsp)
movl %r13d, 0x48(%rsp)
cmpl $0x0, 0x68(%rsp)
je 0x1c8f1
leaq 0x38(%r14), %rax
movq %rax, 0x40(%rsp)
movl 0x18(%rsp), %eax
cmpl $0x1, %eax
movl %eax, %ebp
adcl $0x0, %ebp
movq 0x60(%rsp), %rax
cmpq $0x1, %rax
adcq $0x0, %rax
movq %rax, 0x58(%rsp)
leaq 0x39(%r14), %rax
movq %rax, 0x70(%rsp)
movl 0x68(%rsp), %eax
movq %rax, 0x80(%rsp)
xorl %r13d, %r13d
xorl %eax, %eax
movl $0x0, 0x3c(%rsp)
xorl %ebx, %ebx
movq 0x40(%rsp), %r12
cmpb $0x8, 0x2c(%rsp)
jb 0x1c6da
testl %ebx, %ebx
je 0x1c64f
xorl %ecx, %ecx
cmpl $0x0, 0x3c(%rsp)
setne %cl
andb %cl, %al
movl %ecx, 0x3c(%rsp)
jmp 0x1c6dc
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x1c6be
cmpl $0x0, 0x30(%r14)
je 0x1c693
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq 0x40(%rsp), %rbx
movq %rbx, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c697
movq %rbx, 0xb8(%r14)
cltq
addq %rbx, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c6b7
xorl %eax, %eax
jmp 0x1c6cc
movl $0x0, 0x30(%r14)
movq %rbx, 0xb8(%r14)
movq 0x70(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movzbl (%rax), %eax
movl %eax, %ebx
andl $0x7f, %ebx
incl %ebx
shrl $0x7, %eax
movl %eax, 0x3c(%rsp)
xorl %eax, %eax
testb %al, %al
jne 0x1c8bb
cmpb $0x0, 0x28(%rsp)
je 0x1c749
cmpb $0x8, 0x24(%rsp)
jne 0x1c7e4
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x1c888
cmpl $0x0, 0x30(%r14)
je 0x1c85d
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq 0x40(%rsp), %r15
movq %r15, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c861
movq %r15, 0xb8(%r14)
cltq
addq %r15, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c881
cmpb $0x0, 0xc(%rsp)
je 0x1c7f3
xorl %r15d, %r15d
movq 0xb8(%r14), %rax
cmpq 0xc0(%r14), %rax
jb 0x1c7c1
cmpl $0x0, 0x30(%r14)
je 0x1c796
movq 0x28(%r14), %rdi
movl 0x34(%r14), %edx
movq %r12, %rsi
callq *0x10(%r14)
testl %eax, %eax
je 0x1c79a
movq %r12, 0xb8(%r14)
cltq
addq %r12, %rax
movq %rax, 0xc0(%r14)
jmp 0x1c7ba
xorl %eax, %eax
jmp 0x1c7ce
movl $0x0, 0x30(%r14)
movq %r12, 0xb8(%r14)
movq 0x70(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movb (%rax), %al
movb %al, 0x14(%rsp,%r15)
incq %r15
cmpq %r15, %rbp
jne 0x1c757
jmp 0x1c8bb
movq %r14, %rdi
callq 0x15be7
movl %eax, %esi
jmp 0x1c896
cmpl $0x3, 0x18(%rsp)
jne 0x1cabe
movq %r14, %rdi
callq 0x15be7
movl %eax, %ecx
shrl $0xa, %ecx
andl $0x1f, %ecx
movl %eax, %edx
shrl $0x5, %edx
andl $0x1f, %edx
andl $0x1f, %eax
movl %ecx, %esi
shll $0x8, %esi
subl %ecx, %esi
imulq $0x8421085, %rsi, %rcx  # imm = 0x8421085
shrq $0x20, %rcx
movb %cl, 0x14(%rsp)
movl %edx, %ecx
shll $0x8, %ecx
subl %edx, %ecx
imulq $0x8421085, %rcx, %rcx  # imm = 0x8421085
shrq $0x20, %rcx
movb %cl, 0x15(%rsp)
movl %eax, %ecx
shll $0x8, %ecx
subl %eax, %ecx
imulq $0x8421085, %rcx, %rax  # imm = 0x8421085
shrq $0x20, %rax
movb %al, 0x16(%rsp)
jmp 0x1c8bb
xorl %esi, %esi
jmp 0x1c896
movl $0x0, 0x30(%r14)
movq %r15, 0xb8(%r14)
movq 0x70(%rsp), %rax
movq %rax, 0xc0(%r14)
movb $0x0, 0x38(%r14)
movq 0xb8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r14)
movzbl (%rax), %esi
cmpl 0x4c(%rsp), %esi
movl $0x0, %eax
cmovael %eax, %esi
imull 0x18(%rsp), %esi
addq 0x50(%rsp), %rsi
leaq 0x14(%rsp), %rdi
movq 0x58(%rsp), %rdx
callq 0x42a0
movl 0x18(%rsp), %eax
movl %eax, %edi
imull %r13d, %edi
movq 0x30(%rsp), %r15
addq %r15, %rdi
leaq 0x14(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x42a0
decl %ebx
incq %r13
movb $0x1, %al
cmpq 0x80(%rsp), %r13
jne 0x1c62b
cmpl $0x0, 0x8(%rsp)
sete %al
movb 0x7(%rsp), %cl
xorb $0x1, %cl
orb %al, %cl
movl 0x10(%rsp), %r14d
jne 0x1c962
movl 0x18(%rsp), %eax
imull %r14d, %eax
movl 0x8(%rsp), %ecx
decl %ecx
movl %eax, %edx
imull %ecx, %edx
shrl %ecx
leal 0x1(%rax), %esi
xorl %edi, %edi
xorl %r8d, %r8d
movl %edi, %edi
testl %r14d, %r14d
je 0x1c952
movslq %edx, %r9
movl %esi, %r10d
movq %r15, %r11
movb (%r11,%rdi), %bl
movb (%r11,%r9), %bpl
movb %bpl, (%r11,%rdi)
movb %bl, (%r11,%r9)
incq %r11
decl %r10d
cmpl $0x1, %r10d
jg 0x1c936
leal 0x1(%r8), %r9d
subl %eax, %edx
addl %eax, %edi
cmpl %ecx, %r8d
movl %r9d, %r8d
jne 0x1c926
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
movq %r15, %r12
je 0x1c974
callq 0x4390
movl 0x18(%rsp), %esi
cmpl $0x3, %esi
setb %al
movq 0x68(%rsp), %r8
testl %r8d, %r8d
sete %cl
orb %al, %cl
orb 0x48(%rsp), %cl
movq 0x60(%rsp), %r9
jne 0x1c9af
movq %r12, %rax
addq $0x2, %rax
movb -0x2(%rax), %cl
movb (%rax), %dl
movb %dl, -0x2(%rax)
movb %cl, (%rax)
addq %r9, %rax
decl %r8d
jne 0x1c99d
movl 0x7c(%rsp), %edx
testl %edx, %edx
movl 0x10(%rsp), %ecx
je 0x1c9f8
cmpl %edx, %esi
je 0x1c9f8
movq %r12, %rdi
movl 0x8(%rsp), %r8d
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2003d
movq 0x30(%rsp), %rdi
callq 0x4390
leaq 0x1081b(%rip), %rax     # 0x2d209
movq %rax, 0x1b9bb(%rip)     # 0x383b0
xorl %r12d, %r12d
movq %r12, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, %ebp
jne 0x1cadd
testl %ebx, %ebx
movq 0x30(%rsp), %r15
je 0x1c5c6
movl %ebx, %ebp
movq %rax, 0x50(%rsp)
movq %rax, %rbx
addq $0x2, %rbx
movq 0x60(%rsp), %r12
movq %r14, %rdi
callq 0x15be7
movl %eax, %ecx
shrl $0xa, %ecx
andl $0x1f, %ecx
movl %eax, %edx
shrl $0x5, %edx
andl $0x1f, %edx
andl $0x1f, %eax
movl %ecx, %esi
shll $0x8, %esi
subl %ecx, %esi
imulq $0x8421085, %rsi, %rcx  # imm = 0x8421085
shrq $0x20, %rcx
movb %cl, -0x2(%rbx)
movl %edx, %ecx
shll $0x8, %ecx
subl %edx, %ecx
imulq $0x8421085, %rcx, %rcx  # imm = 0x8421085
shrq $0x20, %rcx
movb %cl, -0x1(%rbx)
movl %eax, %ecx
shll $0x8, %ecx
subl %eax, %ecx
imulq $0x8421085, %rcx, %rax  # imm = 0x8421085
shrq $0x20, %rax
movb %al, (%rbx)
addq %r12, %rbx
decl %ebp
jne 0x1ca36
movq 0x50(%rsp), %rax
jmp 0x1c5c6
movq 0x30(%rsp), %rdi
callq 0x4390
movq %rbx, %rdi
callq 0x4390
leaq 0x10dfc(%rip), %rax     # 0x2d8b5
jmp 0x1c9ee
leaq 0x10d98(%rip), %rdi     # 0x2d85d
leaq 0x1080d(%rip), %rsi     # 0x2d2d9
leaq 0x10d9f(%rip), %rcx     # 0x2d872
movl $0x13f0, %edx           # imm = 0x13F0
callq 0x4200
leaq 0x10d79(%rip), %rdi     # 0x2d85d
leaq 0x107ee(%rip), %rsi     # 0x2d2d9
leaq 0x10d80(%rip), %rcx     # 0x2d872
movl $0x13bf, %edx           # imm = 0x13BF
callq 0x4200