// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngread.c
// Function: png_read_destroy
void /* PRIVATE */
png_read_destroy(png_structp png_ptr, png_infop info_ptr,
    png_infop end_info_ptr)
{
#ifdef PNG_SETJMP_SUPPORTED
   jmp_buf tmp_jmp;
#endif
   png_error_ptr error_fn;
   png_error_ptr warning_fn;
   png_voidp error_ptr;
#ifdef PNG_USER_MEM_SUPPORTED
   png_free_ptr free_fn;
#endif

   png_debug(1, "in png_read_destroy");
 
   if (info_ptr != NULL)
      png_info_destroy(png_ptr, info_ptr);

   if (end_info_ptr != NULL)
      png_info_destroy(png_ptr, end_info_ptr);

   png_free(png_ptr, png_ptr->zbuf);
   png_free(png_ptr, png_ptr->big_row_buf);
   png_free(png_ptr, png_ptr->prev_row);
   png_free(png_ptr, png_ptr->chunkdata);
#ifdef PNG_READ_QUANTIZE_SUPPORTED
   png_free(png_ptr, png_ptr->palette_lookup);
   png_free(png_ptr, png_ptr->quantize_index);
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED
   png_free(png_ptr, png_ptr->gamma_table);
#endif
#ifdef PNG_READ_BACKGROUND_SUPPORTED
   png_free(png_ptr, png_ptr->gamma_from_1);
   png_free(png_ptr, png_ptr->gamma_to_1);
#endif
   if (png_ptr->free_me & PNG_FREE_PLTE)
      png_zfree(png_ptr, png_ptr->palette);
   png_ptr->free_me &= ~PNG_FREE_PLTE;
#if defined(PNG_tRNS_SUPPORTED) || \
    defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
   if (png_ptr->free_me & PNG_FREE_TRNS)
      png_free(png_ptr, png_ptr->trans_alpha);
   png_ptr->free_me &= ~PNG_FREE_TRNS;
#endif
#ifdef PNG_READ_hIST_SUPPORTED
   if (png_ptr->free_me & PNG_FREE_HIST)
      png_free(png_ptr, png_ptr->hist);
   png_ptr->free_me &= ~PNG_FREE_HIST;
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED
   if (png_ptr->gamma_16_table != NULL)
   {
      int i;
      int istop = (1 << (8 - png_ptr->gamma_shift));
      for (i = 0; i < istop; i++)
      {
         png_free(png_ptr, png_ptr->gamma_16_table[i]);
      }
   png_free(png_ptr, png_ptr->gamma_16_table);
   }
#ifdef PNG_READ_BACKGROUND_SUPPORTED
   if (png_ptr->gamma_16_from_1 != NULL)
   {
      int i;
      int istop = (1 << (8 - png_ptr->gamma_shift));
      for (i = 0; i < istop; i++)
      {
         png_free(png_ptr, png_ptr->gamma_16_from_1[i]);
      }
   png_free(png_ptr, png_ptr->gamma_16_from_1);
   }
   if (png_ptr->gamma_16_to_1 != NULL)
   {
      int i;
      int istop = (1 << (8 - png_ptr->gamma_shift));
      for (i = 0; i < istop; i++)
      {
         png_free(png_ptr, png_ptr->gamma_16_to_1[i]);
      }
   png_free(png_ptr, png_ptr->gamma_16_to_1);
   }
#endif
#endif
#ifdef PNG_TIME_RFC1123_SUPPORTED
   png_free(png_ptr, png_ptr->time_buffer);
#endif

   inflateEnd(&png_ptr->zstream);
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
   png_free(png_ptr, png_ptr->save_buffer);
#endif

#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
#ifdef PNG_TEXT_SUPPORTED
   png_free(png_ptr, png_ptr->current_text);
#endif /* PNG_TEXT_SUPPORTED */
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */

   /* Save the important info out of the png_struct, in case it is
    * being used again.
    */
#ifdef PNG_SETJMP_SUPPORTED
   png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
#endif

   error_fn = png_ptr->error_fn;
   warning_fn = png_ptr->warning_fn;
   error_ptr = png_ptr->error_ptr;
#ifdef PNG_USER_MEM_SUPPORTED
   free_fn = png_ptr->free_fn;
#endif

   png_memset(png_ptr, 0, png_sizeof(png_struct));

   png_ptr->error_fn = error_fn;
   png_ptr->warning_fn = warning_fn;
   png_ptr->error_ptr = error_ptr;
#ifdef PNG_USER_MEM_SUPPORTED
   png_ptr->free_fn = free_fn;
#endif

#ifdef PNG_SETJMP_SUPPORTED
   png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
#endif

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x8ae26
movq %rbx, %rdi
callq 0x86ebe
testq %r14, %r14
je 0x8ae36
movq %rbx, %rdi
movq %r14, %rsi
callq 0x86ebe
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x430(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x1e8(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x488(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x388(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x390(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x298(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x2a8(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movl 0x3d8(%rbx), %ecx
btl $0xc, %ecx
jae 0x8aede
movq 0x238(%rbx), %rsi
movq %rbx, %rdi
callq 0x86daa
movl 0x3d8(%rbx), %ecx
movl %ecx, %eax
andl $0xffffefff, %eax       # imm = 0xFFFFEFFF
movl %eax, 0x3d8(%rbx)
btl $0xd, %ecx
jae 0x8af06
movq 0x2d8(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movl 0x3d8(%rbx), %eax
movl %eax, %ecx
andl $0xffffdfff, %ecx       # imm = 0xFFFFDFFF
movl %ecx, 0x3d8(%rbx)
testb $0x8, %al
je 0x8af2d
movq 0x398(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movl 0x3d8(%rbx), %ecx
andl $-0x9, %ecx
movl %ecx, 0x3d8(%rbx)
movq 0x2b0(%rbx), %rsi
testq %rsi, %rsi
je 0x8af94
movl 0x288(%rbx), %eax
cmpl $-0x17, %eax
je 0x8af8c
movb $0x8, %cl
subb %al, %cl
movl $0x1, %eax
movl $0x1, %r14d
shll %cl, %r14d
cmpl $0x2, %r14d
cmovll %eax, %r14d
xorl %r15d, %r15d
movq 0x2b0(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x92016
incq %r15
cmpq %r15, %r14
jne 0x8af6a
movq 0x2b0(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x2b8(%rbx), %rsi
testq %rsi, %rsi
je 0x8aff2
movl 0x288(%rbx), %eax
cmpl $-0x17, %eax
je 0x8afea
movb $0x8, %cl
subb %al, %cl
movl $0x1, %eax
movl $0x1, %r14d
shll %cl, %r14d
cmpl $0x2, %r14d
cmovll %eax, %r14d
xorl %r15d, %r15d
movq 0x2b8(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x92016
incq %r15
cmpq %r15, %r14
jne 0x8afc8
movq 0x2b8(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x2c0(%rbx), %rsi
testq %rsi, %rsi
je 0x8b050
movl 0x288(%rbx), %eax
cmpl $-0x17, %eax
je 0x8b048
movb $0x8, %cl
subb %al, %cl
movl $0x1, %eax
movl $0x1, %r14d
shll %cl, %r14d
cmpl $0x2, %r14d
cmovll %eax, %r14d
xorl %r15d, %r15d
movq 0x2c0(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x92016
incq %r15
cmpq %r15, %r14
jne 0x8b026
movq 0x2c0(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x3d0(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
leaq 0x128(%rbx), %rdi
callq 0x96e17
movq 0x320(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
movq 0x378(%rbx), %rsi
movq %rbx, %rdi
callq 0x92016
leaq 0x10(%rsp), %r14
movl $0xc8, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe370
movq 0xe0(%rbx), %r15
movq 0x428(%rbx), %r12
leaq 0xc8(%rbx), %rdi
movups 0xd0(%rbx), %xmm0
movaps %xmm0, (%rsp)
movl $0x3d0, %edx            # imm = 0x3D0
xorl %esi, %esi
callq 0xe260
movaps (%rsp), %xmm0
movups %xmm0, 0xd0(%rbx)
movq %r15, 0xe0(%rbx)
movq %r12, 0x428(%rbx)
movl $0xc8, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe370
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq