// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: lodepng_encode(unsigned char**, unsigned long*, unsigned char const*, unsigned int, unsigned int, LodePNGState*)
unsigned lodepng_encode(unsigned char** out, size_t* outsize,
                        const unsigned char* image, unsigned w, unsigned h,
                        LodePNGState* state) {
  unsigned char* data = 0; /*uncompressed version of the IDAT chunk data*/
  size_t datasize = 0;
  ucvector outv;
  LodePNGInfo info;
  const LodePNGInfo* info_png = &state->info_png;

  ucvector_init(&outv);
  lodepng_info_init(&info);

  /*provide some proper output values if error will happen*/
  *out = 0;
  *outsize = 0;
  state->error = 0;

  /*check input values validity*/
  if((info_png->color.colortype == LCT_PALETTE || state->encoder.force_palette)
      && (info_png->color.palettesize == 0 || info_png->color.palettesize > 256)) {
    state->error = 68; /*invalid palette size, it is only allowed to be 1-256*/
    goto cleanup;
  }
  if(state->encoder.zlibsettings.btype > 2) {
    state->error = 61; /*error: nonexistent btype*/
    goto cleanup;
  }
  if(info_png->interlace_method > 1) {
    state->error = 71; /*error: nonexistent interlace mode*/
    goto cleanup;
  }
  state->error = checkColorValidity(info_png->color.colortype, info_png->color.bitdepth);
  if(state->error) goto cleanup; /*error: nonexistent color type given*/
  state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth);
  if(state->error) goto cleanup; /*error: nonexistent color type given*/

  /* color convert and compute scanline filter types */
  lodepng_info_copy(&info, &state->info_png);
  if(state->encoder.auto_convert) {
    LodePNGColorStats stats;
    lodepng_color_stats_init(&stats);
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    if(info_png->iccp_defined &&
        isGrayICCProfile(info_png->iccp_profile, info_png->iccp_profile_size)) {
      /*the PNG specification does not allow to use palette with a GRAY ICC profile, even
      if the palette has only gray colors, so disallow it.*/
      stats.allow_palette = 0;
    }
    if(info_png->iccp_defined &&
        isRGBICCProfile(info_png->iccp_profile, info_png->iccp_profile_size)) {
      /*the PNG specification does not allow to use grayscale color with RGB ICC profile, so disallow gray.*/
      stats.allow_greyscale = 0;
    }
#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */
    lodepng_compute_color_stats(&stats, image, w, h, &state->info_raw);
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    if(info_png->background_defined) {
      /*the background chunk's color must be taken into account as well*/
      unsigned r = 0, g = 0, b = 0;
      LodePNGColorMode mode16 = lodepng_color_mode_make(LCT_RGB, 16);
      lodepng_convert_rgb(&r, &g, &b, info_png->background_r, info_png->background_g, info_png->background_b, &mode16, &info_png->color);
      lodepng_color_stats_add(&stats, r, g, b, 65535);
    }
#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */
    state->error = auto_choose_color(&info.color, &state->info_raw, &stats);
    if(state->error) goto cleanup;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    /*also convert the background chunk*/
    if(info_png->background_defined) {
      if(lodepng_convert_rgb(&info.background_r, &info.background_g, &info.background_b,
          info_png->background_r, info_png->background_g, info_png->background_b, &info.color, &info_png->color)) {
        state->error = 104;
        goto cleanup;
      }
    }
#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */
  }
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  if(info_png->iccp_defined) {
    unsigned gray_icc = isGrayICCProfile(info_png->iccp_profile, info_png->iccp_profile_size);
    unsigned rgb_icc = isRGBICCProfile(info_png->iccp_profile, info_png->iccp_profile_size);
    unsigned gray_png = info.color.colortype == LCT_GREY || info.color.colortype == LCT_GREY_ALPHA;
    if(!gray_icc && !rgb_icc) {
      state->error = 100; /* Disallowed profile color type for PNG */
      goto cleanup;
    }
    if(gray_icc != gray_png) {
      /*Not allowed to use RGB/RGBA/palette with GRAY ICC profile or vice versa,
      or in case of auto_convert, it wasn't possible to find appropriate model*/
      state->error = state->encoder.auto_convert ? 102 : 101;
      goto cleanup;
    }
  }
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
  if(!lodepng_color_mode_equal(&state->info_raw, &info.color)) {
    unsigned char* converted;
    size_t size = ((size_t)w * (size_t)h * (size_t)lodepng_get_bpp(&info.color) + 7u) / 8u;

    converted = (unsigned char*)lodepng_malloc(size);
    if(!converted && size) state->error = 83; /*alloc fail*/
    if(!state->error) {
      state->error = lodepng_convert(converted, image, &info.color, &state->info_raw, w, h);
    }
    if(!state->error) preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder);
    lodepng_free(converted);
    if(state->error) goto cleanup;
  }
  else preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder);

  /* output all PNG chunks */ {
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    size_t i;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    /*write signature and chunks*/
    writeSignature(&outv);
    /*IHDR*/
    addChunk_IHDR(&outv, w, h, info.color.colortype, info.color.bitdepth, info.interlace_method);
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    /*unknown chunks between IHDR and PLTE*/
    if(info.unknown_chunks_data[0]) {
      state->error = addUnknownChunks(&outv, info.unknown_chunks_data[0], info.unknown_chunks_size[0]);
      if(state->error) goto cleanup;
    }
    /*color profile chunks must come before PLTE */
    if(info.iccp_defined) addChunk_iCCP(&outv, &info, &state->encoder.zlibsettings);
    if(info.srgb_defined) addChunk_sRGB(&outv, &info);
    if(info.gama_defined) addChunk_gAMA(&outv, &info);
    if(info.chrm_defined) addChunk_cHRM(&outv, &info);
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    /*PLTE*/
    if(info.color.colortype == LCT_PALETTE) {
      addChunk_PLTE(&outv, &info.color);
    }
    if(state->encoder.force_palette && (info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA)) {
      addChunk_PLTE(&outv, &info.color);
    }
    /*tRNS*/
    if(info.color.colortype == LCT_PALETTE && getPaletteTranslucency(info.color.palette, info.color.palettesize) != 0) {
      addChunk_tRNS(&outv, &info.color);
    }
    if((info.color.colortype == LCT_GREY || info.color.colortype == LCT_RGB) && info.color.key_defined) {
      addChunk_tRNS(&outv, &info.color);
    }
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    /*bKGD (must come between PLTE and the IDAt chunks*/
    if(info.background_defined) {
      state->error = addChunk_bKGD(&outv, &info);
      if(state->error) goto cleanup;
    }
    /*pHYs (must come before the IDAT chunks)*/
    if(info.phys_defined) addChunk_pHYs(&outv, &info);

    /*unknown chunks between PLTE and IDAT*/
    if(info.unknown_chunks_data[1]) {
      state->error = addUnknownChunks(&outv, info.unknown_chunks_data[1], info.unknown_chunks_size[1]);
      if(state->error) goto cleanup;
    }
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    /*IDAT (multiple IDAT chunks must be consecutive)*/
    state->error = addChunk_IDAT(&outv, data, datasize, &state->encoder.zlibsettings);
    if(state->error) goto cleanup;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    /*tIME*/
    if(info.time_defined) addChunk_tIME(&outv, &info.time);
    /*tEXt and/or zTXt*/
    for(i = 0; i != info.text_num; ++i) {
      if(lodepng_strlen(info.text_keys[i]) > 79) {
        state->error = 66; /*text chunk too large*/
        goto cleanup;
      }
      if(lodepng_strlen(info.text_keys[i]) < 1) {
        state->error = 67; /*text chunk too small*/
        goto cleanup;
      }
      if(state->encoder.text_compression) {
        addChunk_zTXt(&outv, info.text_keys[i], info.text_strings[i], &state->encoder.zlibsettings);
      } else {
        addChunk_tEXt(&outv, info.text_keys[i], info.text_strings[i]);
      }
    }
    /*LodePNG version id in text chunk*/
    if(state->encoder.add_id) {
      unsigned already_added_id_text = 0;
      for(i = 0; i != info.text_num; ++i) {
        const char* k = info.text_keys[i];
        /* Could use strcmp, but we're not calling or reimplementing this C library function for this use only */
        if(k[0] == 'L' && k[1] == 'o' && k[2] == 'd' && k[3] == 'e' &&
           k[4] == 'P' && k[5] == 'N' && k[6] == 'G' && k[7] == '\0') {
          already_added_id_text = 1;
          break;
        }
      }
      if(already_added_id_text == 0) {
        addChunk_tEXt(&outv, "LodePNG", LODEPNG_VERSION_STRING); /*it's shorter as tEXt than as zTXt chunk*/
      }
    }
    /*iTXt*/
    for(i = 0; i != info.itext_num; ++i) {
      if(lodepng_strlen(info.itext_keys[i]) > 79) {
        state->error = 66; /*text chunk too large*/
        goto cleanup;
      }
      if(lodepng_strlen(info.itext_keys[i]) < 1) {
        state->error = 67; /*text chunk too small*/
        goto cleanup;
      }
      addChunk_iTXt(&outv, state->encoder.text_compression,
                    info.itext_keys[i], info.itext_langtags[i], info.itext_transkeys[i], info.itext_strings[i],
                    &state->encoder.zlibsettings);
    }

    /*unknown chunks between IDAT and IEND*/
    if(info.unknown_chunks_data[2]) {
      state->error = addUnknownChunks(&outv, info.unknown_chunks_data[2], info.unknown_chunks_size[2]);
      if(state->error) goto cleanup;
    }
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    addChunk_IEND(&outv);
  }

cleanup:
  lodepng_info_cleanup(&info);
  lodepng_free(data);

  /*instead of cleaning the vector up, give it to the output*/
  *out = outv.data;
  *outsize = outv.size;

  return state->error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5f8, %rsp            # imm = 0x5F8
movq %r9, %rbx
movl %r8d, %ebp
movl %ecx, %r12d
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movq %rax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rax, 0x20(%rsp)
movups %xmm0, 0x90(%rsp)
movabsq $0x800000006, %rcx      # imm = 0x800000006
movq %rcx, 0x78(%rsp)
movups %xmm0, 0x80(%rsp)
movl %eax, 0x70(%rsp)
movq %rax, 0x68(%rsp)
movl %eax, 0x10c(%rsp)
movl %eax, 0x11c(%rsp)
movl %eax, 0x124(%rsp)
movl %eax, 0x148(%rsp)
movl %eax, 0x150(%rsp)
movups %xmm0, 0x170(%rsp)
movups %xmm0, 0x180(%rsp)
movups %xmm0, 0x190(%rsp)
movups %xmm0, 0xa0(%rsp)
movups %xmm0, 0xb0(%rsp)
movups %xmm0, 0xc0(%rsp)
movups %xmm0, 0xd0(%rsp)
movups %xmm0, 0xe0(%rsp)
movl %eax, 0xf0(%rsp)
movups %xmm0, 0x158(%rsp)
movq %rax, (%rdi)
movq %rax, (%rsi)
movl %eax, 0x1f0(%r9)
movl 0xc8(%r9), %edi
cmpl $0x3, %edi
je 0x6c707
cmpl $0x0, 0x80(%rbx)
je 0x6c729
movq $-0x101, %rax           # imm = 0xFEFF
movq 0xd8(%rbx), %rcx
addq %rax, %rcx
cmpq %rax, %rcx
ja 0x6c729
movl $0x44, 0x1f0(%rbx)
jmp 0x6c780
cmpl $0x3, 0x38(%rbx)
jb 0x6c73b
movl $0x3d, 0x1f0(%rbx)
jmp 0x6c780
cmpl $0x2, 0xc0(%rbx)
jb 0x6c750
movl $0x47, 0x1f0(%rbx)
jmp 0x6c780
movl 0xcc(%rbx), %esi
callq 0x6a639
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6c780
movl 0x90(%rbx), %edi
movl 0x94(%rbx), %esi
callq 0x6a639
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
je 0x6c7bc
leaq 0x68(%rsp), %rdi
callq 0x6840a
movq 0x48(%rsp), %rdi
callq 0x3a540
movq 0x10(%rsp), %rax
movq %rax, (%r15)
movq 0x18(%rsp), %rax
movq %rax, (%r14)
movl 0x1f0(%rbx), %eax
addq $0x5f8, %rsp            # imm = 0x5F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb8(%rbx), %rsi
leaq 0x90(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x6848f
cmpl $0x0, 0x68(%rbx)
je 0x6c9c3
xorl %eax, %eax
movq %rax, 0x1d8(%rsp)
movq %rax, 0x1c8(%rsp)
movq %rax, 0x1ce(%rsp)
movl $0x1, 0x5e0(%rsp)
movq %rax, 0x5e8(%rsp)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x5f0(%rsp)
cmpl $0x0, 0x1a0(%rbx)
je 0x6c881
cmpl $0x14, 0x1b8(%rbx)
jb 0x6c881
movq 0x1b0(%rbx), %rax
cmpb $0x47, 0x10(%rax)
jne 0x6c85e
cmpb $0x52, 0x11(%rax)
jne 0x6c85e
cmpb $0x41, 0x12(%rax)
jne 0x6c85e
cmpb $0x59, 0x13(%rax)
jne 0x6c85e
movl $0x0, 0x5f0(%rsp)
cmpb $0x52, 0x10(%rax)
jne 0x6c881
cmpb $0x47, 0x11(%rax)
jne 0x6c881
cmpb $0x42, 0x12(%rax)
jne 0x6c881
cmpb $0x20, 0x13(%rax)
jne 0x6c881
movl $0x0, 0x5f4(%rsp)
leaq 0xc8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x1c8(%rsp), %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %ebp, %ecx
movq 0x38(%rsp), %r8
callq 0x69a5d
cmpl $0x0, 0xf0(%rbx)
je 0x6c93e
xorl %eax, %eax
leaq 0x64(%rsp), %rcx
movl %eax, (%rcx)
movq %rcx, %rdi
leaq 0x60(%rsp), %rcx
movl %eax, (%rcx)
movq %rcx, %rsi
leaq 0x5c(%rsp), %r10
movl %eax, (%r10)
xorps %xmm0, %xmm0
leaq 0x1a0(%rsp), %rax
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movabsq $0x1000000002, %rcx     # imm = 0x1000000002
movq %rcx, (%rax)
movl 0xf4(%rbx), %ecx
movl 0xf8(%rbx), %r8d
movl 0xfc(%rbx), %r9d
movq 0x30(%rsp), %rdx
movq %rdx, 0x8(%rsp)
movq %rax, (%rsp)
movq %r10, %rdx
callq 0x698ac
leaq 0x64(%rsp), %rax
movl (%rax), %esi
leaq 0x60(%rsp), %rax
movl (%rax), %edx
leaq 0x5c(%rsp), %rax
movl (%rax), %ecx
leaq 0x1c8(%rsp), %rdi
callq 0x6cfb4
leaq 0x1c8(%rsp), %rdx
leaq 0x78(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x6d00d
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6c780
cmpl $0x0, 0xf0(%rbx)
je 0x6c9c3
leaq 0xa4(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0xac(%rsp), %rdx
movl 0xf4(%rbx), %ecx
movl 0xf8(%rbx), %r8d
movl 0xfc(%rbx), %r9d
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, (%rsp)
callq 0x698ac
testl %eax, %eax
je 0x6c9c3
movl $0x68, 0x1f0(%rbx)
jmp 0x6c780
cmpl $0x0, 0x1a0(%rbx)
movq 0x38(%rsp), %rdi
je 0x6ca3c
xorl %eax, %eax
cmpl $0x14, 0x1b8(%rbx)
jb 0x6ca1d
movq 0x1b0(%rbx), %rdx
movzbl 0x10(%rdx), %ecx
cmpl $0x52, %ecx
je 0x6ca08
cmpl $0x47, %ecx
jne 0x6ca1d
cmpb $0x52, 0x11(%rdx)
jne 0x6ca1d
cmpb $0x41, 0x12(%rdx)
jne 0x6ca1d
xorl %ecx, %ecx
cmpb $0x59, 0x13(%rdx)
sete %cl
jmp 0x6ca1f
cmpb $0x47, 0x11(%rdx)
jne 0x6ca1d
cmpb $0x42, 0x12(%rdx)
jne 0x6ca1d
xorl %eax, %eax
cmpb $0x20, 0x13(%rdx)
sete %al
xorl %ecx, %ecx
orl %ecx, %eax
je 0x6cd79
xorl %eax, %eax
testl $0xfffffffb, 0x78(%rsp) # imm = 0xFFFFFFFB
sete %al
cmpl %eax, %ecx
jne 0x6cde9
leaq 0x38(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x78(%rsp), %rsi
callq 0x692f5
testl %eax, %eax
je 0x6cd88
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x68(%rsp), %r9
movq %r13, %rdx
movl %r12d, %ecx
movl %ebp, %r8d
callq 0x6d21d
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x6d786
movl 0x70(%rsp), %r9d
movl 0x78(%rsp), %ecx
movl 0x7c(%rsp), %r8d
movq %r13, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x6d881
movq 0x170(%rsp), %rsi
testq %rsi, %rsi
je 0x6cad2
movq 0x188(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0x6d8fe
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6c780
cmpl $0x0, 0x150(%rsp)
movq 0x30(%rsp), %r12
je 0x6caf3
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movq %r12, %rdx
callq 0x6d967
cmpl $0x0, 0x148(%rsp)
leaq 0x78(%rsp), %r13
je 0x6cb13
movl 0x14c(%rsp), %esi
leaq 0x10(%rsp), %rdi
callq 0x6dbea
cmpl $0x0, 0x11c(%rsp)
je 0x6cb2e
movl 0x120(%rsp), %esi
leaq 0x10(%rsp), %rdi
callq 0x6dc21
cmpl $0x0, 0x124(%rsp)
je 0x6cb47
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6dc5a
movl 0x78(%rsp), %eax
cmpl $0x3, %eax
jne 0x6cb61
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6dceb
movl 0x78(%rsp), %eax
cmpl $0x0, 0x80(%rbx)
je 0x6cb85
movl %eax, %ecx
andl $-0x5, %ecx
cmpl $0x2, %ecx
jne 0x6cb85
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6dceb
movl 0x78(%rsp), %eax
cmpl $0x3, %eax
jne 0x6cbb4
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x6dddb
testl %eax, %eax
je 0x6cbd2
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6de7d
movl 0x78(%rsp), %eax
testl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jne 0x6cbd2
cmpl $0x0, 0x90(%rsp)
je 0x6cbd2
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6de7d
cmpl $0x0, 0xa0(%rsp)
je 0x6cbf9
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e232
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6c780
cmpl $0x0, 0x10c(%rsp)
je 0x6cc12
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e2cd
movq 0x178(%rsp), %rsi
testq %rsi, %rsi
je 0x6cc3f
movq 0x190(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0x6d8fe
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6c780
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0x10(%rsp), %rdi
movq %r12, %rcx
callq 0x6e322
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6c780
cmpl $0x0, 0xf0(%rsp)
je 0x6cc80
leaq 0xf4(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x6e3ad
cmpq $0x0, 0xb0(%rsp)
movq %r12, %rbp
je 0x6ce8c
xorl %eax, %eax
leaq 0x10(%rsp), %r12
movq %rax, %r13
movq 0xb8(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq $-0x1, %rax
cmpb $0x0, 0x1(%rsi,%rax)
leaq 0x1(%rax), %rax
jne 0x6ccaf
cmpq $0x4f, %rax
ja 0x6cf96
xorl %eax, %eax
cmpb $0x0, (%rsi,%rax)
leaq 0x1(%rax), %rax
jne 0x6ccc6
cmpq $0x1, %rax
je 0x6cfa5
cmpl $0x0, 0x88(%rbx)
movq 0xc0(%rsp), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
je 0x6ccfc
movq %rbp, %rcx
callq 0x6e40f
jmp 0x6cd01
callq 0x6e6c1
leaq 0x1(%r13), %rax
cmpq 0xb0(%rsp), %rax
jne 0x6cc99
cmpl $0x0, 0x84(%rbx)
je 0x6cead
testq %rax, %rax
je 0x6ce95
movq $-0x1, %rax
movq 0xb8(%rsp), %rcx
movq 0x8(%rcx,%rax,8), %rdx
cmpb $0x4c, (%rdx)
jne 0x6cd6c
cmpb $0x6f, 0x1(%rdx)
jne 0x6cd6c
cmpb $0x64, 0x2(%rdx)
jne 0x6cd6c
cmpb $0x65, 0x3(%rdx)
jne 0x6cd6c
cmpb $0x50, 0x4(%rdx)
jne 0x6cd6c
cmpb $0x4e, 0x5(%rdx)
jne 0x6cd6c
cmpb $0x47, 0x6(%rdx)
jne 0x6cd6c
cmpb $0x0, 0x7(%rdx)
je 0x6cead
incq %rax
cmpq %rax, %r13
jne 0x6cd34
jmp 0x6ce95
movl $0x64, 0x1f0(%rbx)
jmp 0x6c780
movl %r12d, %eax
movl %ebp, %esi
imulq %rax, %rsi
movl 0x78(%rsp), %edx
movl 0x7c(%rsp), %eax
xorl %ecx, %ecx
cmpq $0x6, %rdx
ja 0x6cdab
leaq 0x1c0f4(%rip), %rcx     # 0x88e9c
movl (%rcx,%rdx,4), %ecx
imull %eax, %ecx
imulq %rcx, %rsi
addq $0x7, %rsi
movq %rsi, %rdi
movq %rsi, 0x40(%rsp)
shrq $0x3, %rdi
callq 0x3a5b0
movq %rax, %rdi
testq %rax, %rax
setne %al
cmpq $0x8, 0x40(%rsp)
setb %cl
orb %al, %cl
jne 0x6ce00
movl $0x53, 0x1f0(%rbx)
jmp 0x6ce35
cmpl $0x1, 0x68(%rbx)
movl $0x66, %eax
sbbl $0x0, %eax
movl %eax, 0x1f0(%rbx)
jmp 0x6c780
cmpl $0x0, 0x1f0(%rbx)
jne 0x6ce35
movq %rdi, 0x40(%rsp)
movq %r13, %rsi
leaq 0x78(%rsp), %rdx
movq 0x38(%rsp), %rcx
movl %r12d, %r8d
movl %ebp, %r9d
callq 0x6865d
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
je 0x6ce3f
movq 0x40(%rsp), %rdi
callq 0x3a540
jmp 0x6c780
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x68(%rsp), %r9
movq 0x40(%rsp), %r13
movq %r13, %rdx
movl %r12d, %ecx
movl %ebp, %r8d
callq 0x6d21d
movl 0x1f0(%rbx), %eax
movl %eax, 0x38(%rsp)
movq %r13, %rdi
callq 0x3a540
cmpl $0x0, 0x38(%rsp)
jne 0x6c780
jmp 0x6ca7d
cmpl $0x0, 0x84(%rbx)
je 0x6cead
movq 0x379c4(%rip), %rdx     # 0xa4860
leaq 0x1c062(%rip), %rsi     # 0x88f05
leaq 0x10(%rsp), %rdi
callq 0x6e6c1
cmpq $0x0, 0xc8(%rsp)
je 0x6cf49
xorl %r13d, %r13d
leaq 0x10(%rsp), %r12
movq 0xd0(%rsp), %rax
movq (%rax,%r13,8), %rdx
movq $-0x1, %rax
cmpb $0x0, 0x1(%rdx,%rax)
leaq 0x1(%rax), %rax
jne 0x6ced7
cmpq $0x4f, %rax
ja 0x6cf96
xorl %eax, %eax
cmpb $0x0, (%rdx,%rax)
leaq 0x1(%rax), %rax
jne 0x6ceee
cmpq $0x1, %rax
je 0x6cfa5
movl 0x88(%rbx), %esi
movq 0xd8(%rsp), %rax
movq 0xe0(%rsp), %rdi
movq (%rax,%r13,8), %rcx
movq (%rdi,%r13,8), %r8
movq 0xe8(%rsp), %rax
movq (%rax,%r13,8), %r9
movq %rbp, (%rsp)
movq %r12, %rdi
callq 0x6e85f
incq %r13
cmpq 0xc8(%rsp), %r13
jne 0x6cec4
movq 0x180(%rsp), %rsi
testq %rsi, %rsi
je 0x6cf76
movq 0x198(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0x6d8fe
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6c780
leaq 0x18(%rsp), %rsi
leaq 0x1d16f(%rip), %rcx     # 0x8a0f1
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x67b70
jmp 0x6c780
movl $0x42, 0x1f0(%rbx)
jmp 0x6c780
movl $0x43, 0x1f0(%rbx)
jmp 0x6c780