// File: mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_convert(unsigned char*, unsigned char const*, LodePNG_InfoColor*, LodePNG_InfoColor*, unsigned int, unsigned int)
unsigned LodePNG_convert(unsigned char* out, const unsigned char* in, LodePNG_InfoColor* infoOut, LodePNG_InfoColor* infoIn, unsigned w, unsigned h)
{
  const size_t numpixels = w * h; /*amount of pixels*/
  const unsigned OUT_BYTES = LodePNG_InfoColor_getBpp(infoOut) / 8; /*bytes per pixel in the output image*/
  const unsigned OUT_ALPHA = LodePNG_InfoColor_isAlphaType(infoOut); /*use 8-bit alpha channel*/
  size_t i, c, bp = 0; /*bitpointer, used by less-than-8-bit color types*/
  
  /*cases where in and out already have the same format*/
  if(LodePNG_InfoColor_equal(infoIn, infoOut))
  {
    size_t i, size = (w * h * LodePNG_InfoColor_getBpp(infoIn) + 7) / 8;
    for(i = 0; i < size; i++) out[i] = in[i];
    return 0;
  }

  if((infoOut->colorType == 2 || infoOut->colorType == 6) && infoOut->bitDepth == 8)
  {
    if(infoIn->bitDepth == 8)
    {
      switch(infoIn->colorType)
      {
        case 0: /*greyscale color*/
          for(i = 0; i < numpixels; i++)
          {
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = 255;
            out[OUT_BYTES * i + 0] = out[OUT_BYTES * i + 1] = out[OUT_BYTES * i + 2] = in[i];
            if(OUT_ALPHA && infoIn->key_defined && in[i] == infoIn->key_r) out[OUT_BYTES * i + 3] = 0;
          }
        break;
        case 2: /*RGB color*/
          for(i = 0; i < numpixels; i++)
          {
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = 255;
            for(c = 0; c < 3; c++) out[OUT_BYTES * i + c] = in[3 * i + c];
            if(OUT_ALPHA && infoIn->key_defined == 1 && in[3 * i + 0] == infoIn->key_r && in[3 * i + 1] == infoIn->key_g && in[3 * i + 2] == infoIn->key_b) out[OUT_BYTES * i + 3] = 0;
          }
        break;
        case 3: /*indexed color (palette)*/
          for(i = 0; i < numpixels; i++)
          {
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = 255;
            if(in[i] >= infoIn->palettesize) return 46;
            for(c = 0; c < OUT_BYTES; c++) out[OUT_BYTES * i + c] = infoIn->palette[4 * in[i] + c]; /*get rgb colors from the palette*/
          }
        break;
        case 4: /*greyscale with alpha*/
          for(i = 0; i < numpixels; i++)
          {
            out[OUT_BYTES * i + 0] = out[OUT_BYTES * i + 1] = out[OUT_BYTES * i + 2] = in[2 * i + 0];
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = in[2 * i + 1];
          }
        break;
        case 6: /*RGB with alpha*/
          for(i = 0; i < numpixels; i++)
          {
            for(c = 0; c < OUT_BYTES; c++) out[OUT_BYTES * i + c] = in[4 * i + c];
          }
        break;
        default: break;
      }
    }
    else if(infoIn->bitDepth == 16)
    {
      switch(infoIn->colorType)
      {
        case 0: /*greyscale color*/
          for(i = 0; i < numpixels; i++)
          {
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = 255;
            out[OUT_BYTES * i + 0] = out[OUT_BYTES * i + 1] = out[OUT_BYTES * i + 2] = in[2 * i];
            if(OUT_ALPHA && infoIn->key_defined && 256U * in[i] + in[i + 1] == infoIn->key_r) out[OUT_BYTES * i + 3] = 0;
          }
        break;
        case 2: /*RGB color*/
          for(i = 0; i < numpixels; i++)
          {
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = 255;
            for(c = 0; c < 3; c++) out[OUT_BYTES * i + c] = in[6 * i + 2 * c];
            if(OUT_ALPHA && infoIn->key_defined && 256U * in[6 * i + 0] + in[6 * i + 1] == infoIn->key_r && 256U * in[6 * i + 2] + in[6 * i + 3] == infoIn->key_g && 256U * in[6 * i + 4] + in[6 * i + 5] == infoIn->key_b) out[OUT_BYTES * i + 3] = 0;
          }
        break;
        case 4: /*greyscale with alpha*/
          for(i = 0; i < numpixels; i++)
          {
            out[OUT_BYTES * i + 0] = out[OUT_BYTES * i + 1] = out[OUT_BYTES * i + 2] = in[4 * i]; /*most significant byte*/
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = in[4 * i + 2];
          }
        break;
        case 6: /*RGB with alpha*/
          for(i = 0; i < numpixels; i++)
          {
            for(c = 0; c < OUT_BYTES; c++) out[OUT_BYTES * i + c] = in[8 * i + 2 * c];
          }
          break;
        default: break;
      }
    }
    else /*infoIn->bitDepth is less than 8 bit per channel*/
    {
      switch(infoIn->colorType)
      {
        case 0: /*greyscale color*/
          for(i = 0; i < numpixels; i++)
          {
            unsigned value = readBitsFromReversedStream(&bp, in, infoIn->bitDepth);
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = 255;
            if(OUT_ALPHA && infoIn->key_defined && value && ((1U << infoIn->bitDepth) - 1U) == infoIn->key_r && ((1U << infoIn->bitDepth) - 1U)) out[OUT_BYTES * i + 3] = 0;
            value = (value * 255) / ((1 << infoIn->bitDepth) - 1); /*scale value from 0 to 255*/
            out[OUT_BYTES * i + 0] = out[OUT_BYTES * i + 1] = out[OUT_BYTES * i + 2] = (unsigned char)(value);
          }
        break;
        case 3: /*indexed color (palette)*/
          for(i = 0; i < numpixels; i++)
          {
            unsigned value = readBitsFromReversedStream(&bp, in, infoIn->bitDepth);
            if(OUT_ALPHA) out[OUT_BYTES * i + 3] = 255;
            if(value >= infoIn->palettesize) return 47;
            for(c = 0; c < OUT_BYTES; c++) out[OUT_BYTES * i + c] = infoIn->palette[4 * value + c]; /*get rgb colors from the palette*/
          }
        break;
        default: break;
      }
    }
  }
  else if(LodePNG_InfoColor_isGreyscaleType(infoOut) && infoOut->bitDepth == 8) /*conversion from greyscale to greyscale*/
  {
    if(!LodePNG_InfoColor_isGreyscaleType(infoIn)) return 62;
    if(infoIn->bitDepth == 8)
    {
      switch(infoIn->colorType)
      {
        case 0: /*greyscale color*/
          for(i = 0; i < numpixels; i++)
          {
            if(OUT_ALPHA) out[OUT_BYTES * i + 1] = 255;
            out[OUT_BYTES * i] = in[i];
            if(OUT_ALPHA && infoIn->key_defined && in[i] == infoIn->key_r) out[OUT_BYTES * i + 1] = 0;
          }
        break;
        case 4: /*greyscale with alpha*/
          for(i = 0; i < numpixels; i++)
          {
            out[OUT_BYTES * i + 0] = in[2 * i + 0];
            if(OUT_ALPHA) out[OUT_BYTES * i + 1] = in[2 * i + 1];
          }
        break;
        default: return 31;
      }
    }
    else if(infoIn->bitDepth == 16)
    {
      switch(infoIn->colorType)
      {
        case 0: /*greyscale color*/
          for(i = 0; i < numpixels; i++)
          {
            if(OUT_ALPHA) out[OUT_BYTES * i + 1] = 255;
            out[OUT_BYTES * i] = in[2 * i];
            if(OUT_ALPHA && infoIn->key_defined && 256U * in[i] + in[i + 1] == infoIn->key_r) out[OUT_BYTES * i + 1] = 0;
          }
        break;
        case 4: /*greyscale with alpha*/
          for(i = 0; i < numpixels; i++)
          {
            out[OUT_BYTES * i] = in[4 * i]; /*most significant byte*/
            if(OUT_ALPHA) out[OUT_BYTES * i + 1] = in[4 * i + 2]; /*most significant byte*/
          }
        break;
        default: return 31;
      }
    }
    else /*infoIn->bitDepth is less than 8 bit per channel*/
    {
      if(infoIn->colorType != 0) return 31; /*colorType 0 is the only greyscale type with < 8 bits per channel*/
      for(i = 0; i < numpixels; i++)
      {
        unsigned value = readBitsFromReversedStream(&bp, in, infoIn->bitDepth);
        if(OUT_ALPHA) out[OUT_BYTES * i + 1] = 255;
        if(OUT_ALPHA && infoIn->key_defined && value && ((1U << infoIn->bitDepth) - 1U) == infoIn->key_r && ((1U << infoIn->bitDepth) - 1U)) out[OUT_BYTES * i + 1] = 0;
        value = (value * 255) / ((1 << infoIn->bitDepth) - 1); /*scale value from 0 to 255*/
        out[OUT_BYTES * i] = (unsigned char)(value);
      }
    }
  }
  else return 59;
  
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movl -0x2c(%rbp), %eax
imull -0x30(%rbp), %eax
movl %eax, %eax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x26220
shrl $0x3, %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x26330
movl %eax, -0x40(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x26350
cmpl $0x0, %eax
je 0x271fe
movl -0x2c(%rbp), %eax
imull -0x30(%rbp), %eax
movl %eax, -0x78(%rbp)
movq -0x28(%rbp), %rdi
callq 0x26220
movl %eax, %ecx
movl -0x78(%rbp), %eax
imull %ecx, %eax
addl $0x7, %eax
shrl $0x3, %eax
movl %eax, %eax
movq %rax, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
jae 0x271f2
movq -0x18(%rbp), %rax
movq -0x60(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movq -0x60(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x271c4
movl $0x0, -0x4(%rbp)
jmp 0x27eb5
movq -0x20(%rbp), %rax
cmpl $0x2, (%rax)
je 0x27214
movq -0x20(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x27ade
movq -0x20(%rbp), %rax
cmpl $0x8, 0x4(%rax)
jne 0x27ade
movq -0x28(%rbp), %rax
cmpl $0x8, 0x4(%rax)
jne 0x275ad
movq -0x28(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x80(%rbp)
subq $0x6, %rax
ja 0x275a6
movq -0x80(%rbp), %rax
leaq 0x245a9(%rip), %rcx     # 0x4b7f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27308
cmpl $0x0, -0x40(%rbp)
je 0x27285
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx)
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x272f5
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x272f5
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x272f5
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $0x0, 0x3(%rax,%rcx)
jmp 0x272f7
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27260
jmp 0x275a8
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x273f2
cmpl $0x0, -0x40(%rbp)
je 0x2733a
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx)
movq $0x0, -0x50(%rbp)
cmpq $0x3, -0x50(%rbp)
jae 0x2737a
movq -0x18(%rbp), %rax
imulq $0x3, -0x48(%rbp), %rcx
addq -0x50(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
addq -0x50(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x27342
cmpl $0x0, -0x40(%rbp)
je 0x273df
movq -0x28(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jne 0x273df
movq -0x18(%rbp), %rax
imulq $0x3, -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x273df
movq -0x18(%rbp), %rax
imulq $0x3, -0x48(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jne 0x273df
movq -0x18(%rbp), %rax
imulq $0x3, -0x48(%rbp), %rcx
movzbl 0x2(%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jne 0x273df
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $0x0, 0x3(%rax,%rcx)
jmp 0x273e1
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27315
jmp 0x275a8
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x274af
cmpl $0x0, -0x40(%rbp)
je 0x27424
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx)
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jb 0x27446
movl $0x2e, -0x4(%rbp)
jmp 0x27eb5
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl -0x3c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x2749c
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq -0x48(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
addq -0x50(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
addq -0x50(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2744e
jmp 0x2749e
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x273ff
jmp 0x275a8
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27538
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x27528
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq %rcx
movb 0x1(%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x3(%rax,%rcx)
jmp 0x2752a
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x274bc
jmp 0x275a8
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x275a4
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl -0x3c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x27594
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq $0x2, %rcx
addq -0x50(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
addq -0x50(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x27554
jmp 0x27596
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27542
jmp 0x275a8
jmp 0x275a8
jmp 0x27ad9
movq -0x28(%rbp), %rax
cmpl $0x10, 0x4(%rax)
jne 0x278e5
movq -0x28(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x88(%rbp)
subq $0x6, %rax
ja 0x278de
movq -0x88(%rbp), %rax
leaq 0x241fc(%rip), %rcx     # 0x4b7dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x276ae
cmpl $0x0, -0x40(%rbp)
je 0x27616
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx)
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x2769b
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x2769b
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
shll $0x8, %eax
movq -0x18(%rbp), %rcx
movq -0x48(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x2769b
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $0x0, 0x3(%rax,%rcx)
jmp 0x2769d
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x275f1
jmp 0x278e0
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x277df
cmpl $0x0, -0x40(%rbp)
je 0x276e0
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx)
movq $0x0, -0x50(%rbp)
cmpq $0x3, -0x50(%rbp)
jae 0x27726
movq -0x18(%rbp), %rax
imulq $0x6, -0x48(%rbp), %rcx
movq -0x50(%rbp), %rdx
shlq %rdx
addq %rdx, %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
addq -0x50(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x276e8
cmpl $0x0, -0x40(%rbp)
je 0x277cc
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x277cc
movq -0x18(%rbp), %rax
imulq $0x6, -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
shll $0x8, %eax
movq -0x18(%rbp), %rcx
imulq $0x6, -0x48(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x277cc
movq -0x18(%rbp), %rax
imulq $0x6, -0x48(%rbp), %rcx
movzbl 0x2(%rax,%rcx), %eax
shll $0x8, %eax
movq -0x18(%rbp), %rcx
imulq $0x6, -0x48(%rbp), %rdx
movzbl 0x3(%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x28(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jne 0x277cc
movq -0x18(%rbp), %rax
imulq $0x6, -0x48(%rbp), %rcx
movzbl 0x4(%rax,%rcx), %eax
shll $0x8, %eax
movq -0x18(%rbp), %rcx
imulq $0x6, -0x48(%rbp), %rdx
movzbl 0x5(%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x28(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jne 0x277cc
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $0x0, 0x3(%rax,%rcx)
jmp 0x277ce
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x276bb
jmp 0x278e0
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x2786a
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq $0x2, %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x2785a
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq $0x2, %rcx
movb 0x2(%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x3(%rax,%rcx)
jmp 0x2785c
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x277ec
jmp 0x278e0
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x278dc
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl -0x3c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x278cc
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq $0x3, %rcx
movq -0x50(%rbp), %rdx
shlq %rdx
addq %rdx, %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
addq -0x50(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x27886
jmp 0x278ce
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27874
jmp 0x278e0
jmp 0x278e0
jmp 0x27ad7
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
testl %eax, %eax
je 0x2790b
jmp 0x278f7
movl -0x8c(%rbp), %eax
subl $0x3, %eax
je 0x27a13
jmp 0x27ad3
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27a0e
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
leaq -0x58(%rbp), %rdi
callq 0x27ed0
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x27951
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x279a8
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x279a8
cmpl $0x0, -0x6c(%rbp)
je 0x279a8
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x279a8
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
cmpl $0x0, %eax
je 0x279a8
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $0x0, 0x3(%rax,%rcx)
imull $0xff, -0x6c(%rbp), %eax
movq -0x28(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x2(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27913
jmp 0x27ad5
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27ad1
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
leaq -0x58(%rbp), %rdi
callq 0x27ed0
movl %eax, -0x70(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x27a59
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x3(%rax,%rcx)
movl -0x70(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jb 0x27a72
movl $0x2f, -0x4(%rbp)
jmp 0x27eb5
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl -0x3c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x27abe
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x70(%rbp), %ecx
shll $0x2, %ecx
movl %ecx, %ecx
addq -0x50(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
addq -0x50(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x27a7a
jmp 0x27ac0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27a1b
jmp 0x27ad5
jmp 0x27ad5
jmp 0x27ad7
jmp 0x27ad9
jmp 0x27eae
movq -0x20(%rbp), %rdi
callq 0x26300
cmpl $0x0, %eax
je 0x27ea3
movq -0x20(%rbp), %rax
cmpl $0x8, 0x4(%rax)
jne 0x27ea3
movq -0x28(%rbp), %rdi
callq 0x26300
cmpl $0x0, %eax
jne 0x27b18
movl $0x3e, -0x4(%rbp)
jmp 0x27eb5
movq -0x28(%rbp), %rax
cmpl $0x8, 0x4(%rax)
jne 0x27c51
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x90(%rbp)
testl %eax, %eax
je 0x27b4c
jmp 0x27b38
movl -0x90(%rbp), %eax
subl $0x4, %eax
je 0x27bda
jmp 0x27c40
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27bd8
cmpl $0x0, -0x40(%rbp)
je 0x27b75
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x1(%rax,%rcx)
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x27bc5
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x27bc5
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x27bc5
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $0x0, 0x1(%rax,%rcx)
jmp 0x27bc7
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27b54
jmp 0x27c4c
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27c3e
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x27c2e
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq %rcx
movb 0x1(%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
jmp 0x27c30
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27be2
jmp 0x27c4c
movl $0x1f, -0x4(%rbp)
jmp 0x27eb5
jmp 0x27ea1
movq -0x28(%rbp), %rax
cmpl $0x10, 0x4(%rax)
jne 0x27da5
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x94(%rbp)
testl %eax, %eax
je 0x27c85
jmp 0x27c71
movl -0x94(%rbp), %eax
subl $0x4, %eax
je 0x27d2c
jmp 0x27d94
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27d2a
cmpl $0x0, -0x40(%rbp)
je 0x27cb2
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x1(%rax,%rcx)
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x27d17
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x27d17
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
shll $0x8, %eax
movq -0x18(%rbp), %rcx
movq -0x48(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
addl %ecx, %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x27d17
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $0x0, 0x1(%rax,%rcx)
jmp 0x27d19
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27c8d
jmp 0x27da0
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27d92
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq $0x2, %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x27d82
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
shlq $0x2, %rcx
movb 0x2(%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, 0x1(%rax,%rcx)
jmp 0x27d84
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27d34
jmp 0x27da0
movl $0x1f, -0x4(%rbp)
jmp 0x27eb5
jmp 0x27e9f
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x27dba
movl $0x1f, -0x4(%rbp)
jmp 0x27eb5
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x27e9d
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
leaq -0x58(%rbp), %rdi
callq 0x27ed0
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x27e00
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $-0x1, 0x1(%rax,%rcx)
cmpl $0x0, -0x40(%rbp)
je 0x27e57
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x27e57
cmpl $0x0, -0x74(%rbp)
je 0x27e57
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movq -0x28(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jne 0x27e57
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
cmpl $0x0, %eax
je 0x27e57
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb $0x0, 0x1(%rax,%rcx)
imull $0xff, -0x74(%rbp), %eax
movq -0x28(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x27dc2
jmp 0x27e9f
jmp 0x27ea1
jmp 0x27eac
movl $0x3b, -0x4(%rbp)
jmp 0x27eb5
jmp 0x27eae
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)