// File: /workspace/github_cpp_makefile_star2_O2/mhe[P]raytracerframework_cpp/lodepng.cpp
// Function: LodePNG_inspect(LodePNG_Decoder*, unsigned char const*, unsigned long)
void LodePNG_inspect(LodePNG_Decoder* decoder, const unsigned char* in, size_t inlength)
{
  if(inlength == 0 || in == 0) { decoder->error = 48; return; } /*the given data is empty*/
  if(inlength < 29) { decoder->error = 27; return; } /*error: the data length is smaller than the length of the header*/
  
  /*when decoding a new PNG image, make sure all parameters created after previous decoding are reset*/
  LodePNG_InfoPng_cleanup(&decoder->infoPng);
  LodePNG_InfoPng_init(&decoder->infoPng);
  decoder->error = 0;

  if(in[0] != 137 || in[1] != 80 || in[2] != 78 || in[3] != 71 || in[4] != 13 || in[5] != 10 || in[6] != 26 || in[7] != 10) { decoder->error = 28; return; } /*error: the first 8 bytes are not the correct PNG signature*/
  if(in[12] != 'I' || in[13] != 'H' || in[14] != 'D' || in[15] != 'R') { decoder->error = 29; return; } /*error: it doesn't start with a IHDR chunk!*/
  
  /*read the values given in the header*/
  decoder->infoPng.width = LodePNG_read32bitInt(&in[16]);
  decoder->infoPng.height = LodePNG_read32bitInt(&in[20]);
  decoder->infoPng.color.bitDepth = in[24];
  decoder->infoPng.color.colorType = in[25];
  decoder->infoPng.compressionMethod = in[26];
  decoder->infoPng.filterMethod = in[27];
  decoder->infoPng.interlaceMethod = in[28];

  if(!decoder->settings.ignoreCrc)
  {
    unsigned CRC = LodePNG_read32bitInt(&in[29]);
    unsigned checksum = Crc32_crc(&in[12], 17);
    if(CRC != checksum) { decoder->error = 57; return; }
  }
  
  if(decoder->infoPng.compressionMethod != 0) { decoder->error = 32; return; } /*error: only compression method 0 is allowed in the specification*/
  if(decoder->infoPng.filterMethod != 0)      { decoder->error = 33; return; } /*error: only filter method 0 is allowed in the specification*/
  if(decoder->infoPng.interlaceMethod > 1)    { decoder->error = 34; return; } /*error: only interlace methods 0 and 1 exist in the specification*/
  
  decoder->error = checkColorValidity(decoder->infoPng.color.colorType, decoder->infoPng.color.bitDepth);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdx, %rdx
setne %al
testq %rsi, %rsi
setne %cl
testb %al, %cl
jne 0x12d66
movl $0x30, 0x120(%rbx)
jmp 0x12ea2
cmpq $0x1c, %rdx
ja 0x12d7b
movl $0x1b, 0x120(%rbx)
jmp 0x12ea2
movq %rsi, %r14
leaq 0x40(%rbx), %r15
movq %r15, %rdi
callq 0x1234f
movq %r15, %rdi
callq 0x122f6
andl $0x0, 0x120(%rbx)
cmpb $-0x77, (%r14)
jne 0x12e98
cmpb $0x50, 0x1(%r14)
jne 0x12e98
cmpb $0x4e, 0x2(%r14)
jne 0x12e98
cmpb $0x47, 0x3(%r14)
jne 0x12e98
cmpb $0xd, 0x4(%r14)
jne 0x12e98
cmpb $0xa, 0x5(%r14)
jne 0x12e98
cmpb $0x1a, 0x6(%r14)
jne 0x12e98
cmpb $0xa, 0x7(%r14)
jne 0x12e98
cmpb $0x49, 0xc(%r14)
jne 0x12ead
cmpb $0x48, 0xd(%r14)
jne 0x12ead
cmpb $0x44, 0xe(%r14)
jne 0x12ead
cmpb $0x52, 0xf(%r14)
jne 0x12ead
leaq 0x10(%r14), %rdi
callq 0x118c0
movl %eax, 0x40(%rbx)
leaq 0x14(%r14), %rdi
callq 0x118c0
movl %eax, 0x44(%rbx)
movzbl 0x18(%r14), %eax
movl %eax, 0x5c(%rbx)
movzbl 0x19(%r14), %eax
movl %eax, 0x58(%rbx)
movzbl 0x1a(%r14), %eax
movl %eax, 0x48(%rbx)
movzbl 0x1b(%r14), %ecx
movl %ecx, 0x4c(%rbx)
movzbl 0x1c(%r14), %ecx
movl %ecx, 0x50(%rbx)
cmpl $0x0, 0x4(%rbx)
jne 0x12e88
leaq 0xc(%r14), %r15
addq $0x1d, %r14
movq %r14, %rdi
callq 0x118c0
movl %eax, %r14d
pushq $0x11
popq %rsi
movq %r15, %rdi
callq 0x119c9
cmpl %eax, %r14d
jne 0x12ecb
movl 0x48(%rbx), %eax
testl %eax, %eax
je 0x12eb9
movl $0x20, 0x120(%rbx)
jmp 0x12ea2
movl $0x1c, 0x120(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1d, 0x120(%rbx)
jmp 0x12ea2
cmpl $0x0, 0x4c(%rbx)
je 0x12ed7
movl $0x21, 0x120(%rbx)
jmp 0x12ea2
movl $0x39, 0x120(%rbx)
jmp 0x12ea2
cmpl $0x2, 0x50(%rbx)
jb 0x12ee9
movl $0x22, 0x120(%rbx)
jmp 0x12ea2
movl 0x58(%rbx), %edi
movl 0x5c(%rbx), %esi
callq 0x12efc
movl %eax, 0x120(%rbx)
jmp 0x12ea2