// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/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 = ucvector_init(NULL, 0);
  LodePNGInfo info;
  const LodePNGInfo* info_png = &state->info_png;
  LodePNGColorMode auto_color;

  lodepng_info_init(&info);
  lodepng_color_mode_init(&auto_color);

  /*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)) {
    /*this error is returned even if auto_convert is enabled and thus encoder could
    generate the palette by itself: while allowing this could be possible in theory,
    it may complicate the code or edge cases, and always requiring to give a palette
    when setting this color type is a simpler contract*/
    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: invalid btype*/
    goto cleanup;
  }
  if(info_png->interlace_method > 1) {
    state->error = 71; /*error: invalid interlace mode*/
    goto cleanup;
  }
  state->error = checkColorValidity(info_png->color.colortype, info_png->color.bitdepth);
  if(state->error) goto cleanup; /*error: invalid color type given*/
  state->error = checkColorValidity(state->info_raw.colortype, state->info_raw.bitdepth);
  if(state->error) goto cleanup; /*error: invalid color type given*/

  /* color convert and compute scanline filter types */
  lodepng_info_copy(&info, &state->info_png);
  if(state->encoder.auto_convert) {
    LodePNGColorStats stats;
    unsigned allow_convert = 1;
    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 */
    state->error = lodepng_compute_color_stats(&stats, image, w, h, &state->info_raw);
    if(state->error) goto cleanup;
#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);
      state->error = lodepng_color_stats_add(&stats, r, g, b, 65535);
      if(state->error) goto cleanup;
    }
#endif /* LODEPNG_COMPILE_ANCILLARY_CHUNKS */
    state->error = auto_choose_color(&auto_color, &state->info_raw, &stats);
    if(state->error) goto cleanup;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    if(info_png->sbit_defined) {
      /*if sbit is defined, due to strict requirements of which sbit values can be present for which color modes,
      auto_convert can't be done in many cases. However, do support a few cases here.
      TODO: more conversions may be possible, and it may also be possible to get a more appropriate color type out of
            auto_choose_color if knowledge about sbit is used beforehand
      */
      unsigned sbit_max = LODEPNG_MAX(LODEPNG_MAX(LODEPNG_MAX(info_png->sbit_r, info_png->sbit_g),
                           info_png->sbit_b), info_png->sbit_a);
      unsigned equal = (!info_png->sbit_g || info_png->sbit_g == info_png->sbit_r)
                    && (!info_png->sbit_b || info_png->sbit_b == info_png->sbit_r)
                    && (!info_png->sbit_a || info_png->sbit_a == info_png->sbit_r);
      allow_convert = 0;
      if(info.color.colortype == LCT_PALETTE &&
         auto_color.colortype == LCT_PALETTE) {
        /* input and output are palette, and in this case it may happen that palette data is
        expected to be copied from info_raw into the info_png */
        allow_convert = 1;
      }
      /*going from 8-bit RGB to palette (or 16-bit as long as sbit_max <= 8) is possible
      since both are 8-bit RGB for sBIT's purposes*/
      if(info.color.colortype == LCT_RGB &&
         auto_color.colortype == LCT_PALETTE && sbit_max <= 8) {
        allow_convert = 1;
      }
      /*going from 8-bit RGBA to palette is also ok but only if sbit_a is exactly 8*/
      if(info.color.colortype == LCT_RGBA && auto_color.colortype == LCT_PALETTE &&
         info_png->sbit_a == 8 && sbit_max <= 8) {
        allow_convert = 1;
      }
      /*going from 16-bit RGB(A) to 8-bit RGB(A) is ok if all sbit values are <= 8*/
      if((info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA) && info.color.bitdepth == 16 &&
         auto_color.colortype == info.color.colortype && auto_color.bitdepth == 8 &&
         sbit_max <= 8) {
        allow_convert = 1;
      }
      /*going to less channels is ok if all bit values are equal (all possible values in sbit,
        as well as the chosen bitdepth of the result). Due to how auto_convert works,
        we already know that auto_color.colortype has less than or equal amount of channels than
        info.colortype. Palette is not used here. This conversion is not allowed if
        info_png->sbit_r < auto_color.bitdepth, because specifically for alpha, non-presence of
        an sbit value heavily implies that alpha's bit depth is equal to the PNG bit depth (rather
        than the bit depths set in the r, g and b sbit values, by how the PNG specification describes
        handling tRNS chunk case with sBIT), so be conservative here about ignoring user input.*/
      if(info.color.colortype != LCT_PALETTE && auto_color.colortype != LCT_PALETTE &&
         equal && info_png->sbit_r == auto_color.bitdepth) {
        allow_convert = 1;
      }
    }
#endif
    if(state->encoder.force_palette) {
      if(info.color.colortype != LCT_GREY && info.color.colortype != LCT_GREY_ALPHA &&
         (auto_color.colortype == LCT_GREY || auto_color.colortype == LCT_GREY_ALPHA)) {
        /*user speficially forced a PLTE palette, so cannot convert to grayscale types because
        the PNG specification only allows writing a suggested palette in PLTE for truecolor types*/
        allow_convert = 0;
      }
    }
    if(allow_convert) {
      lodepng_color_mode_copy(&info.color, &auto_color);
#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) {
      state->error = preProcessScanlines(&data, &datasize, converted, w, h, &info, &state->encoder);
    }
    lodepng_free(converted);
    if(state->error) goto cleanup;
  } else {
    state->error = preProcessScanlines(&data, &datasize, image, w, h, &info, &state->encoder);
    if(state->error) goto cleanup;
  }

  /* output all PNG chunks */ {
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
    size_t i;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    /*write signature and chunks*/
    state->error = writeSignature(&outv);
    if(state->error) goto cleanup;
    /*IHDR*/
    state->error = addChunk_IHDR(&outv, w, h, info.color.colortype, info.color.bitdepth, info.interlace_method);
    if(state->error) goto cleanup;
#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.cicp_defined) {
      state->error = addChunk_cICP(&outv, &info);
      if(state->error) goto cleanup;
    }
    if(info.mdcv_defined) {
      state->error = addChunk_mDCV(&outv, &info);
      if(state->error) goto cleanup;
    }
    if(info.clli_defined) {
      state->error = addChunk_cLLI(&outv, &info);
      if(state->error) goto cleanup;
    }
    if(info.iccp_defined) {
      state->error = addChunk_iCCP(&outv, &info, &state->encoder.zlibsettings);
      if(state->error) goto cleanup;
    }
    if(info.srgb_defined) {
      state->error = addChunk_sRGB(&outv, &info);
      if(state->error) goto cleanup;
    }
    if(info.gama_defined) {
      state->error = addChunk_gAMA(&outv, &info);
      if(state->error) goto cleanup;
    }
    if(info.chrm_defined) {
      state->error = addChunk_cHRM(&outv, &info);
      if(state->error) goto cleanup;
    }
    if(info_png->sbit_defined) {
      state->error = addChunk_sBIT(&outv, &info);
      if(state->error) goto cleanup;
    }
    if(info.exif_defined) {
      state->error = addChunk_eXIf(&outv, &info);
      if(state->error) goto cleanup;
    }
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    /*PLTE*/
    if(info.color.colortype == LCT_PALETTE) {
      state->error = addChunk_PLTE(&outv, &info.color);
      if(state->error) goto cleanup;
    }
    if(state->encoder.force_palette && (info.color.colortype == LCT_RGB || info.color.colortype == LCT_RGBA)) {
      /*force_palette means: write suggested palette for truecolor in PLTE chunk*/
      state->error = addChunk_PLTE(&outv, &info.color);
      if(state->error) goto cleanup;
    }
    /*tRNS (this will only add if when necessary) */
    state->error = addChunk_tRNS(&outv, &info.color);
    if(state->error) goto cleanup;
#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) {
      state->error = addChunk_pHYs(&outv, &info);
      if(state->error) goto cleanup;
    }

    /*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) {
      state->error = addChunk_tIME(&outv, &info.time);
      if(state->error) goto cleanup;
    }
    /*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) {
        state->error = addChunk_zTXt(&outv, info.text_keys[i], info.text_strings[i], &state->encoder.zlibsettings);
        if(state->error) goto cleanup;
      } else {
        state->error = addChunk_tEXt(&outv, info.text_keys[i], info.text_strings[i]);
        if(state->error) goto cleanup;
      }
    }
    /*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) {
        state->error = addChunk_tEXt(&outv, "LodePNG", LODEPNG_VERSION_STRING); /*it's shorter as tEXt than as zTXt chunk*/
        if(state->error) goto cleanup;
      }
    }
    /*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;
      }
      state->error = 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);
      if(state->error) goto cleanup;
    }

    /*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*/
    state->error = addChunk_IEND(&outv);
    if(state->error) goto cleanup;
  }

cleanup:
  lodepng_info_cleanup(&info);
  lodepng_free(data);
  lodepng_color_mode_cleanup(&auto_color);

  /*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 $0x698, %rsp            # imm = 0x698
movq %r9, %rbx
movl %r8d, %ebp
movl %ecx, %r13d
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movups %xmm0, 0xc0(%rsp)
movabsq $0x800000006, %rcx      # imm = 0x800000006
movq %rcx, 0xa8(%rsp)
movups %xmm0, 0xb0(%rsp)
movl %eax, 0xa0(%rsp)
movq %rax, 0x98(%rsp)
movl %eax, 0x150(%rsp)
movl %eax, 0x160(%rsp)
movl %eax, 0x168(%rsp)
movl %eax, 0x18c(%rsp)
movups %xmm0, 0xd0(%rsp)
movups %xmm0, 0xe0(%rsp)
movups %xmm0, 0xf0(%rsp)
movups %xmm0, 0x100(%rsp)
movups %xmm0, 0x110(%rsp)
movl %eax, 0x120(%rsp)
movups %xmm0, 0x128(%rsp)
movups %xmm0, 0x194(%rsp)
movl %eax, 0x1a4(%rsp)
movups %xmm0, 0x1fc(%rsp)
movups %xmm0, 0x1ec(%rsp)
movups %xmm0, 0x1dc(%rsp)
movups %xmm0, 0x1cc(%rsp)
movups %xmm0, 0x1bc(%rsp)
movups %xmm0, 0x1ac(%rsp)
movups %xmm0, 0x210(%rsp)
movups %xmm0, 0x220(%rsp)
movups %xmm0, 0x230(%rsp)
movups %xmm0, 0x88(%rsp)
movq %rcx, 0x70(%rsp)
movups %xmm0, 0x78(%rsp)
movq %rax, (%rdi)
movq %rax, (%rsi)
movl %eax, 0x278(%r9)
movl 0xe0(%r9), %edi
cmpl $0x3, %edi
je 0xa90d
cmpl $0x0, 0x98(%rbx)
je 0xa92f
movq $-0x101, %rax           # imm = 0xFEFF
movq 0xf0(%rbx), %rcx
addq %rax, %rcx
cmpq %rax, %rcx
ja 0xa92f
movl $0x44, 0x278(%rbx)
jmp 0xa986
cmpl $0x3, 0x50(%rbx)
jb 0xa941
movl $0x3d, 0x278(%rbx)
jmp 0xa986
cmpl $0x2, 0xd8(%rbx)
jb 0xa956
movl $0x47, 0x278(%rbx)
jmp 0xa986
movl 0xe4(%rbx), %esi
callq 0x7f52
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
movl 0xa8(%rbx), %edi
movl 0xac(%rbx), %esi
callq 0x7f52
movl %eax, 0x278(%rbx)
testl %eax, %eax
je 0xa9e0
leaq 0x78(%rsp), %r12
leaq 0x98(%rsp), %rdi
callq 0x5b91
movq 0x50(%rsp), %rdi
callq 0x2290
movq (%r12), %rdi
testq %rdi, %rdi
je 0xa9b0
callq 0x2290
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movq 0x10(%rsp), %rax
movq %rax, (%r15)
movq 0x18(%rsp), %rax
movq %rax, (%r14)
movl 0x278(%rbx), %eax
addq $0x698, %rsp            # imm = 0x698
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd0(%rbx), %rsi
leaq 0xa8(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x5c37
cmpl $0x0, 0x80(%rbx)
je 0xad81
xorl %eax, %eax
movq %rax, 0x278(%rsp)
movq %rax, 0x268(%rsp)
movq %rax, 0x26e(%rsp)
movl $0x1, 0x680(%rsp)
movq %rax, 0x688(%rsp)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x690(%rsp)
movl 0x1cc(%rbx), %eax
testl %eax, %eax
je 0xaac0
cmpl $0x14, 0x1e0(%rbx)
jb 0xaa89
movq 0x1d8(%rbx), %rcx
cmpb $0x47, 0x10(%rcx)
jne 0xaa89
cmpb $0x52, 0x11(%rcx)
jne 0xaa89
cmpb $0x41, 0x12(%rcx)
jne 0xaa89
cmpb $0x59, 0x13(%rcx)
jne 0xaa89
movl $0x0, 0x690(%rsp)
testl %eax, %eax
je 0xaac0
cmpl $0x14, 0x1e0(%rbx)
jb 0xaac0
movq 0x1d8(%rbx), %rax
cmpb $0x52, 0x10(%rax)
jne 0xaac0
cmpb $0x47, 0x11(%rax)
jne 0xaac0
cmpb $0x42, 0x12(%rax)
jne 0xaac0
cmpb $0x20, 0x13(%rax)
jne 0xaac0
movl $0x0, 0x694(%rsp)
leaq 0x268(%rsp), %rdi
movq %r12, %rsi
movl %r13d, %edx
movl %ebp, %ecx
movq 0x48(%rsp), %r8
callq 0x72be
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
leaq 0xe0(%rbx), %r10
cmpl $0x0, 0x108(%rbx)
movq %r10, 0x38(%rsp)
je 0xab9a
xorl %eax, %eax
leaq 0x6c(%rsp), %rcx
movl %eax, (%rcx)
movq %rcx, %rdi
leaq 0x68(%rsp), %rcx
movl %eax, (%rcx)
movq %rcx, %rsi
leaq 0x64(%rsp), %rcx
movl %eax, (%rcx)
movq %rcx, %rdx
xorps %xmm0, %xmm0
leaq 0x240(%rsp), %rax
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movabsq $0x800000002, %rcx      # imm = 0x800000002
movq %rcx, (%rax)
movl $0x10, 0x4(%rax)
movl 0x10c(%rbx), %ecx
movl 0x110(%rbx), %r8d
movl 0x114(%rbx), %r9d
movq %r10, 0x8(%rsp)
movq %rax, (%rsp)
callq 0x710d
leaq 0x6c(%rsp), %rax
movl (%rax), %esi
leaq 0x68(%rsp), %rax
movl (%rax), %edx
leaq 0x64(%rsp), %rax
movl (%rax), %ecx
leaq 0x268(%rsp), %rdi
callq 0xb594
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
leaq 0x70(%rsp), %rdi
leaq 0x268(%rsp), %rdx
movq 0x48(%rsp), %rsi
callq 0xb615
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x230(%rbx)
je 0xace3
movl 0x234(%rbx), %eax
movl 0x238(%rbx), %edi
cmpl %edi, %eax
movl %edi, %ecx
cmoval %eax, %ecx
movl 0x23c(%rbx), %edx
cmpl %edx, %ecx
cmovbel %edx, %ecx
movl 0x240(%rbx), %esi
cmpl %esi, %ecx
cmovbel %esi, %ecx
testl %edi, %edi
setne %r8b
cmpl %eax, %edi
setne %dil
testb %dil, %r8b
movl %eax, 0x44(%rsp)
jne 0xac2e
testl %edx, %edx
setne %dil
cmpl %eax, %edx
setne %dl
testb %dl, %dil
jne 0xac2e
testl %esi, %esi
sete %dil
cmpl %eax, %esi
sete %al
orb %dil, %al
movl %eax, 0x30(%rsp)
jmp 0xac36
movl $0x0, 0x30(%rsp)
movl 0xa8(%rsp), %edi
cmpl $0x3, %edi
sete %r9b
movl 0x70(%rsp), %r8d
cmpl $0x3, %r8d
sete %r10b
andb %r10b, %r9b
cmpl $0x2, %edi
sete %r11b
andb %r10b, %r11b
cmpl $0x9, %ecx
setb %dl
andb %dl, %r11b
cmpl $0x6, %edi
sete %al
andb %r10b, %al
cmpl $0x8, %esi
sete %sil
andb %dl, %sil
andb %al, %sil
orb %r9b, %r11b
orb %sil, %r11b
movzbl %r11b, %esi
movl %edi, %eax
andl $-0x5, %eax
cmpl $0x2, %eax
jne 0xacb7
cmpl $0x10, 0xac(%rsp)
jne 0xacb7
movl %r8d, %eax
xorl %edi, %eax
movl 0x74(%rsp), %edx
xorl $0x8, %edx
orl %eax, %edx
movl $0x1, %eax
cmovnel %esi, %eax
cmpl $0x9, %ecx
cmovbl %eax, %esi
movl 0x30(%rsp), %edx
cmpl $0x3, %edi
setne %al
cmpl $0x3, %r8d
setne %cl
andb %al, %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0xace8
movl 0x44(%rsp), %eax
cmpl 0x74(%rsp), %eax
movl $0x1, %eax
cmovel %eax, %esi
jmp 0xace8
movl $0x1, %esi
cmpl $0x0, 0x98(%rbx)
je 0xad08
testl $0xfffffffb, 0xa8(%rsp) # imm = 0xFFFFFFFB
je 0xad08
movl 0x70(%rsp), %eax
andl $-0x5, %eax
cmovel %eax, %esi
testl %esi, %esi
je 0xad81
leaq 0x70(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x52e4
cmpl $0x0, 0x108(%rbx)
je 0xad81
leaq 0xd4(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0xdc(%rsp), %rdx
movl 0x10c(%rbx), %ecx
movl 0x110(%rbx), %r8d
movl 0x114(%rbx), %r9d
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xa8(%rsp), %rax
movq %rax, (%rsp)
callq 0x710d
testl %eax, %eax
je 0xad81
movl $0x68, 0x278(%rbx)
jmp 0xa986
cmpl $0x0, 0x1cc(%rbx)
je 0xadfa
movq 0x1d8(%rbx), %rdx
movl 0x1e0(%rbx), %esi
xorl %ecx, %ecx
movl $0x0, %eax
cmpl $0x14, %esi
jb 0xadbe
cmpb $0x47, 0x10(%rdx)
jne 0xadbe
cmpb $0x52, 0x11(%rdx)
jne 0xadbe
cmpb $0x41, 0x12(%rdx)
jne 0xadbe
xorl %eax, %eax
cmpb $0x59, 0x13(%rdx)
sete %al
cmpl $0x14, %esi
jb 0xadde
cmpb $0x52, 0x10(%rdx)
jne 0xadde
cmpb $0x47, 0x11(%rdx)
jne 0xadde
cmpb $0x42, 0x12(%rdx)
jne 0xadde
xorl %ecx, %ecx
cmpb $0x20, 0x13(%rdx)
sete %cl
orl %eax, %ecx
je 0xae55
xorl %ecx, %ecx
testl $0xfffffffb, 0xa8(%rsp) # imm = 0xFFFFFFFB
sete %cl
cmpl %ecx, %eax
jne 0xb42d
leaq 0x50(%rbx), %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x645b
testl %eax, %eax
je 0xae64
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x98(%rsp), %r9
movq %r12, %rdx
movl %r13d, %ecx
movl %ebp, %r8d
callq 0xb825
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
jmp 0xaf4c
movl $0x64, 0x278(%rbx)
jmp 0xa986
movl %r13d, %eax
movl %ebp, %ecx
imulq %rax, %rcx
movq %rcx, 0x30(%rsp)
movl 0xa8(%rsp), %edi
movl 0xac(%rsp), %eax
movl %eax, 0x44(%rsp)
callq 0x5468
imull 0x44(%rsp), %eax
imulq 0x30(%rsp), %rax
addq $0x7, %rax
movq %rax, 0x30(%rsp)
movq %rax, %rdi
shrq $0x3, %rdi
callq 0x22a0
movq %rax, %rdx
testq %rax, %rax
setne %al
cmpq $0x8, 0x30(%rsp)
setb %cl
orb %al, %cl
jne 0xaec9
movl $0x53, 0x278(%rbx)
cmpl $0x0, 0x278(%rbx)
movq 0x48(%rsp), %rcx
jne 0xaefc
movq %rdx, %rdi
movq %r12, %rsi
movq %rdx, %r12
leaq 0xa8(%rsp), %rdx
movl %r13d, %r8d
movl %ebp, %r9d
callq 0x5e9a
movq %r12, %rdx
movl %eax, 0x278(%rbx)
cmpl $0x0, 0x278(%rbx)
jne 0xaf37
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x98(%rsp), %r9
movq %rdx, %r12
movl %r13d, %ecx
movl %ebp, %r8d
callq 0xb825
movq %r12, %rdx
movl %eax, 0x278(%rbx)
movq %rdx, %rdi
callq 0x2290
cmpl $0x0, 0x278(%rbx)
jne 0xa986
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %r12
leaq 0x8(%rdx), %rax
movq %rax, 0x18(%rsp)
cmpq %rax, %r12
jae 0xaf94
movq %rdx, 0x48(%rsp)
shrq %r12
addq %rax, %r12
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x2350
testq %rax, %rax
je 0xb447
movq %r12, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rdx
leaq 0x10(%rsp), %rdi
movq (%rdi), %rax
movabsq $0xa1a0a0d474e5089, %rcx # imm = 0xA1A0A0D474E5089
movq %rcx, (%rax,%rdx)
movl $0x0, 0x278(%rbx)
movl 0xa0(%rsp), %r9d
movl 0xa8(%rsp), %ecx
movl 0xac(%rsp), %r8d
movl %r13d, %esi
movl %ebp, %edx
callq 0xbda6
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
movq 0x210(%rsp), %rsi
testq %rsi, %rsi
je 0xb010
movq 0x228(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0xbe38
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x1ac(%rsp)
je 0xb03a
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xbead
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x1c0(%rsp)
je 0xb064
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xbf3d
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x1ec(%rsp)
je 0xb08e
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xc0a3
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x194(%rsp)
je 0xb0bd
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0xc0f0
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x18c(%rsp)
je 0xb0fc
movb 0x190(%rsp), %al
leaq 0x268(%rsp), %rcx
movb %al, (%rcx)
leaq 0x696ab(%rip), %rdx     # 0x7478a
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x523c
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x160(%rsp)
je 0xb126
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xc1e5
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x168(%rsp)
je 0xb150
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xc227
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x230(%rbx)
je 0xb179
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xc2b6
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x120(%rsp)
je 0xb1b1
movl 0x130(%rsp), %esi
movq 0x128(%rsp), %rcx
leaq 0x6960a(%rip), %rdx     # 0x747a3
leaq 0x10(%rsp), %rdi
callq 0x523c
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x3, 0xa8(%rsp)
jne 0xb1db
leaq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xc4bf
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x98(%rbx)
je 0xb213
movl 0xa8(%rsp), %eax
andl $-0x5, %eax
cmpl $0x2, %eax
jne 0xb213
leaq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xc4bf
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
leaq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xc54c
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0xd0(%rsp)
je 0xb25d
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xc684
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x150(%rsp)
je 0xb287
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xc75d
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
movq 0x218(%rsp), %rsi
testq %rsi, %rsi
je 0xb2b4
movq 0x230(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0xbe38
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x10(%rsp), %rdi
movq 0x38(%rsp), %rcx
callq 0xc7b3
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpl $0x0, 0x134(%rsp)
je 0xb305
leaq 0x138(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0xc859
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
movq 0xe0(%rsp), %rax
testq %rax, %rax
je 0xb3b6
xorl %r13d, %r13d
leaq 0x10(%rsp), %r12
movq 0xe8(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq $-0x1, %rax
cmpb $0x0, 0x1(%rsi,%rax)
leaq 0x1(%rax), %rax
jne 0xb331
cmpq $0x4f, %rax
ja 0xb576
xorl %eax, %eax
cmpb $0x0, (%rsi,%rax)
leaq 0x1(%rax), %rax
jne 0xb348
cmpq $0x1, %rax
je 0xb585
cmpl $0x0, 0xa0(%rbx)
je 0xb380
movq 0xf0(%rsp), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
movq 0x38(%rsp), %rcx
callq 0xc8b9
jmp 0xb394
movq 0xf0(%rsp), %rax
movq (%rax,%r13,8), %rdx
movq %r12, %rdi
callq 0xc9a8
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
incq %r13
movq 0xe0(%rsp), %rax
cmpq %rax, %r13
jne 0xb31e
cmpl $0x0, 0x9c(%rbx)
je 0xb480
testq %rax, %rax
je 0xb45a
movq 0xe8(%rsp), %rcx
decq %rax
xorl %edx, %edx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
cmpb $0x4c, (%rdi)
jne 0xb40e
cmpb $0x6f, 0x1(%rdi)
jne 0xb40e
cmpb $0x64, 0x2(%rdi)
jne 0xb40e
cmpb $0x65, 0x3(%rdi)
jne 0xb40e
cmpb $0x50, 0x4(%rdi)
jne 0xb40e
cmpb $0x4e, 0x5(%rdi)
jne 0xb40e
cmpb $0x47, 0x6(%rdi)
jne 0xb40e
cmpb $0x0, 0x7(%rdi)
je 0xb423
xorl %edi, %edi
testb %dil, %dil
jne 0xb456
leaq 0x1(%rsi), %rdi
cmpq %rsi, %rax
movq %rdi, %rsi
jne 0xb3db
jmp 0xb456
movl $0x1, %edx
movb $0x1, %dil
jmp 0xb410
cmpl $0x1, 0x80(%rbx)
movl $0x66, %eax
sbbl $0x0, %eax
movl %eax, 0x278(%rbx)
jmp 0xa986
movl $0x53, 0x278(%rbx)
jmp 0xa986
testl %edx, %edx
jne 0xb480
movq 0xa8da7(%rip), %rdx     # 0xb4208
leaq 0x69345(%rip), %rsi     # 0x747ad
leaq 0x10(%rsp), %rdi
callq 0xc9a8
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
cmpq $0x0, 0xf8(%rsp)
je 0xb52f
xorl %r13d, %r13d
leaq 0x10(%rsp), %r12
movq 0x100(%rsp), %rax
movq (%rax,%r13,8), %rdx
movq $-0x1, %rax
cmpb $0x0, 0x1(%rdx,%rax)
leaq 0x1(%rax), %rax
jne 0xb4aa
cmpq $0x4f, %rax
ja 0xb576
xorl %eax, %eax
cmpb $0x0, (%rdx,%rax)
leaq 0x1(%rax), %rax
jne 0xb4c1
cmpq $0x1, %rax
je 0xb585
movl 0xa0(%rbx), %esi
movq 0x108(%rsp), %rax
movq 0x110(%rsp), %rdi
movq (%rax,%r13,8), %rcx
movq (%rdi,%r13,8), %r8
movq 0x118(%rsp), %rax
movq (%rax,%r13,8), %r9
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
callq 0xca67
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
incq %r13
cmpq 0xf8(%rsp), %r13
jne 0xb497
movq 0x220(%rsp), %rsi
testq %rsi, %rsi
je 0xb55c
movq 0x238(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0xbe38
movl %eax, 0x278(%rbx)
testl %eax, %eax
jne 0xa986
leaq 0x6ba19(%rip), %rdx     # 0x76f7c
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x523c
jmp 0xb43c
movl $0x42, 0x278(%rbx)
jmp 0xa986
movl $0x43, 0x278(%rbx)
jmp 0xa986