// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngread.c
// Function: png_read_end
void PNGAPI
png_read_end(png_structp png_ptr, png_infop info_ptr)
{
   png_debug(1, "in png_read_end");
 
   if (png_ptr == NULL)
      return;
   png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */

   do
   {
      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;

      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))
         {
            if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
               png_benign_error(png_ptr, "Too many IDATs found");
         }
         png_handle_unknown(png_ptr, info_ptr, length);
         if (!png_memcmp(chunk_name, png_PLTE, 4))
            png_ptr->mode |= PNG_HAVE_PLTE;
      }
#endif
      else if (!png_memcmp(chunk_name, png_IDAT, 4))
      {
         /* Zero length IDATs are legal after the last IDAT has been
          * read, but not after other chunks have been read.
          */
         if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
            png_benign_error(png_ptr, "Too many IDATs found");
         png_crc_finish(png_ptr, length);
      }
      else if (!png_memcmp(chunk_name, png_PLTE, 4))
         png_handle_PLTE(png_ptr, info_ptr, length);
#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);
   } while (!(png_ptr->mode & PNG_HAVE_IEND));
}

// Assembly:
testq %rdi, %rdi
je 0x8bad9
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
callq 0x9a507
leaq 0x244(%r14), %r15
leaq 0x21235(%rip), %r12     # 0xac9e7
movq %r14, %rdi
callq 0x9a3c1
movl %eax, %ebp
cmpl $0x52444849, 0x244(%r14) # imm = 0x52444849
je 0x8b832
cmpl $0x444e4549, (%r15)     # imm = 0x444E4549
je 0x8b841
movq %r14, %rdi
movq %r15, %rsi
callq 0x88298
xorl %ecx, %ecx
cmpl $0x54414449, 0x244(%r14) # imm = 0x54414449
setne %cl
testl %eax, %eax
je 0x8b861
testl %ecx, %ecx
jne 0x8b80e
testl %ebp, %ebp
jne 0x8b803
testb $0x20, 0x11d(%r14)
je 0x8b80e
movq %r14, %rdi
movq %r12, %rsi
callq 0x92dd0
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9ccfe
cmpl $0x45544c50, 0x244(%r14) # imm = 0x45544C50
jne 0x8b84e
orb $0x2, 0x11c(%r14)
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9a91a
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9ac80
testb $0x10, 0x11c(%r14)
je 0x8b7b2
jmp 0x8bad1
testl %ecx, %ecx
je 0x8b965
cmpl $0x45544c50, (%r15)     # imm = 0x45544C50
je 0x8b98d
cmpl $0x44474b62, (%r15)     # imm = 0x44474B62
je 0x8b99f
cmpl $0x4d524863, (%r15)     # imm = 0x4D524863
je 0x8b9b1
cmpl $0x414d4167, (%r15)     # imm = 0x414D4167
je 0x8b9c3
cmpl $0x54534968, (%r15)     # imm = 0x54534968
je 0x8b9d5
cmpl $0x7346466f, (%r15)     # imm = 0x7346466F
je 0x8b9e7
cmpl $0x4c414370, (%r15)     # imm = 0x4C414370
je 0x8b9f9
cmpl $0x4c414373, (%r15)     # imm = 0x4C414373
je 0x8ba0b
cmpl $0x73594870, (%r15)     # imm = 0x73594870
je 0x8ba1d
cmpl $0x54494273, (%r15)     # imm = 0x54494273
je 0x8ba2f
cmpl $0x42475273, (%r15)     # imm = 0x42475273
je 0x8ba41
cmpl $0x50434369, (%r15)     # imm = 0x50434369
je 0x8ba53
cmpl $0x544c5073, (%r15)     # imm = 0x544C5073
je 0x8ba65
cmpl $0x74584574, (%r15)     # imm = 0x74584574
je 0x8ba77
cmpl $0x454d4974, (%r15)     # imm = 0x454D4974
je 0x8ba89
cmpl $0x534e5274, (%r15)     # imm = 0x534E5274
je 0x8ba9b
cmpl $0x7458547a, (%r15)     # imm = 0x7458547A
je 0x8baad
cmpl $0x74585469, (%r15)     # imm = 0x74585469
je 0x8babf
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9ccfe
jmp 0x8b84e
testl %ebp, %ebp
jne 0x8b973
testb $0x20, 0x11d(%r14)
je 0x8b97e
movq %r14, %rdi
movq %r12, %rsi
callq 0x92dd0
movq %r14, %rdi
movl %ebp, %esi
callq 0x9a507
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9aada
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9bbb3
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9af58
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9acd0
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9bd76
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9bf46
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9c083
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9c3e6
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9be8f
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9ae22
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9b26b
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9b433
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9b6d8
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9c661
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9c596
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9b99f
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9c83a
jmp 0x8b84e
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x9ca75
jmp 0x8b84e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq