// File: /workspace/github_c_makefile_star2_O0/pje[P]pixelsort/lodepng.c
// Function: decodeGeneric
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;
  size_t i;
  ucvector idat; /*the data from idat chunks*/
  ucvector scanlines;
  size_t predict;

  /*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*/

  /*provide some proper output values if error will happen*/
  *out = 0;

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

  ucvector_init(&idat);
  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*/

    /*error: size of the in buffer too small to contain next chunk*/
    if((size_t)((chunk - in) + 12) > insize || chunk < in) CERROR_BREAK(state->error, 30);

    /*length of the data of the chunk, excluding the length bytes, chunk type and CRC bytes*/
    chunkLength = lodepng_chunk_length(chunk);
    /*error: chunk length larger than the max PNG chunk size*/
    if(chunkLength > 2147483647) CERROR_BREAK(state->error, 63);

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

    data = lodepng_chunk_data_const(chunk);

    /*IDAT chunk, containing compressed image data*/
    if(lodepng_chunk_type_equals(chunk, "IDAT"))
    {
      size_t oldsize = idat.size;
      if(!ucvector_resize(&idat, oldsize + chunkLength)) CERROR_BREAK(state->error, 83 /*alloc fail*/);
      for(i = 0; i < chunkLength; i++) idat.data[oldsize + i] = data[i];
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
      critical_pos = 3;
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    }
    /*IEND chunk*/
    else if(lodepng_chunk_type_equals(chunk, "IEND"))
    {
      IEND = 1;
    }
    /*palette chunk (PLTE)*/
    else if(lodepng_chunk_type_equals(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*/
    }
    /*palette transparency chunk (tRNS)*/
    else if(lodepng_chunk_type_equals(chunk, "tRNS"))
    {
      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;
    }
    /*text chunk (tEXt)*/
    else if(lodepng_chunk_type_equals(chunk, "tEXt"))
    {
      if(state->decoder.read_text_chunks)
      {
        state->error = readChunk_tEXt(&state->info_png, data, chunkLength);
        if(state->error) break;
      }
    }
    /*compressed text chunk (zTXt)*/
    else if(lodepng_chunk_type_equals(chunk, "zTXt"))
    {
      if(state->decoder.read_text_chunks)
      {
        state->error = readChunk_zTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength);
        if(state->error) break;
      }
    }
    /*international text chunk (iTXt)*/
    else if(lodepng_chunk_type_equals(chunk, "iTXt"))
    {
      if(state->decoder.read_text_chunks)
      {
        state->error = readChunk_iTXt(&state->info_png, &state->decoder.zlibsettings, 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;
    }
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
    else /*it's not an implemented chunk type, so ignore it: skip over the data*/
    {
      /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/
      if(!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);
  }

  ucvector_init(&scanlines);
  /*predict output size, to allocate exact size for output buffer to avoid more dynamic allocation.
  The prediction is currently not correct for interlaced PNG images.*/
  predict = lodepng_get_raw_size_idat(*w, *h, &state->info_png.color) + *h;
  if(!state->error && !ucvector_reserve(&scanlines, predict)) state->error = 83; /*alloc fail*/
  if(!state->error)
  {
    state->error = zlib_decompress(&scanlines.data, &scanlines.size, idat.data,
                                   idat.size, &state->decoder.zlibsettings);
  }
  ucvector_cleanup(&idat);

  if(!state->error)
  {
    ucvector outv;
    ucvector_init(&outv);
    if(!ucvector_resizev(&outv,
        lodepng_get_raw_size(*w, *h, &state->info_png.color), 0)) state->error = 83; /*alloc fail*/
    if(!state->error) state->error = postProcessScanlines(outv.data, scanlines.data, *w, *h, &state->info_png);
    *out = outv.data;
  }
  ucvector_cleanup(&scanlines);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %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)
movl $0x0, -0x84(%rbp)
movl $0x1, -0x88(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x6820
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x6e1d
jmp 0x752b
leaq -0x60(%rbp), %rdi
callq 0x8620
movq -0x28(%rbp), %rax
addq $0x21, %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
cmpb $0x0, -0x31(%rbp)
movb %al, -0xb9(%rbp)
jne 0x6e56
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x6e65
jmp 0x73d1
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
addq $0xc, %rax
cmpq -0x30(%rbp), %rax
ja 0x6e84
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x6e97
movq -0x20(%rbp), %rax
movl $0x1e, 0x198(%rax)
jmp 0x73d1
movq -0x40(%rbp), %rdi
callq 0x2520
movl %eax, -0x8c(%rbp)
cmpl $0x7fffffff, -0x8c(%rbp) # imm = 0x7FFFFFFF
jbe 0x6ec5
movq -0x20(%rbp), %rax
movl $0x3f, 0x198(%rax)
jmp 0x73d1
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl -0x8c(%rbp), %ecx
addq %rcx, %rax
addq $0xc, %rax
cmpq -0x30(%rbp), %rax
ja 0x6efa
movq -0x40(%rbp), %rax
movl -0x8c(%rbp), %ecx
addq %rcx, %rax
addq $0xc, %rax
cmpq -0x28(%rbp), %rax
jae 0x6f0d
movq -0x20(%rbp), %rax
movl $0x40, 0x198(%rax)
jmp 0x73d1
movq -0x40(%rbp), %rdi
callq 0x26b0
movq %rax, -0x98(%rbp)
movq -0x40(%rbp), %rdi
leaq 0xd438(%rip), %rsi      # 0x14360
callq 0x2590
cmpb $0x0, %al
je 0x6fc5
movq -0x58(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rsi
movl -0x8c(%rbp), %eax
addq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0xa3a0
cmpl $0x0, %eax
jne 0x6f71
movq -0x20(%rbp), %rax
movl $0x53, 0x198(%rax)
jmp 0x73d1
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl -0x8c(%rbp), %ecx
cmpq %rcx, %rax
jae 0x6fb6
movq -0x98(%rbp), %rax
movq -0x48(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x60(%rbp), %rax
movq -0xa0(%rbp), %rcx
addq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x6f79
movl $0x3, -0x88(%rbp)
jmp 0x7386
movq -0x40(%rbp), %rdi
leaq 0xd395(%rip), %rsi      # 0x14365
callq 0x2590
cmpb $0x0, %al
je 0x6fe2
movb $0x1, -0x31(%rbp)
jmp 0x7384
movq -0x40(%rbp), %rdi
leaq 0xd37d(%rip), %rsi      # 0x1436a
callq 0x2590
cmpb $0x0, %al
je 0x7046
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
addq $0x10, %rdi
movq -0x98(%rbp), %rsi
movl -0x8c(%rbp), %eax
movl %eax, %edx
callq 0xd9e0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x7037
jmp 0x73d1
movl $0x2, -0x88(%rbp)
jmp 0x7382
movq -0x40(%rbp), %rdi
leaq 0xd31e(%rip), %rsi      # 0x1436f
callq 0x2590
cmpb $0x0, %al
je 0x70a0
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
addq $0x10, %rdi
movq -0x98(%rbp), %rsi
movl -0x8c(%rbp), %eax
movl %eax, %edx
callq 0xdb60
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x709b
jmp 0x73d1
jmp 0x7380
movq -0x40(%rbp), %rdi
leaq 0xd2c9(%rip), %rsi      # 0x14374
callq 0x2590
cmpb $0x0, %al
je 0x70f6
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
movq -0x98(%rbp), %rsi
movl -0x8c(%rbp), %eax
movl %eax, %edx
callq 0xdcc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x70f1
jmp 0x73d1
jmp 0x737e
movq -0x40(%rbp), %rdi
leaq 0xd278(%rip), %rsi      # 0x14379
callq 0x2590
cmpb $0x0, %al
je 0x7158
movq -0x20(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x7153
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
movq -0x98(%rbp), %rsi
movl -0x8c(%rbp), %eax
movl %eax, %edx
callq 0xde10
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x7151
jmp 0x73d1
jmp 0x7153
jmp 0x737c
movq -0x40(%rbp), %rdi
leaq 0xd21b(%rip), %rsi      # 0x1437e
callq 0x2590
cmpb $0x0, %al
je 0x71be
movq -0x20(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x71b9
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
movq -0x20(%rbp), %rsi
movq -0x98(%rbp), %rdx
movl -0x8c(%rbp), %eax
movl %eax, %ecx
callq 0xdfd0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x71b7
jmp 0x73d1
jmp 0x71b9
jmp 0x737a
movq -0x40(%rbp), %rdi
leaq 0xd1ba(%rip), %rsi      # 0x14383
callq 0x2590
cmpb $0x0, %al
je 0x7224
movq -0x20(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x721f
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
movq -0x20(%rbp), %rsi
movq -0x98(%rbp), %rdx
movl -0x8c(%rbp), %eax
movl %eax, %ecx
callq 0xe1a0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x721d
jmp 0x73d1
jmp 0x721f
jmp 0x7378
movq -0x40(%rbp), %rdi
leaq 0xd159(%rip), %rsi      # 0x14388
callq 0x2590
cmpb $0x0, %al
je 0x727a
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
movq -0x98(%rbp), %rsi
movl -0x8c(%rbp), %eax
movl %eax, %edx
callq 0xe5c0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x7275
jmp 0x73d1
jmp 0x7376
movq -0x40(%rbp), %rdi
leaq 0xd108(%rip), %rsi      # 0x1438d
callq 0x2590
cmpb $0x0, %al
je 0x72d0
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
movq -0x98(%rbp), %rsi
movl -0x8c(%rbp), %eax
movl %eax, %edx
callq 0xe680
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x72cb
jmp 0x73d1
jmp 0x7374
movq -0x40(%rbp), %rdi
callq 0x2630
cmpb $0x0, %al
jne 0x72f0
movq -0x20(%rbp), %rax
movl $0x45, 0x198(%rax)
jmp 0x73d1
movl $0x1, -0x84(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x7372
movq -0x20(%rbp), %rdi
addq $0xb0, %rdi
addq $0xb8, %rdi
movl -0x88(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
addq $0xb0, %rsi
addq $0xd0, %rsi
movl -0x88(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x40(%rbp), %rdx
callq 0x2850
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
je 0x7370
jmp 0x73d1
jmp 0x7372
jmp 0x7374
jmp 0x7376
jmp 0x7378
jmp 0x737a
jmp 0x737c
jmp 0x737e
jmp 0x7380
jmp 0x7382
jmp 0x7384
jmp 0x7386
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x73b9
cmpl $0x0, -0x84(%rbp)
jne 0x73b9
movq -0x40(%rbp), %rdi
callq 0x26d0
cmpl $0x0, %eax
je 0x73b7
movq -0x20(%rbp), %rax
movl $0x39, 0x198(%rax)
jmp 0x73d1
jmp 0x73b9
cmpb $0x0, -0x31(%rbp)
jne 0x73cc
movq -0x40(%rbp), %rdi
callq 0x2820
movq %rax, -0x40(%rbp)
jmp 0x6e32
leaq -0x78(%rbp), %rdi
callq 0x8620
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x20(%rbp), %rdx
addq $0xb0, %rdx
addq $0x10, %rdx
callq 0xe740
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
jne 0x7434
movq -0x80(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0xa3f0
cmpl $0x0, %eax
jne 0x7434
movq -0x20(%rbp), %rax
movl $0x53, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
jne 0x746a
leaq -0x78(%rbp), %rdi
leaq -0x78(%rbp), %rsi
addq $0x8, %rsi
movq -0x60(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0xe790
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
leaq -0x60(%rbp), %rdi
callq 0xe800
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
jne 0x7522
leaq -0xb8(%rbp), %rdi
callq 0x8620
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x20(%rbp), %rdx
addq $0xb0, %rdx
addq $0x10, %rdx
callq 0x2f60
movq %rax, %rsi
leaq -0xb8(%rbp), %rdi
xorl %edx, %edx
callq 0xe850
cmpl $0x0, %eax
jne 0x74d4
movq -0x20(%rbp), %rax
movl $0x53, 0x198(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x198(%rax)
jne 0x7514
movq -0xb8(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x10(%rbp), %rax
movl (%rax), %edx
movq -0x18(%rbp), %rax
movl (%rax), %ecx
movq -0x20(%rbp), %r8
addq $0xb0, %r8
callq 0xe8d0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0xb8(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
leaq -0x78(%rbp), %rdi
callq 0xe800
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)