LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_iCCP
void PNGAPI
png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
             png_charp name, int compression_type,
             png_charp profile, png_uint_32 proflen)
{
   png_charp new_iccp_name;
   png_charp new_iccp_profile;
   png_uint_32 length;

   png_debug1(1, "in %s storage function", "iCCP");

   if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL)
      return;

   length = png_strlen(name)+1;
   new_iccp_name = (png_charp)png_malloc_warn(png_ptr, length);
   if (new_iccp_name == NULL)
   {
        png_warning(png_ptr, "Insufficient memory to process iCCP chunk");
      return;
   }
   png_memcpy(new_iccp_name, name, length);
   new_iccp_profile = (png_charp)png_malloc_warn(png_ptr, proflen);
   if (new_iccp_profile == NULL)
   {
      png_free (png_ptr, new_iccp_name);
      png_warning(png_ptr,
          "Insufficient memory to process iCCP profile");
      return;
   }
   png_memcpy(new_iccp_profile, profile, (png_size_t)proflen);

   png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0);

   info_ptr->iccp_proflen = proflen;
   info_ptr->iccp_name = new_iccp_name;
   info_ptr->iccp_profile = new_iccp_profile;
   /* Compression is always zero but is here so the API and info structure
    * does not have to change if we introduce multiple compression types
    */
   info_ptr->iccp_compression = (png_byte)compression_type;
   info_ptr->free_me |= PNG_FREE_ICCP;
   info_ptr->valid |= PNG_INFO_iCCP;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %r8, %xmm0
movq %rdx, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %eax
testl %eax, %eax
je 0x89069
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r8, %r12
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r15
movl %r9d, (%rsp)
movl %ecx, 0x4(%rsp)
movq %rdx, %rdi
callq 0xe1e0
movq %rax, %r14
incl %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x92d72
testq %rax, %rax
je 0x89114
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0xe370
movl (%rsp), %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0x92d72
testq %rax, %rax
je 0x8911d
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xe370
movq %r15, %rdi
movq %rbx, %rsi
movl $0x10, %edx
xorl %ecx, %ecx
callq 0x87d43
movl (%rsp), %eax
movl %eax, 0x108(%rbx)
movq %rbp, 0xf8(%rbx)
movq %r13, 0x100(%rbx)
movl 0x4(%rsp), %eax
movb %al, 0x10c(%rbx)
orb $0x10, 0xe4(%rbx)
orb $0x10, 0x9(%rbx)
jmp 0x8905a
leaq 0x2352f(%rip), %rsi     # 0xac64a
jmp 0x8912f
movq %r15, %rdi
movq %rbp, %rsi
callq 0x92d32
leaq 0x23545(%rip), %rsi     # 0xac674
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x92e6e
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_tIME
void PNGAPI
png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time)
{
   png_debug1(1, "in %s storage function", "tIME");

   if (png_ptr == NULL || info_ptr == NULL ||
       (png_ptr->mode & PNG_WROTE_tIME))
      return;

   png_memcpy(&(info_ptr->mod_time), mod_time, png_sizeof(png_time));
   info_ptr->valid |= PNG_INFO_tIME;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x89476
testb $0x2, 0x11d(%rdi)
jne 0x89476
movq (%rdx), %rax
movq %rax, 0x50(%rsi)
orb $0x2, 0x9(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_tRNS
void PNGAPI
png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
   png_bytep trans_alpha, int num_trans, png_color_16p trans_color)
{
   png_debug1(1, "in %s storage function", "tRNS");

   if (png_ptr == NULL || info_ptr == NULL)
      return;

   if (trans_alpha != NULL)
   {
       /* It may not actually be necessary to set png_ptr->trans_alpha here;
        * we do it for backward compatibility with the way the png_handle_tRNS
        * function used to do the allocation.
        */

       png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);

       /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
       png_ptr->trans_alpha = info_ptr->trans_alpha = (png_bytep)png_malloc(png_ptr,
           (png_size_t)PNG_MAX_PALETTE_LENGTH);
       if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH)
          png_memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans);
   }

   if (trans_color != NULL)
   {
      int sample_max = (1 << info_ptr->bit_depth);
      if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
          (int)trans_color->gray > sample_max) ||
          (info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
          ((int)trans_color->red > sample_max ||
          (int)trans_color->green > sample_max ||
          (int)trans_color->blue > sample_max)))
         png_warning(png_ptr,
            "tRNS chunk has out-of-range samples for bit_depth");
      png_memcpy(&(info_ptr->trans_color), trans_color,
         png_sizeof(png_color_16));
      if (num_trans == 0)
         num_trans = 1;
   }

   info_ptr->num_trans = (png_uint_16)num_trans;
   if (num_trans != 0)
   {
      info_ptr->valid |= PNG_INFO_tRNS;
      info_ptr->free_me |= PNG_FREE_TRNS;
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %r14d
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x8956e
movq %r8, %r15
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r12
testq %rdx, %rdx
je 0x894ed
movq %r12, %rdi
movq %rbx, %rsi
movl $0x2000, %edx           # imm = 0x2000
xorl %ecx, %ecx
callq 0x87d43
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
callq 0x92cb5
movq %rax, 0x60(%rbx)
movq %rax, 0x2d8(%r12)
leal -0x1(%r14), %ecx
cmpl $0xff, %ecx
ja 0x894ed
movl %r14d, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0xe370
testq %r15, %r15
je 0x89559
movb 0x24(%rbx), %cl
movl $0x1, %eax
shll %cl, %eax
movzbl 0x25(%rbx), %ecx
cmpl $0x2, %ecx
je 0x89517
testl %ecx, %ecx
jne 0x89541
movzwl 0x8(%r15), %edx
cmpl %edx, %eax
jl 0x89532
cmpb $0x2, %cl
jne 0x89541
movzwl 0x2(%r15), %ecx
cmpl %ecx, %eax
jl 0x89532
movzwl 0x4(%r15), %ecx
cmpl %ecx, %eax
jl 0x89532
movzwl 0x6(%r15), %ecx
cmpl %ecx, %eax
jge 0x89541
leaq 0x23189(%rip), %rsi     # 0xac6c2
movq %r12, %rdi
callq 0x92e6e
movzwl 0x8(%r15), %eax
movw %ax, 0x70(%rbx)
movq (%r15), %rax
movq %rax, 0x68(%rbx)
cmpl $0x1, %r14d
adcl $0x0, %r14d
movw %r14w, 0x22(%rbx)
testl %r14d, %r14d
je 0x8956e
orb $0x10, 0x8(%rbx)
orb $0x20, 0xe5(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_rows
void PNGAPI
png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
{
   png_debug1(1, "in %s storage function", "rows");

   if (png_ptr == NULL || info_ptr == NULL)
      return;

   if (info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers))
      png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0);
   info_ptr->row_pointers = row_pointers;
   if (row_pointers)
      info_ptr->valid |= PNG_INFO_IDAT;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x89fc3
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq 0x140(%rsi), %rax
testq %rax, %rax
sete %cl
cmpq %rdx, %rax
sete %al
orb %cl, %al
jne 0x89fac
movq %rbx, %rsi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x87d43
movq %r14, 0x140(%rbx)
testq %r14, %r14
je 0x89fbc
orb $-0x80, 0x9(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_compression_buffer_size
void PNGAPI
png_set_compression_buffer_size(png_structp png_ptr,
    png_size_t size)
{
    if (png_ptr == NULL)
       return;
    png_free(png_ptr, png_ptr->zbuf);
    png_ptr->zbuf_size = size;
    png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size);
    png_ptr->zstream.next_out = png_ptr->zbuf;
    png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
}

// Assembly:
testq %rdi, %rdi
je 0x8a012
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x198(%rdi), %rsi
callq 0x92d32
movq %r14, 0x1a0(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x92cb5
movq %rax, 0x198(%rbx)
movq %rax, 0x140(%rbx)
movl 0x1a0(%rbx), %eax
movl %eax, 0x148(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_bKGD
png_uint_32 PNGAPI
png_get_bKGD(png_structp png_ptr, png_infop info_ptr,
   png_color_16p *background)
{
   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)
      && background != NULL)
   {
      png_debug1(1, "in %s retrieval function", "bKGD");

      *background = &(info_ptr->background);
      return (PNG_INFO_bKGD);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a2f2
testq %rdx, %rdx
je 0x8a2f2
movl 0x8(%rsi), %ecx
andl $0x20, %ecx
je 0x8a2f2
addq $0x72, %rsi
movq %rsi, (%rdx)
movl $0x20, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_cHRM
png_uint_32 PNGAPI
png_get_cHRM(png_structp png_ptr, png_infop info_ptr,
   double *white_x, double *white_y, double *red_x, double *red_y,
   double *green_x, double *green_y, double *blue_x, double *blue_y)
{
   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
   {
      png_debug1(1, "in %s retrieval function", "cHRM");

      if (white_x != NULL)
         *white_x = (double)info_ptr->x_white;
      if (white_y != NULL)
         *white_y = (double)info_ptr->y_white;
      if (red_x != NULL)
         *red_x = (double)info_ptr->x_red;
      if (red_y != NULL)
         *red_y = (double)info_ptr->y_red;
      if (green_x != NULL)
         *green_x = (double)info_ptr->x_green;
      if (green_y != NULL)
         *green_y = (double)info_ptr->y_green;
      if (blue_x != NULL)
         *blue_x = (double)info_ptr->x_blue;
      if (blue_y != NULL)
         *blue_y = (double)info_ptr->y_blue;
      return (PNG_INFO_cHRM);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %dil
testq %rsi, %rsi
sete %r10b
xorl %eax, %eax
orb %dil, %r10b
jne 0x8a3ce
testb $0x4, 0x8(%rsi)
je 0x8a3ce
testq %rdx, %rdx
je 0x8a327
cvtss2sd 0xa0(%rsi), %xmm0
movsd %xmm0, (%rdx)
testq %rcx, %rcx
je 0x8a33b
xorps %xmm0, %xmm0
cvtss2sd 0xa4(%rsi), %xmm0
movsd %xmm0, (%rcx)
testq %r8, %r8
je 0x8a350
xorps %xmm0, %xmm0
cvtss2sd 0xa8(%rsi), %xmm0
movsd %xmm0, (%r8)
movq 0x8(%rsp), %rax
testq %r9, %r9
je 0x8a36a
xorps %xmm0, %xmm0
cvtss2sd 0xac(%rsi), %xmm0
movsd %xmm0, (%r9)
movq 0x10(%rsp), %rcx
testq %rax, %rax
je 0x8a383
xorps %xmm0, %xmm0
cvtss2sd 0xb0(%rsi), %xmm0
movsd %xmm0, (%rax)
movq 0x18(%rsp), %rax
testq %rcx, %rcx
je 0x8a39c
xorps %xmm0, %xmm0
cvtss2sd 0xb4(%rsi), %xmm0
movsd %xmm0, (%rcx)
movq 0x20(%rsp), %rcx
testq %rax, %rax
je 0x8a3b5
xorps %xmm0, %xmm0
cvtss2sd 0xb8(%rsi), %xmm0
movsd %xmm0, (%rax)
movl $0x4, %eax
testq %rcx, %rcx
je 0x8a3ce
xorps %xmm0, %xmm0
cvtss2sd 0xbc(%rsi), %xmm0
movsd %xmm0, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_cHRM_fixed
png_uint_32 PNGAPI
png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
   png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x,
   png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y,
   png_fixed_point *blue_x, png_fixed_point *blue_y)
{
   png_debug1(1, "in %s retrieval function", "cHRM");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
   {
      if (white_x != NULL)
         *white_x = info_ptr->int_x_white;
      if (white_y != NULL)
         *white_y = info_ptr->int_y_white;
      if (red_x != NULL)
         *red_x = info_ptr->int_x_red;
      if (red_y != NULL)
         *red_y = info_ptr->int_y_red;
      if (green_x != NULL)
         *green_x = info_ptr->int_x_green;
      if (green_y != NULL)
         *green_y = info_ptr->int_y_green;
      if (blue_x != NULL)
         *blue_x = info_ptr->int_x_blue;
      if (blue_y != NULL)
         *blue_y = info_ptr->int_y_blue;
      return (PNG_INFO_cHRM);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %dil
testq %rsi, %rsi
sete %r10b
xorl %eax, %eax
orb %dil, %r10b
jne 0x8a475
testb $0x4, 0x8(%rsi)
je 0x8a475
testq %rdx, %rdx
je 0x8a3ff
movl 0x14c(%rsi), %eax
movl %eax, (%rdx)
testq %rcx, %rcx
je 0x8a40c
movl 0x150(%rsi), %eax
movl %eax, (%rcx)
testq %r8, %r8
je 0x8a41a
movl 0x154(%rsi), %eax
movl %eax, (%r8)
movq 0x8(%rsp), %rax
testq %r9, %r9
je 0x8a42d
movl 0x158(%rsi), %ecx
movl %ecx, (%r9)
movq 0x10(%rsp), %rcx
testq %rax, %rax
je 0x8a43f
movl 0x15c(%rsi), %edx
movl %edx, (%rax)
movq 0x18(%rsp), %rax
testq %rcx, %rcx
je 0x8a451
movl 0x160(%rsi), %edx
movl %edx, (%rcx)
movq 0x20(%rsp), %rcx
testq %rax, %rax
je 0x8a463
movl 0x164(%rsi), %edx
movl %edx, (%rax)
movl $0x4, %eax
testq %rcx, %rcx
je 0x8a475
movl 0x168(%rsi), %edx
movl %edx, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_gAMA
png_uint_32 PNGAPI
png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
{
   png_debug1(1, "in %s retrieval function", "gAMA");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
      && file_gamma != NULL)
   {
      *file_gamma = (double)info_ptr->gamma;
      return (PNG_INFO_gAMA);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a4a5
testq %rdx, %rdx
je 0x8a4a5
movl 0x8(%rsi), %ecx
andl $0x1, %ecx
je 0x8a4a5
cvtss2sd 0x34(%rsi), %xmm0
movsd %xmm0, (%rdx)
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_gAMA_fixed
png_uint_32 PNGAPI
png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr,
    png_fixed_point *int_file_gamma)
{
   png_debug1(1, "in %s retrieval function", "gAMA");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
      && int_file_gamma != NULL)
   {
      *int_file_gamma = info_ptr->int_gamma;
      return (PNG_INFO_gAMA);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a4d4
testq %rdx, %rdx
je 0x8a4d4
movl 0x8(%rsi), %ecx
andl $0x1, %ecx
je 0x8a4d4
movl 0x148(%rsi), %eax
movl %eax, (%rdx)
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_sRGB
png_uint_32 PNGAPI
png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
{
   png_debug1(1, "in %s retrieval function", "sRGB");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)
      && file_srgb_intent != NULL)
   {
      *file_srgb_intent = (int)info_ptr->srgb_intent;
      return (PNG_INFO_sRGB);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a503
testq %rdx, %rdx
je 0x8a503
movl $0x800, %ecx            # imm = 0x800
andl 0x8(%rsi), %ecx
je 0x8a503
movzbl 0x38(%rsi), %eax
movl %eax, (%rdx)
movl $0x800, %eax            # imm = 0x800
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_iCCP
png_uint_32 PNGAPI
png_get_iCCP(png_structp png_ptr, png_infop info_ptr,
             png_charpp name, int *compression_type,
             png_charpp profile, png_uint_32 *proflen)
{
   png_debug1(1, "in %s retrieval function", "iCCP");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)
      && name != NULL && profile != NULL && proflen != NULL)
   {
      *name = info_ptr->iccp_name;
      *profile = info_ptr->iccp_profile;
      /* Compression_type is a dummy so the API won't have to change
       * if we introduce multiple compression types later.
       */
      *proflen = (int)info_ptr->iccp_proflen;
      *compression_type = (int)info_ptr->iccp_compression;
      return (PNG_INFO_iCCP);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %dil
testq %rsi, %rsi
sete %r10b
xorl %eax, %eax
orb %dil, %r10b
jne 0x8a55d
testq %r9, %r9
je 0x8a55d
testq %r8, %r8
je 0x8a55d
testq %rdx, %rdx
je 0x8a55d
movl $0x1000, %edi           # imm = 0x1000
andl 0x8(%rsi), %edi
je 0x8a55d
movq 0xf8(%rsi), %rax
movq %rax, (%rdx)
movq 0x100(%rsi), %rax
movq %rax, (%r8)
movl 0x108(%rsi), %eax
movl %eax, (%r9)
movzbl 0x10c(%rsi), %eax
movl %eax, (%rcx)
movl $0x1000, %eax           # imm = 0x1000
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_sPLT
png_uint_32 PNGAPI
png_get_sPLT(png_structp png_ptr, png_infop info_ptr,
             png_sPLT_tpp spalettes)
{
   if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL)
   {
     *spalettes = info_ptr->splt_palettes;
     return ((png_uint_32)info_ptr->splt_palettes_num);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a58a
movq 0x110(%rsi), %rax
movq %rax, (%rdx)
movl 0x118(%rsi), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_hIST
png_uint_32 PNGAPI
png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist)
{
   png_debug1(1, "in %s retrieval function", "hIST");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST)
      && hist != NULL)
   {
      *hist = info_ptr->hist;
      return (PNG_INFO_hIST);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a5bb
testq %rdx, %rdx
je 0x8a5bb
movl 0x8(%rsi), %ecx
andl $0x40, %ecx
je 0x8a5bb
movq 0x98(%rsi), %rax
movq %rax, (%rdx)
movl $0x40, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_IHDR
png_uint_32 PNGAPI
png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
   png_uint_32 *width, png_uint_32 *height, int *bit_depth,
   int *color_type, int *interlace_type, int *compression_type,
   int *filter_type)

{
   png_debug1(1, "in %s retrieval function", "IHDR");

   if (png_ptr == NULL || info_ptr == NULL || width == NULL ||
       height == NULL || bit_depth == NULL || color_type == NULL)
      return (0);

   *width = info_ptr->width;
   *height = info_ptr->height;
   *bit_depth = info_ptr->bit_depth;
   *color_type = info_ptr->color_type;

   if (compression_type != NULL)
      *compression_type = info_ptr->compression_type;

   if (filter_type != NULL)
      *filter_type = info_ptr->filter_type;

   if (interlace_type != NULL)
      *interlace_type = info_ptr->interlace_type;

   /* This is redundant if we can be sure that the info_ptr values were all
    * assigned in png_set_IHDR().  We do the check anyhow in case an
    * application has ignored our advice not to mess with the members
    * of info_ptr directly.
    */
   png_check_IHDR (png_ptr, info_ptr->width, info_ptr->height,
       info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
       info_ptr->compression_type, info_ptr->filter_type);

   return (1);
}

// Assembly:
movq %rsi, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %rcx, %xmm0
movq %rdx, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
testq %r8, %r8
sete %al
testq %r9, %r9
sete %r10b
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %r11d
testl %r11d, %r11d
setne %r11b
orb %al, %r10b
xorl %eax, %eax
orb %r11b, %r10b
jne 0x8a68f
pushq %rax
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %r10
movl (%rsi), %r11d
movl %r11d, (%rdx)
movl 0x4(%rsi), %edx
movl %edx, (%rcx)
movzbl 0x24(%rsi), %ecx
movl %ecx, (%r8)
movzbl 0x25(%rsi), %r8d
movl %r8d, (%r9)
testq %r10, %r10
je 0x8a646
movzbl 0x26(%rsi), %edx
movl %edx, (%r10)
movq 0x10(%rsp), %rdx
testq %rax, %rax
je 0x8a658
movzbl 0x27(%rsi), %r9d
movl %r9d, (%rax)
testq %rdx, %rdx
je 0x8a663
movzbl 0x28(%rsi), %eax
movl %eax, (%rdx)
movl (%rsi), %eax
movl 0x4(%rsi), %edx
movzbl 0x28(%rsi), %r9d
movzbl 0x26(%rsi), %r10d
movzbl 0x27(%rsi), %r11d
movl %eax, %esi
pushq %r11
pushq %r10
callq 0x88526
addq $0x10, %rsp
movl $0x1, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_oFFs
png_uint_32 PNGAPI
png_get_oFFs(png_structp png_ptr, png_infop info_ptr,
   png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
{
   png_debug1(1, "in %s retrieval function", "oFFs");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs)
      && offset_x != NULL && offset_y != NULL && unit_type != NULL)
   {
      *offset_x = info_ptr->x_offset;
      *offset_y = info_ptr->y_offset;
      *unit_type = (int)info_ptr->offset_unit_type;
      return (PNG_INFO_oFFs);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %dil
testq %rsi, %rsi
sete %r9b
xorl %eax, %eax
orb %dil, %r9b
jne 0x8a6da
testq %r8, %r8
je 0x8a6da
testq %rcx, %rcx
je 0x8a6da
testq %rdx, %rdx
je 0x8a6da
movl $0x100, %edi            # imm = 0x100
andl 0x8(%rsi), %edi
je 0x8a6da
movl 0x7c(%rsi), %eax
movl %eax, (%rdx)
movl 0x80(%rsi), %eax
movl %eax, (%rcx)
movzbl 0x84(%rsi), %eax
movl %eax, (%r8)
movl $0x100, %eax            # imm = 0x100
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_pCAL
png_uint_32 PNGAPI
png_get_pCAL(png_structp png_ptr, png_infop info_ptr,
   png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams,
   png_charp *units, png_charpp *params)
{
   png_debug1(1, "in %s retrieval function", "pCAL");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL)
       && purpose != NULL && X0 != NULL && X1 != NULL && type != NULL &&
       nparams != NULL && units != NULL && params != NULL)
   {
      *purpose = info_ptr->pcal_purpose;
      *X0 = info_ptr->pcal_X0;
      *X1 = info_ptr->pcal_X1;
      *type = (int)info_ptr->pcal_type;
      *nparams = (int)info_ptr->pcal_nparams;
      *units = info_ptr->pcal_units;
      *params = info_ptr->pcal_params;
      return (PNG_INFO_pCAL);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %dil
testq %rsi, %rsi
sete %r10b
xorl %eax, %eax
orb %dil, %r10b
jne 0x8a7a3
movq %rcx, %xmm0
movq %rdx, %xmm1
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq %r9, %xmm0
movq %r8, %xmm2
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %edi
testl %edi, %edi
jne 0x8a7a3
pushq %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8a7a2
movq 0x18(%rsp), %r10
testq %r10, %r10
je 0x8a7a2
movq 0x20(%rsp), %r11
testq %r11, %r11
je 0x8a7a2
movl $0x400, %ebx            # imm = 0x400
andl 0x8(%rsi), %ebx
je 0x8a7a2
movq 0xc0(%rsi), %rax
movq %rax, (%rdx)
movl 0xc8(%rsi), %eax
movl %eax, (%rcx)
movl 0xcc(%rsi), %eax
movl %eax, (%r8)
movzbl 0xe0(%rsi), %eax
movl %eax, (%r9)
movzbl 0xe1(%rsi), %eax
movl %eax, (%rdi)
movq 0xd0(%rsi), %rax
movq %rax, (%r10)
movq 0xd8(%rsi), %rax
movq %rax, (%r11)
movl $0x400, %eax            # imm = 0x400
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_sCAL
png_uint_32 PNGAPI
png_get_sCAL(png_structp png_ptr, png_infop info_ptr,
             int *unit, double *width, double *height)
{
    if (png_ptr != NULL && info_ptr != NULL &&
        (info_ptr->valid & PNG_INFO_sCAL))
    {
        *unit = info_ptr->scal_unit;
        *width = info_ptr->scal_pixel_width;
        *height = info_ptr->scal_pixel_height;
        return (PNG_INFO_sCAL);
    }
    return(0);
}

// Assembly:
testq %rdi, %rdi
sete %dil
testq %rsi, %rsi
sete %r9b
xorl %eax, %eax
orb %dil, %r9b
jne 0x8a7e6
testb $0x40, 0x9(%rsi)
je 0x8a7e6
movzbl 0x11c(%rsi), %eax
movl %eax, (%rdx)
movsd 0x120(%rsi), %xmm0
movsd %xmm0, (%rcx)
movsd 0x128(%rsi), %xmm0
movsd %xmm0, (%r8)
movl $0x4000, %eax           # imm = 0x4000
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_PLTE
png_uint_32 PNGAPI
png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette,
   int *num_palette)
{
   png_debug1(1, "in %s retrieval function", "PLTE");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE)
       && palette != NULL)
   {
      *palette = info_ptr->palette;
      *num_palette = info_ptr->num_palette;
      png_debug1(3, "num_palette = %d", *num_palette);
      return (PNG_INFO_PLTE);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %dil
testq %rsi, %rsi
sete %r8b
xorl %eax, %eax
orb %dil, %r8b
jne 0x8a873
testq %rdx, %rdx
je 0x8a873
movl 0x8(%rsi), %edi
andl $0x8, %edi
je 0x8a873
movq 0x18(%rsi), %rax
movq %rax, (%rdx)
movzwl 0x20(%rsi), %eax
movl %eax, (%rcx)
movl $0x8, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_sBIT
png_uint_32 PNGAPI
png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
{
   png_debug1(1, "in %s retrieval function", "sBIT");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT)
      && sig_bit != NULL)
   {
      *sig_bit = &(info_ptr->sig_bit);
      return (PNG_INFO_sBIT);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a8a1
testq %rdx, %rdx
je 0x8a8a1
movl 0x8(%rsi), %ecx
andl $0x2, %ecx
je 0x8a8a1
addq $0x58, %rsi
movq %rsi, (%rdx)
movl $0x2, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_text
png_uint_32 PNGAPI
png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr,
   int *num_text)
{
   if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0)
   {
      png_debug1(1, "in %s retrieval function",
         (png_ptr->chunk_name[0] == '\0' ? "text"
             : (png_const_charp)png_ptr->chunk_name));

      if (text_ptr != NULL)
         *text_ptr = info_ptr->text;

      if (num_text != NULL)
         *num_text = info_ptr->num_text;

      return ((png_uint_32)info_ptr->num_text);
   }
   if (num_text != NULL)
     *num_text = 0;
   return(0);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %dil
orb %al, %dil
jne 0x8a8d2
movl 0x3c(%rsi), %eax
testl %eax, %eax
jle 0x8a8d2
testq %rdx, %rdx
je 0x8a8c7
movq 0x48(%rsi), %rdi
movq %rdi, (%rdx)
testq %rcx, %rcx
je 0x8a8ce
movl %eax, (%rcx)
movl 0x3c(%rsi), %eax
retq
xorl %eax, %eax
testq %rcx, %rcx
je 0x8a8df
movl $0x0, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_tIME
png_uint_32 PNGAPI
png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
{
   png_debug1(1, "in %s retrieval function", "tIME");

   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME)
       && mod_time != NULL)
   {
      *mod_time = &(info_ptr->mod_time);
      return (PNG_INFO_tIME);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a90f
testq %rdx, %rdx
je 0x8a90f
movl $0x200, %ecx            # imm = 0x200
andl 0x8(%rsi), %ecx
je 0x8a90f
addq $0x50, %rsi
movq %rsi, (%rdx)
movl $0x200, %eax            # imm = 0x200
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_tRNS
png_uint_32 PNGAPI
png_get_tRNS(png_structp png_ptr, png_infop info_ptr,
   png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
{
   png_uint_32 retval = 0;
   if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
   {
      png_debug1(1, "in %s retrieval function", "tRNS");

      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
      {
          if (trans_alpha != NULL)
          {
             *trans_alpha = info_ptr->trans_alpha;
             retval |= PNG_INFO_tRNS;
          }

          if (trans_color != NULL)
             *trans_color = &(info_ptr->trans_color);
      }
      else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */
      {
          if (trans_color != NULL)
          {
             *trans_color = &(info_ptr->trans_color);
             retval |= PNG_INFO_tRNS;
          }

          if (trans_alpha != NULL)
             *trans_alpha = NULL;
      }
      if (num_trans != NULL)
      {
         *num_trans = info_ptr->num_trans;
         retval |= PNG_INFO_tRNS;
      }
   }
   return (retval);
}

// Assembly:
testq %rdi, %rdi
sete %dil
testq %rsi, %rsi
sete %r9b
xorl %eax, %eax
orb %dil, %r9b
jne 0x8a985
testb $0x10, 0x8(%rsi)
je 0x8a985
cmpb $0x3, 0x25(%rsi)
jne 0x8a944
testq %rdx, %rdx
je 0x8a957
movq 0x60(%rsi), %rax
movq %rax, (%rdx)
movl $0x10, %eax
jmp 0x8a959
testq %r8, %r8
je 0x8a967
leaq 0x68(%rsi), %rax
movq %rax, (%r8)
movl $0x10, %eax
jmp 0x8a969
xorl %eax, %eax
testq %r8, %r8
je 0x8a975
leaq 0x68(%rsi), %rdx
movq %rdx, (%r8)
jmp 0x8a975
xorl %eax, %eax
testq %rdx, %rdx
je 0x8a975
movq $0x0, (%rdx)
testq %rcx, %rcx
je 0x8a985
movzwl 0x22(%rsi), %eax
movl %eax, (%rcx)
movl $0x10, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngget.c
// Function: png_get_unknown_chunks
png_uint_32 PNGAPI
png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr,
             png_unknown_chunkpp unknowns)
{
   if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL)
   {
     *unknowns = info_ptr->unknown_chunks;
     return ((png_uint_32)info_ptr->unknown_chunks_num);
   }
   return (0);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %dil
xorl %eax, %eax
orb %cl, %dil
jne 0x8a9b2
movq 0xe8(%rsi), %rax
movq %rax, (%rdx)
movl 0xf0(%rsi), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngread.c
// Function: png_read_update_info
void PNGAPI
png_read_update_info(png_structp png_ptr, png_infop info_ptr)
{
   png_debug(1, "in png_read_update_info");
 
   if (png_ptr == NULL)
      return;
   if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
      png_read_start_row(png_ptr);
   else
      png_warning(png_ptr,
      "Ignoring extra png_read_update_info() call; row buffer not reallocated");

   png_read_transform_info(png_ptr, info_ptr);
}

// Assembly:
testq %rdi, %rdi
je 0x8b203
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testb $0x40, 0x120(%rdi)
jne 0x8b204
movq %r14, %rdi
callq 0x9da2c
jmp 0x8b213
retq
leaq 0x2172a(%rip), %rsi     # 0xac935
movq %r14, %rdi
callq 0x92e6e
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8f53c
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngread.c
// Function: png_read_rows
void PNGAPI
png_read_rows(png_structp png_ptr, png_bytepp row,
   png_bytepp display_row, png_uint_32 num_rows)
{
   png_uint_32 i;
   png_bytepp rp;
   png_bytepp dp;

   png_debug(1, "in png_read_rows");
 
   if (png_ptr == NULL)
      return;
   rp = row;
   dp = display_row;
   if (rp != NULL && dp != NULL)
      for (i = 0; i < num_rows; i++)
      {
         png_bytep rptr = *rp++;
         png_bytep dptr = *dp++;

         png_read_row(png_ptr, rptr, dptr);
      }
   else if (rp != NULL)
      for (i = 0; i < num_rows; i++)
      {
         png_bytep rptr = *rp;
         png_read_row(png_ptr, rptr, NULL);
         rp++;
      }
   else if (dp != NULL)
      for (i = 0; i < num_rows; i++)
      {
         png_bytep dptr = *dp;
         png_read_row(png_ptr, NULL, dptr);
         dp++;
      }
}

// Assembly:
testq %rdi, %rdi
je 0x8b71e
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %dl
orb %al, %dl
jne 0x8b6c3
testl %ecx, %ecx
je 0x8b715
movl %ecx, %r12d
xorl %r13d, %r13d
movq (%r15,%r13,8), %rsi
movq (%r14,%r13,8), %rdx
movq %rbx, %rdi
callq 0x8b238
incq %r13
cmpl %r13d, %r12d
jne 0x8b6a9
jmp 0x8b715
testq %r15, %r15
je 0x8b6ea
testl %ecx, %ecx
je 0x8b715
movl %ecx, %r14d
xorl %r12d, %r12d
movq (%r15,%r12,8), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x8b238
incq %r12
cmpl %r12d, %r14d
jne 0x8b6d2
jmp 0x8b715
testq %r14, %r14
sete %al
testl %ecx, %ecx
sete %dl
orb %al, %dl
jne 0x8b715
movl %ecx, %r15d
xorl %r12d, %r12d
movq (%r14,%r12,8), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8b238
incq %r12
cmpl %r12d, %r15d
jne 0x8b6ff
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngread.c
// Function: png_read_image
void PNGAPI
png_read_image(png_structp png_ptr, png_bytepp image)
{
   png_uint_32 i, image_height;
   int pass, j;
   png_bytepp rp;

   png_debug(1, "in png_read_image");
 
   if (png_ptr == NULL)
      return;

#ifdef PNG_READ_INTERLACING_SUPPORTED
   pass = png_set_interlace_handling(png_ptr);
#else
   if (png_ptr->interlaced)
      png_error(png_ptr,
        "Cannot read interlaced image -- interlace handler disabled");
   pass = 1;
#endif


   image_height=png_ptr->height;
   png_ptr->num_rows = image_height; /* Make sure this is set correctly */

   for (j = 0; j < pass; j++)
   {
      rp = image;
      for (i = 0; i < image_height; i++)
      {
         png_read_row(png_ptr, *rp, NULL);
         rp++;
      }
   }
}

// Assembly:
testq %rdi, %rdi
je 0x8b785
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x9dd90
movl 0x1c0(%r14), %r15d
movl %r15d, 0x1c4(%r14)
testl %eax, %eax
jle 0x8b777
movl %eax, %ebp
xorl %r12d, %r12d
testq %r15, %r15
je 0x8b76f
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x8b238
incq %r13
cmpl %r13d, %r15d
jne 0x8b759
incl %r12d
cmpl %ebp, %r12d
jne 0x8b751
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngread.c
// Function: png_destroy_read_struct
void PNGAPI
png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
   png_infopp end_info_ptr_ptr)
{
   png_structp png_ptr = NULL;
   png_infop info_ptr = NULL, end_info_ptr = NULL;
#ifdef PNG_USER_MEM_SUPPORTED
   png_free_ptr free_fn = NULL;
   png_voidp mem_ptr = NULL;
#endif

   png_debug(1, "in png_destroy_read_struct");
 
   if (png_ptr_ptr != NULL)
      png_ptr = *png_ptr_ptr;
   if (png_ptr == NULL)
      return;

#ifdef PNG_USER_MEM_SUPPORTED
   free_fn = png_ptr->free_fn;
   mem_ptr = png_ptr->mem_ptr;
#endif

   if (info_ptr_ptr != NULL)
      info_ptr = *info_ptr_ptr;

   if (end_info_ptr_ptr != NULL)
      end_info_ptr = *end_info_ptr_ptr;

   png_read_destroy(png_ptr, info_ptr, end_info_ptr);

   if (info_ptr != NULL)
   {
#ifdef PNG_TEXT_SUPPORTED
      png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, -1);
#endif

#ifdef PNG_USER_MEM_SUPPORTED
      png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn,
          (png_voidp)mem_ptr);
#else
      png_destroy_struct((png_voidp)info_ptr);
#endif
      *info_ptr_ptr = NULL;
   }

   if (end_info_ptr != NULL)
   {
#ifdef PNG_READ_TEXT_SUPPORTED
      png_free_data(png_ptr, end_info_ptr, PNG_FREE_TEXT, -1);
#endif
#ifdef PNG_USER_MEM_SUPPORTED
      png_destroy_struct_2((png_voidp)end_info_ptr, (png_free_ptr)free_fn,
         (png_voidp)mem_ptr);
#else
      png_destroy_struct((png_voidp)end_info_ptr);
#endif
      *end_info_ptr_ptr = NULL;
   }

   if (png_ptr != NULL)
   {
#ifdef PNG_USER_MEM_SUPPORTED
      png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn,
          (png_voidp)mem_ptr);
#else
      png_destroy_struct((png_voidp)png_ptr);
#endif
      *png_ptr_ptr = NULL;
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
testq %rdi, %rdi
je 0x8baf5
movq (%rbx), %r15
jmp 0x8baf8
xorl %r15d, %r15d
testq %r15, %r15
je 0x8bbbe
testq %rsi, %rsi
je 0x8bb0b
movq (%rsi), %r12
jmp 0x8bb0e
xorl %r12d, %r12d
testq %rdx, %rdx
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
je 0x8bb22
movq (%rdx), %r14
jmp 0x8bb25
xorl %r14d, %r14d
movq 0x418(%r15), %r13
movq 0x428(%r15), %rbp
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x8bbcd
testq %r12, %r12
je 0x8bb75
movq %r15, %rdi
movq %r12, %rsi
movl $0x4000, %edx           # imm = 0x4000
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x87d43
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x92c64
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
testq %r14, %r14
je 0x8bba9
movq %r15, %rdi
movq %r14, %rsi
movl $0x4000, %edx           # imm = 0x4000
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x87d43
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x92c64
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x92c64
movq $0x0, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngrio.c
// Function: png_default_read_data
void PNGAPI
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
   png_size_t check;

   if (png_ptr == NULL)
      return;
   /* fread() returns 0 on error, so it is OK to store this in a png_size_t
    * instead of an int, which is what fread() actually returns.
    */
   check = fread(data, 1, length, (png_FILE_p)png_ptr->io_ptr);

   if (check != length)
      png_error(png_ptr, "Read Error");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x8c0ed
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
movq 0xf8(%rdi), %rcx
movl $0x1, %esi
movq %rax, %rdi
callq 0xe6c0
cmpq %r14, %rax
jne 0x8c0f5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x2094c(%rip), %rsi     # 0xaca48
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x92dd0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_convert_from_struct_tm
void PNGAPI
png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime)
{
   png_debug(1, "in png_convert_from_struct_tm");

   ptime->year = (png_uint_16)(1900 + ttime->tm_year);
   ptime->month = (png_byte)(ttime->tm_mon + 1);
   ptime->day = (png_byte)ttime->tm_mday;
   ptime->hour = (png_byte)ttime->tm_hour;
   ptime->minute = (png_byte)ttime->tm_min;
   ptime->second = (png_byte)ttime->tm_sec;
}

// Assembly:
movl $0x76c, %eax            # imm = 0x76C
addl 0x14(%rsi), %eax
movw %ax, (%rdi)
movb 0x10(%rsi), %al
incb %al
movb %al, 0x2(%rdi)
movb 0xc(%rsi), %al
movb %al, 0x3(%rdi)
movb 0x8(%rsi), %al
movb %al, 0x4(%rdi)
movb 0x4(%rsi), %al
movb %al, 0x5(%rdi)
movb (%rsi), %al
movb %al, 0x6(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_convert_from_time_t
void PNGAPI
png_convert_from_time_t(png_timep ptime, time_t ttime)
{
   struct tm *tbuf;

   png_debug(1, "in png_convert_from_time_t");

   tbuf = gmtime(&ttime);
   png_convert_from_struct_tm(ptime, tbuf);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rsi, (%rdi)
callq 0xe3a0
movl $0x76c, %ecx            # imm = 0x76C
addl 0x14(%rax), %ecx
movw %cx, (%rbx)
movb 0x10(%rax), %cl
incb %cl
movb %cl, 0x2(%rbx)
movb 0xc(%rax), %cl
movb %cl, 0x3(%rbx)
movb 0x8(%rax), %cl
movb %cl, 0x4(%rbx)
movb 0x4(%rax), %cl
movb %cl, 0x5(%rbx)
movb (%rax), %al
movb %al, 0x6(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_write_rows
void PNGAPI
png_write_rows(png_structp png_ptr, png_bytepp row,
   png_uint_32 num_rows)
{
   png_uint_32 i; /* row counter */
   png_bytepp rp; /* row pointer */

   png_debug(1, "in png_write_rows");

   if (png_ptr == NULL)
      return;

   /* Loop through the rows */
   for (i = 0, rp = row; i < num_rows; i++, rp++)
   {
      png_write_row(png_ptr, *rp);
   }
}

// Assembly:
testq %rdi, %rdi
sete %al
testl %edx, %edx
sete %cl
orb %al, %cl
jne 0x8cd89
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r15d
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
callq 0x8cd8a
incq %r12
cmpl %r12d, %r15d
jne 0x8cd6a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_write_image
void PNGAPI
png_write_image(png_structp png_ptr, png_bytepp image)
{
   png_uint_32 i; /* row index */
   int pass, num_pass; /* pass variables */
   png_bytepp rp; /* points to current row */

   if (png_ptr == NULL)
      return;

   png_debug(1, "in png_write_image");

#ifdef PNG_WRITE_INTERLACING_SUPPORTED
   /* Initialize interlace handling.  If image is not interlaced,
    * this will set pass to 1
    */
   num_pass = png_set_interlace_handling(png_ptr);
#else
   num_pass = 1;
#endif
   /* Loop through passes */
   for (pass = 0; pass < num_pass; pass++)
   {
      /* Loop through image */
      for (i = 0, rp = image; i < png_ptr->height; i++, rp++)
      {
         png_write_row(png_ptr, *rp);
      }
   }
}

// Assembly:
testq %rdi, %rdi
je 0x8d018
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x9dd90
testl %eax, %eax
jle 0x8d010
movl %eax, %ebp
xorl %r15d, %r15d
cmpl $0x0, 0x1c0(%r14)
je 0x8d008
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
callq 0x8cd8a
incq %r12
cmpl 0x1c0(%r14), %r12d
jb 0x8cff0
incl %r15d
cmpl %ebp, %r15d
jne 0x8cfe3
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_write_flush
void PNGAPI
png_write_flush(png_structp png_ptr)
{
   int wrote_IDAT;

   png_debug(1, "in png_write_flush");

   if (png_ptr == NULL)
      return;
   /* We have already written out all of the data */
   if (png_ptr->row_number >= png_ptr->num_rows)
      return;

   do
   {
      int ret;

      /* Compress the data */
      ret = deflate(&png_ptr->zstream, Z_SYNC_FLUSH);
      wrote_IDAT = 0;

      /* Check for compression errors */
      if (ret != Z_OK)
      {
         if (png_ptr->zstream.msg != NULL)
            png_error(png_ptr, png_ptr->zstream.msg);
         else
            png_error(png_ptr, "zlib error");
      }

      if (!(png_ptr->zstream.avail_out))
      {
         /* Write the IDAT and reset the zlib output buffer */
         png_write_IDAT(png_ptr, png_ptr->zbuf,
                        png_ptr->zbuf_size);
         png_ptr->zstream.next_out = png_ptr->zbuf;
         png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
         wrote_IDAT = 1;
      }
   } while(wrote_IDAT == 1);

   /* If there is any data left to be output, write it into a new IDAT */
   if (png_ptr->zbuf_size != png_ptr->zstream.avail_out)
   {
      /* Write the IDAT and reset the zlib output buffer */
      png_write_IDAT(png_ptr, png_ptr->zbuf,
                     png_ptr->zbuf_size - png_ptr->zstream.avail_out);
      png_ptr->zstream.next_out = png_ptr->zbuf;
      png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
   }
   png_ptr->flush_rows = 0;
   png_flush(png_ptr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x8d0bd
movq %rdi, %rbx
movl 0x1e4(%rdi), %eax
cmpl 0x1c4(%rdi), %eax
jae 0x8d0bd
leaq 0x128(%rbx), %r14
leaq 0x1f869(%rip), %r15     # 0xac8c2
movq %r14, %rdi
movl $0x2, %esi
callq 0x93c32
testl %eax, %eax
je 0x8d080
movq 0x158(%rbx), %rsi
testq %rsi, %rsi
cmoveq %r15, %rsi
movq %rbx, %rdi
callq 0x92dd0
movl 0x148(%rbx), %eax
testq %rax, %rax
jne 0x8d0c3
movq 0x198(%rbx), %rsi
movq 0x1a0(%rbx), %rdx
movq %rbx, %rdi
callq 0x9e8aa
movq 0x198(%rbx), %rax
movq %rax, 0x140(%rbx)
movl 0x1a0(%rbx), %eax
movl %eax, 0x148(%rbx)
jmp 0x8d059
popq %rbx
popq %r14
popq %r15
retq
movq 0x1a0(%rbx), %rdx
subq %rax, %rdx
je 0x8d0f8
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
callq 0x9e8aa
movq 0x198(%rbx), %rax
movq %rax, 0x140(%rbx)
movl 0x1a0(%rbx), %eax
movl %eax, 0x148(%rbx)
movl $0x0, 0x284(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xa14dd
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_set_compression_window_bits
void PNGAPI
png_set_compression_window_bits(png_structp png_ptr, int window_bits)
{
   if (png_ptr == NULL)
      return;
   if (window_bits > 15)
      png_warning(png_ptr, "Only compression windows <= 32k supported by PNG");
   else if (window_bits < 8)
      png_warning(png_ptr, "Only compression windows >= 256 supported by PNG");
#ifndef WBITS_8_OK
   /* Avoid libpng bug with 256-byte windows */
   if (window_bits == 8)
     {
       png_warning(png_ptr, "Compression window is being reset to 512");
       window_bits = 9;
     }
#endif
   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS;
   png_ptr->zlib_window_bits = window_bits;
}

// Assembly:
testq %rdi, %rdi
je 0x8d5a2
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
cmpl $0xf, %esi
jle 0x8d562
leaq 0x1f717(%rip), %rsi     # 0xacc77
jmp 0x8d56e
cmpl $0x7, %ebp
jg 0x8d576
leaq 0x1f73a(%rip), %rsi     # 0xacca8
movq %rbx, %rdi
callq 0x92e6e
cmpl $0x8, %ebp
jne 0x8d58f
leaq 0x1f757(%rip), %rsi     # 0xaccd9
movq %rbx, %rdi
callq 0x92e6e
movl $0x9, %ebp
orb $0x8, 0x120(%rbx)
movl %ebp, 0x1b0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_set_compression_method
void PNGAPI
png_set_compression_method(png_structp png_ptr, int method)
{
   png_debug(1, "in png_set_compression_method");

   if (png_ptr == NULL)
      return;
   if (method != 8)
      png_warning(png_ptr, "Only compression method 8 is supported by PNG");
   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD;
   png_ptr->zlib_method = method;
}

// Assembly:
testq %rdi, %rdi
je 0x8d5db
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x8, %esi
je 0x8d5c5
leaq 0x1f745(%rip), %rsi     # 0xacd02
movq %r14, %rdi
callq 0x92e6e
orb $0x10, 0x120(%r14)
movl %ebx, 0x1ac(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_set_background
void PNGAPI
png_set_background(png_structp png_ptr,
   png_color_16p background_color, int background_gamma_code,
   int need_expand, double background_gamma)
{
   png_debug(1, "in png_set_background");
 
   if (png_ptr == NULL)
      return;
   if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN)
   {
      png_warning(png_ptr, "Application must supply a known background gamma");
      return;
   }

   png_ptr->transformations |= PNG_BACKGROUND;
   png_memcpy(&(png_ptr->background), background_color,
      png_sizeof(png_color_16));
   png_ptr->background_gamma = (float)background_gamma;
   png_ptr->background_gamma_type = (png_byte)(background_gamma_code);
   png_ptr->transformations |= (need_expand ? PNG_BACKGROUND_EXPAND : 0);
}

// Assembly:
testq %rdi, %rdi
je 0x8d7ec
testl %edx, %edx
je 0x8d7ed
movl $0x80, %eax
orl 0x124(%rdi), %eax
movl %eax, 0x124(%rdi)
movq (%rsi), %r8
movq %r8, 0x260(%rdi)
movzwl 0x8(%rsi), %esi
movw %si, 0x268(%rdi)
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x25c(%rdi)
movb %dl, 0x258(%rdi)
xorl %edx, %edx
testl %ecx, %ecx
setne %dl
shll $0x8, %edx
orl %eax, %edx
movl %edx, 0x124(%rdi)
retq
leaq 0x1f675(%rip), %rsi     # 0xace69
jmp 0x92e6e