// File: alan0201tw[P]RayTracer/include/stb_image.h
// Function: stbi__psd_load(stbi__context*, int*, int*, int*, int, stbi__result_info*, int)
static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc)
{
   int pixelCount;
   int channelCount, compression;
   int channel, i;
   int bitdepth;
   int w,h;
   stbi_uc *out;
   STBI_NOTUSED(ri);

   // 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");

   // Check size
   if (!stbi__mad3sizes_valid(4, w, h, 0))
      return stbi__errpuc("too large", "Corrupt PSD");

   // Create the destination image.

   if (!compression && bitdepth == 16 && bpc == 16) {
      out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0);
      ri->bits_per_channel = 16;
   } else
      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 preceded 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.
            if (!stbi__psd_decode_rle(s, p, pixelCount)) {
               STBI_FREE(out);
               return stbi__errpuc("corrupt", "bad RLE data");
            }
         }
      }

   } 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 (or 16-bit) value for each pixel in the image.

      // Read the data by channel.
      for (channel = 0; channel < 4; channel++) {
         if (channel >= channelCount) {
            // Fill this channel with default data.
            if (bitdepth == 16 && bpc == 16) {
               stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
               stbi__uint16 val = channel == 3 ? 65535 : 0;
               for (i = 0; i < pixelCount; i++, q += 4)
                  *q = val;
            } else {
               stbi_uc *p = out+channel;
               stbi_uc val = channel == 3 ? 255 : 0;
               for (i = 0; i < pixelCount; i++, p += 4)
                  *p = val;
            }
         } else {
            if (ri->bits_per_channel == 16) {    // output bpc
               stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
               for (i = 0; i < pixelCount; i++, q += 4)
                  *q = (stbi__uint16) stbi__get16be(s);
            } else {
               stbi_uc *p = out+channel;
               if (bitdepth == 16) {  // input bpc
                  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);
               }
            }
         }
      }
   }

   // remove weird white matte from PSD
   if (channelCount >= 4) {
      if (ri->bits_per_channel == 16) {
         for (i=0; i < w*h; ++i) {
            stbi__uint16 *pixel = (stbi__uint16 *) out + 4*i;
            if (pixel[3] != 0 && pixel[3] != 65535) {
               float a = pixel[3] / 65535.0f;
               float ra = 1.0f / a;
               float inv_a = 65535.0f * (1 - ra);
               pixel[0] = (stbi__uint16) (pixel[0]*ra + inv_a);
               pixel[1] = (stbi__uint16) (pixel[1]*ra + inv_a);
               pixel[2] = (stbi__uint16) (pixel[2]*ra + inv_a);
            }
         }
      } else {
         for (i=0; i < w*h; ++i) {
            unsigned char *pixel = out + 4*i;
            if (pixel[3] != 0 && pixel[3] != 255) {
               float a = pixel[3] / 255.0f;
               float ra = 1.0f / a;
               float inv_a = 255.0f * (1 - ra);
               pixel[0] = (unsigned char) (pixel[0]*ra + inv_a);
               pixel[1] = (unsigned char) (pixel[1]*ra + inv_a);
               pixel[2] = (unsigned char) (pixel[2]*ra + inv_a);
            }
         }
      }
   }

   // convert to desired output format
   if (req_comp && req_comp != 4) {
      if (ri->bits_per_channel == 16)
         out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, 4, req_comp, w, h);
      else
         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
movq %rsp, %rbp
subq $0xe0, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6b410
cmpl $0x38425053, %eax       # imm = 0x38425053
je 0x5c9c6
leaq 0x24d79(%rip), %rdi     # 0x81726
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
movq -0x10(%rbp), %rdi
callq 0x65e40
cmpl $0x1, %eax
je 0x5c9f4
leaq 0x24d53(%rip), %rdi     # 0x8172e
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq 0x661f0
movq -0x10(%rbp), %rdi
callq 0x65e40
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jl 0x5ca1a
cmpl $0x10, -0x40(%rbp)
jle 0x5ca3a
leaq 0x24d1b(%rip), %rdi     # 0x8173c
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
movq -0x10(%rbp), %rdi
callq 0x6b410
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6b410
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rdi
callq 0x65e40
movl %eax, -0x50(%rbp)
cmpl $0x8, -0x50(%rbp)
je 0x5ca8a
cmpl $0x10, -0x50(%rbp)
je 0x5ca8a
leaq 0x24cdf(%rip), %rdi     # 0x81750
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
movq -0x10(%rbp), %rdi
callq 0x65e40
cmpl $0x3, %eax
je 0x5cab8
leaq 0x24cc7(%rip), %rdi     # 0x81766
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6b410
movq -0xe0(%rbp), %rdi
movl %eax, %esi
callq 0x661f0
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6b410
movq -0xd8(%rbp), %rdi
movl %eax, %esi
callq 0x661f0
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6b410
movq -0xd0(%rbp), %rdi
movl %eax, %esi
callq 0x661f0
movq -0x10(%rbp), %rdi
callq 0x65e40
movl %eax, -0x44(%rbp)
cmpl $0x1, -0x44(%rbp)
jle 0x5cb50
leaq 0x24c42(%rip), %rdi     # 0x81779
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
movl -0x54(%rbp), %esi
movl -0x58(%rbp), %edx
movl $0x4, %edi
xorl %ecx, %ecx
callq 0x662a0
cmpl $0x0, %eax
jne 0x5cb87
leaq 0x2458a(%rip), %rdi     # 0x810f8
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
cmpl $0x0, -0x44(%rbp)
jne 0x5cbbb
cmpl $0x10, -0x50(%rbp)
jne 0x5cbbb
cmpl $0x10, 0x10(%rbp)
jne 0x5cbbb
movl -0x54(%rbp), %esi
movl -0x58(%rbp), %edx
movl $0x8, %edi
xorl %ecx, %ecx
callq 0x664e0
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movl $0x10, (%rax)
jmp 0x5cbd1
movl -0x54(%rbp), %eax
shll $0x2, %eax
imull -0x58(%rbp), %eax
movslq %eax, %rdi
callq 0x57060
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x5cbf8
leaq 0x24523(%rip), %rdi     # 0x81102
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
movl -0x54(%rbp), %eax
imull -0x58(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x5ccdb
movq -0x10(%rbp), %rdi
movl -0x58(%rbp), %esi
imull -0x40(%rbp), %esi
shll %esi
callq 0x661f0
movl $0x0, -0x48(%rbp)
cmpl $0x4, -0x48(%rbp)
jge 0x5ccd6
movq -0x60(%rbp), %rax
movslq -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x40(%rbp), %eax
jl 0x5cc86
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x5cc84
movl -0x48(%rbp), %edx
xorl %eax, %eax
movl $0xff, %ecx
cmpl $0x3, %edx
cmovel %ecx, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movb %cl, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x68(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x68(%rbp)
jmp 0x5cc4d
jmp 0x5ccc6
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl -0x3c(%rbp), %edx
callq 0x6ed20
cmpl $0x0, %eax
jne 0x5ccc4
movq -0x60(%rbp), %rdi
callq 0x75e0
leaq 0x24d27(%rip), %rdi     # 0x819d2
callq 0x56040
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
cmovneq %rax, %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
jmp 0x5ccc6
jmp 0x5ccc8
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x5cc25
jmp 0x5ced5
movl $0x0, -0x48(%rbp)
cmpl $0x4, -0x48(%rbp)
jge 0x5ced3
movl -0x48(%rbp), %eax
cmpl -0x40(%rbp), %eax
jl 0x5cdbb
cmpl $0x10, -0x50(%rbp)
jne 0x5cd5d
cmpl $0x10, 0x10(%rbp)
jne 0x5cd5d
movq -0x60(%rbp), %rax
movslq -0x48(%rbp), %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movl -0x48(%rbp), %edx
xorl %eax, %eax
movl $0xffff, %ecx           # imm = 0xFFFF
cmpl $0x3, %edx
cmovel %ecx, %eax
movw %ax, -0x72(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x5cd5b
movw -0x72(%rbp), %cx
movq -0x70(%rbp), %rax
movw %cx, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x70(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x70(%rbp)
jmp 0x5cd31
jmp 0x5cdb6
movq -0x60(%rbp), %rax
movslq -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movl -0x48(%rbp), %edx
xorl %eax, %eax
movl $0xff, %ecx
cmpl $0x3, %edx
cmovel %ecx, %eax
movb %al, -0x81(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x5cdb4
movb -0x81(%rbp), %cl
movq -0x80(%rbp), %rax
movb %cl, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x80(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x80(%rbp)
jmp 0x5cd89
jmp 0x5cdb6
jmp 0x5cec3
movq -0x38(%rbp), %rax
cmpl $0x10, (%rax)
jne 0x5ce20
movq -0x60(%rbp), %rax
movslq -0x48(%rbp), %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x5ce1b
movq -0x10(%rbp), %rdi
callq 0x65e40
movw %ax, %cx
movq -0x90(%rbp), %rax
movw %cx, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x90(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x90(%rbp)
jmp 0x5cde0
jmp 0x5cec1
movq -0x60(%rbp), %rax
movslq -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
cmpl $0x10, -0x50(%rbp)
jne 0x5ce7d
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x5ce7b
movq -0x10(%rbp), %rdi
callq 0x65e40
sarl $0x8, %eax
movb %al, %cl
movq -0x98(%rbp), %rax
movb %cl, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x98(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x98(%rbp)
jmp 0x5ce3f
jmp 0x5cebf
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x5cebd
movq -0x10(%rbp), %rdi
callq 0x65d00
movb %al, %cl
movq -0x98(%rbp), %rax
movb %cl, (%rax)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
movq -0x98(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x98(%rbp)
jmp 0x5ce84
jmp 0x5cebf
jmp 0x5cec1
jmp 0x5cec3
jmp 0x5cec5
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x5cce2
jmp 0x5ced5
cmpl $0x4, -0x40(%rbp)
jl 0x5d1a6
movq -0x38(%rbp), %rax
cmpl $0x10, (%rax)
jne 0x5d04d
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl -0x54(%rbp), %ecx
imull -0x58(%rbp), %ecx
cmpl %ecx, %eax
jge 0x5d048
movq -0x60(%rbp), %rax
movl -0x4c(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movzwl 0x6(%rax), %eax
cmpl $0x0, %eax
je 0x5d038
movq -0xa0(%rbp), %rax
movzwl 0x6(%rax), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x5d038
movq -0xa0(%rbp), %rax
movzwl 0x6(%rax), %eax
cvtsi2ss %eax, %xmm0
movss 0x222a8(%rip), %xmm1    # 0x7f208
divss %xmm1, %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0xa4(%rbp), %xmm3
movss 0x21280(%rip), %xmm0    # 0x7e1fc
movaps %xmm0, %xmm2
divss %xmm3, %xmm2
movss %xmm2, -0xa8(%rbp)
movss -0xa8(%rbp), %xmm2
subss %xmm2, %xmm0
mulss %xmm1, %xmm0
movss %xmm0, -0xac(%rbp)
movq -0xa0(%rbp), %rax
movzwl (%rax), %ecx
cvtsi2ss %ecx, %xmm0
movss -0xa8(%rbp), %xmm2
movss -0xac(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movw %cx, (%rax)
movq -0xa0(%rbp), %rax
movzwl 0x2(%rax), %ecx
cvtsi2ss %ecx, %xmm0
movss -0xa8(%rbp), %xmm2
movss -0xac(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movw %cx, 0x2(%rax)
movq -0xa0(%rbp), %rax
movzwl 0x4(%rax), %eax
cvtsi2ss %eax, %xmm0
movss -0xa8(%rbp), %xmm2
movss -0xac(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movw %ax, %cx
movq -0xa0(%rbp), %rax
movw %cx, 0x4(%rax)
jmp 0x5d03a
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5cef3
jmp 0x5d1a4
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl -0x54(%rbp), %ecx
imull -0x58(%rbp), %ecx
cmpl %ecx, %eax
jge 0x5d1a2
movq -0x60(%rbp), %rax
movl -0x4c(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movzbl 0x3(%rax), %eax
cmpl $0x0, %eax
je 0x5d192
movq -0xb8(%rbp), %rax
movzbl 0x3(%rax), %eax
cmpl $0xff, %eax
je 0x5d192
movq -0xb8(%rbp), %rax
movzbl 0x3(%rax), %eax
cvtsi2ss %eax, %xmm0
movss 0x21172(%rip), %xmm1    # 0x7e230
divss %xmm1, %xmm0
movss %xmm0, -0xbc(%rbp)
movss -0xbc(%rbp), %xmm3
movss 0x21122(%rip), %xmm0    # 0x7e1fc
movaps %xmm0, %xmm2
divss %xmm3, %xmm2
movss %xmm2, -0xc0(%rbp)
movss -0xc0(%rbp), %xmm2
subss %xmm2, %xmm0
mulss %xmm1, %xmm0
movss %xmm0, -0xc4(%rbp)
movq -0xb8(%rbp), %rax
movzbl (%rax), %ecx
cvtsi2ss %ecx, %xmm0
movss -0xc0(%rbp), %xmm2
movss -0xc4(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movb %cl, (%rax)
movq -0xb8(%rbp), %rax
movzbl 0x1(%rax), %ecx
cvtsi2ss %ecx, %xmm0
movss -0xc0(%rbp), %xmm2
movss -0xc4(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movb %cl, 0x1(%rax)
movq -0xb8(%rbp), %rax
movzbl 0x2(%rax), %eax
cvtsi2ss %eax, %xmm0
movss -0xc0(%rbp), %xmm2
movss -0xc4(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movb %al, %cl
movq -0xb8(%rbp), %rax
movb %cl, 0x2(%rax)
jmp 0x5d194
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5d054
jmp 0x5d1a4
jmp 0x5d1a6
cmpl $0x0, -0x2c(%rbp)
je 0x5d208
cmpl $0x4, -0x2c(%rbp)
je 0x5d208
movq -0x38(%rbp), %rax
cmpl $0x10, (%rax)
jne 0x5d1d9
movq -0x60(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl -0x54(%rbp), %ecx
movl -0x58(%rbp), %r8d
movl $0x4, %esi
callq 0x6ae00
movq %rax, -0x60(%rbp)
jmp 0x5d1f5
movq -0x60(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl -0x54(%rbp), %ecx
movl -0x58(%rbp), %r8d
movl $0x4, %esi
callq 0x6a860
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x5d206
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5d233
jmp 0x5d208
cmpq $0x0, -0x28(%rbp)
je 0x5d219
movq -0x28(%rbp), %rax
movl $0x4, (%rax)
movl -0x58(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x54(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq