// File: /workspace/github_c_makefile_star2_O0/tditlu[P]shadetabler/src/lodepng/lodepng.c
// Function: lodepng_inspect_chunk
unsigned lodepng_inspect_chunk(LodePNGState* state, size_t pos,
                               const unsigned char* in, size_t insize) {
  const unsigned char* chunk = in + pos;
  unsigned chunkLength;
  const unsigned char* data;
  unsigned unhandled = 0;
  unsigned error = 0;

  if(pos + 4 > insize) return 30;
  chunkLength = lodepng_chunk_length(chunk);
  if(chunkLength > 2147483647) return 63;
  data = lodepng_chunk_data_const(chunk);
  if(data + chunkLength + 4 > in + insize) return 30;

  if(lodepng_chunk_type_equals(chunk, "PLTE")) {
    error = readChunk_PLTE(&state->info_png.color, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "tRNS")) {
    error = readChunk_tRNS(&state->info_png.color, data, chunkLength);
#ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS
  } else if(lodepng_chunk_type_equals(chunk, "bKGD")) {
    error = readChunk_bKGD(&state->info_png, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "tEXt")) {
    error = readChunk_tEXt(&state->info_png, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "zTXt")) {
    error = readChunk_zTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "iTXt")) {
    error = readChunk_iTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "tIME")) {
    error = readChunk_tIME(&state->info_png, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "pHYs")) {
    error = readChunk_pHYs(&state->info_png, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "gAMA")) {
    error = readChunk_gAMA(&state->info_png, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "cHRM")) {
    error = readChunk_cHRM(&state->info_png, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "sRGB")) {
    error = readChunk_sRGB(&state->info_png, data, chunkLength);
  } else if(lodepng_chunk_type_equals(chunk, "iCCP")) {
    error = readChunk_iCCP(&state->info_png, &state->decoder.zlibsettings, data, chunkLength);
#endif /*LODEPNG_COMPILE_ANCILLARY_CHUNKS*/
  } else {
    /* unhandled chunk is ok (is not an error) */
    unhandled = 1;
  }

  if(!error && !unhandled && !state->decoder.ignore_crc) {
    if(lodepng_chunk_check_crc(chunk)) return 57; /*invalid CRC*/
  }

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rax
addq $0x4, %rax
cmpq -0x28(%rbp), %rax
jbe 0xaefc
movl $0x1e, -0x4(%rbp)
jmp 0xb22a
movq -0x30(%rbp), %rdi
callq 0x5a60
movl %eax, -0x34(%rbp)
cmpl $0x7fffffff, -0x34(%rbp) # imm = 0x7FFFFFFF
jbe 0xaf1d
movl $0x3f, -0x4(%rbp)
jmp 0xb22a
movq -0x30(%rbp), %rdi
callq 0x5c70
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x34(%rbp), %ecx
addq %rcx, %rax
addq $0x4, %rax
movq -0x20(%rbp), %rcx
addq -0x28(%rbp), %rcx
cmpq %rcx, %rax
jbe 0xaf51
movl $0x1e, -0x4(%rbp)
jmp 0xb22a
movq -0x30(%rbp), %rdi
leaq 0x10631(%rip), %rsi     # 0x1b58d
callq 0x5b10
cmpb $0x0, %al
je 0xaf8a
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
addq $0x10, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xb240
movl %eax, -0x48(%rbp)
jmp 0xb1f5
movq -0x30(%rbp), %rdi
leaq 0x105fd(%rip), %rsi     # 0x1b592
callq 0x5b10
cmpb $0x0, %al
je 0xafc3
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
addq $0x10, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xb3a0
movl %eax, -0x48(%rbp)
jmp 0xb1f3
movq -0x30(%rbp), %rdi
leaq 0x105c9(%rip), %rsi     # 0x1b597
callq 0x5b10
cmpb $0x0, %al
je 0xaff8
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xb500
movl %eax, -0x48(%rbp)
jmp 0xb1f1
movq -0x30(%rbp), %rdi
leaq 0x10599(%rip), %rsi     # 0x1b59c
callq 0x5b10
cmpb $0x0, %al
je 0xb02d
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xb670
movl %eax, -0x48(%rbp)
jmp 0xb1ef
movq -0x30(%rbp), %rdi
leaq 0x10569(%rip), %rsi     # 0x1b5a1
callq 0x5b10
cmpb $0x0, %al
je 0xb066
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x34(%rbp), %eax
movl %eax, %ecx
callq 0xb7f0
movl %eax, -0x48(%rbp)
jmp 0xb1ed
movq -0x30(%rbp), %rdi
leaq 0x10535(%rip), %rsi     # 0x1b5a6
callq 0x5b10
cmpb $0x0, %al
je 0xb09f
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x34(%rbp), %eax
movl %eax, %ecx
callq 0xb9a0
movl %eax, -0x48(%rbp)
jmp 0xb1eb
movq -0x30(%rbp), %rdi
leaq 0x10501(%rip), %rsi     # 0x1b5ab
callq 0x5b10
cmpb $0x0, %al
je 0xb0d4
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xbd20
movl %eax, -0x48(%rbp)
jmp 0xb1e9
movq -0x30(%rbp), %rdi
leaq 0x104d1(%rip), %rsi     # 0x1b5b0
callq 0x5b10
cmpb $0x0, %al
je 0xb109
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xbde0
movl %eax, -0x48(%rbp)
jmp 0xb1e7
movq -0x30(%rbp), %rdi
leaq 0x104a1(%rip), %rsi     # 0x1b5b5
callq 0x5b10
cmpb $0x0, %al
je 0xb13e
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xbea0
movl %eax, -0x48(%rbp)
jmp 0xb1e5
movq -0x30(%rbp), %rdi
leaq 0x10471(%rip), %rsi     # 0x1b5ba
callq 0x5b10
cmpb $0x0, %al
je 0xb170
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xbf20
movl %eax, -0x48(%rbp)
jmp 0xb1e3
movq -0x30(%rbp), %rdi
leaq 0x10444(%rip), %rsi     # 0x1b5bf
callq 0x5b10
cmpb $0x0, %al
je 0xb1a2
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %eax
movl %eax, %edx
callq 0xc130
movl %eax, -0x48(%rbp)
jmp 0xb1e1
movq -0x30(%rbp), %rdi
leaq 0x10417(%rip), %rsi     # 0x1b5c4
callq 0x5b10
cmpb $0x0, %al
je 0xb1d8
movq -0x10(%rbp), %rdi
addq $0xb8, %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x34(%rbp), %eax
movl %eax, %ecx
callq 0xc180
movl %eax, -0x48(%rbp)
jmp 0xb1df
movl $0x1, -0x44(%rbp)
jmp 0xb1e1
jmp 0xb1e3
jmp 0xb1e5
jmp 0xb1e7
jmp 0xb1e9
jmp 0xb1eb
jmp 0xb1ed
jmp 0xb1ef
jmp 0xb1f1
jmp 0xb1f3
jmp 0xb1f5
cmpl $0x0, -0x48(%rbp)
jne 0xb224
cmpl $0x0, -0x44(%rbp)
jne 0xb224
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0xb224
movq -0x30(%rbp), %rdi
callq 0x5c90
cmpl $0x0, %eax
je 0xb222
movl $0x39, -0x4(%rbp)
jmp 0xb22a
jmp 0xb224
movl -0x48(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)