// File: /workspace/github_cpp_makefile_star2_O3/srajangarg[P]raytracer/src/core/stb_image.hpp
// Function: stbi__psd_load(stbi__context*, int*, int*, int*, int)
static stbi_uc *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
   int   pixelCount;
   int channelCount, compression;
   int channel, i, count, len;
   int bitdepth;
   int w,h;
   stbi_uc *out;

   // Check identifier
   if (stbi__get32be(s) != 0x38425053)   // "8BPS"
      return stbi__errpuc("not PSD", "Corrupt PSD image");

   // Check file type version.
   if (stbi__get16be(s) != 1)
      return stbi__errpuc("wrong version", "Unsupported version of PSD image");

   // Skip 6 reserved bytes.
   stbi__skip(s, 6 );

   // Read the number of channels (R, G, B, A, etc).
   channelCount = stbi__get16be(s);
   if (channelCount < 0 || channelCount > 16)
      return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image");

   // Read the rows and columns of the image.
   h = stbi__get32be(s);
   w = stbi__get32be(s);

   // Make sure the depth is 8 bits.
   bitdepth = stbi__get16be(s);
   if (bitdepth != 8 && bitdepth != 16)
      return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit");

   // Make sure the color mode is RGB.
   // Valid options are:
   //   0: Bitmap
   //   1: Grayscale
   //   2: Indexed color
   //   3: RGB color
   //   4: CMYK color
   //   7: Multichannel
   //   8: Duotone
   //   9: Lab color
   if (stbi__get16be(s) != 3)
      return stbi__errpuc("wrong color format", "PSD is not in RGB color format");

   // Skip the Mode Data.  (It's the palette for indexed color; other info for other modes.)
   stbi__skip(s,stbi__get32be(s) );

   // Skip the image resources.  (resolution, pen tool paths, etc)
   stbi__skip(s, stbi__get32be(s) );

   // Skip the reserved data.
   stbi__skip(s, stbi__get32be(s) );

   // Find out if the data is compressed.
   // Known values:
   //   0: no compression
   //   1: RLE compressed
   compression = stbi__get16be(s);
   if (compression > 1)
      return stbi__errpuc("bad compression", "PSD has an unknown compression format");

   // Create the destination image.
   out = (stbi_uc *) stbi__malloc(4 * w*h);
   if (!out) return stbi__errpuc("outofmem", "Out of memory");
   pixelCount = w*h;

   // Initialize the data to zero.
   //memset( out, 0, pixelCount * 4 );

   // Finally, the image data.
   if (compression) {
      // RLE as used by .PSD and .TIFF
      // Loop until you get the number of unpacked bytes you are expecting:
      //     Read the next source byte into n.
      //     If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.
      //     Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.
      //     Else if n is 128, noop.
      // Endloop

      // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data,
      // which we're going to just skip.
      stbi__skip(s, h * channelCount * 2 );

      // Read the RLE data by channel.
      for (channel = 0; channel < 4; channel++) {
         stbi_uc *p;

         p = out+channel;
         if (channel >= channelCount) {
            // Fill this channel with default data.
            for (i = 0; i < pixelCount; i++, p += 4)
               *p = (channel == 3 ? 255 : 0);
         } else {
            // Read the RLE data.
            count = 0;
            while (count < pixelCount) {
               len = stbi__get8(s);
               if (len == 128) {
                  // No-op.
               } else if (len < 128) {
                  // Copy next len+1 bytes literally.
                  len++;
                  count += len;
                  while (len) {
                     *p = stbi__get8(s);
                     p += 4;
                     len--;
                  }
               } else if (len > 128) {
                  stbi_uc   val;
                  // Next -len+1 bytes in the dest are replicated from next source byte.
                  // (Interpret len as a negative 8-bit int.)
                  len ^= 0x0FF;
                  len += 2;
                  val = stbi__get8(s);
                  count += len;
                  while (len) {
                     *p = val;
                     p += 4;
                     len--;
                  }
               }
            }
         }
      }

   } else {
      // We're at the raw image data.  It's each channel in order (Red, Green, Blue, Alpha, ...)
      // where each channel consists of an 8-bit value for each pixel in the image.

      // Read the data by channel.
      for (channel = 0; channel < 4; channel++) {
         stbi_uc *p;

         p = out + channel;
         if (channel >= channelCount) {
            // Fill this channel with default data.
            stbi_uc val = channel == 3 ? 255 : 0;
            for (i = 0; i < pixelCount; i++, p += 4)
               *p = val;
         } else {
            // Read the data.
            if (bitdepth == 16) {
               for (i = 0; i < pixelCount; i++, p += 4)
                  *p = (stbi_uc) (stbi__get16be(s) >> 8);
            } else {
               for (i = 0; i < pixelCount; i++, p += 4)
                  *p = stbi__get8(s);
            }
         }
      }
   }

   if (req_comp && req_comp != 4) {
      out = stbi__convert_format(out, 4, req_comp, w, h);
      if (out == NULL) return out; // stbi__convert_format frees input on failure
   }

   if (comp) *comp = 4;
   *y = h;
   *x = w;

   return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %r8d, 0x54(%rsp)
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
callq 0x1e517
movl %eax, %ebx
shll $0x10, %ebx
movq %r12, %rdi
callq 0x1e517
orl %ebx, %eax
cmpl $0x38425053, %eax       # imm = 0x38425053
jne 0x1a045
movq %r12, %rdi
callq 0x1e517
cmpl $0x1, %eax
jne 0x1a051
cmpq $0x0, 0x10(%r12)
movq %r14, 0x70(%rsp)
je 0x1a05d
movq 0xb8(%r12), %rax
movq 0xc0(%r12), %rdx
movl %edx, %ecx
subl %eax, %ecx
cmpl $0x5, %ecx
jg 0x1a065
movq %rdx, 0xb8(%r12)
movq 0x28(%r12), %rdi
movl $0x6, %esi
subl %ecx, %esi
callq *0x18(%r12)
jmp 0x1a071
leaq 0x127c3(%rip), %rax     # 0x2c80f
jmp 0x1a179
leaq 0x127bf(%rip), %rax     # 0x2c817
jmp 0x1a179
movq 0xb8(%r12), %rax
addq $0x6, %rax
movq %rax, 0xb8(%r12)
movq %r12, %rdi
callq 0x1e517
cmpl $0x11, %eax
jb 0x1a08a
leaq 0x127a0(%rip), %rax     # 0x2c825
jmp 0x1a179
movl %eax, %r14d
movq %r12, %rdi
callq 0x1e517
movl %eax, %ebp
movq %r12, %rdi
callq 0x1e517
movq %rax, 0x10(%rsp)
movq %r12, %rdi
callq 0x1e517
movq %rax, 0x30(%rsp)
movq %r12, %rdi
callq 0x1e517
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x1e517
movl %eax, %ebx
cmpl $0x8, %eax
je 0x1a0d6
cmpl $0x10, %ebx
jne 0x1a172
movq %r12, %rdi
callq 0x1e517
cmpl $0x3, %eax
jne 0x1a169
movl %ebx, 0x50(%rsp)
movq %r15, 0x68(%rsp)
movq %r12, %rdi
callq 0x1e517
movl %eax, %ebx
shll $0x10, %ebx
movq %r12, %rdi
callq 0x1e517
orl %eax, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x1e753
movq %r12, %rdi
callq 0x1e517
movl %eax, %ebx
shll $0x10, %ebx
movq %r12, %rdi
callq 0x1e517
orl %eax, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x1e753
movq %r12, %rdi
callq 0x1e517
movl %eax, %ebx
shll $0x10, %ebx
movq %r12, %rdi
callq 0x1e517
orl %eax, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x1e753
movq %r12, %rdi
callq 0x1e517
cmpl $0x2, %eax
jb 0x1a194
leaq 0x126fb(%rip), %rax     # 0x2c862
jmp 0x1a179
leaq 0x126df(%rip), %rax     # 0x2c84f
jmp 0x1a179
leaq 0x126c0(%rip), %rax     # 0x2c839
movq %rax, 0x1d210(%rip)     # 0x37390
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %r15d
shll $0x10, %ebp
movq %rbp, 0x60(%rsp)
movq 0x10(%rsp), %rax
addl %ebp, %eax
movq 0x30(%rsp), %rbp
shll $0x10, %ebp
movq 0x8(%rsp), %rcx
addl %ebp, %ecx
movl %eax, 0x1c(%rsp)
movl %ecx, 0x2c(%rsp)
imull %ecx, %eax
movq %rax, 0x40(%rsp)
leal (,%rax,4), %eax
movslq %eax, %rdi
callq 0x43f0
testq %rax, %rax
je 0x1a938
movq %rax, %rbx
movq %r13, 0x58(%rsp)
movl %r14d, %eax
movq %rax, 0x78(%rsp)
testl %r15d, %r15d
movq %rbx, 0x48(%rsp)
je 0x1a944
imull 0x1c(%rsp), %r14d
addl %r14d, %r14d
movq %r12, %rdi
movl %r14d, %esi
callq 0x1e753
leaq 0x38(%r12), %r14
leaq 0x39(%r12), %rax
movq %rax, 0x30(%rsp)
movq 0x8(%rsp), %rsi
movl %esi, %eax
orl %ebp, %eax
movq %rbp, %rdi
movq 0x10(%rsp), %rbp
movl %ebp, %ecx
movq 0x60(%rsp), %rdx
orl %edx, %ecx
imull %eax, %ecx
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x80(%rsp)
addq $0x3c, %rbx
addl %edi, %esi
addl %edx, %ebp
imull %esi, %ebp
addq $0xf, %rbp
andq $-0x10, %rbp
movq %rbp, 0x10(%rsp)
xorl %eax, %eax
movq 0x40(%rsp), %rbp
movq %rax, 0x20(%rsp)
cmpq 0x78(%rsp), %rax
jae 0x1a481
testl %ebp, %ebp
jle 0x1a91e
movq 0x48(%rsp), %rax
movq 0x20(%rsp), %rcx
leaq (%rax,%rcx), %r13
xorl %r15d, %r15d
movq 0xb8(%r12), %rcx
movq 0xc0(%r12), %rax
cmpq %rax, %rcx
jae 0x1a2be
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb8(%r12)
movb (%rcx), %cl
jmp 0x1a31e
cmpl $0x0, 0x30(%r12)
je 0x1a2eb
movq 0x28(%r12), %rdi
movl 0x34(%r12), %edx
movq %r14, %rsi
callq *0x10(%r12)
testl %eax, %eax
je 0x1a2f5
cltq
addq %r14, %rax
movb (%r14), %cl
movq 0x30(%rsp), %rdx
jmp 0x1a30e
movl %r15d, 0x8(%rsp)
xorl %r15d, %r15d
jmp 0x1a338
movl $0x0, 0x30(%r12)
movb $0x0, 0x38(%r12)
xorl %ecx, %ecx
movq 0x30(%rsp), %rdx
movq %rdx, %rax
movq %rax, 0xc0(%r12)
movq %rdx, 0xb8(%r12)
cmpb $-0x80, %cl
je 0x1a473
movl %r15d, 0x8(%rsp)
movzbl %cl, %r15d
testb %cl, %cl
js 0x1a3df
incl %r15d
movl %r15d, %ebp
movq 0xb8(%r12), %rax
cmpq 0xc0(%r12), %rax
jae 0x1a360
leaq 0x1(%rax), %rcx
movq %rcx, 0xb8(%r12)
movb (%rax), %al
jmp 0x1a3bb
cmpl $0x0, 0x30(%r12)
je 0x1a38e
movq 0x28(%r12), %rdi
movl 0x34(%r12), %edx
movq %r14, %rsi
callq *0x10(%r12)
testl %eax, %eax
je 0x1a392
movslq %eax, %rcx
addq %r14, %rcx
movb (%r14), %al
movq 0x30(%rsp), %rdx
jmp 0x1a3ab
xorl %eax, %eax
jmp 0x1a3bb
movl $0x0, 0x30(%r12)
movb $0x0, 0x38(%r12)
xorl %eax, %eax
movq 0x30(%rsp), %rdx
movq %rdx, %rcx
movq %rcx, 0xc0(%r12)
movq %rdx, 0xb8(%r12)
movb %al, (%r13)
addq $0x4, %r13
decl %ebp
jne 0x1a33e
movl 0x8(%rsp), %eax
addl %r15d, %eax
movl %eax, %r15d
movq 0x40(%rsp), %rbp
jmp 0x1a473
cmpq %rax, %rdx
jae 0x1a3f4
leaq 0x1(%rdx), %rax
movq %rax, 0xb8(%r12)
movb (%rdx), %al
jmp 0x1a44f
cmpl $0x0, 0x30(%r12)
je 0x1a422
movq 0x28(%r12), %rdi
movl 0x34(%r12), %edx
movq %r14, %rsi
callq *0x10(%r12)
testl %eax, %eax
je 0x1a426
movslq %eax, %rcx
addq %r14, %rcx
movb (%r14), %al
movq 0x30(%rsp), %rdx
jmp 0x1a43f
xorl %eax, %eax
jmp 0x1a44f
movl $0x0, 0x30(%r12)
movb $0x0, 0x38(%r12)
xorl %eax, %eax
movq 0x30(%rsp), %rdx
movq %rdx, %rcx
movq %rcx, 0xc0(%r12)
movq %rdx, 0xb8(%r12)
movl $0x101, %ecx            # imm = 0x101
subl %r15d, %ecx
addl $0xfffffeff, %r15d      # imm = 0xFFFFFEFF
movb %al, (%r13)
addq $0x4, %r13
incl %r15d
jne 0x1a45e
movl 0x8(%rsp), %r15d
addl %ecx, %r15d
cmpl %ebp, %r15d
jl 0x1a299
jmp 0x1a91e
testl %ebp, %ebp
jle 0x1a91e
cmpq $0x3, 0x20(%rsp)
sete %al
negb %al
xorl %ecx, %ecx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm2
por 0x11844(%rip), %xmm2    # 0x2bcf0
movdqa 0x80(%rsp), %xmm1
movdqa 0x117a3(%rip), %xmm3    # 0x2bc60
pxor %xmm3, %xmm1
pxor %xmm3, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pcmpeqd %xmm6, %xmm6
pxor %xmm6, %xmm5
packssdw %xmm5, %xmm5
movd %xmm5, %edx
testb $0x1, %dl
je 0x1a510
movb %al, -0x3c(%rbx,%rcx,4)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm6, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
movd %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1a538
movb %al, -0x38(%rbx,%rcx,4)
movdqa %xmm0, %xmm3
por 0x1179c(%rip), %xmm3    # 0x2bce0
pxor 0x11714(%rip), %xmm3    # 0x2bc60
movdqa %xmm3, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pcmpeqd %xmm1, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
movdqa %xmm3, %xmm5
pand %xmm2, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm4, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm6, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
movd %xmm5, %edx
shrl $0x10, %edx
testb $0x1, %dl
je 0x1a593
movb %al, -0x34(%rbx,%rcx,4)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm3
pshufhw $0x84, %xmm4, %xmm2     # xmm2 = xmm4[0,1,2,3,4,5,4,6]
por %xmm3, %xmm2
pxor %xmm6, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
movd %xmm2, %edx
shrl $0x18, %edx
testb $0x1, %dl
je 0x1a5c6
movb %al, -0x30(%rbx,%rcx,4)
movdqa %xmm0, %xmm2
por 0x116fe(%rip), %xmm2    # 0x2bcd0
pxor 0x11686(%rip), %xmm2    # 0x2bc60
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pcmpeqd %xmm6, %xmm6
pxor %xmm6, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x2, %xmm5, %edx
testb $0x1, %dl
je 0x1a62a
movb %al, -0x2c(%rbx,%rcx,4)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm6, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x2, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1a653
movb %al, -0x28(%rbx,%rcx,4)
movdqa %xmm0, %xmm3
por 0x11661(%rip), %xmm3    # 0x2bcc0
pxor 0x115f9(%rip), %xmm3    # 0x2bc60
movdqa %xmm3, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pcmpeqd %xmm1, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
movdqa %xmm3, %xmm5
pand %xmm2, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm4, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm6, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x3, %xmm5, %edx
testb $0x1, %dl
je 0x1a6ac
movb %al, -0x24(%rbx,%rcx,4)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm3
pshufhw $0x84, %xmm4, %xmm2     # xmm2 = xmm4[0,1,2,3,4,5,4,6]
por %xmm3, %xmm2
pxor %xmm6, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x3, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1a6e0
movb %al, -0x20(%rbx,%rcx,4)
movdqa %xmm0, %xmm2
por 0x115c4(%rip), %xmm2    # 0x2bcb0
pxor 0x1156c(%rip), %xmm2    # 0x2bc60
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pcmpeqd %xmm6, %xmm6
pxor %xmm6, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x1a744
movb %al, -0x1c(%rbx,%rcx,4)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm6, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x4, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1a76d
movb %al, -0x18(%rbx,%rcx,4)
movdqa %xmm0, %xmm3
por 0x11527(%rip), %xmm3    # 0x2bca0
pxor 0x114df(%rip), %xmm3    # 0x2bc60
movdqa %xmm3, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pcmpeqd %xmm1, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
movdqa %xmm3, %xmm5
pand %xmm2, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm4, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm6, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x5, %xmm5, %edx
testb $0x1, %dl
je 0x1a7c6
movb %al, -0x14(%rbx,%rcx,4)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm3
pshufhw $0x84, %xmm4, %xmm2     # xmm2 = xmm4[0,1,2,3,4,5,4,6]
por %xmm3, %xmm2
pxor %xmm6, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x5, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1a7fa
movb %al, -0x10(%rbx,%rcx,4)
movdqa %xmm0, %xmm2
por 0x1148a(%rip), %xmm2    # 0x2bc90
pxor 0x11452(%rip), %xmm2    # 0x2bc60
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pcmpeqd %xmm6, %xmm6
pxor %xmm6, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x6, %xmm5, %edx
testb $0x1, %dl
je 0x1a85e
movb %al, -0xc(%rbx,%rcx,4)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm6, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x6, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1a887
movb %al, -0x8(%rbx,%rcx,4)
por 0x113f1(%rip), %xmm0    # 0x2bc80
pxor 0x113c9(%rip), %xmm0    # 0x2bc60
movdqa %xmm0, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm2     # xmm2 = xmm3[0,0,2,2]
pcmpeqd %xmm1, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
movdqa %xmm0, %xmm4
pand %xmm2, %xmm4
pshufd $0xf5, %xmm3, %xmm1     # xmm1 = xmm3[1,1,3,3]
por %xmm1, %xmm4
packssdw %xmm4, %xmm3
pxor %xmm6, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
pextrw $0x7, %xmm3, %edx
testb $0x1, %dl
je 0x1a8dc
movb %al, -0x4(%rbx,%rcx,4)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm0
pshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
por %xmm0, %xmm1
pxor %xmm6, %xmm1
packssdw %xmm1, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x7, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1a90f
movb %al, (%rbx,%rcx,4)
addq $0x10, %rcx
cmpq %rcx, 0x10(%rsp)
jne 0x1a496
movq 0x20(%rsp), %rax
incq %rax
incq %rbx
cmpq $0x4, %rax
jne 0x1a270
jmp 0x1af59
leaq 0x1198a(%rip), %rax     # 0x2c2c9
jmp 0x1a179
leaq 0x38(%r12), %rax
movq %rax, 0x80(%rsp)
leaq 0x39(%r12), %rax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %rsi
movl %esi, %eax
orl %ebp, %eax
movq %rbp, %rdi
movq 0x10(%rsp), %rbp
movl %ebp, %ecx
movq 0x60(%rsp), %rdx
orl %edx, %ecx
imull %eax, %ecx
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x30(%rsp)
movq %rbx, %r15
addq $0x3c, %r15
addl %edi, %esi
addl %edx, %ebp
imull %esi, %ebp
movq %rbp, 0x10(%rsp)
leaq 0xf(%rbp), %r14
andq $-0x10, %r14
xorl %eax, %eax
movdqa 0x112b0(%rip), %xmm7    # 0x2bc60
pcmpeqd %xmm8, %xmm8
movq 0x40(%rsp), %rcx
cmpq 0x78(%rsp), %rax
movq %rax, 0x8(%rsp)
jae 0x1aa01
cmpl $0x10, 0x50(%rsp)
jne 0x1ae88
testl %ecx, %ecx
jle 0x1af3c
xorl %ebp, %ebp
movq %r12, %rdi
callq 0x1e517
pcmpeqd %xmm8, %xmm8
movdqa 0x11270(%rip), %xmm7    # 0x2bc60
movb %ah, (%rbx,%rbp,4)
incq %rbp
cmpl %ebp, 0x10(%rsp)
jne 0x1a9db
jmp 0x1af3c
cmpq $0x3, %rax
sete %al
testl %ecx, %ecx
jle 0x1af3c
negb %al
xorl %ecx, %ecx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm2
por 0x112c6(%rip), %xmm2    # 0x2bcf0
movdqa 0x30(%rsp), %xmm1
pxor %xmm7, %xmm1
pxor %xmm7, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pxor %xmm8, %xmm5
packssdw %xmm5, %xmm5
movd %xmm5, %edx
testb $0x1, %dl
je 0x1aa81
movb %al, -0x3c(%r15,%rcx,4)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm8, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
movd %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1aaab
movb %al, -0x38(%r15,%rcx,4)
movdqa %xmm0, %xmm3
por 0x11229(%rip), %xmm3    # 0x2bce0
pxor %xmm7, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pcmpeqd %xmm1, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
movdqa %xmm3, %xmm5
pand %xmm2, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm4, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm8, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
movd %xmm5, %edx
shrl $0x10, %edx
testb $0x1, %dl
je 0x1ab04
movb %al, -0x34(%r15,%rcx,4)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm3
pshufhw $0x84, %xmm4, %xmm2     # xmm2 = xmm4[0,1,2,3,4,5,4,6]
por %xmm3, %xmm2
pxor %xmm8, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
movd %xmm2, %edx
shrl $0x18, %edx
testb $0x1, %dl
je 0x1ab39
movb %al, -0x30(%r15,%rcx,4)
movdqa %xmm0, %xmm2
por 0x1118b(%rip), %xmm2    # 0x2bcd0
pxor %xmm7, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pxor %xmm8, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x2, %xmm5, %edx
testb $0x1, %dl
je 0x1ab97
movb %al, -0x2c(%r15,%rcx,4)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm8, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x2, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1abc2
movb %al, -0x28(%r15,%rcx,4)
movdqa %xmm0, %xmm3
por 0x110f2(%rip), %xmm3    # 0x2bcc0
pxor %xmm7, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pcmpeqd %xmm1, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
movdqa %xmm3, %xmm5
pand %xmm2, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm4, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm8, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x3, %xmm5, %edx
testb $0x1, %dl
je 0x1ac19
movb %al, -0x24(%r15,%rcx,4)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm3
pshufhw $0x84, %xmm4, %xmm2     # xmm2 = xmm4[0,1,2,3,4,5,4,6]
por %xmm3, %xmm2
pxor %xmm8, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x3, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1ac4f
movb %al, -0x20(%r15,%rcx,4)
movdqa %xmm0, %xmm2
por 0x11055(%rip), %xmm2    # 0x2bcb0
pxor %xmm7, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pxor %xmm8, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x1acad
movb %al, -0x1c(%r15,%rcx,4)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm8, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x4, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1acd8
movb %al, -0x18(%r15,%rcx,4)
movdqa %xmm0, %xmm3
por 0x10fbc(%rip), %xmm3    # 0x2bca0
pxor %xmm7, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pcmpeqd %xmm1, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
movdqa %xmm3, %xmm5
pand %xmm2, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm4, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm8, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x5, %xmm5, %edx
testb $0x1, %dl
je 0x1ad2f
movb %al, -0x14(%r15,%rcx,4)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm3
pshufhw $0x84, %xmm4, %xmm2     # xmm2 = xmm4[0,1,2,3,4,5,4,6]
por %xmm3, %xmm2
pxor %xmm8, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x5, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1ad65
movb %al, -0x10(%r15,%rcx,4)
movdqa %xmm0, %xmm2
por 0x10f1f(%rip), %xmm2    # 0x2bc90
pxor %xmm7, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pxor %xmm8, %xmm5
packssdw %xmm5, %xmm5
packsswb %xmm5, %xmm5
pextrw $0x6, %xmm5, %edx
testb $0x1, %dl
je 0x1adc3
movb %al, -0xc(%r15,%rcx,4)
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm8, %xmm2
packssdw %xmm2, %xmm2
packsswb %xmm2, %xmm2
pextrw $0x6, %xmm2, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1adee
movb %al, -0x8(%r15,%rcx,4)
por 0x10e8a(%rip), %xmm0    # 0x2bc80
pxor %xmm7, %xmm0
movdqa %xmm0, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm2     # xmm2 = xmm3[0,0,2,2]
pcmpeqd %xmm1, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
movdqa %xmm0, %xmm4
pand %xmm2, %xmm4
pshufd $0xf5, %xmm3, %xmm1     # xmm1 = xmm3[1,1,3,3]
por %xmm1, %xmm4
packssdw %xmm4, %xmm3
pxor %xmm8, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
pextrw $0x7, %xmm3, %edx
testb $0x1, %dl
je 0x1ae41
movb %al, -0x4(%r15,%rcx,4)
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm0
pshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
por %xmm0, %xmm1
pxor %xmm8, %xmm1
packssdw %xmm1, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x7, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x1ae76
movb %al, (%r15,%rcx,4)
addq $0x10, %rcx
cmpq %rcx, %r14
jne 0x1aa14
jmp 0x1af3c
testl %ecx, %ecx
jle 0x1af3c
movq 0xb8(%r12), %rcx
movq 0xc0(%r12), %rax
xorl %r13d, %r13d
cmpq %rax, %rcx
jae 0x1aebb
leaq 0x1(%rcx), %rsi
movq %rsi, 0xb8(%r12)
movb (%rcx), %dl
movq %rsi, %rcx
jmp 0x1af2a
cmpl $0x0, 0x30(%r12)
je 0x1aef0
movq 0x28(%r12), %rdi
movl 0x34(%r12), %edx
movq 0x80(%rsp), %rbp
movq %rbp, %rsi
callq *0x10(%r12)
testl %eax, %eax
je 0x1aef4
cltq
addq %rbp, %rax
movb (%rbp), %dl
movq 0x20(%rsp), %rcx
jmp 0x1af0d
xorl %edx, %edx
jmp 0x1af2a
movl $0x0, 0x30(%r12)
movb $0x0, 0x38(%r12)
xorl %edx, %edx
movq 0x20(%rsp), %rcx
movq %rcx, %rax
movdqa 0x10d4b(%rip), %xmm7    # 0x2bc60
pcmpeqd %xmm8, %xmm8
movq %rax, 0xc0(%r12)
movq %rcx, 0xb8(%r12)
movb %dl, (%rbx,%r13,4)
incq %r13
cmpl %r13d, 0x10(%rsp)
jne 0x1aea3
movq 0x8(%rsp), %rax
incq %rax
incq %r15
incq %rbx
cmpq $0x4, %rax
movq 0x40(%rsp), %rcx
jne 0x1a9ba
movl 0x54(%rsp), %edx
testl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
je 0x1af98
movq 0x48(%rsp), %rdi
movl $0x4, %esi
movl 0x2c(%rsp), %ebx
movl %ebx, %ecx
movl 0x1c(%rsp), %r8d
callq 0x20612
testq %rax, %rax
movq 0x58(%rsp), %rsi
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rdx
jne 0x1afb0
jmp 0x1a180
movq 0x58(%rsp), %rsi
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rdx
movq 0x48(%rsp), %rax
movl 0x2c(%rsp), %ebx
testq %rdx, %rdx
je 0x1afbb
movl $0x4, (%rdx)
movl 0x1c(%rsp), %edx
movl %edx, (%rcx)
movl %ebx, (%rsi)
jmp 0x1a182