// File: /workspace/github_cpp_makefile_star2_O3/srajangarg[P]raytracer/src/core/stb_image.hpp
// Function: stbi__create_png_image_raw(stbi__png*, unsigned char*, unsigned int, int, unsigned int, unsigned int, int, int)
static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color)
{
   stbi__context *s = a->s;
   stbi__uint32 i,j,stride = x*out_n;
   stbi__uint32 img_len, img_width_bytes;
   int k;
   int img_n = s->img_n; // copy it into a local for later

   STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);
   a->out = (stbi_uc *) stbi__malloc(x * y * out_n); // extra bytes to write off the end into
   if (!a->out) return stbi__err("outofmem", "Out of memory");

   img_width_bytes = (((img_n * x * depth) + 7) >> 3);
   img_len = (img_width_bytes + 1) * y;
   if (s->img_x == x && s->img_y == y) {
      if (raw_len != img_len) return stbi__err("not enough pixels","Corrupt PNG");
   } else { // interlaced:
      if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG");
   }

   for (j=0; j < y; ++j) {
      stbi_uc *cur = a->out + stride*j;
      stbi_uc *prior = cur - stride;
      int filter = *raw++;
      int filter_bytes = img_n;
      int width = x;
      if (filter > 4)
         return stbi__err("invalid filter","Corrupt PNG");

      if (depth < 8) {
         STBI_ASSERT(img_width_bytes <= x);
         cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place
         filter_bytes = 1;
         width = img_width_bytes;
      }

      // if first row, use special filter that doesn't sample previous row
      if (j == 0) filter = first_row_filter[filter];

      // handle first byte explicitly
      for (k=0; k < filter_bytes; ++k) {
         switch (filter) {
            case STBI__F_none       : cur[k] = raw[k]; break;
            case STBI__F_sub        : cur[k] = raw[k]; break;
            case STBI__F_up         : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
            case STBI__F_avg        : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break;
            case STBI__F_paeth      : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break;
            case STBI__F_avg_first  : cur[k] = raw[k]; break;
            case STBI__F_paeth_first: cur[k] = raw[k]; break;
         }
      }

      if (depth == 8) {
         if (img_n != out_n)
            cur[img_n] = 255; // first pixel
         raw += img_n;
         cur += out_n;
         prior += out_n;
      } else {
         raw += 1;
         cur += 1;
         prior += 1;
      }

      // this is a little gross, so that we don't switch per-pixel or per-component
      if (depth < 8 || img_n == out_n) {
         int nk = (width - 1)*img_n;
         #define CASE(f) \
             case f:     \
                for (k=0; k < nk; ++k)
         switch (filter) {
            // "none" filter turns into a memcpy here; make that explicit.
            case STBI__F_none:         memcpy(cur, raw, nk); break;
            CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break;
            CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
            CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break;
            CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break;
            CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break;
            CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break;
         }
         #undef CASE
         raw += nk;
      } else {
         STBI_ASSERT(img_n+1 == out_n);
         #define CASE(f) \
             case f:     \
                for (i=x-1; i >= 1; --i, cur[img_n]=255,raw+=img_n,cur+=out_n,prior+=out_n) \
                   for (k=0; k < img_n; ++k)
         switch (filter) {
            CASE(STBI__F_none)         cur[k] = raw[k]; break;
            CASE(STBI__F_sub)          cur[k] = STBI__BYTECAST(raw[k] + cur[k-out_n]); break;
            CASE(STBI__F_up)           cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
            CASE(STBI__F_avg)          cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-out_n])>>1)); break;
            CASE(STBI__F_paeth)        cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
            CASE(STBI__F_avg_first)    cur[k] = STBI__BYTECAST(raw[k] + (cur[k-out_n] >> 1)); break;
            CASE(STBI__F_paeth_first)  cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-out_n],0,0)); break;
         }
         #undef CASE
      }
   }

   // we make a separate pass to expand bits to pixels; for performance,
   // this could run two scanlines behind the above code, so it won't
   // intefere with filtering but will still be in the cache.
   if (depth < 8) {
      for (j=0; j < y; ++j) {
         stbi_uc *cur = a->out + stride*j;
         stbi_uc *in  = a->out + stride*j + x*out_n - img_width_bytes;
         // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit
         // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop
         stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range

         // note that the final byte might overshoot and write more data than desired.
         // we can allocate enough data that this never writes out of memory, but it
         // could also overwrite the next scanline. can it overwrite non-empty data
         // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel.
         // so we need to explicitly clamp the final ones

         if (depth == 4) {
            for (k=x*img_n; k >= 2; k-=2, ++in) {
               *cur++ = scale * ((*in >> 4)       );
               *cur++ = scale * ((*in     ) & 0x0f);
            }
            if (k > 0) *cur++ = scale * ((*in >> 4)       );
         } else if (depth == 2) {
            for (k=x*img_n; k >= 4; k-=4, ++in) {
               *cur++ = scale * ((*in >> 6)       );
               *cur++ = scale * ((*in >> 4) & 0x03);
               *cur++ = scale * ((*in >> 2) & 0x03);
               *cur++ = scale * ((*in     ) & 0x03);
            }
            if (k > 0) *cur++ = scale * ((*in >> 6)       );
            if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03);
            if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03);
         } else if (depth == 1) {
            for (k=x*img_n; k >= 8; k-=8, ++in) {
               *cur++ = scale * ((*in >> 7)       );
               *cur++ = scale * ((*in >> 6) & 0x01);
               *cur++ = scale * ((*in >> 5) & 0x01);
               *cur++ = scale * ((*in >> 4) & 0x01);
               *cur++ = scale * ((*in >> 3) & 0x01);
               *cur++ = scale * ((*in >> 2) & 0x01);
               *cur++ = scale * ((*in >> 1) & 0x01);
               *cur++ = scale * ((*in     ) & 0x01);
            }
            if (k > 0) *cur++ = scale * ((*in >> 7)       );
            if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01);
            if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01);
            if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01);
            if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01);
            if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01);
            if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01);
         }
         if (img_n != out_n) {
            int q;
            // insert alpha = 255
            cur = a->out + stride*j;
            if (img_n == 1) {
               for (q=x-1; q >= 0; --q) {
                  cur[q*2+1] = 255;
                  cur[q*2+0] = cur[q];
               }
            } else {
               STBI_ASSERT(img_n == 3);
               for (q=x-1; q >= 0; --q) {
                  cur[q*4+3] = 255;
                  cur[q*4+2] = cur[q*3+2];
                  cur[q*4+1] = cur[q*3+1];
                  cur[q*4+0] = cur[q*3+0];
               }
            }
         }
      }
   }

   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %edx, %r15d
movq (%rdi), %rbx
movl 0x8(%rbx), %edx
cmpl %ecx, %edx
sete %al
movq %rdx, 0x48(%rsp)
incl %edx
movl %edx, 0x74(%rsp)
cmpl %ecx, %edx
sete %dl
orb %al, %dl
je 0x21777
movl %r9d, %r13d
movl %r8d, %ebp
movq %rsi, %r12
movq %rdi, %r14
movl %r8d, %eax
movl %ecx, 0x1c(%rsp)
imull %ecx, %eax
movl %eax, 0x18(%rsp)
movl %eax, %edi
imull %r9d, %edi
callq 0x43f0
movq %r14, 0x68(%rsp)
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x21318
movq 0x48(%rsp), %r14
movl %r14d, %eax
imull %ebp, %eax
movl %eax, 0x14(%rsp)
imull 0xe0(%rsp), %eax
addl $0x7, %eax
shrl $0x3, %eax
movq %rax, 0x58(%rsp)
incl %eax
imull %r13d, %eax
movq %rbp, 0x60(%rsp)
cmpl %ebp, (%rbx)
jne 0x20c90
cmpl %r13d, 0x4(%rbx)
jne 0x20c90
cmpl %r15d, %eax
je 0x20c95
leaq 0xb974(%rip), %rax      # 0x2c5ff
jmp 0x21328
cmpl %r15d, %eax
ja 0x20c84
movl $0x1, %eax
testl %r13d, %r13d
je 0x21331
movl %r14d, %r15d
movslq %r14d, %rbx
movl 0x1c(%rsp), %ecx
cmpl %ecx, %r14d
sete %al
movl 0x18(%rsp), %edx
movl %edx, %esi
movq %rsi, %rdi
negq %rdi
movq %rdi, 0x38(%rsp)
cmpl $0x8, 0xe0(%rsp)
setl %dil
subl 0x58(%rsp), %edx
movq %rdx, 0x98(%rsp)
movslq %ecx, %r11
orb %al, %dil
movb %dil, 0x13(%rsp)
movq 0x60(%rsp), %rax
decl %eax
movl %eax, 0xc(%rsp)
movl %r13d, %eax
movq %rax, 0x78(%rsp)
movq %r11, %rax
negq %rax
movq %rax, 0x30(%rsp)
movq %rsi, 0x88(%rsp)
subq %rsi, %rax
movq %rax, 0x90(%rsp)
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, 0x80(%rsp)
movq %r11, 0x20(%rsp)
movzbl (%r12), %r10d
cmpq $0x4, %r10
ja 0x21321
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rdi
movl 0x18(%rsp), %eax
movl %eax, %ecx
imull %edx, %ecx
movq %rdi, 0x40(%rsp)
addq %rdi, %rcx
movq %rcx, %rax
movl %r14d, %ebp
movq 0x60(%rsp), %rdi
movl %edi, %r8d
cmpl $0x7, 0xe0(%rsp)
jg 0x20d90
movq %rdx, %r9
movq 0x58(%rsp), %rdx
cmpl %edi, %edx
ja 0x21739
movq 0x98(%rsp), %rax
addq %rcx, %rax
movl $0x1, %ebp
movl %edx, %r8d
movq %r9, %rdx
movl %r8d, 0x50(%rsp)
movq %rdx, 0xa0(%rsp)
testq %rdx, %rdx
jne 0x20dad
leaq 0xb1f3(%rip), %rdx      # 0x2bf9c
movb (%r10,%rdx), %r10b
movl %esi, %esi
movq %rsi, 0x28(%rsp)
leaq 0x1(%r12), %rdi
movzbl %r10b, %r11d
movl %ebp, %r8d
testl %ebp, %ebp
jle 0x20e19
movl %r8d, %edx
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %r9
leaq (%r9,%rsi), %r13
addq 0x28(%rsp), %r13
xorl %esi, %esi
cmpb $0x6, %r10b
ja 0x20e11
leaq 0xafdb(%rip), %rbp      # 0x2bdc4
movslq (%rbp,%r11,4), %r9
addq %rbp, %r9
jmpq *%r9
movb (%rdi,%rsi), %r9b
jmp 0x20e0d
movb (%r13,%rsi), %r9b
jmp 0x20e09
movb (%r13,%rsi), %r9b
shrb %r9b
addb (%rdi,%rsi), %r9b
movb %r9b, (%rax,%rsi)
incq %rsi
cmpq %rsi, %rdx
jne 0x20ddc
cmpl $0x8, 0xe0(%rsp)
jne 0x20e42
movl 0x1c(%rsp), %esi
cmpl %esi, %r14d
movl 0x50(%rsp), %r9d
je 0x20e35
movb $-0x1, (%rax,%rbx)
addq %rbx, %rdi
movq 0x20(%rsp), %rdx
movq %rdi, %r12
jmp 0x20e54
addq $0x2, %r12
movl $0x1, %edx
movl 0x1c(%rsp), %esi
movl 0x50(%rsp), %r9d
leaq (%rax,%rdx), %rdi
cmpb $0x0, 0x13(%rsp)
je 0x20e93
decl %r9d
imull %r14d, %r9d
movslq %r9d, %rbp
cmpb $0x6, %r10b
ja 0x210a9
leaq 0xaf82(%rip), %rsi      # 0x2bdfc
movslq (%rsi,%r11,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movq %r12, %rsi
movq %rbp, %rdx
callq 0x4290
jmp 0x210a9
cmpl %esi, 0x74(%rsp)
jne 0x21758
cmpb $0x6, %r10b
ja 0x210b1
addq 0x38(%rsp), %rcx
addq %rdx, %rcx
leaq 0xaf2a(%rip), %r8       # 0x2bde0
movslq (%r8,%r11,4), %rsi
addq %r8, %rsi
jmpq *%rsi
movl 0xc(%rsp), %eax
testl %eax, %eax
movq 0x20(%rsp), %r11
je 0x210b1
testl %r14d, %r14d
jle 0x20ee6
xorl %ecx, %ecx
movb (%r12,%rcx), %dl
movb %dl, (%rdi,%rcx)
incq %rcx
cmpq %rcx, %r15
jne 0x20ed7
movb $-0x1, (%rdi,%rbx)
addq %rbx, %r12
addq %r11, %rdi
decl %eax
jne 0x20ed0
jmp 0x210b1
testl %r9d, %r9d
jle 0x210a9
movslq %r8d, %rsi
movl %r9d, %ecx
movq %rcx, 0x50(%rsp)
movq %rdx, %r8
subq %rsi, %r8
addq %r8, %rax
movq 0x40(%rsp), %rcx
addq 0x38(%rsp), %rcx
addq 0x28(%rsp), %rdx
movq %rdx, %r8
subq %rsi, %r8
addq %rcx, %r8
addq %rcx, %rdx
xorl %esi, %esi
movzbl (%rax,%rsi), %r9d
movzbl (%rdx,%rsi), %r11d
movzbl (%r8,%rsi), %r10d
leal (%r11,%r9), %ebx
subl %r10d, %ebx
movl %ebx, %ecx
subl %r9d, %ecx
movl %ecx, %r13d
negl %r13d
cmovsl %ecx, %r13d
movl %ebx, %ecx
subl %r11d, %ecx
movl %ecx, %r14d
negl %r14d
cmovsl %ecx, %r14d
subl %r10d, %ebx
movl %ebx, %ecx
negl %ecx
cmovsl %ebx, %ecx
cmpl %ecx, %r14d
ja 0x20f79
movl %r11d, %r10d
cmpl %ecx, %r13d
cmoval %r10d, %r9d
cmpl %r14d, %r13d
cmoval %r10d, %r9d
addb (%r12,%rsi), %r9b
movb %r9b, (%rdi,%rsi)
incq %rsi
cmpq %rsi, 0x50(%rsp)
movq 0x80(%rsp), %rbx
jne 0x20f33
jmp 0x210a9
testl %r9d, %r9d
jle 0x210a9
movl %r9d, %eax
movq 0x40(%rsp), %rcx
addq 0x38(%rsp), %rcx
addq 0x28(%rsp), %rdx
addq %rcx, %rdx
xorl %ecx, %ecx
movb (%rdx,%rcx), %sil
addb (%r12,%rcx), %sil
movb %sil, (%rdi,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x20fc6
jmp 0x210a9
testl %r9d, %r9d
jle 0x210a9
movslq %r8d, %rsi
movl %r9d, %ecx
movq %rdx, %r8
subq %rsi, %r8
addq %r8, %rax
movq 0x40(%rsp), %rsi
addq 0x38(%rsp), %rsi
addq 0x28(%rsp), %rdx
addq %rsi, %rdx
xorl %esi, %esi
movzbl (%rdx,%rsi), %r8d
movzbl (%rax,%rsi), %r9d
addl %r8d, %r9d
shrl %r9d
addb (%r12,%rsi), %r9b
movb %r9b, (%rdi,%rsi)
incq %rsi
cmpq %rsi, %rcx
jne 0x2100b
jmp 0x210a9
testl %r9d, %r9d
jle 0x210a9
movslq %r8d, %rsi
movl %r9d, %ecx
subq %rsi, %rdx
addq %rdx, %rax
xorl %edx, %edx
movb (%rax,%rdx), %sil
addb (%r12,%rdx), %sil
movb %sil, (%rdi,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x21040
jmp 0x210a9
testl %r9d, %r9d
jle 0x210a9
movslq %r8d, %rsi
movl %r9d, %ecx
subq %rsi, %rdx
addq %rdx, %rax
xorl %edx, %edx
movb (%rax,%rdx), %sil
shrb %sil
addb (%r12,%rdx), %sil
movb %sil, (%rdi,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x21069
jmp 0x210a9
testl %r9d, %r9d
jle 0x210a9
movslq %r8d, %rsi
movl %r9d, %ecx
subq %rsi, %rdx
addq %rdx, %rax
xorl %edx, %edx
movb (%rax,%rdx), %sil
addb (%r12,%rdx), %sil
movb %sil, (%rdi,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x21095
addq %rbp, %r12
movq 0x48(%rsp), %r14
movq 0xa0(%rsp), %rdx
incq %rdx
movq 0x28(%rsp), %rsi
addl 0x18(%rsp), %esi
cmpq 0x78(%rsp), %rdx
jne 0x20d29
jmp 0x21343
movl 0xc(%rsp), %esi
testl %esi, %esi
je 0x210b1
addq 0x30(%rsp), %rax
addq %rdx, %rax
movq 0x40(%rsp), %r8
addq 0x90(%rsp), %r8
addq 0x28(%rsp), %rdx
addq %r8, %rdx
testl %r14d, %r14d
jle 0x21166
xorl %r8d, %r8d
movzbl (%rax,%r8), %r9d
movzbl (%rcx,%r8), %r11d
movzbl (%rdx,%r8), %r10d
leal (%r11,%r9), %ebx
subl %r10d, %ebx
movl %ebx, %ebp
subl %r9d, %ebp
movl %ebp, %r13d
negl %r13d
cmovsl %ebp, %r13d
movl %ebx, %ebp
subl %r11d, %ebp
movl %ebp, %r14d
negl %r14d
cmovsl %ebp, %r14d
subl %r10d, %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
cmpl %ebp, %r14d
ja 0x21148
movl %r11d, %r10d
cmpl %ebp, %r13d
cmoval %r10d, %r9d
cmpl %r14d, %r13d
cmoval %r10d, %r9d
addb (%r12,%r8), %r9b
movb %r9b, (%rdi,%r8)
incq %r8
cmpq %r8, %r15
jne 0x21102
movq 0x80(%rsp), %rbx
movb $-0x1, (%rdi,%rbx)
addq %rbx, %r12
movq 0x20(%rsp), %r11
addq %r11, %rdi
addq %r11, %rcx
addq %r11, %rax
addq %r11, %rdx
decl %esi
movq 0x48(%rsp), %r14
jne 0x210fa
jmp 0x210b1
movl 0xc(%rsp), %edx
movl %edx, %eax
testl %edx, %edx
movq 0x20(%rsp), %r11
je 0x210b1
testl %r14d, %r14d
jle 0x211c6
xorl %edx, %edx
movb (%rcx,%rdx), %sil
addb (%r12,%rdx), %sil
movb %sil, (%rdi,%rdx)
incq %rdx
cmpq %rdx, %r15
jne 0x211b2
movb $-0x1, (%rdi,%rbx)
addq %rbx, %r12
addq %r11, %rdi
addq %r11, %rcx
decl %eax
jne 0x211ab
jmp 0x210b1
movl 0xc(%rsp), %esi
testl %esi, %esi
movq 0x20(%rsp), %r11
je 0x210b1
addq 0x30(%rsp), %rax
addq %rdx, %rax
movl %esi, %edx
testl %r14d, %r14d
jle 0x2121e
xorl %esi, %esi
movzbl (%rcx,%rsi), %r8d
movzbl (%rax,%rsi), %r9d
addl %r8d, %r9d
shrl %r9d
addb (%r12,%rsi), %r9b
movb %r9b, (%rdi,%rsi)
incq %rsi
cmpq %rsi, %r15
jne 0x211fe
movb $-0x1, (%rdi,%rbx)
addq %rbx, %r12
addq %r11, %rdi
addq %r11, %rcx
addq %r11, %rax
decl %edx
jne 0x211f7
jmp 0x210b1
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
movq 0x20(%rsp), %r11
je 0x210b1
addq 0x30(%rsp), %rax
addq %rdx, %rax
testl %r14d, %r14d
jle 0x2126b
xorl %edx, %edx
movb (%rax,%rdx), %sil
addb (%r12,%rdx), %sil
movb %sil, (%rdi,%rdx)
incq %rdx
cmpq %rdx, %r15
jne 0x21257
movb $-0x1, (%rdi,%rbx)
addq %rbx, %r12
addq %r11, %rdi
addq %r11, %rax
decl %ecx
jne 0x21250
jmp 0x210b1
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
movq 0x20(%rsp), %r11
je 0x210b1
addq 0x30(%rsp), %rax
addq %rdx, %rax
testl %r14d, %r14d
jle 0x212b8
xorl %edx, %edx
movb (%rax,%rdx), %sil
shrb %sil
addb (%r12,%rdx), %sil
movb %sil, (%rdi,%rdx)
incq %rdx
cmpq %rdx, %r15
jne 0x212a1
movb $-0x1, (%rdi,%rbx)
addq %rbx, %r12
addq %r11, %rdi
addq %r11, %rax
decl %ecx
jne 0x2129a
jmp 0x210b1
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
movq 0x20(%rsp), %r11
je 0x210b1
addq 0x30(%rsp), %rax
addq %rdx, %rax
testl %r14d, %r14d
jle 0x21302
xorl %edx, %edx
movb (%rax,%rdx), %sil
addb (%r12,%rdx), %sil
movb %sil, (%rdi,%rdx)
incq %rdx
cmpq %rdx, %r15
jne 0x212ee
movb $-0x1, (%rdi,%rbx)
addq %rbx, %r12
addq %r11, %rdi
addq %r11, %rax
decl %ecx
jne 0x212e7
jmp 0x210b1
leaq 0xafaa(%rip), %rax      # 0x2c2c9
jmp 0x21328
leaq 0xb2e9(%rip), %rax      # 0x2c611
movq %rax, 0x16061(%rip)     # 0x37390
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0xe0(%rsp), %r13d
cmpl $0x7, %r13d
jg 0x2172f
movl 0x58(%rsp), %ecx
movl %r13d, %edx
movq 0x60(%rsp), %r8
decl %r8d
movq 0x88(%rsp), %rax
movq %rax, %rsi
subq %rcx, %rsi
negq %rcx
leaq (%r8,%r8,2), %rdi
addq $0x2, %rdi
movq %rdi, 0x28(%rsp)
movq %r8, %rdi
incq %r8
xorl %r9d, %r9d
addq %rax, %rcx
leaq 0xab7b(%rip), %r10      # 0x2bf10
xorl %r11d, %r11d
xorl %ebx, %ebx
movq 0x68(%rsp), %r12
movb $0x1, %bpl
cmpl $0x0, 0xe8(%rsp)
jne 0x213b0
movb (%rdx,%r10), %bpl
movq 0x18(%r12), %r15
movl 0x18(%rsp), %eax
movl %eax, %r12d
imull %ebx, %r12d
addq %r15, %r12
leaq (%r12,%rcx), %r14
movl %r11d, %r11d
cmpl $0x4, %r13d
je 0x21628
cmpl $0x2, %r13d
je 0x2156f
cmpl $0x1, %r13d
jne 0x2168a
movl 0x14(%rsp), %r13d
movl %r13d, %eax
cmpl $0x8, %r13d
jl 0x214af
leaq (%r15,%rsi), %r14
movl 0x14(%rsp), %eax
movl %eax, %r12d
movb (%r14,%r11), %al
sarb $0x7, %al
andb %bpl, %al
movb %al, (%r15,%r11)
movb (%r14,%r11), %al
addb %al, %al
sarb $0x7, %al
andb %bpl, %al
movb %al, 0x1(%r15,%r11)
movb (%r14,%r11), %al
shlb $0x2, %al
sarb $0x7, %al
andb %bpl, %al
movb %al, 0x2(%r15,%r11)
movb (%r14,%r11), %al
shlb $0x3, %al
sarb $0x7, %al
andb %bpl, %al
movb %al, 0x3(%r15,%r11)
movb (%r14,%r11), %al
shlb $0x4, %al
sarb $0x7, %al
andb %bpl, %al
movb %al, 0x4(%r15,%r11)
movb (%r14,%r11), %al
shlb $0x5, %al
sarb $0x7, %al
andb %bpl, %al
movb %al, 0x5(%r15,%r11)
movb (%r14,%r11), %al
shlb $0x6, %al
sarb $0x7, %al
andb %bpl, %al
movb %al, 0x6(%r15,%r11)
testb $0x1, (%r14,%r11)
movzbl %bpl, %eax
cmovel %r9d, %eax
movb %al, 0x7(%r15,%r11)
leal -0x8(%r12), %eax
incq %r14
addq $0x8, %r15
cmpl $0xf, %r12d
ja 0x21402
addq %r11, %r14
addq %r11, %r15
movq %r15, %r12
testl %eax, %eax
jle 0x2168a
movb (%r14), %r15b
sarb $0x7, %r15b
andb %bpl, %r15b
movb %r15b, (%r12)
cmpl $0x1, %eax
je 0x2168a
movb (%r14), %r15b
addb %r15b, %r15b
sarb $0x7, %r15b
andb %bpl, %r15b
movb %r15b, 0x1(%r12)
cmpl $0x3, %eax
jb 0x2168a
movb (%r14), %r15b
shlb $0x2, %r15b
sarb $0x7, %r15b
andb %bpl, %r15b
movb %r15b, 0x2(%r12)
cmpl $0x3, %eax
je 0x2168a
movb (%r14), %r15b
shlb $0x3, %r15b
sarb $0x7, %r15b
andb %bpl, %r15b
movb %r15b, 0x3(%r12)
cmpl $0x5, %eax
jb 0x2168a
movb (%r14), %r15b
shlb $0x4, %r15b
sarb $0x7, %r15b
andb %bpl, %r15b
movb %r15b, 0x4(%r12)
cmpl $0x5, %eax
je 0x2168a
movb (%r14), %r15b
shlb $0x5, %r15b
sarb $0x7, %r15b
andb %bpl, %r15b
movb %r15b, 0x5(%r12)
cmpl $0x7, %eax
jne 0x2168a
movb (%r14), %al
shlb $0x6, %al
sarb $0x7, %al
andb %bpl, %al
movb %al, 0x6(%r12)
jmp 0x2168a
movl 0x14(%rsp), %eax
movl %eax, %r13d
cmpl $0x4, %eax
jl 0x215e0
leaq (%r15,%rsi), %r14
movl 0x14(%rsp), %r13d
movl %r13d, %r12d
movb (%r14,%r11), %al
shrb $0x6, %al
mulb %bpl
movb %al, (%r15,%r11)
movb (%r14,%r11), %al
shrb $0x4, %al
andb $0x3, %al
mulb %bpl
movb %al, 0x1(%r15,%r11)
movb (%r14,%r11), %al
shrb $0x2, %al
andb $0x3, %al
mulb %bpl
movb %al, 0x2(%r15,%r11)
movb (%r14,%r11), %al
andb $0x3, %al
mulb %bpl
movb %al, 0x3(%r15,%r11)
leal -0x4(%r12), %r13d
incq %r14
addq $0x4, %r15
cmpl $0x7, %r12d
ja 0x21584
addq %r11, %r14
addq %r11, %r15
movq %r15, %r12
testl %r13d, %r13d
jle 0x2168a
movb (%r14), %al
shrb $0x6, %al
mulb %bpl
movb %al, (%r12)
cmpl $0x1, %r13d
je 0x2168a
movb (%r14), %al
shrb $0x4, %al
andb $0x3, %al
mulb %bpl
movb %al, 0x1(%r12)
cmpl $0x3, %r13d
jne 0x2168a
movb (%r14), %al
shrb $0x2, %al
andb $0x3, %al
mulb %bpl
movb %al, 0x2(%r12)
jmp 0x2168a
movl 0x14(%rsp), %r13d
movl %r13d, %eax
cmpl $0x2, %r13d
jl 0x21678
leaq (%r15,%rsi), %r14
movl 0x14(%rsp), %eax
movl %eax, %r12d
movb (%r14,%r11), %al
shrb $0x4, %al
mulb %bpl
movb %al, (%r15,%r11)
movb (%r14,%r11), %al
andb $0xf, %al
mulb %bpl
movb %al, 0x1(%r15,%r11)
leal -0x2(%r12), %eax
incq %r14
addq $0x2, %r15
cmpl $0x3, %r12d
ja 0x2163e
addq %r11, %r14
addq %r11, %r15
movq %r15, %r12
cmpl $0x1, %eax
jne 0x2168a
movb (%r14), %al
shrb $0x4, %al
mulb %bpl
movb %al, (%r12)
movq 0x48(%rsp), %rax
cmpl 0x1c(%rsp), %eax
movq 0x68(%rsp), %r12
je 0x21714
movq 0x18(%r12), %rax
movq 0x48(%rsp), %r14
cmpl $0x1, %r14d
je 0x216f5
cmpl $0x3, %r14d
jne 0x21796
movq %rdi, %r14
testl %r14d, %r14d
js 0x21714
addq %r11, %rax
movq 0x28(%rsp), %r14
addq %rax, %r14
movq %r8, %r15
movb $-0x1, -0x1(%rax,%r15,4)
movb (%r14), %bpl
movb %bpl, -0x2(%rax,%r15,4)
movb -0x1(%r14), %bpl
movb %bpl, -0x3(%rax,%r15,4)
movb -0x2(%r14), %bpl
movb %bpl, -0x4(%rax,%r15,4)
addq $-0x3, %r14
decq %r15
jg 0x216ca
jmp 0x21714
testl %edi, %edi
js 0x21714
addq %r11, %rax
movq %r8, %r14
movb $-0x1, -0x1(%rax,%r14,2)
movb -0x1(%rax,%r14), %bpl
movb %bpl, -0x2(%rax,%r14,2)
decq %r14
jg 0x216ff
incq %rbx
addl 0x18(%rsp), %r11d
cmpq 0x78(%rsp), %rbx
movl 0xe0(%rsp), %r13d
jne 0x2139f
movl $0x1, %eax
jmp 0x21331
leaq 0xaee0(%rip), %rdi      # 0x2c620
leaq 0xac52(%rip), %rsi      # 0x2c399
leaq 0xae41(%rip), %rcx      # 0x2c58f
movl $0xfaa, %edx            # imm = 0xFAA
callq 0x41f0
leaq 0xaed6(%rip), %rdi      # 0x2c635
leaq 0xac33(%rip), %rsi      # 0x2c399
leaq 0xae22(%rip), %rcx      # 0x2c58f
movl $0xfdf, %edx            # imm = 0xFDF
callq 0x41f0
leaq 0xade8(%rip), %rdi      # 0x2c566
leaq 0xac14(%rip), %rsi      # 0x2c399
leaq 0xae03(%rip), %rcx      # 0x2c58f
movl $0xf94, %edx            # imm = 0xF94
callq 0x41f0
leaq 0xaea9(%rip), %rdi      # 0x2c646
leaq 0xabf5(%rip), %rsi      # 0x2c399
leaq 0xade4(%rip), %rcx      # 0x2c58f
movl $0x102f, %edx           # imm = 0x102F
callq 0x41f0