// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movq %rdi, %rbx
movb 0x24e(%rdi), %al
movl 0x124(%rdi), %ecx
movl %ecx, %edx
shrl $0x8, %edx
testb $0x2, %al
sete %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x8022e
orb $0x8, 0x11d(%rbx)
jmp 0x80265
movl %ecx, %edx
andl $0x4180, %edx           # imm = 0x4180
cmpl $0x4080, %edx           # imm = 0x4080
jne 0x80265
movzwl 0x262(%rbx), %edx
cmpw 0x264(%rbx), %dx
jne 0x80265
cmpw 0x266(%rbx), %dx
jne 0x80265
orb $0x8, 0x11d(%rbx)
movw %dx, 0x268(%rbx)
movl %ecx, %edx
notl %edx
testw $0x1100, %dx            # imm = 0x1100
jne 0x8040b
testb $0x2, %al
jne 0x802cf
movzbl 0x24f(%rbx), %esi
leal -0x1(%rsi), %edx
cmpl $0x7, %edx
ja 0x80358
leaq 0x1d7e2(%rip), %rsi     # 0x9da74
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
imull $0xff, 0x268(%rbx), %edx
movd %edx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
movq %xmm0, 0x262(%rbx)
btl $0x19, %ecx
jb 0x8040b
imull $0xff, 0x2e8(%rbx), %ecx
jmp 0x803e9
cmpb $0x3, %al
jne 0x80337
movq 0x238(%rbx), %rdx
movzbl 0x260(%rbx), %esi
leaq (%rsi,%rsi,2), %rsi
movzbl (%rdx,%rsi), %edi
movw %di, 0x262(%rbx)
movzbl 0x1(%rdx,%rsi), %edi
movw %di, 0x264(%rbx)
movzbl 0x2(%rdx,%rsi), %edx
movw %dx, 0x266(%rbx)
andl $0x2080000, %ecx        # imm = 0x2080000
cmpl $0x80000, %ecx          # imm = 0x80000
jne 0x8037c
movzwl 0x242(%rbx), %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x8040b
movq 0x2d8(%rbx), %rsi
notb (%rsi,%rdx)
incq %rdx
jmp 0x8031f
movzwl 0x268(%rbx), %eax
movw %ax, 0x272(%rbx)
movq 0x260(%rbx), %rax
movq %rax, 0x26a(%rbx)
jmp 0x8049d
cmpl $0x10, %esi
jne 0x8040b
movzwl 0x268(%rbx), %ecx
movl $0x262, %edx            # imm = 0x262
movl $0x264, %esi            # imm = 0x264
movl $0x266, %edi            # imm = 0x266
jmp 0x803ff
leaq 0x260(%rbx), %rax
movzwl 0x8(%rax), %ecx
movw %cx, 0x272(%rbx)
movq (%rax), %rax
movq %rax, 0x26a(%rbx)
jmp 0x8042b
imull $0x55, 0x268(%rbx), %edx
movd %edx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
movq %xmm0, 0x262(%rbx)
btl $0x19, %ecx
jb 0x8040b
imull $0x55, 0x2e8(%rbx), %ecx
jmp 0x803e9
imull $0x11, 0x268(%rbx), %edx
movd %edx, %xmm0
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
movq %xmm0, 0x262(%rbx)
btl $0x19, %ecx
jb 0x8040b
imull $0x11, 0x2e8(%rbx), %ecx
movw %cx, 0x2e8(%rbx)
movl $0x2e2, %edx            # imm = 0x2E2
movl $0x2e4, %esi            # imm = 0x2E4
movl $0x2e6, %edi            # imm = 0x2E6
movw %cx, (%rbx,%rdi)
movw %cx, (%rbx,%rsi)
movw %cx, (%rbx,%rdx)
movzwl 0x268(%rbx), %ecx
movw %cx, 0x272(%rbx)
movq 0x260(%rbx), %rcx
movq %rcx, 0x26a(%rbx)
cmpb $0x3, %al
jne 0x8049d
movzwl 0x242(%rbx), %eax
movb $0x1, %bpl
testq %rax, %rax
je 0x8049f
movss 0x290(%rbx), %xmm0
mulss 0x28c(%rbx), %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x12bca(%rip), %xmm0    # 0x93020
andpd 0x12e12(%rip), %xmm0    # 0x93270
movsd 0x1d6ea(%rip), %xmm1    # 0x9db50
ucomisd %xmm0, %xmm1
jbe 0x8049f
movq 0x2d8(%rbx), %rcx
xorl %edx, %edx
pushq $0x1
popq %rsi
xorl %edi, %edi
cmpq %rdx, %rax
je 0x806fc
movzbl (%rcx,%rdx), %r8d
testl %r8d, %r8d
je 0x80498
cmpl $0xff, %r8d
je 0x80498
movl %esi, %edi
incq %rdx
jmp 0x8047a
xorl %ebp, %ebp
movl 0x124(%rbx), %eax
testl $0x602000, %eax         # imm = 0x602000
je 0x8053e
movss 0x28c(%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x804c3
jnp 0x8053e
movzbl 0x24f(%rbx), %esi
movq %rbx, %rdi
callq 0x80dc2
movl 0x124(%rbx), %eax
testb %al, %al
js 0x80674
testb %bpl, %bpl
je 0x80aff
movq 0x238(%rbx), %rcx
movzwl 0x240(%rbx), %edx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x80710
movq 0x298(%rbx), %rdi
movzbl (%rcx,%rsi), %r8d
movb (%rdi,%r8), %r8b
movb %r8b, (%rcx,%rsi)
movzbl 0x1(%rcx,%rsi), %r8d
movb (%rdi,%r8), %r8b
movb %r8b, 0x1(%rcx,%rsi)
movzbl 0x2(%rcx,%rsi), %r8d
movb (%rdi,%r8), %dil
movb %dil, 0x2(%rcx,%rsi)
addq $0x3, %rsi
jmp 0x804fd
testb %al, %al
setns %al
movl %ebp, %ecx
xorb $0x1, %cl
orb %al, %cl
jne 0x80aff
movl %ebp, 0x20(%rsp)
movzwl 0x242(%rbx), %eax
movq 0x238(%rbx), %rcx
movzwl 0x262(%rbx), %r10d
movl $0xff, %edx
movl %r10d, 0x8(%rsp)
andl %edx, %r10d
movzwl 0x264(%rbx), %ebp
movl %ebp, 0x10(%rsp)
andl %edx, %ebp
movzwl 0x266(%rbx), %r8d
movl %r8d, %r12d
andl %edx, %r12d
addq $0x2, %rcx
xorl %r9d, %r9d
movzwl %r10w, %r10d
movl $0x80, %r11d
movl $0xffff, %r14d          # imm = 0xFFFF
movzwl %bp, %r15d
movzwl %r12w, %r12d
cmpq %r9, %rax
je 0x8066a
movq 0x2d8(%rbx), %r13
movzbl (%r13,%r9), %ebp
cmpl $0xff, %ebp
je 0x8065e
testl %ebp, %ebp
jne 0x805ea
movl 0x8(%rsp), %edx
movb %dl, -0x2(%rcx)
movl 0x10(%rsp), %edx
movb %dl, -0x1(%rcx)
movb %r8b, (%rcx)
jmp 0x8065e
movzwl %bp, %esi
movzbl -0x2(%rcx), %edi
imull %esi, %edi
notb %bpl
movzbl %bpl, %esi
imull %r10d, %esi
addl %r11d, %edi
addl %esi, %edi
andl %r14d, %edi
movl %edi, %edx
shrl $0x8, %edx
addl %edi, %edx
movb %dh, -0x2(%rcx)
movzbl -0x1(%rcx), %edi
movzbl (%r13,%r9), %esi
imull %esi, %edi
movl $0xff, %ebp
xorl %ebp, %esi
imull %r15d, %esi
addl %r11d, %edi
addl %esi, %edi
andl %r14d, %edi
movl %edi, %edx
shrl $0x8, %edx
addl %edi, %edx
movb %dh, -0x1(%rcx)
movzbl (%rcx), %edi
movzbl (%r13,%r9), %esi
imull %esi, %edi
xorl %ebp, %esi
imull %r12d, %esi
addl %r11d, %edi
addl %esi, %edi
andl %r14d, %edi
movl %edi, %edx
shrl $0x8, %edx
addl %edi, %edx
movb %dh, (%rcx)
incq %r9
addq $0x3, %rcx
jmp 0x805b1
movl $0xfffbff7f, %eax       # imm = 0xFFFBFF7F
jmp 0x80aea
testb %bpl, %bpl
je 0x80720
movl %ebp, 0x20(%rsp)
movq 0x238(%rbx), %r14
movzwl 0x240(%rbx), %r15d
movzbl 0x258(%rbx), %eax
cmpl $0x1, %eax
je 0x807a3
cmpl $0x3, %eax
je 0x80767
cmpl $0x2, %eax
jne 0x807e1
movzwl 0x262(%rbx), %eax
movq 0x298(%rbx), %rcx
movq 0x2a8(%rbx), %rdx
movb (%rcx,%rax), %sil
movl %esi, 0x8(%rsp)
movzwl 0x264(%rbx), %esi
movb (%rcx,%rsi), %dil
movl %edi, 0x10(%rsp)
movzwl 0x266(%rbx), %edi
movb (%rcx,%rdi), %cl
movl %ecx, 0x30(%rsp)
movb (%rdx,%rax), %r13b
movb (%rdx,%rsi), %r12b
movb (%rdx,%rdi), %dl
jmp 0x80979
testl %edi, %edi
jne 0x8049f
andb $-0x21, 0x125(%rbx)
jmp 0x8049f
andl $0xffffdf7f, %eax       # imm = 0xFFFFDF7F
movl %eax, 0x124(%rbx)
jmp 0x80aff
movb 0x24f(%rbx), %cl
pushq $-0x1
popq %rax
shll %cl, %eax
notl %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x8(%rsp)
movzbl 0x258(%rbx), %eax
cmpl $0x3, %eax
je 0x807b6
cmpl $0x2, %eax
je 0x8078f
cmpl $0x1, %eax
jne 0x80bac
cvtss2sd 0x290(%rbx), %xmm1
shufpd $0x2, 0x1d3fe(%rip), %xmm1 # xmm1 = xmm1[0],mem[1]
jmp 0x80bb4
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 0x13787(%rip), %xmm2    # 0x93f10
divpd %xmm0, %xmm2
jmp 0x807e9
movsd 0x28c(%rbx), %xmm0
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
mulps %xmm0, %xmm1
jmp 0x807ca
cvtss2sd 0x290(%rbx), %xmm2
shufpd $0x2, 0x1d3ac(%rip), %xmm2 # xmm2 = xmm2[0],mem[1]
jmp 0x807e9
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 0x13738(%rip), %xmm1    # 0x93f10
divpd %xmm0, %xmm1
jmp 0x80bb4
movapd 0x13727(%rip), %xmm2    # 0x93f10
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
movsd 0x12827(%rip), %xmm0    # 0x93020
addsd %xmm1, %xmm0
andpd 0x12a6b(%rip), %xmm0    # 0x93270
movsd 0x1d343(%rip), %xmm3    # 0x9db50
ucomisd %xmm0, %xmm3
movzwl 0x262(%rbx), %eax
movapd %xmm2, 0x40(%rsp)
jbe 0x8083f
movb 0x264(%rbx), %cl
movl %ecx, 0x10(%rsp)
movb 0x266(%rbx), %cl
movl %ecx, 0x30(%rsp)
movl %eax, %ecx
movl %ecx, 0x8(%rsp)
jmp 0x808e9
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x129ca(%rip), %xmm0    # 0x93218
movapd %xmm1, 0x30(%rsp)
callq 0xe800
movsd 0x129b7(%rip), %xmm1    # 0x93218
mulsd %xmm1, %xmm0
addsd 0x127a3(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movl %eax, 0x8(%rsp)
movzwl 0x264(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x30(%rsp), %xmm1
callq 0xe800
movsd 0x12982(%rip), %xmm1    # 0x93218
mulsd %xmm1, %xmm0
addsd 0x1276e(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movl %eax, 0x10(%rsp)
movzwl 0x266(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movapd 0x30(%rsp), %xmm1
callq 0xe800
movapd 0x40(%rsp), %xmm2
mulsd 0x12946(%rip), %xmm0    # 0x93218
addsd 0x12736(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movl %eax, 0x30(%rsp)
movzwl 0x262(%rbx), %eax
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x12920(%rip), %xmm0    # 0x93218
movapd %xmm2, %xmm1
callq 0xe800
movsd 0x1290f(%rip), %xmm1    # 0x93218
mulsd %xmm1, %xmm0
addsd 0x126fb(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %r13d
movzwl 0x264(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x40(%rsp), %xmm1
callq 0xe800
movsd 0x128dd(%rip), %xmm1    # 0x93218
mulsd %xmm1, %xmm0
addsd 0x126c9(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %r12d
movzwl 0x266(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x40(%rsp), %xmm1
callq 0xe800
mulsd 0x128ab(%rip), %xmm0    # 0x93218
addsd 0x1269b(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %edx
movzbl %r13b, %eax
movzbl %r12b, %ecx
movzbl %dl, %edx
addq $0x2, %r14
xorl %esi, %esi
movl $0x80, %edi
movl $0xff, %r8d
cmpq %rsi, %r15
je 0x80ae5
movzwl 0x242(%rbx), %r9d
cmpq %r9, %rsi
jae 0x809e1
movq 0x2d8(%rbx), %r10
movzbl (%r10,%rsi), %r12d
cmpl $0xff, %r12d
je 0x809e1
testl %r12d, %r12d
jne 0x80a19
movl 0x8(%rsp), %r9d
movb %r9b, -0x2(%r14)
movl 0x10(%rsp), %r9d
movb %r9b, -0x1(%r14)
movl 0x30(%rsp), %r9d
movb %r9b, (%r14)
jmp 0x80a0d
movq 0x298(%rbx), %r9
movzbl -0x2(%r14), %r10d
movb (%r9,%r10), %r10b
movb %r10b, -0x2(%r14)
movzbl -0x1(%r14), %r10d
movb (%r9,%r10), %r10b
movb %r10b, -0x1(%r14)
movzbl (%r14), %r10d
movb (%r9,%r10), %r9b
movb %r9b, (%r14)
incq %rsi
addq $0x3, %r14
jmp 0x80995
movq 0x2a0(%rbx), %r9
movq 0x2a8(%rbx), %r11
movzbl -0x2(%r14), %r13d
movzbl (%r11,%r13), %ebp
imull %r12d, %ebp
notb %r12b
movzbl %r12b, %r12d
imull %eax, %r12d
addl %ebp, %r12d
leal (%r12,%rdi), %r13d
shrl $0x8, %r13d
andl %r8d, %r13d
addl %r13d, %r12d
addl $0x80, %r12d
shrl $0x8, %r12d
andl %r8d, %r12d
movb (%r9,%r12), %bpl
movb %bpl, -0x2(%r14)
movzbl -0x1(%r14), %r12d
movzbl (%r11,%r12), %ebp
movzbl (%r10,%rsi), %r12d
imull %r12d, %ebp
xorl %r8d, %r12d
imull %ecx, %r12d
addl %ebp, %r12d
leal (%r12,%rdi), %r13d
shrl $0x8, %r13d
andl %r8d, %r13d
addl %r13d, %r12d
addl $0x80, %r12d
shrl $0x8, %r12d
andl %r8d, %r12d
movb (%r9,%r12), %bpl
movb %bpl, -0x1(%r14)
movzbl (%r14), %r12d
movzbl (%r11,%r12), %r11d
movzbl (%r10,%rsi), %r10d
imull %r10d, %r11d
xorl %r8d, %r10d
imull %edx, %r10d
addl %r11d, %r10d
leal (%r10,%rdi), %r11d
shrl $0x8, %r11d
andl %r8d, %r11d
addl %r11d, %r10d
addl $0x80, %r10d
shrl $0x8, %r10d
andl %r8d, %r10d
jmp 0x80a06
movl $0xfffbdf7f, %eax       # imm = 0xFFFBDF7F
andl 0x124(%rbx), %eax
orl $0x40000, %eax          # imm = 0x40000
movl %eax, 0x124(%rbx)
movl 0x20(%rsp), %ebp
testb $0x8, 0x124(%rbx)
sete %al
xorb $0x1, %bpl
orb %al, %bpl
jne 0x80b9d
movzbl 0x2c8(%rbx), %ecx
pushq $0x8
popq %rax
movl %eax, %edx
subl %ecx, %edx
movzbl 0x2c9(%rbx), %r8d
movl %eax, %esi
subl %r8d, %esi
movzbl 0x2ca(%rbx), %r9d
subl %r9d, %eax
xorl %edi, %edi
cmpl $0x9, %ecx
cmovael %edi, %edx
movzwl 0x240(%rbx), %ecx
cmpl $0x9, %r8d
cmovael %edi, %esi
cmpl $0x9, %r9d
cmovael %edi, %eax
leaq (%rcx,%rcx,2), %r8
cmpq %rdi, %r8
je 0x80b9d
movq 0x238(%rbx), %r9
movzbl (%r9,%rdi), %r10d
movl %edx, %ecx
shrl %cl, %r10d
movb %r10b, (%r9,%rdi)
movzbl 0x1(%r9,%rdi), %r10d
movl %esi, %ecx
shrl %cl, %r10d
movb %r10b, 0x1(%r9,%rdi)
movzbl 0x2(%r9,%rdi), %r10d
movl %eax, %ecx
shrl %cl, %r10d
movb %r10b, 0x2(%r9,%rdi)
addq $0x3, %rdi
jmp 0x80b5d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movapd 0x1335c(%rip), %xmm1    # 0x93f10
movzwl 0x268(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd 0x8(%rsp), %xmm0
movapd %xmm1, 0x10(%rsp)
callq 0xe800
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x1242e(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movw %ax, 0x272(%rbx)
movzwl 0x268(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x10(%rsp), %xmm1
movhlps %xmm1, %xmm1            # xmm1 = xmm1[1,1]
movaps %xmm1, 0x20(%rsp)
callq 0xe800
mulsd 0x8(%rsp), %xmm0
addsd 0x123f4(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movw %ax, 0x268(%rbx)
movzwl 0x262(%rbx), %ecx
cmpw 0x264(%rbx), %cx
jne 0x80c7b
cmpw 0x266(%rbx), %cx
jne 0x80c7b
cmpw %ax, %cx
jne 0x80c7b
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 0x80aff
movzwl %cx, %eax
cvtsi2sd %eax, %xmm0
divsd 0x8(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0xe800
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd 0x1236c(%rip), %xmm1    # 0x93010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, 0x26c(%rbx)
movzwl 0x264(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm2, %xmm0
movaps 0x10(%rsp), %xmm1
callq 0xe800
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x12332(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movw %ax, 0x26e(%rbx)
movzwl 0x266(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x10(%rsp), %xmm1
callq 0xe800
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x122fc(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movw %ax, 0x270(%rbx)
movzwl 0x262(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x20(%rsp), %xmm1
callq 0xe800
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x122c6(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movw %ax, 0x262(%rbx)
movzwl 0x264(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x20(%rsp), %xmm1
callq 0xe800
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x12290(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movw %ax, 0x264(%rbx)
movzwl 0x266(%rbx), %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
movaps 0x20(%rsp), %xmm1
callq 0xe800
mulsd 0x8(%rsp), %xmm0
addsd 0x1225e(%rip), %xmm0    # 0x93010
cvttsd2si %xmm0, %eax
movw %ax, 0x266(%rbx)
jmp 0x80aff