// File: /workspace/github_cpp_makefile_star2_O2/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 0x7dbb9
movq %rbx, %rdi
callq 0x7a31a
testq %r14, %r14
je 0x7dbc9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7a31a
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x430(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x1e8(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x488(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x388(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x390(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x298(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x2a8(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movl 0x3d8(%rbx), %ecx
btl $0xc, %ecx
jae 0x7dc71
movq 0x238(%rbx), %rsi
movq %rbx, %rdi
callq 0x7a20e
movl 0x3d8(%rbx), %ecx
movl %ecx, %eax
andl $0xffffefff, %eax       # imm = 0xFFFFEFFF
movl %eax, 0x3d8(%rbx)
btl $0xd, %ecx
jae 0x7dc99
movq 0x2d8(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movl 0x3d8(%rbx), %eax
movl %eax, %ecx
andl $0xffffdfff, %ecx       # imm = 0xFFFFDFFF
movl %ecx, 0x3d8(%rbx)
testb $0x8, %al
je 0x7dcc0
movq 0x398(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movl 0x3d8(%rbx), %ecx
andl $-0x9, %ecx
movl %ecx, 0x3d8(%rbx)
cmpq $0x0, 0x2b0(%rbx)
pushq $0x1
popq %r14
je 0x7dd14
movb $0x8, %cl
subb 0x288(%rbx), %cl
movl %r14d, %r15d
shll %cl, %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
movq 0x2b0(%rbx), %rsi
cmpq %r12, %r15
je 0x7dd0c
movq (%rsi,%r12,8), %rsi
movq %rbx, %rdi
callq 0x84923
incq %r12
jmp 0x7dcef
movq %rbx, %rdi
callq 0x84923
cmpq $0x0, 0x2b8(%rbx)
je 0x7dd5b
movb $0x8, %cl
subb 0x288(%rbx), %cl
movl %r14d, %r15d
shll %cl, %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
movq 0x2b8(%rbx), %rsi
cmpq %r12, %r15
je 0x7dd53
movq (%rsi,%r12,8), %rsi
movq %rbx, %rdi
callq 0x84923
incq %r12
jmp 0x7dd36
movq %rbx, %rdi
callq 0x84923
cmpq $0x0, 0x2c0(%rbx)
je 0x7dd9f
movb $0x8, %cl
subb 0x288(%rbx), %cl
shll %cl, %r14d
xorl %r15d, %r15d
testl %r14d, %r14d
cmovlel %r15d, %r14d
movq 0x2c0(%rbx), %rsi
cmpq %r15, %r14
je 0x7dd97
movq (%rsi,%r15,8), %rsi
movq %rbx, %rdi
callq 0x84923
incq %r15
jmp 0x7dd7a
movq %rbx, %rdi
callq 0x84923
movq 0x3d0(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
leaq 0x128(%rbx), %rdi
callq 0x89412
movq 0x320(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
movq 0x378(%rbx), %rsi
movq %rbx, %rdi
callq 0x84923
leaq 0x10(%rsp), %r14
movl $0xc8, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe380
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 0xe270
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 0xe380
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq