// File: lvandeve[P]lodepng/pngdetail.cpp
// Function: Data::loadInspect()
void loadInspect() {
    if(inspected) return;
    inspected = true;
    loadFile();
    if(error) return;
    is_png = is_icc = is_exif = false;
    if(isIcc()) {
      lodepng_set_icc(&state.info_png, "<none>", &buffer[0], buffer.size());
      is_icc = true;
    } else if(isExif()) {
      lodepng_set_exif(&state.info_png, &buffer[0], buffer.size());
      is_exif = true;
    } else {
      is_png = true;
      const unsigned char* data = &buffer[0];
      error = lodepng_inspect(&w, &h, &state, data, buffer.size());
      if(error) return;
      // end before first IDAT chunk: do not parse more than first part of file for all this.
      const unsigned char* end = lodepng_chunk_find_const(data, data + buffer.size(), "IDAT");
      if(!end) end = data + buffer.size(); // no IDAT, invalid PNG but extract info anyway
      error = inspect_chunk_by_name(data, end, state, "PLTE");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "tRNS");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "cHRM");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "gAMA");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "sBIT");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "bKGD");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "hIST");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "pHYs");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "iCCP");
      if(error) return;
      error = inspect_chunk_by_name(data, end, state, "eXIf");
      if(error) return;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
testb $0x1, 0x2dc(%rax)
je 0x317e5
jmp 0x31be2
movq -0x20(%rbp), %rdi
movb $0x1, 0x2dc(%rdi)
callq 0x31bf0
movq -0x20(%rbp), %rax
cmpl $0x0, 0x2d8(%rax)
je 0x31807
jmp 0x31be2
movq -0x20(%rbp), %rdi
movb $0x0, 0x2df(%rdi)
movb $0x0, 0x2de(%rdi)
movb $0x0, 0x2dd(%rdi)
callq 0x32b90
testb $0x1, %al
jne 0x3182b
jmp 0x31884
movq -0x20(%rbp), %rdi
movq %rdi, %rax
addq $0x58, %rax
addq $0xd0, %rax
movq %rax, -0x30(%rbp)
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19560
movq -0x20(%rbp), %rdi
movq %rax, -0x28(%rbp)
addq $0x20, %rdi
callq 0x19370
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
movl %eax, %ecx
leaq 0x99e4(%rip), %rsi      # 0x3b253
callq 0x5200
movq -0x20(%rbp), %rax
movb $0x1, 0x2de(%rax)
jmp 0x31be2
movq -0x20(%rbp), %rdi
callq 0x32d20
testb $0x1, %al
jne 0x31893
jmp 0x318e5
movq -0x20(%rbp), %rdi
movq %rdi, %rax
addq $0x58, %rax
addq $0xd0, %rax
movq %rax, -0x40(%rbp)
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19560
movq -0x20(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0x20, %rdi
callq 0x19370
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl %eax, %edx
callq 0x53b0
movq -0x20(%rbp), %rax
movb $0x1, 0x2df(%rax)
jmp 0x31be0
movq -0x20(%rbp), %rdi
movb $0x1, 0x2dd(%rdi)
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x19560
movq -0x20(%rbp), %rdi
movq %rax, -0x10(%rbp)
movq %rdi, %rax
addq $0x50, %rax
movq %rax, -0x60(%rbp)
movq %rdi, %rax
addq $0x54, %rax
movq %rax, -0x58(%rbp)
movq %rdi, %rax
addq $0x58, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
addq $0x20, %rdi
callq 0x19370
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq %rax, %r8
callq 0x9140
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31969
jmp 0x31be2
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
addq $0x20, %rdi
callq 0x19370
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdi
addq %rax, %rsi
leaq 0x8012(%rip), %rdx      # 0x399aa
callq 0x42c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x319cb
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
addq $0x20, %rdi
callq 0x19370
movq %rax, %rcx
movq -0x78(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x6b7e(%rip), %rcx      # 0x38560
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31a01
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x6b4d(%rip), %rcx      # 0x38565
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31a37
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x6b3f(%rip), %rcx      # 0x3858d
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31a6d
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x6b04(%rip), %rcx      # 0x38588
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31aa3
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x6af6(%rip), %rcx      # 0x385b0
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31ad9
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x6a7a(%rip), %rcx      # 0x3856a
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31b0f
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x9734(%rip), %rcx      # 0x3b25a
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31b45
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x6a27(%rip), %rcx      # 0x38583
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31b78
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x6a08(%rip), %rcx      # 0x38597
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31bab
jmp 0x31be2
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x58, %rdx
leaq 0x69e9(%rip), %rcx      # 0x385ab
callq 0x27bc0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2d8(%rax)
cmpl $0x0, 0x2d8(%rax)
je 0x31bde
jmp 0x31be2
jmp 0x31be0
jmp 0x31be2
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)