// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4(%rsi), %rax
pushq $0x1e
popq %r12
cmpq %rcx, %rax
ja 0x721e
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
addq %rdx, %rbx
movq %rbx, %rdi
callq 0x460b
testl %eax, %eax
js 0x707e
movl %eax, %ebp
movl %eax, %ecx
leaq (%rbx,%rcx), %rax
addq $0xc, %rax
addq %r15, %r13
cmpq %r13, %rax
ja 0x721e
movq %rcx, %r15
leaq 0x8(%rbx), %r12
leaq 0x8b42(%rip), %rsi      # 0xfb9d
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x7087
leaq 0xc8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x7295
jmp 0x71f9
pushq $0x3f
popq %r12
jmp 0x721e
leaq 0x8b14(%rip), %rsi      # 0xfba2
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x70b1
leaq 0xc8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x734e
jmp 0x71f9
leaq 0x8aef(%rip), %rsi      # 0xfba7
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x70db
leaq 0xb8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x73f8
jmp 0x71f9
leaq 0x8aca(%rip), %rsi      # 0xfbac
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x7105
leaq 0xb8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x7499
jmp 0x71f9
leaq 0x8aa5(%rip), %rsi      # 0xfbb1
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x7132
leaq 0xb8(%r14), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x757d
jmp 0x71f9
leaq 0x8a7d(%rip), %rsi      # 0xfbb6
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x715f
leaq 0xb8(%r14), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x7695
jmp 0x71f9
leaq 0x8a55(%rip), %rsi      # 0xfbbb
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x7186
leaq 0xb8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x78bf
jmp 0x71f9
leaq 0x8a33(%rip), %rsi      # 0xfbc0
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x71ad
leaq 0xb8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x7918
jmp 0x71f9
leaq 0x8a11(%rip), %rsi      # 0xfbc5
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x71d4
leaq 0xb8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x794e
jmp 0x71f9
leaq 0x89ef(%rip), %rsi      # 0xfbca
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x7230
leaq 0xb8(%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x796f
movl %eax, %r12d
testl %eax, %eax
jne 0x721e
cmpl $0x0, 0x20(%r14)
je 0x720c
xorl %r12d, %r12d
jmp 0x721e
movq %rbx, %rdi
callq 0x46b5
testl %eax, %eax
pushq $0x39
popq %r12
cmovel %eax, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8998(%rip), %rsi      # 0xfbcf
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x7261
cmpl $0x1, %ebp
jne 0x728e
movl $0x1, 0x198(%r14)
movzbl (%r12), %eax
movl %eax, 0x19c(%r14)
jmp 0x7200
leaq 0x896c(%rip), %rsi      # 0xfbd4
movq %rbx, %rdi
callq 0x4629
testb %al, %al
je 0x7207
leaq 0xb8(%r14), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x79dd
jmp 0x71f9
pushq $0x62
jmp 0x7080