// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_init_read_transformations
void /* PRIVATE */
png_init_read_transformations(png_structp png_ptr)
{
   png_debug(1, "in png_init_read_transformations");

  {
#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
    defined(PNG_READ_SHIFT_SUPPORTED) || \
    defined(PNG_READ_GAMMA_SUPPORTED)
   int color_type = png_ptr->color_type;
#endif

#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED)

#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
   /* Detect gray background and attempt to enable optimization
    * for gray --> RGB case
    *
    * Note:  if PNG_BACKGROUND_EXPAND is set and color_type is either RGB or
    * RGB_ALPHA (in which case need_expand is superfluous anyway), the
    * background color might actually be gray yet not be flagged as such.
    * This is not a problem for the current code, which uses
    * PNG_BACKGROUND_IS_GRAY only to decide when to do the
    * png_do_gray_to_rgb() transformation.
    */
   if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) &&
       !(color_type & PNG_COLOR_MASK_COLOR))
   {
          png_ptr->mode |= PNG_BACKGROUND_IS_GRAY;
   } else if ((png_ptr->transformations & PNG_BACKGROUND) &&
              !(png_ptr->transformations & PNG_BACKGROUND_EXPAND) &&
              (png_ptr->transformations & PNG_GRAY_TO_RGB) &&
              png_ptr->background.red == png_ptr->background.green &&
              png_ptr->background.red == png_ptr->background.blue)
   {
          png_ptr->mode |= PNG_BACKGROUND_IS_GRAY;
          png_ptr->background.gray = png_ptr->background.red;
   }
#endif

   if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) &&
       (png_ptr->transformations & PNG_EXPAND))
   {
      if (!(color_type & PNG_COLOR_MASK_COLOR))  /* i.e., GRAY or GRAY_ALPHA */
      {
         /* Expand background and tRNS chunks */
         switch (png_ptr->bit_depth)
         {
            case 1:
               png_ptr->background.gray *= (png_uint_16)0xff;
               png_ptr->background.red = png_ptr->background.green
                 =  png_ptr->background.blue = png_ptr->background.gray;
               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
               {
                 png_ptr->trans_color.gray *= (png_uint_16)0xff;
                 png_ptr->trans_color.red = png_ptr->trans_color.green
                   = png_ptr->trans_color.blue = png_ptr->trans_color.gray;
               }
               break;

            case 2:
               png_ptr->background.gray *= (png_uint_16)0x55;
               png_ptr->background.red = png_ptr->background.green
                 = png_ptr->background.blue = png_ptr->background.gray;
               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
               {
                 png_ptr->trans_color.gray *= (png_uint_16)0x55;
                 png_ptr->trans_color.red = png_ptr->trans_color.green
                   = png_ptr->trans_color.blue = png_ptr->trans_color.gray;
               }
               break;

            case 4:
               png_ptr->background.gray *= (png_uint_16)0x11;
               png_ptr->background.red = png_ptr->background.green
                 = png_ptr->background.blue = png_ptr->background.gray;
               if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
               {
                 png_ptr->trans_color.gray *= (png_uint_16)0x11;
                 png_ptr->trans_color.red = png_ptr->trans_color.green
                   = png_ptr->trans_color.blue = png_ptr->trans_color.gray;
               }
               break;

            case 8:

            case 16:
               png_ptr->background.red = png_ptr->background.green
                 = png_ptr->background.blue = png_ptr->background.gray;
               break;
         }
      }
      else if (color_type == PNG_COLOR_TYPE_PALETTE)
      {
         png_ptr->background.red   =
            png_ptr->palette[png_ptr->background.index].red;
         png_ptr->background.green =
            png_ptr->palette[png_ptr->background.index].green;
         png_ptr->background.blue  =
            png_ptr->palette[png_ptr->background.index].blue;

#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
        if (png_ptr->transformations & PNG_INVERT_ALPHA)
        {
#ifdef PNG_READ_EXPAND_SUPPORTED
           if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
#endif
           {
           /* Invert the alpha channel (in tRNS) unless the pixels are
            * going to be expanded, in which case leave it for later
            */
              int i, istop;
              istop=(int)png_ptr->num_trans;
              for (i=0; i<istop; i++)
                 png_ptr->trans_alpha[i] = (png_byte)(255 - png_ptr->trans_alpha[i]);
           }
        }
#endif

      }
   }
#endif

#if defined(PNG_READ_BACKGROUND_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED)
   png_ptr->background_1 = png_ptr->background;
#endif
#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)

   if ((color_type == PNG_COLOR_TYPE_PALETTE && png_ptr->num_trans != 0)
       && (fabs(png_ptr->screen_gamma * png_ptr->gamma - 1.0)
         < PNG_GAMMA_THRESHOLD))
   {
    int i, k;
    k=0;
    for (i=0; i<png_ptr->num_trans; i++)
    {
      if (png_ptr->trans_alpha[i] != 0 && png_ptr->trans_alpha[i] != 0xff)
        k=1; /* Partial transparency is present */
    }
    if (k == 0)
      png_ptr->transformations &= ~PNG_GAMMA;
   }

   if ((png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) &&
        png_ptr->gamma != 0.0)
   {
      png_build_gamma_table(png_ptr, png_ptr->bit_depth);

#ifdef PNG_READ_BACKGROUND_SUPPORTED
      if (png_ptr->transformations & PNG_BACKGROUND)
      {
         if (color_type == PNG_COLOR_TYPE_PALETTE)
         {
           /* Could skip if no transparency */
            png_color back, back_1;
            png_colorp palette = png_ptr->palette;
            int num_palette = png_ptr->num_palette;
            int i;
            if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE)
            {
               back.red = png_ptr->gamma_table[png_ptr->background.red];
               back.green = png_ptr->gamma_table[png_ptr->background.green];
               back.blue = png_ptr->gamma_table[png_ptr->background.blue];

               back_1.red = png_ptr->gamma_to_1[png_ptr->background.red];
               back_1.green = png_ptr->gamma_to_1[png_ptr->background.green];
               back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue];
            }
            else
            {
               double g, gs;

               switch (png_ptr->background_gamma_type)
               {
                  case PNG_BACKGROUND_GAMMA_SCREEN:
                     g = (png_ptr->screen_gamma);
                     gs = 1.0;
                     break;

                  case PNG_BACKGROUND_GAMMA_FILE:
                     g = 1.0 / (png_ptr->gamma);
                     gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);
                     break;

                  case PNG_BACKGROUND_GAMMA_UNIQUE:
                     g = 1.0 / (png_ptr->background_gamma);
                     gs = 1.0 / (png_ptr->background_gamma *
                                 png_ptr->screen_gamma);
                     break;
                  default:
                     g = 1.0;    /* back_1 */
                     gs = 1.0;   /* back */
               }

               if ( fabs(gs - 1.0) < PNG_GAMMA_THRESHOLD)
               {
                  back.red   = (png_byte)png_ptr->background.red;
                  back.green = (png_byte)png_ptr->background.green;
                  back.blue  = (png_byte)png_ptr->background.blue;
               }
               else
               {
                  back.red = (png_byte)(pow(
                     (double)png_ptr->background.red/255.0, gs) * 255.0 + .5);
                  back.green = (png_byte)(pow(
                     (double)png_ptr->background.green/255.0, gs) * 255.0
                         + .5);
                  back.blue = (png_byte)(pow(
                     (double)png_ptr->background.blue/255.0, gs) * 255.0 + .5);
               }

               back_1.red = (png_byte)(pow(
                  (double)png_ptr->background.red/255.0, g) * 255.0 + .5);
               back_1.green = (png_byte)(pow(
                  (double)png_ptr->background.green/255.0, g) * 255.0 + .5);
               back_1.blue = (png_byte)(pow(
                  (double)png_ptr->background.blue/255.0, g) * 255.0 + .5);
            }
            for (i = 0; i < num_palette; i++)
            {
               if (i < (int)png_ptr->num_trans && png_ptr->trans_alpha[i] != 0xff)
               {
                  if (png_ptr->trans_alpha[i] == 0)
                  {
                     palette[i] = back;
                  }
                  else /* if (png_ptr->trans_alpha[i] != 0xff) */
                  {
                     png_byte v, w;

                     v = png_ptr->gamma_to_1[palette[i].red];
                     png_composite(w, v, png_ptr->trans_alpha[i], back_1.red);
                     palette[i].red = png_ptr->gamma_from_1[w];

                     v = png_ptr->gamma_to_1[palette[i].green];
                     png_composite(w, v, png_ptr->trans_alpha[i], back_1.green);
                     palette[i].green = png_ptr->gamma_from_1[w];

                     v = png_ptr->gamma_to_1[palette[i].blue];
                     png_composite(w, v, png_ptr->trans_alpha[i], back_1.blue);
                     palette[i].blue = png_ptr->gamma_from_1[w];
                  }
               }
               else
               {
                  palette[i].red = png_ptr->gamma_table[palette[i].red];
                  palette[i].green = png_ptr->gamma_table[palette[i].green];
                  palette[i].blue = png_ptr->gamma_table[palette[i].blue];
               }
            }
            /* Prevent the transformations being done again, and make sure
             * that the now spurious alpha channel is stripped - the code
             * has just reduced background composition and gamma correction
             * to a simple alpha channel strip.
             */
            png_ptr->transformations &= ~PNG_BACKGROUND;
            png_ptr->transformations &= ~PNG_GAMMA;
            png_ptr->transformations |= PNG_STRIP_ALPHA;
         }
         /* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */
         else
         /* color_type != PNG_COLOR_TYPE_PALETTE */
         {
            double m = (double)(((png_uint_32)1 << png_ptr->bit_depth) - 1);
            double g = 1.0;
            double gs = 1.0;

            switch (png_ptr->background_gamma_type)
            {
               case PNG_BACKGROUND_GAMMA_SCREEN:
                  g = (png_ptr->screen_gamma);
                  gs = 1.0;
                  break;

               case PNG_BACKGROUND_GAMMA_FILE:
                  g = 1.0 / (png_ptr->gamma);
                  gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);
                  break;

               case PNG_BACKGROUND_GAMMA_UNIQUE:
                  g = 1.0 / (png_ptr->background_gamma);
                  gs = 1.0 / (png_ptr->background_gamma *
                     png_ptr->screen_gamma);
                  break;
            }

            png_ptr->background_1.gray = (png_uint_16)(pow(
               (double)png_ptr->background.gray / m, g) * m + .5);
            png_ptr->background.gray = (png_uint_16)(pow(
               (double)png_ptr->background.gray / m, gs) * m + .5);

            if ((png_ptr->background.red != png_ptr->background.green) ||
                (png_ptr->background.red != png_ptr->background.blue) ||
                (png_ptr->background.red != png_ptr->background.gray))
            {
               /* RGB or RGBA with color background */
               png_ptr->background_1.red = (png_uint_16)(pow(
                  (double)png_ptr->background.red / m, g) * m + .5);
               png_ptr->background_1.green = (png_uint_16)(pow(
                  (double)png_ptr->background.green / m, g) * m + .5);
               png_ptr->background_1.blue = (png_uint_16)(pow(
                  (double)png_ptr->background.blue / m, g) * m + .5);
               png_ptr->background.red = (png_uint_16)(pow(
                  (double)png_ptr->background.red / m, gs) * m + .5);
               png_ptr->background.green = (png_uint_16)(pow(
                  (double)png_ptr->background.green / m, gs) * m + .5);
               png_ptr->background.blue = (png_uint_16)(pow(
                  (double)png_ptr->background.blue / m, gs) * m + .5);
            }
            else
            {
               /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */
               png_ptr->background_1.red = png_ptr->background_1.green
                 = png_ptr->background_1.blue = png_ptr->background_1.gray;
               png_ptr->background.red = png_ptr->background.green
                 = png_ptr->background.blue = png_ptr->background.gray;
            }
         }
      }
      else
      /* Transformation does not include PNG_BACKGROUND */
#endif /* PNG_READ_BACKGROUND_SUPPORTED */
      if (color_type == PNG_COLOR_TYPE_PALETTE)
      {
         png_colorp palette = png_ptr->palette;
         int num_palette = png_ptr->num_palette;
         int i;

         for (i = 0; i < num_palette; i++)
         {
            palette[i].red = png_ptr->gamma_table[palette[i].red];
            palette[i].green = png_ptr->gamma_table[palette[i].green];
            palette[i].blue = png_ptr->gamma_table[palette[i].blue];
         }

         /* Done the gamma correction. */
         png_ptr->transformations &= ~PNG_GAMMA;
      }
   }
#ifdef PNG_READ_BACKGROUND_SUPPORTED
   else
#endif
#endif /* PNG_READ_GAMMA_SUPPORTED && PNG_FLOATING_POINT_SUPPORTED */
#ifdef PNG_READ_BACKGROUND_SUPPORTED
   /* No GAMMA transformation */
   if ((png_ptr->transformations & PNG_BACKGROUND) &&
       (color_type == PNG_COLOR_TYPE_PALETTE))
   {
      int i;
      int istop = (int)png_ptr->num_trans;
      png_color back;
      png_colorp palette = png_ptr->palette;

      back.red   = (png_byte)png_ptr->background.red;
      back.green = (png_byte)png_ptr->background.green;
      back.blue  = (png_byte)png_ptr->background.blue;

      for (i = 0; i < istop; i++)
      {
         if (png_ptr->trans_alpha[i] == 0)
         {
            palette[i] = back;
         }
         else if (png_ptr->trans_alpha[i] != 0xff)
         {
            /* The png_composite() macro is defined in png.h */
            png_composite(palette[i].red, palette[i].red,
               png_ptr->trans_alpha[i], back.red);
            png_composite(palette[i].green, palette[i].green,
               png_ptr->trans_alpha[i], back.green);
            png_composite(palette[i].blue, palette[i].blue,
               png_ptr->trans_alpha[i], back.blue);
         }
      }

      /* Handled alpha, still need to strip the channel. */
      png_ptr->transformations &= ~PNG_BACKGROUND;
      png_ptr->transformations |= PNG_STRIP_ALPHA;
   }
#endif /* PNG_READ_BACKGROUND_SUPPORTED */

#ifdef PNG_READ_SHIFT_SUPPORTED
   if ((png_ptr->transformations & PNG_SHIFT) &&
      (color_type == PNG_COLOR_TYPE_PALETTE))
   {
      png_uint_16 i;
      png_uint_16 istop = png_ptr->num_palette;
      int sr = 8 - png_ptr->sig_bit.red;
      int sg = 8 - png_ptr->sig_bit.green;
      int sb = 8 - png_ptr->sig_bit.blue;

      if (sr < 0 || sr > 8)
         sr = 0;
      if (sg < 0 || sg > 8)
         sg = 0;
      if (sb < 0 || sb > 8)
         sb = 0;
      for (i = 0; i < istop; i++)
      {
         png_ptr->palette[i].red >>= sr;
         png_ptr->palette[i].green >>= sg;
         png_ptr->palette[i].blue >>= sb;
      }
   }
#endif  /* PNG_READ_SHIFT_SUPPORTED */
 }
#if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \
 && !defined(PNG_READ_BACKGROUND_SUPPORTED)
   if (png_ptr)
      return;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movb 0x24e(%rdi), %bpl
movl 0x124(%rdi), %eax
movl %eax, %ecx
shrl $0x8, %ecx
testb $0x2, %bpl
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x8e2fa
orb $0x8, 0x11d(%rbx)
jmp 0x8e331
movl %eax, %ecx
andl $0x4180, %ecx           # imm = 0x4180
cmpl $0x4080, %ecx           # imm = 0x4080
jne 0x8e331
movzwl 0x262(%rbx), %ecx
cmpw 0x264(%rbx), %cx
jne 0x8e331
cmpw 0x266(%rbx), %cx
jne 0x8e331
orb $0x8, 0x11d(%rbx)
movw %cx, 0x268(%rbx)
movl %eax, %ecx
notl %ecx
testl $0x1100, %ecx           # imm = 0x1100
jne 0x8e4b7
testb $0x2, %bpl
jne 0x8e3a4
movzbl 0x24f(%rbx), %edx
leal -0x1(%rdx), %ecx
cmpl $0x7, %ecx
ja 0x8e41c
leaq 0x1e9f3(%rip), %rdx     # 0xacd54
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl 0x268(%rbx), %ecx
movl %ecx, %edx
shll $0x8, %edx
subl %ecx, %edx
movd %edx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
movq %xmm0, 0x262(%rbx)
btl $0x19, %eax
jb 0x8e4b7
movl 0x2e8(%rbx), %ecx
movl %ecx, %eax
shll $0x8, %eax
subl %ecx, %eax
jmp 0x8e495
cmpb $0x3, %bpl
jne 0x8e4b7
movq 0x238(%rbx), %rcx
movzbl 0x260(%rbx), %edx
leaq (%rdx,%rdx,2), %rdx
movzbl (%rcx,%rdx), %esi
movw %si, 0x262(%rbx)
movzbl 0x1(%rcx,%rdx), %esi
movw %si, 0x264(%rbx)
movzbl 0x2(%rcx,%rdx), %ecx
movw %cx, 0x266(%rbx)
andl $0x2080000, %eax        # imm = 0x2080000
cmpl $0x80000, %eax          # imm = 0x80000
jne 0x8e4b7
movzwl 0x242(%rbx), %eax
testq %rax, %rax
je 0x8e4b7
xorl %ecx, %ecx
movq 0x2d8(%rbx), %rdx
notb (%rdx,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x8e405
jmp 0x8e4b7
cmpl $0x10, %edx
jne 0x8e4b7
movzwl 0x268(%rbx), %eax
movl $0x262, %ecx            # imm = 0x262
movl $0x264, %edx            # imm = 0x264
movl $0x266, %esi            # imm = 0x266
jmp 0x8e4ab
imull $0x55, 0x268(%rbx), %ecx
movd %ecx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
movq %xmm0, 0x262(%rbx)
btl $0x19, %eax
jb 0x8e4b7
imull $0x55, 0x2e8(%rbx), %eax
jmp 0x8e495
movl 0x268(%rbx), %ecx
movl %ecx, %edx
shll $0x4, %edx
addl %ecx, %edx
movd %edx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
movq %xmm0, 0x262(%rbx)
btl $0x19, %eax
jb 0x8e4b7
movl 0x2e8(%rbx), %ecx
movl %ecx, %eax
shll $0x4, %eax
addl %ecx, %eax
movw %ax, 0x2e8(%rbx)
movl $0x2e2, %ecx            # imm = 0x2E2
movl $0x2e4, %edx            # imm = 0x2E4
movl $0x2e6, %esi            # imm = 0x2E6
movw %ax, (%rbx,%rsi)
movw %ax, (%rbx,%rdx)
movw %ax, (%rbx,%rcx)
movzwl 0x268(%rbx), %eax
movw %ax, 0x272(%rbx)
movq 0x260(%rbx), %rax
movq %rax, 0x26a(%rbx)
cmpb $0x3, %bpl
jne 0x8e54a
movzwl 0x242(%rbx), %eax
testq %rax, %rax
je 0x8e54a
movss 0x290(%rbx), %xmm0
mulss 0x28c(%rbx), %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x13b47(%rip), %xmm0    # 0xa2048
andpd 0x13d67(%rip), %xmm0    # 0xa2270
movsd 0x1e8ff(%rip), %xmm1    # 0xace10
ucomisd %xmm0, %xmm1
jbe 0x8e54a
movq 0x2d8(%rbx), %rcx
xorl %edx, %edx
xorl %esi, %esi
movzbl (%rcx,%rdx), %edi
testl %edi, %edi
je 0x8e537
cmpl $0xff, %edi
je 0x8e537
movl $0x1, %esi
incq %rdx
cmpq %rdx, %rax
jne 0x8e522
testl %esi, %esi
jne 0x8e54a
andb $-0x21, 0x125(%rbx)
movl 0x124(%rbx), %eax
testl $0x602000, %eax         # imm = 0x602000
je 0x8e5fd
movss 0x28c(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x8e572
jnp 0x8e5fd
movzbl 0x24f(%rbx), %esi
movq %rbx, %rdi
callq 0x8eea3
movl 0x124(%rbx), %eax
testb %al, %al
js 0x8e73c
cmpb $0x3, %bpl
jne 0x8ebb7
movzwl 0x240(%rbx), %esi
testq %rsi, %rsi
je 0x8e5ed
movq 0x238(%rbx), %rcx
movq 0x298(%rbx), %rdx
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
movzbl (%rcx,%rdi), %r8d
movb (%rdx,%r8), %r8b
movb %r8b, (%rcx,%rdi)
movzbl 0x1(%rcx,%rdi), %r8d
movb (%rdx,%r8), %r8b
movb %r8b, 0x1(%rcx,%rdi)
movzbl 0x2(%rcx,%rdi), %r8d
movb (%rdx,%r8), %r8b
movb %r8b, 0x2(%rcx,%rdi)
addq $0x3, %rdi
cmpq %rdi, %rsi
jne 0x8e5b9
andl $0xffffdf7f, %eax       # imm = 0xFFFFDF7F
movl %eax, 0x124(%rbx)
jmp 0x8ebb7
cmpb $0x3, %bpl
setne %cl
testb %al, %al
setns %al
orb %cl, %al
jne 0x8ebb7
movb %bpl, 0xf(%rsp)
movzwl 0x242(%rbx), %eax
testq %rax, %rax
je 0x8e732
movzwl 0x262(%rbx), %r9d
movl $0xff, %ecx
movl %r9d, 0x10(%rsp)
andl %ecx, %r9d
movzwl 0x264(%rbx), %esi
movl %esi, %r14d
andl %ecx, %r14d
movzwl 0x266(%rbx), %edi
movl %edi, %r15d
andl %ecx, %r15d
movq 0x238(%rbx), %rbp
addq $0x2, %rbp
xorl %r8d, %r8d
movzwl %r9w, %r9d
movl $0x80, %r10d
movl $0xffff, %r11d          # imm = 0xFFFF
movzwl %r14w, %r14d
movzwl %r15w, %r15d
movq 0x2d8(%rbx), %r12
movzbl (%r12,%r8), %r13d
cmpl $0xff, %r13d
je 0x8e722
testl %r13d, %r13d
jne 0x8e6aa
movl 0x10(%rsp), %ecx
movb %cl, -0x2(%rbp)
movb %sil, -0x1(%rbp)
movb %dil, (%rbp)
jmp 0x8e722
movzwl %r13w, %edx
movzbl -0x2(%rbp), %ecx
imull %edx, %ecx
notb %r13b
movzbl %r13b, %edx
imull %r9d, %edx
addl %r10d, %ecx
addl %edx, %ecx
andl %r11d, %ecx
movl %ecx, %edx
shrl $0x8, %edx
addl %ecx, %edx
movb %dh, -0x2(%rbp)
movzbl -0x1(%rbp), %ecx
movzbl (%r12,%r8), %edx
imull %edx, %ecx
movl $0xff, %r13d
xorl %r13d, %edx
imull %r14d, %edx
addl %r10d, %ecx
addl %edx, %ecx
andl %r11d, %ecx
movl %ecx, %edx
shrl $0x8, %edx
addl %ecx, %edx
movb %dh, -0x1(%rbp)
movzbl (%rbp), %ecx
movzbl (%r12,%r8), %edx
imull %edx, %ecx
xorl %r13d, %edx
imull %r15d, %edx
addl %r10d, %ecx
addl %edx, %ecx
andl %r11d, %ecx
movl %ecx, %edx
shrl $0x8, %edx
addl %ecx, %edx
movb %dh, (%rbp)
incq %r8
addq $0x3, %rbp
cmpq %r8, %rax
jne 0x8e67b
movl $0xfffbff7f, %eax       # imm = 0xFFFBFF7F
jmp 0x8eba1
cmpb $0x3, %bpl
jne 0x8e7b8
movq 0x238(%rbx), %r14
movzwl 0x240(%rbx), %r15d
movzbl 0x258(%rbx), %eax
cmpl $0x1, %eax
movb %bpl, 0xf(%rsp)
je 0x8e843
cmpl $0x3, %eax
je 0x8e807
cmpl $0x2, %eax
jne 0x8e881
movzwl 0x262(%rbx), %edx
movq 0x298(%rbx), %rcx
movq 0x2a8(%rbx), %rsi
movb (%rcx,%rdx), %r13b
movzwl 0x264(%rbx), %edi
movb (%rcx,%rdi), %al
movzwl 0x266(%rbx), %r8d
movb (%rcx,%r8), %cl
movb (%rsi,%rdx), %bpl
movb (%rsi,%rdi), %r12b
movb (%rsi,%r8), %dil
jmp 0x8ea2c
movb 0x24f(%rbx), %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
notl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x10(%rsp)
movzbl 0x258(%rbx), %eax
cmpl $0x3, %eax
je 0x8e856
cmpl $0x2, %eax
je 0x8e82f
cmpl $0x1, %eax
jne 0x8ec75
xorps %xmm1, %xmm1
cvtss2sd 0x290(%rbx), %xmm1
shufpd $0x2, 0x1e61e(%rip), %xmm1 # xmm1 = xmm1[0],mem[1]
jmp 0x8ec7d
movss 0x25c(%rbx), %xmm0
movss 0x290(%rbx), %xmm1
mulss %xmm0, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cvtps2pd %xmm0, %xmm0
movapd 0x14737(%rip), %xmm2    # 0xa2f60
divpd %xmm0, %xmm2
jmp 0x8e889
movsd 0x28c(%rbx), %xmm0
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
mulps %xmm0, %xmm1
jmp 0x8e86a
cvtss2sd 0x290(%rbx), %xmm2
shufpd $0x2, 0x1e5cc(%rip), %xmm2 # xmm2 = xmm2[0],mem[1]
jmp 0x8e889
movss 0x25c(%rbx), %xmm0
movss 0x290(%rbx), %xmm1
mulss %xmm0, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
cvtps2pd %xmm0, %xmm0
movapd 0x146e8(%rip), %xmm1    # 0xa2f60
divpd %xmm0, %xmm1
jmp 0x8ec7d
movapd 0x146d7(%rip), %xmm2    # 0xa2f60
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
movsd 0x137af(%rip), %xmm0    # 0xa2048
addsd %xmm1, %xmm0
andpd 0x139cb(%rip), %xmm0    # 0xa2270
movsd 0x1e563(%rip), %xmm3    # 0xace10
ucomisd %xmm0, %xmm3
movzwl 0x262(%rbx), %r13d
movapd %xmm2, 0x10(%rsp)
jbe 0x8e8d6
movd 0x264(%rbx), %xmm0
pand 0x1e55f(%rip), %xmm0    # 0xace30
jmp 0x8e977
movzwl %r13w, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x1392f(%rip), %xmm0    # 0xa2218
movapd %xmm1, 0x20(%rsp)
callq 0xe7d0
movsd 0x1391c(%rip), %xmm1    # 0xa2218
mulsd %xmm1, %xmm0
addsd 0x13728(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %r13d
movzwl 0x264(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x20(%rsp), %xmm1
callq 0xe7d0
movapd %xmm0, 0x30(%rsp)
movzwl 0x266(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x138d3(%rip), %xmm0    # 0xa2218
movaps 0x20(%rsp), %xmm1
callq 0xe7d0
movapd 0x10(%rsp), %xmm2
movapd 0x30(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd 0x1b189(%rip), %xmm1    # 0xa9af0
addpd 0x136a1(%rip), %xmm1    # 0xa2010
cvttpd2dq %xmm1, %xmm0
packuswb %xmm0, %xmm0
packuswb %xmm0, %xmm0
movdqa %xmm0, 0x20(%rsp)
movzwl 0x262(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x13881(%rip), %xmm0    # 0xa2218
movapd %xmm2, %xmm1
callq 0xe7d0
movsd 0x13870(%rip), %xmm1    # 0xa2218
mulsd %xmm1, %xmm0
addsd 0x1367c(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %ebp
movzwl 0x264(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x10(%rsp), %xmm1
callq 0xe7d0
movsd 0x1383c(%rip), %xmm1    # 0xa2218
mulsd %xmm1, %xmm0
addsd 0x13648(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %r12d
movzwl 0x266(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x10(%rsp), %xmm1
callq 0xe7d0
mulsd 0x13807(%rip), %xmm0    # 0xa2218
addsd 0x13617(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %edi
movdqa 0x20(%rsp), %xmm0
movd %xmm0, %eax
movl %eax, %ecx
shrl $0x8, %ecx
testq %r15, %r15
je 0x8eb9c
movzbl %bpl, %edx
movl %edx, 0x10(%rsp)
movzbl %r12b, %edx
movl %edx, 0x20(%rsp)
movzbl %dil, %edi
addq $0x2, %r14
xorl %r8d, %r8d
movl $0x80, %r9d
movl $0xff, %r10d
movzwl 0x242(%rbx), %edx
cmpq %rdx, %r8
jae 0x8ea8e
movq 0x2d8(%rbx), %rbp
movzbl (%rbp,%r8), %edx
cmpl $0xff, %edx
je 0x8ea8e
testl %edx, %edx
jne 0x8eacb
movb %r13b, -0x2(%r14)
movb %al, -0x1(%r14)
movb %cl, (%r14)
jmp 0x8eaba
movq 0x298(%rbx), %rdx
movzbl -0x2(%r14), %r11d
movb (%rdx,%r11), %r11b
movb %r11b, -0x2(%r14)
movzbl -0x1(%r14), %r11d
movb (%rdx,%r11), %r11b
movb %r11b, -0x1(%r14)
movzbl (%r14), %r11d
movb (%rdx,%r11), %dl
movb %dl, (%r14)
incq %r8
addq $0x3, %r14
cmpq %r8, %r15
jne 0x8ea5c
jmp 0x8eb9c
movq 0x2a0(%rbx), %r11
movq 0x2a8(%rbx), %r12
movl %r13d, %esi
movzbl -0x2(%r14), %r13d
movzbl (%r12,%r13), %r13d
imull %edx, %r13d
notb %dl
movzbl %dl, %edx
imull 0x10(%rsp), %edx
addl %r13d, %edx
leal (%rdx,%r9), %r13d
shrl $0x8, %r13d
andl %r10d, %r13d
addl %r13d, %edx
addl $0x80, %edx
shrl $0x8, %edx
andl %r10d, %edx
movb (%r11,%rdx), %dl
movb %dl, -0x2(%r14)
movzbl -0x1(%r14), %edx
movzbl (%r12,%rdx), %edx
movzbl (%rbp,%r8), %r13d
imull %r13d, %edx
xorl %r10d, %r13d
imull 0x20(%rsp), %r13d
addl %edx, %r13d
leal (%r9,%r13), %edx
shrl $0x8, %edx
andl %r10d, %edx
addl %r13d, %edx
addl $0x80, %edx
movl %esi, %r13d
shrl $0x8, %edx
andl %r10d, %edx
movb (%r11,%rdx), %dl
movb %dl, -0x1(%r14)
movzbl (%r14), %edx
movzbl (%r12,%rdx), %edx
movzbl (%rbp,%r8), %r12d
imull %r12d, %edx
xorl %r10d, %r12d
imull %edi, %r12d
addl %edx, %r12d
leal (%r12,%r9), %edx
shrl $0x8, %edx
andl %r10d, %edx
addl %r12d, %edx
addl $0x80, %edx
shrl $0x8, %edx
andl %r10d, %edx
movb (%r11,%rdx), %dl
jmp 0x8eab7
movl $0xfffbdf7f, %eax       # imm = 0xFFFBDF7F
andl 0x124(%rbx), %eax
orl $0x40000, %eax          # imm = 0x40000
movl %eax, 0x124(%rbx)
movb 0xf(%rsp), %bpl
cmpb $0x3, %bpl
jne 0x8ec66
movl 0x124(%rbx), %eax
andl $0x8, %eax
je 0x8ec66
movzbl 0x2c8(%rbx), %ecx
movl $0x8, %eax
movl $0x8, %edx
subl %ecx, %edx
movzbl 0x2c9(%rbx), %edi
movl $0x8, %esi
subl %edi, %esi
movzbl 0x2ca(%rbx), %r8d
subl %r8d, %eax
xorl %r9d, %r9d
cmpl $0x9, %ecx
cmovael %r9d, %edx
movzwl 0x240(%rbx), %ecx
cmpl $0x9, %edi
cmovael %r9d, %esi
cmpl $0x9, %r8d
cmovael %r9d, %eax
testq %rcx, %rcx
je 0x8ec66
movq 0x238(%rbx), %rdi
leaq (%rcx,%rcx,2), %r8
xorl %r9d, %r9d
movzbl (%rdi,%r9), %r10d
movl %edx, %ecx
shrl %cl, %r10d
movb %r10b, (%rdi,%r9)
movzbl 0x1(%rdi,%r9), %r10d
movl %esi, %ecx
shrl %cl, %r10d
movb %r10b, 0x1(%rdi,%r9)
movzbl 0x2(%rdi,%r9), %r10d
movl %eax, %ecx
shrl %cl, %r10d
movb %r10b, 0x2(%rdi,%r9)
addq $0x3, %r9
cmpq %r9, %r8
jne 0x8ec2f
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movapd 0x142e3(%rip), %xmm1    # 0xa2f60
movzwl 0x268(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x10(%rsp), %xmm0
movapd %xmm1, 0x20(%rsp)
callq 0xe7d0
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x13382(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %eax
movw %ax, 0x272(%rbx)
movzwl 0x268(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x20(%rsp), %xmm1
movhlps %xmm1, %xmm1            # xmm1 = xmm1[1,1]
movaps %xmm1, 0x30(%rsp)
callq 0xe7d0
mulsd 0x10(%rsp), %xmm0
addsd 0x13345(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %eax
movw %ax, 0x268(%rbx)
movzwl 0x262(%rbx), %ecx
cmpw 0x264(%rbx), %cx
jne 0x8ed4a
cmpw 0x266(%rbx), %cx
jne 0x8ed4a
cmpw %ax, %cx
jne 0x8ed4a
movzwl 0x272(%rbx), %ecx
movw %cx, 0x270(%rbx)
movw %cx, 0x26e(%rbx)
movw %cx, 0x26c(%rbx)
movw %ax, 0x266(%rbx)
movw %ax, 0x264(%rbx)
movw %ax, 0x262(%rbx)
jmp 0x8ebb7
movzwl %cx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
callq 0xe7d0
movsd 0x10(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd 0x132ba(%rip), %xmm1    # 0xa2030
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, 0x26c(%rbx)
movzwl 0x264(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm2, %xmm0
movaps 0x20(%rsp), %xmm1
callq 0xe7d0
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x1327d(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %eax
movw %ax, 0x26e(%rbx)
movzwl 0x266(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x20(%rsp), %xmm1
callq 0xe7d0
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x13244(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %eax
movw %ax, 0x270(%rbx)
movzwl 0x262(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x30(%rsp), %xmm1
callq 0xe7d0
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x1320b(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %eax
movw %ax, 0x262(%rbx)
movzwl 0x264(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x30(%rsp), %xmm1
callq 0xe7d0
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x131d2(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %eax
movw %ax, 0x264(%rbx)
movzwl 0x266(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x30(%rsp), %xmm1
callq 0xe7d0
mulsd 0x10(%rsp), %xmm0
addsd 0x1319d(%rip), %xmm0    # 0xa2030
cvttsd2si %xmm0, %eax
movw %ax, 0x266(%rbx)
jmp 0x8ebb7