// File: /workspace/github_cpp_makefile_star2_O2/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 $0xd8, %rsp
movl %edx, %r13d
movq (%rdi), %rbx
movl 0x8(%rbx), %edx
cmpl %ecx, %edx
sete %al
movq %rdx, 0x28(%rsp)
incl %edx
movl %edx, 0x78(%rsp)
cmpl %ecx, %edx
sete %dl
orb %al, %dl
je 0x19e36
movl %r9d, %r12d
movl %r8d, %r14d
movq %rsi, %rbp
movq %rdi, %r15
movl %r8d, %edi
movl %ecx, 0x14(%rsp)
imull %ecx, %edi
movq %rdi, 0x48(%rsp)
imull %r9d, %edi
callq 0x4420
movq %rax, 0x18(%r15)
testq %rax, %rax
je 0x199cd
movl 0x110(%rsp), %edx
movq 0x28(%rsp), %rax
imull %r14d, %eax
movl %eax, 0x34(%rsp)
movl %eax, %r8d
imull %edx, %r8d
addl $0x7, %r8d
shrl $0x3, %r8d
leal 0x1(%r8), %eax
imull %r12d, %eax
movq %r14, 0x18(%rsp)
cmpl %r14d, (%rbx)
jne 0x193a0
cmpl %r12d, 0x4(%rbx)
jne 0x193a0
cmpl %r13d, %eax
je 0x193a5
leaq 0x9164(%rip), %rax      # 0x224ff
jmp 0x19ddb
cmpl %r13d, %eax
ja 0x19394
movq %r15, 0x60(%rsp)
movq 0x28(%rsp), %rcx
movslq %ecx, %r13
movl %edx, %esi
movl 0x14(%rsp), %r9d
cmpl %r9d, %ecx
sete %al
movq 0x48(%rsp), %rdx
movl %edx, %edi
movq %rdi, %r10
negq %r10
movq %r10, 0xb8(%rsp)
cmpl $0x8, %esi
setl %sil
movq %r8, 0x88(%rsp)
subl %r8d, %edx
movq %rdx, 0xa8(%rsp)
movslq %r9d, %rdx
orb %al, %sil
movb %sil, 0x7(%rsp)
testl %ecx, %ecx
movl $0x0, %eax
cmovgl %ecx, %eax
movq %rax, 0x58(%rsp)
movl %r12d, %eax
movq %rax, 0x90(%rsp)
movq %rdx, %r10
negq %r10
movq %r10, %rcx
movq %rdi, 0x80(%rsp)
subq %rdi, %rcx
movq %rcx, 0xa0(%rsp)
xorl %eax, %eax
xorl %esi, %esi
movq 0x18(%rsp), %r8
movq %rbp, %r15
movq %r13, 0x50(%rsp)
movq %rdx, 0x68(%rsp)
movq %r10, 0x40(%rsp)
cmpq 0x90(%rsp), %rsi
je 0x199d9
movzbl (%r15), %ebp
cmpq $0x4, %rbp
movq 0x28(%rsp), %rdx
ja 0x19dd4
movq 0x60(%rsp), %rcx
movq 0x18(%rcx), %rdi
movq 0x48(%rsp), %r14
imull %esi, %r14d
addq %rdi, %r14
movq %r14, 0x8(%rsp)
movl %r8d, %ecx
movq %rcx, 0x98(%rsp)
cmpl $0x7, 0x110(%rsp)
leaq 0x8829(%rip), %rbx      # 0x21cc8
jg 0x194cd
movq 0x88(%rsp), %rcx
cmpl %r8d, %ecx
ja 0x19df8
movq 0xa8(%rsp), %rdx
addq %r14, %rdx
movq %rdx, 0x8(%rsp)
pushq $0x1
popq %rdx
movq %rcx, 0x98(%rsp)
movq %rsi, 0xc8(%rsp)
testq %rsi, %rsi
jne 0x194e6
leaq 0x89bb(%rip), %rcx      # 0x21e9c
movb (%rbp,%rcx), %bpl
movl %eax, %ecx
movq 0xb8(%rsp), %rax
addq %rax, %r14
testl %edx, %edx
movl $0x0, %r13d
movl %edx, 0x7c(%rsp)
cmovgl %edx, %r13d
leaq 0x1(%r15), %rsi
movq %rdi, 0xb0(%rsp)
addq %rdi, %rax
movq %rcx, 0x38(%rsp)
movq %rax, 0xc0(%rsp)
leaq (%rax,%rcx), %rdx
xorl %r12d, %r12d
movq %rsi, 0x70(%rsp)
movq %rdx, 0xd0(%rsp)
movzbl %bpl, %ecx
cmpq %r12, %r13
je 0x1959d
cmpb $0x6, %bpl
ja 0x19598
movslq (%rbx,%rcx,4), %rax
addq %rbx, %rax
jmpq *%rax
movb (%rsi,%r12), %al
jmp 0x1958f
movb (%rsi,%r12), %al
movb %al, 0x20(%rsp)
movzbl (%rdx,%r12), %esi
xorl %edi, %edi
xorl %edx, %edx
callq 0x19e74
movq 0xd0(%rsp), %rdx
movq 0x70(%rsp), %rsi
addb 0x20(%rsp), %al
movl 0x14(%rsp), %r9d
jmp 0x1958f
movb (%rdx,%r12), %al
jmp 0x1958b
movb (%rdx,%r12), %al
shrb %al
addb (%rsi,%r12), %al
movq 0x8(%rsp), %rcx
movb %al, (%rcx,%r12)
incq %r12
jmp 0x19533
cmpl $0x8, 0x110(%rsp)
jne 0x195cb
cmpl %r9d, 0x28(%rsp)
je 0x195bc
movq 0x50(%rsp), %rax
movq 0x8(%rsp), %rdx
movb $-0x1, (%rdx,%rax)
addq 0x50(%rsp), %rsi
movq 0x68(%rsp), %rax
movq %rsi, %r15
jmp 0x195d2
addq $0x2, %r15
pushq $0x1
popq %rax
movq 0x8(%rsp), %rdx
leaq (%rdx,%rax), %r12
cmpb $0x0, 0x7(%rsp)
je 0x19659
movq 0x98(%rsp), %r8
decl %r8d
imull 0x28(%rsp), %r8d
movslq %r8d, %rdx
movq %rdx, 0x8(%rsp)
cmpb $0x6, %bpl
movq 0xc0(%rsp), %rbx
ja 0x1962e
leaq 0x86f0(%rip), %rdx      # 0x21d00
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
movslq 0x7c(%rsp), %rdx
jmpq *%rcx
movq %r12, %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
callq 0x42a0
addq 0x8(%rsp), %r15
movl 0x14(%rsp), %r9d
movq 0xc8(%rsp), %rsi
incq %rsi
movq 0x48(%rsp), %rax
movq 0x38(%rsp), %rcx
addl %ecx, %eax
movq 0x18(%rsp), %r8
jmp 0x1944a
cmpl %r9d, 0x78(%rsp)
jne 0x19e17
cmpb $0x6, %bpl
movq 0x58(%rsp), %r8
ja 0x19638
addq %rax, %r14
leaq 0x866b(%rip), %rdx      # 0x21ce4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
movq 0x50(%rsp), %r13
movq 0x68(%rsp), %rbp
jmpq *%rcx
movq 0x18(%rsp), %rax
decl %eax
je 0x19638
xorl %ecx, %ecx
cmpq %rcx, %r8
je 0x196a9
movb (%r15,%rcx), %dl
movb %dl, (%r12,%rcx)
incq %rcx
jmp 0x19697
movb $-0x1, (%r12,%r13)
addq %r13, %r15
addq %rbp, %r12
jmp 0x19691
testl %r8d, %r8d
movl $0x0, %ecx
cmovlel %ecx, %r8d
addq 0x38(%rsp), %rax
addq %rax, %rbx
negq %rdx
movq %rdx, 0x20(%rsp)
movq %r15, %r14
subq $0x1, %r8
jb 0x1962e
movb (%r14), %bpl
movq 0x20(%rsp), %rax
movzbl (%r12,%rax), %edi
movzbl (%rbx), %esi
movzbl (%rbx,%rax), %edx
movq %r8, %r13
callq 0x19e74
movq %r13, %r8
addb %bpl, %al
movb %al, (%r12)
incq %r12
incq %rbx
incq %r14
jmp 0x196d5
testl %r8d, %r8d
movl $0x0, %ecx
cmovlel %ecx, %r8d
addq 0x38(%rsp), %rax
addq %rax, %rbx
xorl %eax, %eax
cmpq %rax, %r8
je 0x1962e
movb (%rbx,%rax), %cl
addb (%r15,%rax), %cl
movb %cl, (%r12,%rax)
incq %rax
jmp 0x19726
testl %r8d, %r8d
movl $0x0, %ecx
cmovlel %ecx, %r8d
addq 0x38(%rsp), %rax
addq %rax, %rbx
movq %r12, %rax
subq %rdx, %rax
xorl %ecx, %ecx
cmpq %rcx, %r8
je 0x1962e
movzbl (%rbx,%rcx), %edx
movzbl (%rax,%rcx), %esi
addl %edx, %esi
shrl %esi
addb (%r15,%rcx), %sil
movb %sil, (%r12,%rcx)
incq %rcx
jmp 0x1975b
testl %r8d, %r8d
movl $0x0, %eax
cmovlel %eax, %r8d
movq %r12, %rax
subq %rdx, %rax
xorl %ecx, %ecx
cmpq %rcx, %r8
je 0x1962e
movb (%rax,%rcx), %dl
addb (%r15,%rcx), %dl
movb %dl, (%r12,%rcx)
incq %rcx
jmp 0x19791
testl %r8d, %r8d
movl $0x0, %eax
cmovlel %eax, %r8d
movq %r12, %rax
subq %rdx, %rax
xorl %ecx, %ecx
cmpq %rcx, %r8
je 0x1962e
movb (%rax,%rcx), %dl
shrb %dl
addb (%r15,%rcx), %dl
movb %dl, (%r12,%rcx)
incq %rcx
jmp 0x197be
testl %r8d, %r8d
movl $0x0, %eax
cmovlel %eax, %r8d
movq %r12, %rax
subq %rdx, %rax
xorl %ecx, %ecx
cmpq %rcx, %r8
je 0x1962e
movb (%rax,%rcx), %dl
addb (%r15,%rcx), %dl
movb %dl, (%r12,%rcx)
incq %rcx
jmp 0x197ed
movq %r14, 0x20(%rsp)
movq 0x8(%rsp), %r14
addq 0x40(%rsp), %r14
addq %rax, %r14
movq 0xb0(%rsp), %rcx
addq 0xa0(%rsp), %rcx
movq 0x38(%rsp), %rbp
addq %rax, %rbp
addq %rcx, %rbp
movq 0x18(%rsp), %rax
decl %eax
je 0x19633
movl %eax, 0x8(%rsp)
xorl %ebx, %ebx
cmpq %rbx, %r8
je 0x19878
movb (%r15,%rbx), %r13b
movzbl (%r14,%rbx), %edi
movq 0x20(%rsp), %rax
movzbl (%rax,%rbx), %esi
movzbl (%rbp,%rbx), %edx
callq 0x19e74
movq 0x58(%rsp), %r8
addb %r13b, %al
movb %al, (%r12,%rbx)
incq %rbx
jmp 0x19846
movq 0x50(%rsp), %rax
movb $-0x1, (%r12,%rax)
addq %rax, %r15
movq 0x68(%rsp), %rax
addq %rax, %r12
addq %rax, 0x20(%rsp)
addq %rax, %r14
addq %rax, %rbp
movl 0x8(%rsp), %eax
jmp 0x19838
movq 0x18(%rsp), %rax
decl %eax
je 0x19638
xorl %ecx, %ecx
cmpq %rcx, %r8
je 0x198c3
movb (%r14,%rcx), %dl
addb (%r15,%rcx), %dl
movb %dl, (%r12,%rcx)
incq %rcx
jmp 0x198ad
movb $-0x1, (%r12,%r13)
addq %r13, %r15
addq %rbp, %r12
addq %rbp, %r14
jmp 0x198a3
movq 0x18(%rsp), %rax
decl %eax
je 0x19638
movq 0x40(%rsp), %rcx
addq %r12, %rcx
xorl %edx, %edx
cmpq %rdx, %r8
je 0x19909
movzbl (%r14,%rdx), %esi
movzbl (%rcx,%rdx), %edi
addl %esi, %edi
shrl %edi
addb (%r15,%rdx), %dil
movb %dil, (%r12,%rdx)
incq %rdx
jmp 0x198ea
movb $-0x1, (%r12,%r13)
addq %r13, %r15
addq %rbp, %r12
addq %rbp, %r14
jmp 0x198d8
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %r10
decl %eax
je 0x19638
leaq (%r12,%r10), %rcx
xorl %edx, %edx
cmpq %rdx, %r8
je 0x19947
movb (%rcx,%rdx), %sil
addb (%r15,%rdx), %sil
movb %sil, (%r12,%rdx)
incq %rdx
jmp 0x19931
movb $-0x1, (%r12,%r13)
addq %r13, %r15
addq %rbp, %r12
jmp 0x19923
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %r10
decl %eax
je 0x19638
leaq (%r12,%r10), %rcx
xorl %edx, %edx
cmpq %rdx, %r8
je 0x19985
movb (%rcx,%rdx), %sil
shrb %sil
addb (%r15,%rdx), %sil
movb %sil, (%r12,%rdx)
incq %rdx
jmp 0x1996c
movb $-0x1, (%r12,%r13)
addq %r13, %r15
addq %rbp, %r12
jmp 0x1995e
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %r10
decl %eax
je 0x19638
leaq (%r12,%r10), %rcx
xorl %edx, %edx
cmpq %rdx, %r8
je 0x199c0
movb (%rcx,%rdx), %sil
addb (%r15,%rdx), %sil
movb %sil, (%r12,%rdx)
incq %rdx
jmp 0x199aa
movb $-0x1, (%r12,%r13)
addq %r13, %r15
addq %rbp, %r12
jmp 0x1999c
leaq 0x87f5(%rip), %rax      # 0x221c9
jmp 0x19ddb
pushq $0x1
popq %rcx
movl 0x110(%rsp), %r9d
cmpl $0x7, %r9d
jg 0x19de4
movl 0x88(%rsp), %edx
movl %r9d, %esi
movl %r8d, %edi
movq 0x80(%rsp), %rax
subq %rdx, %rax
movq %rax, 0x8(%rsp)
negq %rdx
leaq (%rdi,%rdi,2), %rax
addq $-0x3, %rax
movq %rax, 0x20(%rsp)
movl %r8d, %eax
decl %r8d
leal -0x4(,%rax,4), %r10d
movl %r10d, 0x58(%rsp)
decq %rdi
leal -0x1(,%rax,2), %eax
movl %eax, 0x70(%rsp)
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq 0x90(%rsp), %r12
je 0x19de4
movb $0x1, %bpl
cmpl $0x0, 0x118(%rsp)
jne 0x19a6a
leaq 0x83aa(%rip), %rax      # 0x21e10
movb (%rsi,%rax), %bpl
movl %r15d, %r15d
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x48(%rsp), %r13
imull %r12d, %r13d
cmpl $0x4, %r9d
je 0x19c00
movq 0x80(%rsp), %r10
leaq (%r10,%r13), %r14
addq %rdx, %r14
addq %rax, %r14
cmpl $0x2, %r9d
je 0x19b5d
cmpl $0x1, %r9d
jne 0x19d0b
addq %r15, %rax
addq $0x7, %rax
movl 0x34(%rsp), %r10d
cmpl $0x8, %r10d
jl 0x19c61
movb (%r14), %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x7(%rax)
movb (%r14), %r9b
addb %r9b, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x6(%rax)
movb (%r14), %r9b
shlb $0x2, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x5(%rax)
movb (%r14), %r9b
shlb $0x3, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x4(%rax)
movb (%r14), %r9b
shlb $0x4, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x3(%rax)
movb (%r14), %r9b
shlb $0x5, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x2(%rax)
movb (%r14), %r9b
shlb $0x6, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x1(%rax)
movzbl %bpl, %r9d
testb $0x1, (%r14)
cmovel %ebx, %r9d
movb %r9b, (%rax)
addl $-0x8, %r10d
incq %r14
addq $0x8, %rax
jmp 0x19abb
leaq (%rax,%r15), %r10
addq $0x3, %r10
movl 0x34(%rsp), %r9d
cmpl $0x4, %r9d
jl 0x19bb3
movb (%r14), %al
shrb $0x6, %al
mulb %bpl
movb %al, -0x3(%r10)
movb (%r14), %al
shrb $0x4, %al
andb $0x3, %al
mulb %bpl
movb %al, -0x2(%r10)
movb (%r14), %al
shrb $0x2, %al
andb $0x3, %al
mulb %bpl
movb %al, -0x1(%r10)
movb (%r14), %al
andb $0x3, %al
mulb %bpl
movb %al, (%r10)
addl $-0x4, %r9d
incq %r14
addq $0x4, %r10
jmp 0x19b6a
testl %r9d, %r9d
jle 0x19d0b
movb (%r14), %al
shrb $0x6, %al
mulb %bpl
movb %al, -0x3(%r10)
cmpl $0x1, %r9d
je 0x19d0b
movb (%r14), %al
shrb $0x4, %al
andb $0x3, %al
mulb %bpl
movb %al, -0x2(%r10)
cmpl $0x3, %r9d
jne 0x19d0b
movb (%r14), %al
shrb $0x2, %al
andb $0x3, %al
mulb %bpl
movb %al, -0x1(%r10)
jmp 0x19d0b
leaq (%rax,%r15), %r14
addq 0x8(%rsp), %r14
leaq (%rax,%r15), %r9
incq %r9
xorl %r10d, %r10d
movl 0x34(%rsp), %r11d
cmpl $0x2, %r11d
jl 0x19c43
movb (%r14,%r10), %al
shrb $0x4, %al
mulb %bpl
movb %al, -0x1(%r9,%r10,2)
movb (%r14,%r10), %al
andb $0xf, %al
mulb %bpl
movb %al, (%r9,%r10,2)
addl $-0x2, %r11d
incq %r10
jmp 0x19c18
cmpl $0x1, %r11d
jne 0x19d0b
movb (%r14,%r10), %al
shrb $0x4, %al
mulb %bpl
movb %al, -0x1(%r9,%r10,2)
jmp 0x19d0b
testl %r10d, %r10d
jle 0x19d0b
movb (%r14), %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x7(%rax)
cmpl $0x1, %r10d
je 0x19d0b
movb (%r14), %r9b
addb %r9b, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x6(%rax)
cmpl $0x3, %r10d
jb 0x19d0b
movb (%r14), %r9b
shlb $0x2, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x5(%rax)
cmpl $0x3, %r10d
je 0x19d0b
movb (%r14), %r9b
shlb $0x3, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x4(%rax)
cmpl $0x5, %r10d
jb 0x19d0b
movb (%r14), %r9b
shlb $0x4, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x3(%rax)
cmpl $0x5, %r10d
je 0x19d0b
movb (%r14), %r9b
shlb $0x5, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x2(%rax)
cmpl $0x7, %r10d
jne 0x19d0b
movb (%r14), %r9b
shlb $0x6, %r9b
sarb $0x7, %r9b
andb %bpl, %r9b
movb %r9b, -0x1(%rax)
movq 0x28(%rsp), %rax
cmpl 0x14(%rsp), %eax
je 0x19d86
movq 0x60(%rsp), %rax
addq 0x18(%rax), %r13
movq 0x28(%rsp), %r11
cmpl $0x1, %r11d
je 0x19d9b
movl 0x58(%rsp), %eax
movl %r8d, %r9d
movq 0x20(%rsp), %r10
cmpl $0x3, %r11d
je 0x19d81
jmp 0x19e55
leal 0x3(%rax), %r11d
movb $-0x1, (%r13,%r11)
movl %r10d, %r11d
movb 0x2(%r13,%r11), %bpl
leal 0x2(%rax), %r14d
movb %bpl, (%r13,%r14)
movb 0x1(%r13,%r11), %bpl
leal 0x1(%rax), %r14d
movb %bpl, (%r13,%r14)
movb (%r13,%r11), %r11b
movl %eax, %r14d
movb %r11b, (%r13,%r14)
addq $-0x3, %r10
decl %r9d
addl $-0x4, %eax
testl %r9d, %r9d
jns 0x19d41
incq %r12
addl 0x48(%rsp), %r15d
movl 0x110(%rsp), %r9d
jmp 0x19a44
movl 0x70(%rsp), %eax
xorl %r9d, %r9d
movl %r8d, %r10d
addl %r9d, %r10d
js 0x19d86
leaq (%rdi,%r9), %r10
leal -0x1(%rax), %r11d
movl %eax, %r14d
movb $-0x1, (%r13,%r14)
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
movb (%r13,%r10), %r10b
movb %r10b, (%r13,%r11)
decq %r9
addl $-0x2, %eax
jmp 0x19da2
leaq 0x8736(%rip), %rax      # 0x22511
movq %rax, 0x155ee(%rip)     # 0x2f3d0
xorl %ecx, %ecx
movl %ecx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8721(%rip), %rdi      # 0x22520
leaq 0x8493(%rip), %rsi      # 0x22299
leaq 0x8682(%rip), %rcx      # 0x2248f
movl $0xfaa, %edx            # imm = 0xFAA
callq 0x4210
leaq 0x8717(%rip), %rdi      # 0x22535
leaq 0x8474(%rip), %rsi      # 0x22299
leaq 0x8663(%rip), %rcx      # 0x2248f
movl $0xfdf, %edx            # imm = 0xFDF
callq 0x4210
leaq 0x8629(%rip), %rdi      # 0x22466
leaq 0x8455(%rip), %rsi      # 0x22299
leaq 0x8644(%rip), %rcx      # 0x2248f
movl $0xf94, %edx            # imm = 0xF94
callq 0x4210
leaq 0x86ea(%rip), %rdi      # 0x22546
leaq 0x8436(%rip), %rsi      # 0x22299
leaq 0x8625(%rip), %rcx      # 0x2248f
movl $0x102f, %edx           # imm = 0x102F
callq 0x4210