// File: lvandeve[P]lodepng/lodepng.cpp
// Function: decodeGeneric(unsigned char**, unsigned int*, unsigned int*, LodePNGState*, unsigned char const*, unsigned long)
static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h,
                          LodePNGState* state,
                          const unsigned char* in, size_t insize) {
  unsigned char IEND = 0;
  const unsigned char* chunk; /*points to beginning of next chunk*/
  unsigned char* idat; /*the data from idat chunks, zlib compressed*/
  size_t idatsize = 0;
  unsigned char* scanlines = 0;
  size_t scanlines_size = 0, expected_size = 0;
  size_t outsize = 0;

  /*for unknown chunk order*/
  unsigned unknown = 0;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  unsigned critical_pos = 1; /*1 = after IHDR, 2 = after PLTE, 3 = after IDAT*/
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/


  /* safe output values in case error happens */
  *out = 0;
  *w = *h = 0;

  state->error = lodepng_inspect(w, h, state, in, insize); /*reads header and resets other parameters in state->info_png*/
  if(state->error) return;

  if(lodepng_pixel_overflow(*w, *h, &state->info_png.color, &state->info_raw)) {
    CERROR_RETURN(state->error, 92); /*overflow possible due to amount of pixels*/
  }

  /*the input filesize is a safe upper bound for the sum of idat chunks size*/
  idat = (unsigned char*)lodepng_malloc(insize);
  if(!idat) CERROR_RETURN(state->error, 83); /*alloc fail*/

  chunk = &in[33]; /*first byte of the first chunk after the header*/

  /*loop through the chunks, ignoring unknown chunks and stopping at IEND chunk.
  IDAT data is put at the start of the in buffer*/
  while(!IEND && !state->error) {
    unsigned chunkLength;
    const unsigned char* data; /*the data in the chunk*/
    size_t pos = (size_t)(chunk - in);

    /*error: next chunk out of bounds of the in buffer*/
    if(chunk < in || pos + 12 > insize) {
      if(state->decoder.ignore_end) break; /*other errors may still happen though*/
      CERROR_BREAK(state->error, 30);
    }

    /*length of the data of the chunk, excluding the 12 bytes for length, chunk type and CRC*/
    chunkLength = lodepng_chunk_length(chunk);
    /*error: chunk length larger than the max PNG chunk size*/
    if(chunkLength > 2147483647) {
      if(state->decoder.ignore_end) break; /*other errors may still happen though*/
      CERROR_BREAK(state->error, 63);
    }

    if(pos + (size_t)chunkLength + 12 > insize || pos + (size_t)chunkLength + 12 < pos) {
      CERROR_BREAK(state->error, 64); /*error: size of the in buffer too small to contain next chunk (or int overflow)*/
    }

    data = lodepng_chunk_data_const(chunk);

    unknown = 0;

    /*IDAT chunk, containing compressed image data*/
    if(lodepng_chunk_type_equals(chunk, "IDAT")) {
      size_t newsize;
      if(lodepng_addofl(idatsize, chunkLength, &newsize)) CERROR_BREAK(state->error, 95);
      if(newsize > insize) CERROR_BREAK(state->error, 95);
      lodepng_memcpy(idat + idatsize, data, chunkLength);
      idatsize += chunkLength;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
      critical_pos = 3;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    } else if(lodepng_chunk_type_equals(chunk, "IEND")) {
      /*IEND chunk*/
      IEND = 1;
    } else if(lodepng_chunk_type_equals(chunk, "PLTE")) {
      /*palette chunk (PLTE)*/
      state->error = readChunk_PLTE(&state->info_png.color, data, chunkLength);
      if(state->error) break;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
      critical_pos = 2;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    } else if(lodepng_chunk_type_equals(chunk, "tRNS")) {
      /*palette transparency chunk (tRNS). Even though this one is an ancillary chunk , it is still compiled
      in without 'LODEPNG_COMPILE_ANCILLARY_CHUNKS' because it contains essential color information that
      affects the alpha channel of pixels. */
      state->error = readChunk_tRNS(&state->info_png.color, data, chunkLength);
      if(state->error) break;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
      /*background color chunk (bKGD)*/
    } else if(lodepng_chunk_type_equals(chunk, "bKGD")) {
      state->error = readChunk_bKGD(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "tEXt")) {
      /*text chunk (tEXt)*/
      if(state->decoder.read_text_chunks) {
        state->error = readChunk_tEXt(&state->info_png, data, chunkLength);
        if(state->error) break;
      }
    } else if(lodepng_chunk_type_equals(chunk, "zTXt")) {
      /*compressed text chunk (zTXt)*/
      if(state->decoder.read_text_chunks) {
        state->error = readChunk_zTXt(&state->info_png, &state->decoder, data, chunkLength);
        if(state->error) break;
      }
    } else if(lodepng_chunk_type_equals(chunk, "iTXt")) {
      /*international text chunk (iTXt)*/
      if(state->decoder.read_text_chunks) {
        state->error = readChunk_iTXt(&state->info_png, &state->decoder, data, chunkLength);
        if(state->error) break;
      }
    } else if(lodepng_chunk_type_equals(chunk, "tIME")) {
      state->error = readChunk_tIME(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "pHYs")) {
      state->error = readChunk_pHYs(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "gAMA")) {
      state->error = readChunk_gAMA(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "cHRM")) {
      state->error = readChunk_cHRM(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "sRGB")) {
      state->error = readChunk_sRGB(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "iCCP")) {
      state->error = readChunk_iCCP(&state->info_png, &state->decoder, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "cICP")) {
      state->error = readChunk_cICP(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "mDCV")) {
      state->error = readChunk_mDCV(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "cLLI")) {
      state->error = readChunk_cLLI(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "eXIf")) {
      state->error = readChunk_eXIf(&state->info_png, data, chunkLength);
      if(state->error) break;
    } else if(lodepng_chunk_type_equals(chunk, "sBIT")) {
      state->error = readChunk_sBIT(&state->info_png, data, chunkLength);
      if(state->error) break;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    } else /*it's not an implemented chunk type, so ignore it: skip over the data*/ {
      if(!lodepng_chunk_type_name_valid(chunk)) {
        CERROR_BREAK(state->error, 121); /* invalid chunk type name */
      }
      if(lodepng_chunk_reserved(chunk)) {
        CERROR_BREAK(state->error, 122); /* invalid third lowercase character */
      }

      /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/
      if(!state->decoder.ignore_critical && !lodepng_chunk_ancillary(chunk)) {
        CERROR_BREAK(state->error, 69);
      }

      unknown = 1;
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
      if(state->decoder.remember_unknown_chunks) {
        state->error = lodepng_chunk_append(&state->info_png.unknown_chunks_data[critical_pos - 1],
                                            &state->info_png.unknown_chunks_size[critical_pos - 1], chunk);
        if(state->error) break;
      }
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    }

    if(!state->decoder.ignore_crc && !unknown) /*check CRC if wanted, only on known chunk types*/ {
      if(lodepng_chunk_check_crc(chunk)) CERROR_BREAK(state->error, 57); /*invalid CRC*/
    }

    if(!IEND) chunk = lodepng_chunk_next_const(chunk, in + insize);
  }

  if(!state->error && state->info_png.color.colortype == LCT_PALETTE && !state->info_png.color.palette) {
    state->error = 106; /* error: PNG file must have PLTE chunk if color type is palette */
  }

  if(!state->error) {
    /*predict output size, to allocate exact size for output buffer to avoid more dynamic allocation.
    If the decompressed size does not match the prediction, the image must be corrupt.*/
    if(state->info_png.interlace_method == 0) {
      unsigned bpp = lodepng_get_bpp(&state->info_png.color);
      expected_size = lodepng_get_raw_size_idat(*w, *h, bpp);
    } else {
      unsigned bpp = lodepng_get_bpp(&state->info_png.color);
      /*Adam-7 interlaced: expected size is the sum of the 7 sub-images sizes*/
      expected_size = 0;
      expected_size += lodepng_get_raw_size_idat((*w + 7) >> 3, (*h + 7) >> 3, bpp);
      if(*w > 4) expected_size += lodepng_get_raw_size_idat((*w + 3) >> 3, (*h + 7) >> 3, bpp);
      expected_size += lodepng_get_raw_size_idat((*w + 3) >> 2, (*h + 3) >> 3, bpp);
      if(*w > 2) expected_size += lodepng_get_raw_size_idat((*w + 1) >> 2, (*h + 3) >> 2, bpp);
      expected_size += lodepng_get_raw_size_idat((*w + 1) >> 1, (*h + 1) >> 2, bpp);
      if(*w > 1) expected_size += lodepng_get_raw_size_idat((*w + 0) >> 1, (*h + 1) >> 1, bpp);
      expected_size += lodepng_get_raw_size_idat((*w + 0), (*h + 0) >> 1, bpp);
    }

    state->error = zlib_decompress(&scanlines, &scanlines_size, expected_size, idat, idatsize, &state->decoder.zlibsettings);
  }
  if(!state->error && scanlines_size != expected_size) state->error = 91; /*decompressed size doesn't match prediction*/
  lodepng_free(idat);

  if(!state->error) {
    outsize = lodepng_get_raw_size(*w, *h, &state->info_png.color);
    *out = (unsigned char*)lodepng_malloc(outsize);
    if(!*out) state->error = 83; /*alloc fail*/
  }
  if(!state->error) {
    lodepng_memset(*out, 0, outsize);
    state->error = postProcessScanlines(*out, scanlines, *w, *h, &state->info_png);
  }
  lodepng_free(scanlines);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movl $0x1, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0xa1d0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xc5a3
jmp 0xd1f7
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x20(%rbp), %rdx
addq $0xd0, %rdx
addq $0x10, %rdx
movq -0x20(%rbp), %rcx
addq $0xa8, %rcx
callq 0x16b30
cmpl $0x0, %eax
je 0xc5e6
movq -0x20(%rbp), %rax
movl $0x5c, 0x278(%rax)
jmp 0xd1f7
movq -0x30(%rbp), %rdi
callq 0x3bc0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xc60d
movq -0x20(%rbp), %rax
movl $0x53, 0x278(%rax)
jmp 0xd1f7
movq -0x28(%rbp), %rax
addq $0x21, %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
cmpb $0x0, -0x31(%rbp)
movb %al, -0xa1(%rbp)
jne 0xc63d
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0xc64c
jmp 0xcef6
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0xc679
movq -0x90(%rbp), %rax
addq $0xc, %rax
cmpq -0x30(%rbp), %rax
jbe 0xc69b
movq -0x20(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0xc688
jmp 0xcef6
movq -0x20(%rbp), %rax
movl $0x1e, 0x278(%rax)
jmp 0xcef6
movq -0x40(%rbp), %rdi
callq 0x4d80
movl %eax, -0x7c(%rbp)
cmpl $0x7fffffff, -0x7c(%rbp) # imm = 0x7FFFFFFF
jbe 0xc6d2
movq -0x20(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0xc6bf
jmp 0xcef6
movq -0x20(%rbp), %rax
movl $0x3f, 0x278(%rax)
jmp 0xcef6
movq -0x90(%rbp), %rax
movl -0x7c(%rbp), %ecx
addq %rcx, %rax
addq $0xc, %rax
cmpq -0x30(%rbp), %rax
ja 0xc703
movq -0x90(%rbp), %rax
movl -0x7c(%rbp), %ecx
addq %rcx, %rax
addq $0xc, %rax
cmpq -0x90(%rbp), %rax
jae 0xc716
movq -0x20(%rbp), %rax
movl $0x40, 0x278(%rax)
jmp 0xcef6
movq -0x40(%rbp), %rdi
callq 0x4f90
movq %rax, -0x88(%rbp)
movl $0x0, -0x74(%rbp)
movq -0x40(%rbp), %rdi
leaq 0xa6272(%rip), %rsi     # 0xb29aa
callq 0x4e30
cmpb $0x0, %al
je 0xc7be
movq -0x50(%rbp), %rdi
movl -0x7c(%rbp), %eax
movl %eax, %esi
leaq -0x98(%rbp), %rdx
callq 0x5180
cmpl $0x0, %eax
je 0xc76e
movq -0x20(%rbp), %rax
movl $0x5f, 0x278(%rax)
jmp 0xcef6
movq -0x98(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0xc78e
movq -0x20(%rbp), %rax
movl $0x5f, 0x278(%rax)
jmp 0xcef6
movq -0x48(%rbp), %rdi
addq -0x50(%rbp), %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0x5820
movl -0x7c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x3, -0x78(%rbp)
jmp 0xcea6
movq -0x40(%rbp), %rdi
leaq 0xa7771(%rip), %rsi     # 0xb3f3a
callq 0x4e30
cmpb $0x0, %al
je 0xc7db
movb $0x1, -0x31(%rbp)
jmp 0xcea4
movq -0x40(%rbp), %rdi
leaq 0xa4d7a(%rip), %rsi     # 0xb1560
callq 0x4e30
cmpb $0x0, %al
je 0xc839
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
addq $0x10, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xaa90
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xc82d
jmp 0xcef6
movl $0x2, -0x78(%rbp)
jmp 0xcea2
movq -0x40(%rbp), %rdi
leaq 0xa4d21(%rip), %rsi     # 0xb1565
callq 0x4e30
cmpb $0x0, %al
je 0xc890
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
addq $0x10, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xabf0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xc88b
jmp 0xcef6
jmp 0xcea0
movq -0x40(%rbp), %rdi
leaq 0xa4ccf(%rip), %rsi     # 0xb156a
callq 0x4e30
cmpb $0x0, %al
je 0xc8e3
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xad50
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xc8de
jmp 0xcef6
jmp 0xce9e
movq -0x40(%rbp), %rdi
leaq 0xa4c81(%rip), %rsi     # 0xb156f
callq 0x4e30
cmpb $0x0, %al
je 0xc942
movq -0x20(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xc93d
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xaec0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xc93b
jmp 0xcef6
jmp 0xc93d
jmp 0xce9c
movq -0x40(%rbp), %rdi
leaq 0xa4c27(%rip), %rsi     # 0xb1574
callq 0x4e30
cmpb $0x0, %al
je 0xc9a5
movq -0x20(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xc9a0
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x20(%rbp), %rsi
movq -0x88(%rbp), %rdx
movl -0x7c(%rbp), %eax
movl %eax, %ecx
callq 0xb040
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xc99e
jmp 0xcef6
jmp 0xc9a0
jmp 0xce9a
movq -0x40(%rbp), %rdi
leaq 0xa4bc9(%rip), %rsi     # 0xb1579
callq 0x4e30
cmpb $0x0, %al
je 0xca08
movq -0x20(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xca03
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x20(%rbp), %rsi
movq -0x88(%rbp), %rdx
movl -0x7c(%rbp), %eax
movl %eax, %ecx
callq 0xb230
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xca01
jmp 0xcef6
jmp 0xca03
jmp 0xce98
movq -0x40(%rbp), %rdi
leaq 0xa4b6b(%rip), %rsi     # 0xb157e
callq 0x4e30
cmpb $0x0, %al
je 0xca5b
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xb620
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xca56
jmp 0xcef6
jmp 0xce96
movq -0x40(%rbp), %rdi
leaq 0xa4b1d(%rip), %rsi     # 0xb1583
callq 0x4e30
cmpb $0x0, %al
je 0xcaae
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xb6e0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcaa9
jmp 0xcef6
jmp 0xce94
movq -0x40(%rbp), %rdi
leaq 0xa4acf(%rip), %rsi     # 0xb1588
callq 0x4e30
cmpb $0x0, %al
je 0xcb01
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xb7a0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcafc
jmp 0xcef6
jmp 0xce92
movq -0x40(%rbp), %rdi
leaq 0xa4a81(%rip), %rsi     # 0xb158d
callq 0x4e30
cmpb $0x0, %al
je 0xcb54
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xb820
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcb4f
jmp 0xcef6
jmp 0xce90
movq -0x40(%rbp), %rdi
leaq 0xa4a33(%rip), %rsi     # 0xb1592
callq 0x4e30
cmpb $0x0, %al
je 0xcba7
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xba30
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcba2
jmp 0xcef6
jmp 0xce8e
movq -0x40(%rbp), %rdi
leaq 0xa49e5(%rip), %rsi     # 0xb1597
callq 0x4e30
cmpb $0x0, %al
je 0xcbfe
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x20(%rbp), %rsi
movq -0x88(%rbp), %rdx
movl -0x7c(%rbp), %eax
movl %eax, %ecx
callq 0xba80
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcbf9
jmp 0xcef6
jmp 0xce8c
movq -0x40(%rbp), %rdi
leaq 0xa4993(%rip), %rsi     # 0xb159c
callq 0x4e30
cmpb $0x0, %al
je 0xcc51
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xbcb0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcc4c
jmp 0xcef6
jmp 0xce8a
movq -0x40(%rbp), %rdi
leaq 0xa4945(%rip), %rsi     # 0xb15a1
callq 0x4e30
cmpb $0x0, %al
je 0xcca4
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xbd40
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcc9f
jmp 0xcef6
jmp 0xce88
movq -0x40(%rbp), %rdi
leaq 0xa48f7(%rip), %rsi     # 0xb15a6
callq 0x4e30
cmpb $0x0, %al
je 0xccf7
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xbef0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xccf2
jmp 0xcef6
jmp 0xce86
movq -0x40(%rbp), %rdi
leaq 0xa48a9(%rip), %rsi     # 0xb15ab
callq 0x4e30
cmpb $0x0, %al
je 0xcd4a
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xbfa0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcd45
jmp 0xcef6
jmp 0xce84
movq -0x40(%rbp), %rdi
leaq 0xa485b(%rip), %rsi     # 0xb15b0
callq 0x4e30
cmpb $0x0, %al
je 0xcd9d
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
movq -0x88(%rbp), %rsi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0xbfd0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xcd98
jmp 0xcef6
jmp 0xce82
movq -0x40(%rbp), %rdi
callq 0x5500
cmpb $0x0, %al
jne 0xcdbd
movq -0x20(%rbp), %rax
movl $0x79, 0x278(%rax)
jmp 0xcef6
movq -0x40(%rbp), %rdi
callq 0x5570
cmpb $0x0, %al
je 0xcddd
movq -0x20(%rbp), %rax
movl $0x7a, 0x278(%rax)
jmp 0xcef6
movq -0x20(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
jne 0xce07
movq -0x40(%rbp), %rdi
callq 0x4f10
cmpb $0x0, %al
jne 0xce07
movq -0x20(%rbp), %rax
movl $0x45, 0x278(%rax)
jmp 0xcef6
movl $0x1, -0x74(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
je 0xce80
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
addq $0x178, %rdi            # imm = 0x178
movl -0x78(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
addq $0xd0, %rsi
addq $0x190, %rsi            # imm = 0x190
movl -0x78(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x40(%rbp), %rdx
callq 0x53d0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
je 0xce7e
jmp 0xcef6
jmp 0xce80
jmp 0xce82
jmp 0xce84
jmp 0xce86
jmp 0xce88
jmp 0xce8a
jmp 0xce8c
jmp 0xce8e
jmp 0xce90
jmp 0xce92
jmp 0xce94
jmp 0xce96
jmp 0xce98
jmp 0xce9a
jmp 0xce9c
jmp 0xce9e
jmp 0xcea0
jmp 0xcea2
jmp 0xcea4
jmp 0xcea6
movq -0x20(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0xced6
cmpl $0x0, -0x74(%rbp)
jne 0xced6
movq -0x40(%rbp), %rdi
callq 0x4fb0
cmpl $0x0, %eax
je 0xced4
movq -0x20(%rbp), %rax
movl $0x39, 0x278(%rax)
jmp 0xcef6
jmp 0xced6
cmpb $0x0, -0x31(%rbp)
jne 0xcef1
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq -0x30(%rbp), %rsi
callq 0x51c0
movq %rax, -0x40(%rbp)
jmp 0xc619
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
jne 0xcf2c
movq -0x20(%rbp), %rax
cmpl $0x3, 0xe0(%rax)
jne 0xcf2c
movq -0x20(%rbp), %rax
cmpq $0x0, 0xe8(%rax)
jne 0xcf2c
movq -0x20(%rbp), %rax
movl $0x6a, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
jne 0xd110
movq -0x20(%rbp), %rax
cmpl $0x0, 0xd8(%rax)
jne 0xcf84
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
addq $0x10, %rdi
callq 0x5a60
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movl -0x9c(%rbp), %edx
callq 0x16c80
movq %rax, -0x68(%rbp)
jmp 0xd0e7
movq -0x20(%rbp), %rdi
addq $0xd0, %rdi
addq $0x10, %rdi
callq 0x5a60
movl %eax, -0xa0(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
addl $0x7, %edi
shrl $0x3, %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
addl $0x7, %esi
shrl $0x3, %esi
movl -0xa0(%rbp), %edx
callq 0x16c80
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jbe 0xd005
movq -0x10(%rbp), %rax
movl (%rax), %edi
addl $0x3, %edi
shrl $0x3, %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
addl $0x7, %esi
shrl $0x3, %esi
movl -0xa0(%rbp), %edx
callq 0x16c80
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
addl $0x3, %edi
shrl $0x2, %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
addl $0x3, %esi
shrl $0x3, %esi
movl -0xa0(%rbp), %edx
callq 0x16c80
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jbe 0xd064
movq -0x10(%rbp), %rax
movl (%rax), %edi
addl $0x1, %edi
shrl $0x2, %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
addl $0x3, %esi
shrl $0x2, %esi
movl -0xa0(%rbp), %edx
callq 0x16c80
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
addl $0x1, %edi
shrl %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
addl $0x1, %esi
shrl $0x2, %esi
movl -0xa0(%rbp), %edx
callq 0x16c80
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
jbe 0xd0c0
movq -0x10(%rbp), %rax
movl (%rax), %edi
addl $0x0, %edi
shrl %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
addl $0x1, %esi
shrl %esi
movl -0xa0(%rbp), %edx
callq 0x16c80
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
addl $0x0, %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
addl $0x0, %esi
shrl %esi
movl -0xa0(%rbp), %edx
callq 0x16c80
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x20(%rbp), %r9
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x117d0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
jne 0xd135
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
je 0xd135
movq -0x20(%rbp), %rax
movl $0x5b, 0x278(%rax)
movq -0x48(%rbp), %rdi
callq 0x4230
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
jne 0xd19c
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x20(%rbp), %rdx
addq $0xd0, %rdx
addq $0x10, %rdx
callq 0x5c80
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x3bc0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xd19a
movq -0x20(%rbp), %rax
movl $0x53, 0x278(%rax)
jmp 0xd19c
movq -0x20(%rbp), %rax
cmpl $0x0, 0x278(%rax)
jne 0xd1ee
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x70(%rbp), %rdx
xorl %esi, %esi
callq 0x3be0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x58(%rbp), %rsi
movq -0x10(%rbp), %rax
movl (%rax), %edx
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x20(%rbp), %r8
addq $0xd0, %r8
callq 0x16cd0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x278(%rax)
movq -0x58(%rbp), %rdi
callq 0x4230
addq $0xb0, %rsp
popq %rbp
retq