// File: lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::parseICC(lodepng::LodePNGICC*, unsigned char const*, unsigned long)
static unsigned parseICC(LodePNGICC* icc, const unsigned char* data, size_t size) {
  size_t i, j;
  size_t pos = 0;
  unsigned version;
  unsigned inputspace;
  size_t numtags;

  if(size < 132) return 1; /* Too small to be a valid icc profile. */

  icc->has_chromaticity = 0;
  icc->has_whitepoint = 0;
  icc->has_trc = 0;
  icc->has_chad = 0;

  icc->trc[0].type = icc->trc[1].type = icc->trc[2].type = 0;
  icc->white[0] = icc->white[1] = icc->white[2] = 0;
  icc->red[0] = icc->red[1] = icc->red[2] = 0;
  icc->green[0] = icc->green[1] = icc->green[2] = 0;
  icc->blue[0] = icc->blue[1] = icc->blue[2] = 0;

  pos = 8;
  version = decodeICCUint32(data, size, &pos);
  if(pos >= size) return 1;
  icc->version_major = (int)((version >> 24) & 255);
  icc->version_minor = (int)((version >> 20) & 15);
  icc->version_bugfix = (int)((version >> 16) & 15);

  pos = 16;
  inputspace = decodeICCUint32(data, size, &pos);
  if(pos >= size) return 1;
  if(inputspace == 0x47524159) {
    /* The string  "GRAY" as unsigned 32-bit int. */
    icc->inputspace = 1;
  } else if(inputspace == 0x52474220) {
    /* The string  "RGB " as unsigned 32-bit int. */
    icc->inputspace = 2;
  } else {
    /* unsupported by PNG (CMYK, YCbCr, Lab, HSV, ...) */
    icc->inputspace = 0;
  }

  /* Should always be 0.9642, 1.0, 0.8249 */
  pos = 68;
  icc->illuminant[0] = decodeICC15Fixed16(data, size, &pos);
  icc->illuminant[1] = decodeICC15Fixed16(data, size, &pos);
  icc->illuminant[2] = decodeICC15Fixed16(data, size, &pos);

  pos = 128;
  numtags = decodeICCUint32(data, size, &pos);
  if(pos >= size) return 1;
  /* scan for tags we want to handle */
  for(i = 0; i < numtags; i++) {
    size_t offset;
    unsigned tagsize;
    size_t namepos = pos;
    pos += 4;
    offset = decodeICCUint32(data, size, &pos);
    tagsize = decodeICCUint32(data, size, &pos);
    if(pos >= size || offset >= size) return 1;
    if(offset + tagsize > size) return 1;
    if(tagsize < 8) return 1;

    if(isICCword(data, size, namepos, "wtpt")) {
      offset += 8; /* skip tag and reserved */
      icc->white[0] = decodeICC15Fixed16(data, size, &offset);
      icc->white[1] = decodeICC15Fixed16(data, size, &offset);
      icc->white[2] = decodeICC15Fixed16(data, size, &offset);
      icc->has_whitepoint = 1;
    } else if(isICCword(data, size, namepos, "rXYZ")) {
      offset += 8; /* skip tag and reserved */
      icc->red[0] = decodeICC15Fixed16(data, size, &offset);
      icc->red[1] = decodeICC15Fixed16(data, size, &offset);
      icc->red[2] = decodeICC15Fixed16(data, size, &offset);
      icc->has_chromaticity = 1;
    } else if(isICCword(data, size, namepos, "gXYZ")) {
      offset += 8; /* skip tag and reserved */
      icc->green[0] = decodeICC15Fixed16(data, size, &offset);
      icc->green[1] = decodeICC15Fixed16(data, size, &offset);
      icc->green[2] = decodeICC15Fixed16(data, size, &offset);
      icc->has_chromaticity = 1;
    } else if(isICCword(data, size, namepos, "bXYZ")) {
      offset += 8; /* skip tag and reserved */
      icc->blue[0] = decodeICC15Fixed16(data, size, &offset);
      icc->blue[1] = decodeICC15Fixed16(data, size, &offset);
      icc->blue[2] = decodeICC15Fixed16(data, size, &offset);
      icc->has_chromaticity = 1;
    } else if(isICCword(data, size, namepos, "chad")) {
      offset += 8; /* skip datatype keyword "sf32" and reserved */
      for(j = 0; j < 9; j++) {
        icc->chad[j] = decodeICC15Fixed16(data, size, &offset);
      }
      icc->has_chad = 1;
    } else if(isICCword(data, size, namepos, "rTRC") ||
              isICCword(data, size, namepos, "gTRC") ||
              isICCword(data, size, namepos, "bTRC") ||
              isICCword(data, size, namepos, "kTRC")) {
      char c = (char)data[namepos];
      /* both 'k' and 'r' are stored in channel 0 */
      int channel = (c == 'b') ? 2 : (c == 'g' ? 1 : 0);
      /* "curv": linear, gamma power or LUT */
      if(isICCword(data, size, offset, "curv")) {
        size_t count;
        LodePNGICCCurve* trc = &icc->trc[channel];
        icc->has_trc = 1;
        offset += 8; /* skip tag "curv" and reserved */
        count = decodeICCUint32(data, size, &offset);
        if(count == 0) {
          trc->type = 0; /* linear */
        } else if(count == 1) {
          trc->type = 2; /* gamma */
          trc->gamma = decodeICCUint16(data, size, &offset) / 256.0f;
        } else {
          trc->type = 1; /* LUT */
          if(offset + count * 2 > size || count > 16777216) return 1; /* also avoid crazy count */
          trc->lut_size = count;
          trc->lut = (float*)lodepng_malloc(count * sizeof(float));
          for(j = 0; j < count; j++) {
            trc->lut[j] = decodeICCUint16(data, size, &offset) * (1.0f / 65535.0f);
          }
        }
      }
      /* "para": parametric formula with gamma power, multipliers, biases and comparison point */
      /* TODO: test this on a realistic sample */
      if(isICCword(data, size, offset, "para")) {
        unsigned type;
        LodePNGICCCurve* trc = &icc->trc[channel];
        icc->has_trc = 1;
        offset += 8; /* skip tag "para" and reserved */
        type = decodeICCUint16(data, size, &offset);
        offset += 2;
        if(type > 4) return 1; /* unknown parametric curve type */
        trc->type = type + 2;
        trc->gamma = decodeICC15Fixed16(data, size, &offset);
        if(type >= 1) {
          trc->a = decodeICC15Fixed16(data, size, &offset);
          trc->b = decodeICC15Fixed16(data, size, &offset);
        }
        if(type >= 2) {
          trc->c = decodeICC15Fixed16(data, size, &offset);
        }
        if(type >= 3) {
          trc->d = decodeICC15Fixed16(data, size, &offset);
        }
        if(type == 4) {
          trc->e = decodeICC15Fixed16(data, size, &offset);
          trc->f = decodeICC15Fixed16(data, size, &offset);
        }
      }
      /* TODO: verify: does the "chrm" tag participate in computation so should be parsed? */
    }
    /* Return error if any parse went beyond the filesize. Note that the
    parsing itself was always safe since it bound-checks inside. */
    if(offset > size) return 1;
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x84, -0x20(%rbp)
jae 0x1e585
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
movq -0x10(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x44(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x7c(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xf0(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xb8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x80(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x50(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x4c(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x48(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x60(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x5c(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x58(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x6c(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x68(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x64(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x78(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x74(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x70(%rax)
movq $0x8, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x209e0
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x1e69d
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
movl -0x3c(%rbp), %ecx
shrl $0x18, %ecx
andl $0xff, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x3c(%rbp), %ecx
shrl $0x14, %ecx
andl $0xf, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x3c(%rbp), %ecx
shrl $0x10, %ecx
andl $0xf, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq $0x10, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x209e0
movl %eax, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x1e702
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
cmpl $0x47524159, -0x40(%rbp) # imm = 0x47524159
jne 0x1e717
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
jmp 0x1e738
cmpl $0x52474220, -0x40(%rbp) # imm = 0x52474220
jne 0x1e72c
movq -0x10(%rbp), %rax
movl $0x2, (%rax)
jmp 0x1e736
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1e738
movq $0x44, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x14(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x18(%rax)
movq $0x80, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x209e0
movl %eax, %eax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x1e7c3
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x1eed3
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x209e0
movl %eax, %eax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x209e0
movl %eax, -0x54(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1e82c
movq -0x50(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x1e838
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
movq -0x50(%rbp), %rax
movl -0x54(%rbp), %ecx
addq %rcx, %rax
cmpq -0x20(%rbp), %rax
jbe 0x1e854
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
cmpl $0x8, -0x54(%rbp)
jae 0x1e866
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x9422f(%rip), %rcx     # 0xb2aa8
callq 0x20ac0
cmpl $0x0, %eax
je 0x1e8ed
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x48(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x4c(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x50(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x44(%rax)
jmp 0x1eead
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x941ad(%rip), %rcx     # 0xb2aad
callq 0x20ac0
cmpl $0x0, %eax
je 0x1e974
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x58(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x5c(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x60(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x54(%rax)
jmp 0x1eeab
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x9412b(%rip), %rcx     # 0xb2ab2
callq 0x20ac0
cmpl $0x0, %eax
je 0x1e9fb
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x64(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x68(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x6c(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x54(%rax)
jmp 0x1eea9
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x940a9(%rip), %rcx     # 0xb2ab7
callq 0x20ac0
cmpl $0x0, %eax
je 0x1ea82
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x70(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x74(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movss %xmm0, 0x78(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x54(%rax)
jmp 0x1eea7
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x94027(%rip), %rcx     # 0xb2abc
callq 0x20ac0
cmpl $0x0, %eax
je 0x1eaf7
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x9, -0x30(%rbp)
jae 0x1eae7
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movss %xmm0, 0x20(%rax,%rcx,4)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1eab3
movq -0x10(%rbp), %rax
movl $0x1, 0x1c(%rax)
jmp 0x1eea5
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x93fb7(%rip), %rcx     # 0xb2ac1
callq 0x20ac0
cmpl $0x0, %eax
jne 0x1eb6f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x93f9f(%rip), %rcx     # 0xb2ac6
callq 0x20ac0
cmpl $0x0, %eax
jne 0x1eb6f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x93f87(%rip), %rcx     # 0xb2acb
callq 0x20ac0
cmpl $0x0, %eax
jne 0x1eb6f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x93f6f(%rip), %rcx     # 0xb2ad0
callq 0x20ac0
cmpl $0x0, %eax
je 0x1eea3
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x61(%rbp)
movsbl -0x61(%rbp), %eax
cmpl $0x62, %eax
jne 0x1eb93
movl $0x2, %eax
movl %eax, -0x8c(%rbp)
jmp 0x1ebaa
movsbl -0x61(%rbp), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x67, %edx
cmovel %ecx, %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq 0x93f0f(%rip), %rcx     # 0xb2ad5
callq 0x20ac0
cmpl $0x0, %eax
je 0x1ed27
movq -0x10(%rbp), %rax
addq $0x80, %rax
movslq -0x68(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x7c(%rax)
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x209e0
movl %eax, %eax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x1ec31
movq -0x78(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1ed25
cmpq $0x1, -0x70(%rbp)
jne 0x1ec74
movq -0x78(%rbp), %rax
movl $0x2, (%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20b80
movl %eax, %eax
cvtsi2ss %rax, %xmm0
movss 0x93d8e(%rip), %xmm1    # 0xb29f0
divss %xmm1, %xmm0
movq -0x78(%rbp), %rax
movss %xmm0, 0x18(%rax)
jmp 0x1ed23
movq -0x78(%rbp), %rax
movl $0x1, (%rax)
movq -0x50(%rbp), %rax
movq -0x70(%rbp), %rcx
shlq %rcx
addq %rcx, %rax
cmpq -0x20(%rbp), %rax
ja 0x1ec9c
cmpq $0x1000000, -0x70(%rbp) # imm = 0x1000000
jbe 0x1eca8
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
movq -0x70(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x70(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1efb0
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x8(%rax)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x70(%rbp), %rax
jae 0x1ed21
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20b80
movl %eax, %eax
cvtsi2ss %rax, %xmm0
movss 0x93cee(%rip), %xmm1    # 0xb29ec
mulss %xmm1, %xmm0
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1ecd4
jmp 0x1ed23
jmp 0x1ed25
jmp 0x1ed27
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq 0x93da0(%rip), %rcx     # 0xb2ada
callq 0x20ac0
cmpl $0x0, %eax
je 0x1eea1
movq -0x10(%rbp), %rax
addq $0x80, %rax
movslq -0x68(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x7c(%rax)
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20b80
movl %eax, -0x7c(%rbp)
movq -0x50(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x50(%rbp)
cmpl $0x4, -0x7c(%rbp)
jbe 0x1edad
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
movl -0x7c(%rbp), %ecx
addl $0x2, %ecx
movq -0x88(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x88(%rbp), %rax
movss %xmm0, 0x18(%rax)
cmpl $0x1, -0x7c(%rbp)
jb 0x1ee19
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x88(%rbp), %rax
movss %xmm0, 0x1c(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x88(%rbp), %rax
movss %xmm0, 0x20(%rax)
cmpl $0x2, -0x7c(%rbp)
jb 0x1ee3c
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x88(%rbp), %rax
movss %xmm0, 0x24(%rax)
cmpl $0x3, -0x7c(%rbp)
jb 0x1ee5f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x88(%rbp), %rax
movss %xmm0, 0x28(%rax)
cmpl $0x4, -0x7c(%rbp)
jne 0x1ee9f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x88(%rbp), %rax
movss %xmm0, 0x2c(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x20a80
movq -0x88(%rbp), %rax
movss %xmm0, 0x30(%rax)
jmp 0x1eea1
jmp 0x1eea3
jmp 0x1eea5
jmp 0x1eea7
jmp 0x1eea9
jmp 0x1eeab
jmp 0x1eead
movq -0x50(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0x1eec0
movl $0x1, -0x4(%rbp)
jmp 0x1eeda
jmp 0x1eec2
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1e7cb
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)