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

  if (bit_depth <= 8)
  {
     int i;
     double g;

     if (png_ptr->screen_gamma > .000001)
        g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);

     else
        g = 1.0;

     png_ptr->gamma_table = (png_bytep)png_malloc(png_ptr,
        (png_uint_32)256);

     for (i = 0; i < 256; i++)
     {
        png_ptr->gamma_table[i] = (png_byte)(pow((double)i / 255.0,
           g) * 255.0 + .5);
     }

#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
   defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
     if (png_ptr->transformations & ((PNG_BACKGROUND) | PNG_RGB_TO_GRAY))
     {

        g = 1.0 / (png_ptr->gamma);

        png_ptr->gamma_to_1 = (png_bytep)png_malloc(png_ptr,
           (png_uint_32)256);

        for (i = 0; i < 256; i++)
        {
           png_ptr->gamma_to_1[i] = (png_byte)(pow((double)i / 255.0,
              g) * 255.0 + .5);
        }


        png_ptr->gamma_from_1 = (png_bytep)png_malloc(png_ptr,
           (png_uint_32)256);

        if (png_ptr->screen_gamma > 0.000001)
           g = 1.0 / png_ptr->screen_gamma;

        else
           g = png_ptr->gamma;   /* Probably doing rgb_to_gray */

        for (i = 0; i < 256; i++)
        {
           png_ptr->gamma_from_1[i] = (png_byte)(pow((double)i / 255.0,
              g) * 255.0 + .5);

        }
     }
#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */
  }
  else
  {
     double g;
     int i, j, shift, num;
     int sig_bit;
     png_uint_32 ig;

     if (png_ptr->color_type & PNG_COLOR_MASK_COLOR)
     {
        sig_bit = (int)png_ptr->sig_bit.red;

        if ((int)png_ptr->sig_bit.green > sig_bit)
           sig_bit = png_ptr->sig_bit.green;

        if ((int)png_ptr->sig_bit.blue > sig_bit)
           sig_bit = png_ptr->sig_bit.blue;
     }
     else
     {
        sig_bit = (int)png_ptr->sig_bit.gray;
     }

     if (sig_bit > 0)
        shift = 16 - sig_bit;

     else
        shift = 0;

     if (png_ptr->transformations & PNG_16_TO_8)
     {
        if (shift < (16 - PNG_MAX_GAMMA_8))
           shift = (16 - PNG_MAX_GAMMA_8);
     }

     if (shift > 8)
        shift = 8;

     if (shift < 0)
        shift = 0;

     png_ptr->gamma_shift = (png_byte)shift;

     num = (1 << (8 - shift));

     if (png_ptr->screen_gamma > .000001)
        g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);
     else
        g = 1.0;

     png_ptr->gamma_16_table = (png_uint_16pp)png_calloc(png_ptr,
        (png_uint_32)(num * png_sizeof(png_uint_16p)));

     if (png_ptr->transformations & (PNG_16_TO_8 | PNG_BACKGROUND))
     {
        double fin, fout;
        png_uint_32 last, max;

        for (i = 0; i < num; i++)
        {
           png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr,
              (png_uint_32)(256 * png_sizeof(png_uint_16)));
        }

        g = 1.0 / g;
        last = 0;
        for (i = 0; i < 256; i++)
        {
           fout = ((double)i + 0.5) / 256.0;
           fin = pow(fout, g);
           max = (png_uint_32)(fin * (double)((png_uint_32)num << 8));
           while (last <= max)
           {
              png_ptr->gamma_16_table[(int)(last & (0xff >> shift))]
                 [(int)(last >> (8 - shift))] = (png_uint_16)(
                 (png_uint_16)i | ((png_uint_16)i << 8));
              last++;
           }
        }
        while (last < ((png_uint_32)num << 8))
        {
           png_ptr->gamma_16_table[(int)(last & (0xff >> shift))]
              [(int)(last >> (8 - shift))] = (png_uint_16)65535L;
           last++;
        }
     }
     else
     {
        for (i = 0; i < num; i++)
        {
           png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr,
              (png_uint_32)(256 * png_sizeof(png_uint_16)));

           ig = (((png_uint_32)i * (png_uint_32)png_gamma_shift[shift]) >> 4);

           for (j = 0; j < 256; j++)
           {
              png_ptr->gamma_16_table[i][j] =
                 (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) /
                    65535.0, g) * 65535.0 + .5);
           }
        }
     }

#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
   defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
     if (png_ptr->transformations & (PNG_BACKGROUND | PNG_RGB_TO_GRAY))
     {

        g = 1.0 / (png_ptr->gamma);

        png_ptr->gamma_16_to_1 = (png_uint_16pp)png_calloc(png_ptr,
           (png_uint_32)(num * png_sizeof(png_uint_16p )));

        for (i = 0; i < num; i++)
        {
           png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr,
              (png_uint_32)(256 * png_sizeof(png_uint_16)));

           ig = (((png_uint_32)i *
              (png_uint_32)png_gamma_shift[shift]) >> 4);
           for (j = 0; j < 256; j++)
           {
              png_ptr->gamma_16_to_1[i][j] =
                 (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) /
                    65535.0, g) * 65535.0 + .5);
           }
        }

        if (png_ptr->screen_gamma > 0.000001)
           g = 1.0 / png_ptr->screen_gamma;

        else
           g = png_ptr->gamma;   /* Probably doing rgb_to_gray */

        png_ptr->gamma_16_from_1 = (png_uint_16pp)png_calloc(png_ptr,
           (png_uint_32)(num * png_sizeof(png_uint_16p)));

        for (i = 0; i < num; i++)
        {
           png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr,
              (png_uint_32)(256 * png_sizeof(png_uint_16)));

           ig = (((png_uint_32)i *
              (png_uint_32)png_gamma_shift[shift]) >> 4);

           for (j = 0; j < 256; j++)
           {
              png_ptr->gamma_16_from_1[i][j] =
                 (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) /
                    65535.0, g) * 65535.0 + .5);
           }
        }
     }
#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */
  }
}

// Assembly:
subq $0x88, %rsp
movb %sil, %al
movq %rdi, 0x80(%rsp)
movb %al, 0x7f(%rsp)
movzbl 0x7f(%rsp), %eax
cmpl $0x8, %eax
jg 0x109ae6
movq 0x80(%rsp), %rax
movss 0x290(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x299c8(%rip), %xmm1    # 0x1331e8
ucomisd %xmm1, %xmm0
jbe 0x10985e
movq 0x80(%rsp), %rax
movss 0x28c(%rax), %xmm0
movq 0x80(%rsp), %rax
mulss 0x290(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x297b6(%rip), %xmm0    # 0x133008
divsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
jmp 0x10986c
movsd 0x297a2(%rip), %xmm0    # 0x133008
movsd %xmm0, 0x70(%rsp)
movq 0x80(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x1135b0
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x298(%rax)
movl $0x0, 0x78(%rsp)
cmpl $0x100, 0x78(%rsp)      # imm = 0x100
jge 0x109905
cvtsi2sdl 0x78(%rsp), %xmm0
movsd 0x29970(%rip), %xmm1    # 0x133220
movsd %xmm1, 0x30(%rsp)
divsd %xmm1, %xmm0
movsd 0x70(%rsp), %xmm1
callq 0xf880
movsd 0x30(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x29739(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, %dl
movq 0x80(%rsp), %rax
movq 0x298(%rax), %rax
movslq 0x78(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x109898
movq 0x80(%rsp), %rax
movl 0x124(%rax), %eax
andq $0x600080, %rax         # imm = 0x600080
cmpq $0x0, %rax
je 0x109ae1
movq 0x80(%rsp), %rax
movss 0x28c(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x296c9(%rip), %xmm0    # 0x133008
divsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x80(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x1135b0
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x2a8(%rax)
movl $0x0, 0x78(%rsp)
cmpl $0x100, 0x78(%rsp)      # imm = 0x100
jge 0x1099e2
cvtsi2sdl 0x78(%rsp), %xmm0
movsd 0x29893(%rip), %xmm1    # 0x133220
movsd %xmm1, 0x28(%rsp)
divsd %xmm1, %xmm0
movsd 0x70(%rsp), %xmm1
callq 0xf880
movsd 0x28(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x2965c(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, %dl
movq 0x80(%rsp), %rax
movq 0x2a8(%rax), %rax
movslq 0x78(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x109975
movq 0x80(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x1135b0
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x2a0(%rax)
movq 0x80(%rsp), %rax
movss 0x290(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x297c6(%rip), %xmm1    # 0x1331e8
ucomisd %xmm1, %xmm0
jbe 0x109a50
movq 0x80(%rsp), %rax
movss 0x290(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x295c4(%rip), %xmm0    # 0x133008
divsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
jmp 0x109a6a
movq 0x80(%rsp), %rax
movss 0x28c(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x70(%rsp)
movl $0x0, 0x78(%rsp)
cmpl $0x100, 0x78(%rsp)      # imm = 0x100
jge 0x109adf
cvtsi2sdl 0x78(%rsp), %xmm0
movsd 0x29796(%rip), %xmm1    # 0x133220
movsd %xmm1, 0x20(%rsp)
divsd %xmm1, %xmm0
movsd 0x70(%rsp), %xmm1
callq 0xf880
movsd 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x2955f(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movb %al, %dl
movq 0x80(%rsp), %rax
movq 0x2a0(%rax), %rax
movslq 0x78(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x109a72
jmp 0x109ae1
jmp 0x10a27e
movq 0x80(%rsp), %rax
movzbl 0x24e(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x109b62
movq 0x80(%rsp), %rax
movzbl 0x2c8(%rax), %eax
movl %eax, 0x54(%rsp)
movq 0x80(%rsp), %rax
movzbl 0x2c9(%rax), %eax
cmpl 0x54(%rsp), %eax
jle 0x109b38
movq 0x80(%rsp), %rax
movzbl 0x2c9(%rax), %eax
movl %eax, 0x54(%rsp)
movq 0x80(%rsp), %rax
movzbl 0x2ca(%rax), %eax
cmpl 0x54(%rsp), %eax
jle 0x109b60
movq 0x80(%rsp), %rax
movzbl 0x2ca(%rax), %eax
movl %eax, 0x54(%rsp)
jmp 0x109b75
movq 0x80(%rsp), %rax
movzbl 0x2cb(%rax), %eax
movl %eax, 0x54(%rsp)
cmpl $0x0, 0x54(%rsp)
jle 0x109b8b
movl $0x10, %eax
subl 0x54(%rsp), %eax
movl %eax, 0x5c(%rsp)
jmp 0x109b93
movl $0x0, 0x5c(%rsp)
movq 0x80(%rsp), %rax
movl 0x124(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x109bbc
cmpl $0x5, 0x5c(%rsp)
jge 0x109bba
movl $0x5, 0x5c(%rsp)
jmp 0x109bbc
cmpl $0x8, 0x5c(%rsp)
jle 0x109bcb
movl $0x8, 0x5c(%rsp)
cmpl $0x0, 0x5c(%rsp)
jge 0x109bda
movl $0x0, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
movzbl %al, %ecx
movq 0x80(%rsp), %rax
movl %ecx, 0x288(%rax)
movl $0x8, %ecx
subl 0x5c(%rsp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x58(%rsp)
movq 0x80(%rsp), %rax
movss 0x290(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x295c9(%rip), %xmm1    # 0x1331e8
ucomisd %xmm1, %xmm0
jbe 0x109c5d
movq 0x80(%rsp), %rax
movss 0x28c(%rax), %xmm0
movq 0x80(%rsp), %rax
mulss 0x290(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x293b7(%rip), %xmm0    # 0x133008
divsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
jmp 0x109c6b
movsd 0x293a3(%rip), %xmm0    # 0x133008
movsd %xmm0, 0x68(%rsp)
movq 0x80(%rsp), %rdi
movslq 0x58(%rsp), %rax
shlq $0x3, %rax
movl %eax, %eax
movl %eax, %esi
callq 0x113560
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x2b0(%rax)
movq 0x80(%rsp), %rax
movl 0x124(%rax), %eax
andl $0x480, %eax            # imm = 0x480
cmpl $0x0, %eax
je 0x109e7d
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0x58(%rsp), %eax
jge 0x109cff
movq 0x80(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x1135b0
movq %rax, %rdx
movq 0x80(%rsp), %rax
movq 0x2b0(%rax), %rax
movslq 0x64(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x109cbb
movsd 0x29301(%rip), %xmm0    # 0x133008
divsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
movl $0x0, 0x3c(%rsp)
movl $0x0, 0x64(%rsp)
cmpl $0x100, 0x64(%rsp)      # imm = 0x100
jge 0x109e11
cvtsi2sdl 0x64(%rsp), %xmm0
movsd 0x292d1(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
movsd 0x2fa15(%rip), %xmm1    # 0x139760
mulsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
callq 0xf880
movsd %xmm0, 0x48(%rsp)
movsd 0x48(%rsp), %xmm0
movl 0x58(%rsp), %eax
shll $0x8, %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, 0x38(%rsp)
movl 0x3c(%rsp), %eax
cmpl 0x38(%rsp), %eax
ja 0x109dff
movl 0x64(%rsp), %eax
movzwl %ax, %eax
movl 0x64(%rsp), %ecx
movzwl %cx, %ecx
shll $0x8, %ecx
orl %ecx, %eax
movw %ax, %dx
movq 0x80(%rsp), %rax
movq 0x2b0(%rax), %rax
movl 0x3c(%rsp), %ecx
movl %ecx, 0x1c(%rsp)
movl 0x5c(%rsp), %ecx
movl $0xff, %esi
sarl %cl, %esi
movl 0x1c(%rsp), %ecx
andl %esi, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl 0x3c(%rsp), %esi
movl $0x8, %ecx
subl 0x5c(%rsp), %ecx
shrl %cl, %esi
movl %esi, %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x109d8b
jmp 0x109e01
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x109d23
jmp 0x109e13
movl 0x3c(%rsp), %eax
movl 0x58(%rsp), %ecx
shll $0x8, %ecx
cmpl %ecx, %eax
jae 0x109e78
movq 0x80(%rsp), %rax
movq 0x2b0(%rax), %rax
movl 0x3c(%rsp), %ecx
movl %ecx, 0x18(%rsp)
movl 0x5c(%rsp), %ecx
movl $0xff, %edx
sarl %cl, %edx
movl 0x18(%rsp), %ecx
andl %edx, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl 0x3c(%rsp), %edx
movl $0x8, %ecx
subl 0x5c(%rsp), %ecx
shrl %cl, %edx
movl %edx, %ecx
movslq %ecx, %rcx
movw $0xffff, (%rax,%rcx,2)  # imm = 0xFFFF
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x109e13
jmp 0x109f7e
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0x58(%rsp), %eax
jge 0x109f7c
movq 0x80(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x1135b0
movq %rax, %rdx
movq 0x80(%rsp), %rax
movq 0x2b0(%rax), %rax
movslq 0x64(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x64(%rsp), %eax
movslq 0x5c(%rsp), %rdx
leaq 0x2f860(%rip), %rcx     # 0x139730
imull (%rcx,%rdx,4), %eax
shrl $0x4, %eax
movl %eax, 0x50(%rsp)
movl $0x0, 0x60(%rsp)
cmpl $0x100, 0x60(%rsp)      # imm = 0x100
jge 0x109f6a
movl 0x50(%rsp), %eax
movl 0x60(%rsp), %ecx
shll $0x8, %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm0
movsd 0x2bd71(%rip), %xmm1    # 0x135c78
movsd %xmm1, 0x10(%rsp)
divsd %xmm1, %xmm0
movsd 0x68(%rsp), %xmm1
callq 0xf880
movsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x290e2(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, %dx
movq 0x80(%rsp), %rax
movq 0x2b0(%rax), %rax
movslq 0x64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x60(%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x109ee3
jmp 0x109f6c
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x109e85
jmp 0x109f7e
movq 0x80(%rsp), %rax
movl 0x124(%rax), %eax
andq $0x600080, %rax         # imm = 0x600080
cmpq $0x0, %rax
je 0x10a27c
movq 0x80(%rsp), %rax
movss 0x28c(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x29050(%rip), %xmm0    # 0x133008
divsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x80(%rsp), %rdi
movslq 0x58(%rsp), %rax
shlq $0x3, %rax
movl %eax, %eax
movl %eax, %esi
callq 0x113560
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x2c0(%rax)
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0x58(%rsp), %eax
jge 0x10a0ed
movq 0x80(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x1135b0
movq %rax, %rdx
movq 0x80(%rsp), %rax
movq 0x2c0(%rax), %rax
movslq 0x64(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x64(%rsp), %eax
movslq 0x5c(%rsp), %rdx
leaq 0x2f6ef(%rip), %rcx     # 0x139730
imull (%rcx,%rdx,4), %eax
shrl $0x4, %eax
movl %eax, 0x50(%rsp)
movl $0x0, 0x60(%rsp)
cmpl $0x100, 0x60(%rsp)      # imm = 0x100
jge 0x10a0db
movl 0x50(%rsp), %eax
movl 0x60(%rsp), %ecx
shll $0x8, %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm0
movsd 0x2bc00(%rip), %xmm1    # 0x135c78
movsd %xmm1, 0x8(%rsp)
divsd %xmm1, %xmm0
movsd 0x68(%rsp), %xmm1
callq 0xf880
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x28f71(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, %dx
movq 0x80(%rsp), %rax
movq 0x2c0(%rax), %rax
movslq 0x64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x60(%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x10a054
jmp 0x10a0dd
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x109ff6
movq 0x80(%rsp), %rax
movss 0x290(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x290df(%rip), %xmm1    # 0x1331e8
ucomisd %xmm1, %xmm0
jbe 0x10a137
movq 0x80(%rsp), %rax
movss 0x290(%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x28edd(%rip), %xmm0    # 0x133008
divsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
jmp 0x10a151
movq 0x80(%rsp), %rax
movss 0x28c(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x80(%rsp), %rdi
movslq 0x58(%rsp), %rax
shlq $0x3, %rax
movl %eax, %eax
movl %eax, %esi
callq 0x113560
movq %rax, %rcx
movq 0x80(%rsp), %rax
movq %rcx, 0x2b8(%rax)
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0x58(%rsp), %eax
jge 0x10a27a
movq 0x80(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x1135b0
movq %rax, %rdx
movq 0x80(%rsp), %rax
movq 0x2b8(%rax), %rax
movslq 0x64(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x64(%rsp), %eax
movslq 0x5c(%rsp), %rdx
leaq 0x2f560(%rip), %rcx     # 0x139730
imull (%rcx,%rdx,4), %eax
shrl $0x4, %eax
movl %eax, 0x50(%rsp)
movl $0x0, 0x60(%rsp)
cmpl $0x100, 0x60(%rsp)      # imm = 0x100
jge 0x10a268
movl 0x50(%rsp), %eax
movl 0x60(%rsp), %ecx
shll $0x8, %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm0
movsd 0x2ba71(%rip), %xmm1    # 0x135c78
movsd %xmm1, (%rsp)
divsd %xmm1, %xmm0
movsd 0x68(%rsp), %xmm1
callq 0xf880
movsd (%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x28de4(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, %dx
movq 0x80(%rsp), %rax
movq 0x2b8(%rax), %rax
movslq 0x64(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x60(%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x10a1e3
jmp 0x10a26a
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x10a185
jmp 0x10a27c
jmp 0x10a27e
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)