// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/png/pngread.c
// Function: png_read_info
void PNGAPI
png_read_info(png_structp png_ptr, png_infop info_ptr)
{
   png_debug(1, "in png_read_info");
 
   if (png_ptr == NULL || info_ptr == NULL)
      return;
 
   /* If we haven't checked all of the PNG signature bytes, do so now. */
   if (png_ptr->sig_bytes < 8)
   {
      png_size_t num_checked = png_ptr->sig_bytes,
                 num_to_check = 8 - num_checked;

#ifdef PNG_IO_STATE_SUPPORTED
      png_ptr->io_state = PNG_IO_READING | PNG_IO_SIGNATURE;
#endif

      png_read_data(png_ptr, &(info_ptr->signature[num_checked]), num_to_check);
      png_ptr->sig_bytes = 8;

      if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check))
      {
         if (num_checked < 4 &&
             png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4))
            png_error(png_ptr, "Not a PNG file");
         else
            png_error(png_ptr, "PNG file corrupted by ASCII conversion");
      }
      if (num_checked < 3)
         png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
   }

   for (;;)
   {
      PNG_IHDR;
      PNG_IDAT;
      PNG_IEND;
      PNG_PLTE;
#ifdef PNG_READ_bKGD_SUPPORTED
      PNG_bKGD;
#endif
#ifdef PNG_READ_cHRM_SUPPORTED
      PNG_cHRM;
#endif
#ifdef PNG_READ_gAMA_SUPPORTED
      PNG_gAMA;
#endif
#ifdef PNG_READ_hIST_SUPPORTED
      PNG_hIST;
#endif
#ifdef PNG_READ_iCCP_SUPPORTED
      PNG_iCCP;
#endif
#ifdef PNG_READ_iTXt_SUPPORTED
      PNG_iTXt;
#endif
#ifdef PNG_READ_oFFs_SUPPORTED
      PNG_oFFs;
#endif
#ifdef PNG_READ_pCAL_SUPPORTED
      PNG_pCAL;
#endif
#ifdef PNG_READ_pHYs_SUPPORTED
      PNG_pHYs;
#endif
#ifdef PNG_READ_sBIT_SUPPORTED
      PNG_sBIT;
#endif
#ifdef PNG_READ_sCAL_SUPPORTED
      PNG_sCAL;
#endif
#ifdef PNG_READ_sPLT_SUPPORTED
      PNG_sPLT;
#endif
#ifdef PNG_READ_sRGB_SUPPORTED
      PNG_sRGB;
#endif
#ifdef PNG_READ_tEXt_SUPPORTED
      PNG_tEXt;
#endif
#ifdef PNG_READ_tIME_SUPPORTED
      PNG_tIME;
#endif
#ifdef PNG_READ_tRNS_SUPPORTED
      PNG_tRNS;
#endif
#ifdef PNG_READ_zTXt_SUPPORTED
      PNG_zTXt;
#endif
      png_uint_32 length = png_read_chunk_header(png_ptr);
      PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;

      /* This should be a binary subdivision search or a hash for
       * matching the chunk name rather than a linear search.
       */
      if (!png_memcmp(chunk_name, png_IDAT, 4))
        if (png_ptr->mode & PNG_AFTER_IDAT)
          png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;

      if (!png_memcmp(chunk_name, png_IHDR, 4))
         png_handle_IHDR(png_ptr, info_ptr, length);
      else if (!png_memcmp(chunk_name, png_IEND, 4))
         png_handle_IEND(png_ptr, info_ptr, length);
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
      else if (png_handle_as_unknown(png_ptr, chunk_name))
      {
         if (!png_memcmp(chunk_name, png_IDAT, 4))
            png_ptr->mode |= PNG_HAVE_IDAT;
         png_handle_unknown(png_ptr, info_ptr, length);
         if (!png_memcmp(chunk_name, png_PLTE, 4))
            png_ptr->mode |= PNG_HAVE_PLTE;
         else if (!png_memcmp(chunk_name, png_IDAT, 4))
         {
            if (!(png_ptr->mode & PNG_HAVE_IHDR))
               png_error(png_ptr, "Missing IHDR before IDAT");
            else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
                     !(png_ptr->mode & PNG_HAVE_PLTE))
               png_error(png_ptr, "Missing PLTE before IDAT");
            break;
         }
      }
#endif
      else if (!png_memcmp(chunk_name, png_PLTE, 4))
         png_handle_PLTE(png_ptr, info_ptr, length);
      else if (!png_memcmp(chunk_name, png_IDAT, 4))
      {
         if (!(png_ptr->mode & PNG_HAVE_IHDR))
            png_error(png_ptr, "Missing IHDR before IDAT");
         else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
                  !(png_ptr->mode & PNG_HAVE_PLTE))
            png_error(png_ptr, "Missing PLTE before IDAT");

         png_ptr->idat_size = length;
         png_ptr->mode |= PNG_HAVE_IDAT;
         break;
      }
#ifdef PNG_READ_bKGD_SUPPORTED
      else if (!png_memcmp(chunk_name, png_bKGD, 4))
         png_handle_bKGD(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_cHRM_SUPPORTED
      else if (!png_memcmp(chunk_name, png_cHRM, 4))
         png_handle_cHRM(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_gAMA_SUPPORTED
      else if (!png_memcmp(chunk_name, png_gAMA, 4))
         png_handle_gAMA(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_hIST_SUPPORTED
      else if (!png_memcmp(chunk_name, png_hIST, 4))
         png_handle_hIST(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_oFFs_SUPPORTED
      else if (!png_memcmp(chunk_name, png_oFFs, 4))
         png_handle_oFFs(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_pCAL_SUPPORTED
      else if (!png_memcmp(chunk_name, png_pCAL, 4))
         png_handle_pCAL(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_sCAL_SUPPORTED
      else if (!png_memcmp(chunk_name, png_sCAL, 4))
         png_handle_sCAL(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_pHYs_SUPPORTED
      else if (!png_memcmp(chunk_name, png_pHYs, 4))
         png_handle_pHYs(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_sBIT_SUPPORTED
      else if (!png_memcmp(chunk_name, png_sBIT, 4))
         png_handle_sBIT(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_sRGB_SUPPORTED
      else if (!png_memcmp(chunk_name, png_sRGB, 4))
         png_handle_sRGB(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_iCCP_SUPPORTED
      else if (!png_memcmp(chunk_name, png_iCCP, 4))
         png_handle_iCCP(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_sPLT_SUPPORTED
      else if (!png_memcmp(chunk_name, png_sPLT, 4))
         png_handle_sPLT(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_tEXt_SUPPORTED
      else if (!png_memcmp(chunk_name, png_tEXt, 4))
         png_handle_tEXt(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_tIME_SUPPORTED
      else if (!png_memcmp(chunk_name, png_tIME, 4))
         png_handle_tIME(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_tRNS_SUPPORTED
      else if (!png_memcmp(chunk_name, png_tRNS, 4))
         png_handle_tRNS(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_zTXt_SUPPORTED
      else if (!png_memcmp(chunk_name, png_zTXt, 4))
         png_handle_zTXt(png_ptr, info_ptr, length);
#endif
#ifdef PNG_READ_iTXt_SUPPORTED
      else if (!png_memcmp(chunk_name, png_iTXt, 4))
         png_handle_iTXt(png_ptr, info_ptr, length);
#endif
      else
         png_handle_unknown(png_ptr, info_ptr, length);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x7d18f
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x254(%rdi), %r15d
cmpq $0x7, %r15
ja 0x7ce11
pushq $0x8
popq %r13
subq %r15, %r13
movl $0x11, 0x490(%rbx)
leaq 0x2c(%r14), %r12
leaq (%r14,%r15), %rsi
addq $0x2c, %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x7e034
movb $0x8, 0x254(%rbx)
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x7a179
testl %eax, %eax
je 0x7ce04
cmpb $0x3, %r15b
ja 0x7cdf5
pushq $0x4
popq %rdx
subq %r15, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x7a179
testl %eax, %eax
je 0x7cdf5
leaq 0x207fa(%rip), %rsi     # 0x9d5ed
jmp 0x7cdfc
leaq 0x20800(%rip), %rsi     # 0x9d5fc
movq %rbx, %rdi
callq 0x849c0
cmpb $0x2, %r15b
ja 0x7ce11
orb $0x10, 0x11d(%rbx)
leaq 0x244(%rbx), %r15
movq %rbx, %rdi
callq 0x8b5f5
movl %eax, %ebp
cmpl $0x54414449, (%r15)     # imm = 0x54414449
jne 0x7ce40
movl 0x11c(%rbx), %eax
testb $0x8, %al
je 0x7ce40
orl $0x2000, %eax           # imm = 0x2000
movl %eax, 0x11c(%rbx)
cmpl $0x52444849, (%r15)     # imm = 0x52444849
je 0x7ce99
cmpl $0x444e4549, (%r15)     # imm = 0x444E4549
je 0x7ceab
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7a87f
testl %eax, %eax
je 0x7cebd
cmpl $0x54414449, (%r15)     # imm = 0x54414449
jne 0x7ce71
orb $0x4, 0x11c(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8ddd9
cmpl $0x45544c50, (%r15)     # imm = 0x45544C50
je 0x7cfc6
cmpl $0x54414449, (%r15)     # imm = 0x54414449
jne 0x7ce18
jmp 0x7d116
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8badb
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8bde8
jmp 0x7ce18
cmpl $0x45544c50, (%r15)     # imm = 0x45544C50
je 0x7cfd2
cmpl $0x54414449, (%r15)     # imm = 0x54414449
je 0x7d129
cmpl $0x44474b62, (%r15)     # imm = 0x44474B62
je 0x7cfe4
cmpl $0x4d524863, (%r15)     # imm = 0x4D524863
je 0x7cff6
cmpl $0x414d4167, (%r15)     # imm = 0x414D4167
je 0x7d008
cmpl $0x54534968, (%r15)     # imm = 0x54534968
je 0x7d01a
cmpl $0x7346466f, (%r15)     # imm = 0x7346466F
je 0x7d02c
cmpl $0x4c414370, (%r15)     # imm = 0x4C414370
je 0x7d03e
cmpl $0x4c414373, (%r15)     # imm = 0x4C414373
je 0x7d050
cmpl $0x73594870, (%r15)     # imm = 0x73594870
je 0x7d062
cmpl $0x54494273, (%r15)     # imm = 0x54494273
je 0x7d074
cmpl $0x42475273, (%r15)     # imm = 0x42475273
je 0x7d086
cmpl $0x50434369, (%r15)     # imm = 0x50434369
je 0x7d098
cmpl $0x544c5073, (%r15)     # imm = 0x544C5073
je 0x7d0aa
cmpl $0x74584574, (%r15)     # imm = 0x74584574
je 0x7d0bc
cmpl $0x454d4974, (%r15)     # imm = 0x454D4974
je 0x7d0ce
cmpl $0x534e5274, (%r15)     # imm = 0x534E5274
je 0x7d0e0
cmpl $0x7458547a, (%r15)     # imm = 0x7458547A
je 0x7d0f2
cmpl $0x74585469, (%r15)     # imm = 0x74585469
je 0x7d104
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8ddd9
jmp 0x7ce18
orb $0x2, 0x11c(%rbx)
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8bc4c
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8ccea
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8c0e2
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8be44
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8ceb4
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8d074
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8d1af
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8d4e1
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8cfbf
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8bfb3
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8c3cf
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8c5bd
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8c858
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8d758
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8d68e
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8cb04
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8d927
jmp 0x7ce18
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x8db59
jmp 0x7ce18
movl 0x11c(%rbx), %eax
testb $0x1, %al
jne 0x7d13c
leaq 0x204fc(%rip), %rsi     # 0x9d623
jmp 0x7d150
movl 0x11c(%rbx), %eax
testb $0x1, %al
jne 0x7d166
leaq 0x204e9(%rip), %rsi     # 0x9d623
jmp 0x7d17a
testb $0x2, %al
jne 0x7d18f
cmpb $0x3, 0x24e(%rbx)
jne 0x7d18f
leaq 0x204ec(%rip), %rsi     # 0x9d63c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x849c0
testb $0x2, %al
jne 0x7d182
cmpb $0x3, 0x24e(%rbx)
jne 0x7d182
leaq 0x204c2(%rip), %rsi     # 0x9d63c
movq %rbx, %rdi
callq 0x849c0
movl %ebp, 0x230(%rbx)
orb $0x4, 0x11c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq