// File: /workspace/github_cpp_makefile_star2_O1/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, 0x40(%rsp)
movq %rax, 0x48(%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, 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)
movups %xmm0, 0x170(%rsp)
movups %xmm0, 0x180(%rsp)
movups %xmm0, 0x190(%rsp)
movq %rax, (%rdi)
movq %rax, (%rsi)
movl %eax, 0x1f0(%r9)
movl 0xc8(%r9), %edi
cmpl $0x3, %edi
je 0x6ced2
cmpl $0x0, 0x80(%rbx)
je 0x6cef4
movq $-0x101, %rax           # imm = 0xFEFF
movq 0xd8(%rbx), %rcx
addq %rax, %rcx
cmpq %rax, %rcx
ja 0x6cef4
movl $0x44, 0x1f0(%rbx)
jmp 0x6cf4b
cmpl $0x3, 0x38(%rbx)
jb 0x6cf06
movl $0x3d, 0x1f0(%rbx)
jmp 0x6cf4b
cmpl $0x2, 0xc0(%rbx)
jb 0x6cf1b
movl $0x47, 0x1f0(%rbx)
jmp 0x6cf4b
movl 0xcc(%rbx), %esi
callq 0x6acd5
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6cf4b
movl 0x90(%rbx), %edi
movl 0x94(%rbx), %esi
callq 0x6acd5
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
je 0x6cf87
leaq 0x68(%rsp), %rdi
callq 0x68a03
movq 0x40(%rsp), %rdi
callq 0x3a530
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 0x68a88
cmpl $0x0, 0x68(%rbx)
je 0x6d1aa
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)
movl 0x1a0(%rbx), %eax
testl %eax, %eax
je 0x6d061
cmpl $0x14, 0x1b8(%rbx)
jb 0x6d02a
movq 0x1b0(%rbx), %rcx
cmpb $0x47, 0x10(%rcx)
jne 0x6d02a
cmpb $0x52, 0x11(%rcx)
jne 0x6d02a
cmpb $0x41, 0x12(%rcx)
jne 0x6d02a
cmpb $0x59, 0x13(%rcx)
jne 0x6d02a
movl $0x0, 0x5f0(%rsp)
testl %eax, %eax
je 0x6d061
cmpl $0x14, 0x1b8(%rbx)
jb 0x6d061
movq 0x1b0(%rbx), %rax
cmpb $0x52, 0x10(%rax)
jne 0x6d061
cmpb $0x47, 0x11(%rax)
jne 0x6d061
cmpb $0x42, 0x12(%rax)
jne 0x6d061
cmpb $0x20, 0x13(%rax)
jne 0x6d061
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 0x6a038
cmpl $0x0, 0xf0(%rbx)
je 0x6d125
xorl %eax, %eax
leaq 0x5c(%rsp), %rcx
movl %eax, (%rcx)
movq %rcx, %rdi
leaq 0x58(%rsp), %rcx
movl %eax, (%rcx)
movq %rcx, %rsi
leaq 0x54(%rsp), %r10
movl %eax, (%r10)
xorps %xmm0, %xmm0
leaq 0x1a0(%rsp), %rax
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movabsq $0x800000002, %rcx      # imm = 0x800000002
movq %rcx, (%rax)
movl $0x10, 0x4(%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 0x69e87
leaq 0x5c(%rsp), %rax
movl (%rax), %esi
leaq 0x58(%rsp), %rax
movl (%rax), %edx
leaq 0x54(%rsp), %rax
movl (%rax), %ecx
leaq 0x1c8(%rsp), %rdi
callq 0x6d7ba
leaq 0x1c8(%rsp), %rdx
leaq 0x78(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x6d836
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6cf4b
cmpl $0x0, 0xf0(%rbx)
je 0x6d1aa
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 0x69e87
testl %eax, %eax
je 0x6d1aa
movl $0x68, 0x1f0(%rbx)
jmp 0x6cf4b
cmpl $0x0, 0x1a0(%rbx)
je 0x6d224
movq 0x1b0(%rbx), %rdx
movl 0x1b8(%rbx), %esi
xorl %ecx, %ecx
movl $0x0, %eax
cmpl $0x14, %esi
jb 0x6d1e7
cmpb $0x47, 0x10(%rdx)
jne 0x6d1e7
cmpb $0x52, 0x11(%rdx)
jne 0x6d1e7
cmpb $0x41, 0x12(%rdx)
jne 0x6d1e7
xorl %eax, %eax
cmpb $0x59, 0x13(%rdx)
sete %al
cmpl $0x14, %esi
jb 0x6d207
cmpb $0x52, 0x10(%rdx)
jne 0x6d207
cmpb $0x47, 0x11(%rdx)
jne 0x6d207
cmpb $0x42, 0x12(%rdx)
jne 0x6d207
xorl %ecx, %ecx
cmpb $0x20, 0x13(%rdx)
sete %cl
orl %eax, %ecx
je 0x6d584
xorl %ecx, %ecx
testl $0xfffffffb, 0x78(%rsp) # imm = 0xFFFFFFFB
sete %cl
cmpl %ecx, %eax
jne 0x6d66e
leaq 0x38(%rbx), %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x698da
testl %eax, %eax
je 0x6d593
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %r9
movq %r13, %rdx
movl %r12d, %ecx
movl %ebp, %r8d
callq 0x6da46
leaq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x6dfa6
movl 0x70(%rsp), %r9d
movl 0x78(%rsp), %ecx
movl 0x7c(%rsp), %r8d
movq %r13, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x6e0a1
movq 0x170(%rsp), %rsi
testq %rsi, %rsi
je 0x6d2bf
movq 0x188(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0x6e11e
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6cf4b
cmpl $0x0, 0x150(%rsp)
movq 0x30(%rsp), %r12
je 0x6d2e0
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movq %r12, %rdx
callq 0x6e193
cmpl $0x0, 0x148(%rsp)
leaq 0x78(%rsp), %r13
je 0x6d2fe
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e45c
cmpl $0x0, 0x11c(%rsp)
je 0x6d317
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e499
cmpl $0x0, 0x124(%rsp)
je 0x6d330
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6e4d8
cmpl $0x3, 0x78(%rsp)
jne 0x6d344
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6e569
cmpl $0x0, 0x80(%rbx)
je 0x6d366
movl 0x78(%rsp), %eax
andl $-0x5, %eax
cmpl $0x2, %eax
jne 0x6d366
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6e569
cmpl $0x3, 0x78(%rsp)
jne 0x6d393
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x6e660
testl %eax, %eax
je 0x6d393
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6e6fc
testl $0xfffffffd, 0x78(%rsp) # imm = 0xFFFFFFFD
jne 0x6d3b4
cmpl $0x0, 0x90(%rsp)
je 0x6d3b4
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6e6fc
cmpl $0x0, 0xa0(%rsp)
je 0x6d3db
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6ea85
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6cf4b
cmpl $0x0, 0x10c(%rsp)
je 0x6d3f4
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x6eb22
movq 0x178(%rsp), %rsi
testq %rsi, %rsi
je 0x6d421
movq 0x190(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0x6e11e
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6cf4b
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x10(%rsp), %rdi
movq %r12, %rcx
callq 0x6eb77
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6cf4b
cmpl $0x0, 0xf0(%rsp)
je 0x6d462
leaq 0xf4(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x6ec02
movq 0xb0(%rsp), %rax
testq %rax, %rax
movq %r12, %rbp
je 0x6d506
xorl %r13d, %r13d
leaq 0x10(%rsp), %r12
movq 0xb8(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq $-0x1, %rax
cmpb $0x0, 0x1(%rsi,%rax)
leaq 0x1(%rax), %rax
jne 0x6d491
cmpq $0x4f, %rax
ja 0x6d79c
xorl %eax, %eax
cmpb $0x0, (%rsi,%rax)
leaq 0x1(%rax), %rax
jne 0x6d4a8
cmpq $0x1, %rax
je 0x6d7ab
cmpl $0x0, 0x88(%rbx)
je 0x6d4de
movq 0xc0(%rsp), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
movq %rbp, %rcx
callq 0x6ec64
jmp 0x6d4f2
movq 0xc0(%rsp), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0x6ef3a
incq %r13
movq 0xb0(%rsp), %rax
cmpq %rax, %r13
jne 0x6d47e
cmpl $0x0, 0x84(%rbx)
je 0x6d6a1
testq %rax, %rax
je 0x6d689
movq 0xb8(%rsp), %rcx
decq %rax
xorl %edx, %edx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
cmpb $0x4c, (%rdi)
jne 0x6d55e
cmpb $0x6f, 0x1(%rdi)
jne 0x6d55e
cmpb $0x64, 0x2(%rdi)
jne 0x6d55e
cmpb $0x65, 0x3(%rdi)
jne 0x6d55e
cmpb $0x50, 0x4(%rdi)
jne 0x6d55e
cmpb $0x4e, 0x5(%rdi)
jne 0x6d55e
cmpb $0x47, 0x6(%rdi)
jne 0x6d55e
cmpb $0x0, 0x7(%rdi)
je 0x6d57a
xorl %edi, %edi
testb %dil, %dil
jne 0x6d685
leaq 0x1(%rsi), %rdi
cmpq %rsi, %rax
movq %rdi, %rsi
jne 0x6d52b
jmp 0x6d685
movl $0x1, %edx
movb $0x1, %dil
jmp 0x6d560
movl $0x64, 0x1f0(%rbx)
jmp 0x6cf4b
movl %r12d, %eax
movl %ebp, %esi
imulq %rax, %rsi
movl 0x78(%rsp), %edx
movl 0x7c(%rsp), %eax
xorl %ecx, %ecx
cmpq $0x6, %rdx
ja 0x6d5b6
leaq 0x1c8c9(%rip), %rcx     # 0x89e7c
movl (%rcx,%rdx,4), %ecx
imull %eax, %ecx
imulq %rcx, %rsi
addq $0x7, %rsi
movq %rsi, %rdi
movq %rsi, 0x60(%rsp)
shrq $0x3, %rdi
callq 0x3a5a0
movq %rax, %rdx
testq %rax, %rax
setne %al
cmpq $0x8, 0x60(%rsp)
setb %cl
orb %al, %cl
jne 0x6d5f2
movl $0x53, 0x1f0(%rbx)
cmpl $0x0, 0x1f0(%rbx)
movq 0x38(%rsp), %rcx
jne 0x6d622
movq %rdx, %rdi
movq %r13, %rsi
movq %rdx, %r13
leaq 0x78(%rsp), %rdx
movl %r12d, %r8d
movl %ebp, %r9d
callq 0x68c8b
movq %r13, %rdx
movl %eax, 0x1f0(%rbx)
cmpl $0x0, 0x1f0(%rbx)
jne 0x6d654
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %r9
movq %rdx, %r13
movl %r12d, %ecx
movl %ebp, %r8d
callq 0x6da46
movq %r13, %rdx
movq %rdx, %rdi
callq 0x3a530
cmpl $0x0, 0x1f0(%rbx)
jne 0x6cf4b
jmp 0x6d26a
cmpl $0x1, 0x68(%rbx)
movl $0x66, %eax
sbbl $0x0, %eax
movl %eax, 0x1f0(%rbx)
jmp 0x6cf4b
testl %edx, %edx
jne 0x6d6a1
movq 0x381d0(%rip), %rdx     # 0xa5860
leaq 0x1c84e(%rip), %rsi     # 0x89ee5
leaq 0x10(%rsp), %rdi
callq 0x6ef3a
cmpq $0x0, 0xc8(%rsp)
je 0x6d73d
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 0x6d6cb
cmpq $0x4f, %rax
ja 0x6d79c
xorl %eax, %eax
cmpb $0x0, (%rdx,%rax)
leaq 0x1(%rax), %rax
jne 0x6d6e2
cmpq $0x1, %rax
je 0x6d7ab
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 0x6f110
incq %r13
cmpq 0xc8(%rsp), %r13
jne 0x6d6b8
movq 0x180(%rsp), %rsi
testq %rsi, %rsi
je 0x6d76a
movq 0x198(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0x6e11e
movl %eax, 0x1f0(%rbx)
testl %eax, %eax
jne 0x6cf4b
leaq 0x18(%rsp), %rsi
leaq 0x1d95b(%rip), %rcx     # 0x8b0d1
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x68168
testl %eax, %eax
jne 0x6cf4b
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x6cf4b
movl $0x42, 0x1f0(%rbx)
jmp 0x6cf4b
movl $0x43, 0x1f0(%rbx)
jmp 0x6cf4b