// File: /workspace/github_cpp_makefile_star2_O1/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 0x8bbee
movq %rbx, %rdi
callq 0x87ca0
testq %r14, %r14
je 0x8bbfe
movq %rbx, %rdi
movq %r14, %rsi
callq 0x87ca0
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x430(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x1e8(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x488(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x388(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x390(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x298(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x2a0(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x2a8(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
testb $0x10, 0x3d9(%rbx)
je 0x8bc9d
movq 0x238(%rbx), %rsi
movq %rbx, %rdi
callq 0x87b7f
movl 0x3d8(%rbx), %eax
movl %eax, %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movl %ecx, 0x3d8(%rbx)
btl $0xd, %eax
jae 0x8bcc6
movq 0x2d8(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movl 0x3d8(%rbx), %eax
movl %eax, %ecx
andl $0xffffdfff, %ecx       # imm = 0xFFFFDFFF
movl %ecx, 0x3d8(%rbx)
testb $0x8, %al
je 0x8bced
movq 0x398(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
andb $-0x9, 0x3d8(%rbx)
cmpq $0x0, 0x2b0(%rbx)
je 0x8bd50
movl 0x288(%rbx), %eax
cmpl $-0x17, %eax
je 0x8bd41
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 0x92d32
incq %r15
cmpq %r15, %r14
jne 0x8bd26
movq 0x2b0(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
cmpq $0x0, 0x2b8(%rbx)
je 0x8bdac
movl 0x288(%rbx), %eax
cmpl $-0x17, %eax
je 0x8bd9d
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 0x92d32
incq %r15
cmpq %r15, %r14
jne 0x8bd82
movq 0x2b8(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
cmpq $0x0, 0x2c0(%rbx)
je 0x8be08
movl 0x288(%rbx), %eax
cmpl $-0x17, %eax
je 0x8bdf9
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 0x92d32
incq %r15
cmpq %r15, %r14
jne 0x8bdde
movq 0x2c0(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x3d0(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
leaq 0x128(%rbx), %rdi
callq 0x97748
movq 0x320(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
movq 0x378(%rbx), %rsi
movq %rbx, %rdi
callq 0x92d32
leaq 0x10(%rsp), %r14
movl $0xc8, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe370
movq 0xe0(%rbx), %r15
movq 0x428(%rbx), %r12
movups 0xd0(%rbx), %xmm0
movaps %xmm0, (%rsp)
movl $0x498, %edx            # imm = 0x498
movq %rbx, %rdi
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