LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x1052b8
jmp 0x105333
movq 0x20(%rsp), %rdi
callq 0x129f90
movl %eax, 0xc(%rsp)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0x105333
movl $0x0, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x1c0(%rcx), %eax
jae 0x105324
movq 0x20(%rsp), %rdi
movq (%rsp), %rax
movq (%rax), %rsi
callq 0x104e60
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movq (%rsp), %rax
addq $0x8, %rax
movq %rax, (%rsp)
jmp 0x1052e9
jmp 0x105326
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x1052ce
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_set_flush
void PNGAPI
png_set_flush(png_structp png_ptr, int nrows)
{
   png_debug(1, "in png_set_flush");

   if (png_ptr == NULL)
      return;
   png_ptr->flush_dist = (nrows < 0 ? 0 : nrows);
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x105353
jmp 0x105379
cmpl $0x0, -0xc(%rsp)
jge 0x105362
xorl %eax, %eax
movl %eax, -0x10(%rsp)
jmp 0x10536a
movl -0xc(%rsp), %eax
movl %eax, -0x10(%rsp)
movl -0x10(%rsp), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x280(%rax)
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_destroy_write_struct
void PNGAPI
png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
{
   png_structp png_ptr = NULL;
   png_infop 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_write_struct");

   if (png_ptr_ptr != NULL)
   {
      png_ptr = *png_ptr_ptr;
#ifdef PNG_USER_MEM_SUPPORTED
      free_fn = png_ptr->free_fn;
      mem_ptr = png_ptr->mem_ptr;
#endif
   }

#ifdef PNG_USER_MEM_SUPPORTED
   if (png_ptr != NULL)
   {
      free_fn = png_ptr->free_fn;
      mem_ptr = png_ptr->mem_ptr;
   }
#endif

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

   if (info_ptr != NULL)
   {
      if (png_ptr != NULL)
      {
        png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);

#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
        if (png_ptr->num_chunk_list)
        {
           png_free(png_ptr, png_ptr->chunk_list);
           png_ptr->num_chunk_list = 0;
        }
#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 (png_ptr != NULL)
   {
      png_write_destroy(png_ptr);
#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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x105599
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x428(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x418(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x1055c3
movq 0x20(%rsp), %rax
movq 0x428(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x418(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x1055d8
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x105656
cmpq $0x0, 0x20(%rsp)
je 0x105636
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl $0x7fff, %edx           # imm = 0x7FFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xfba80
movq 0x20(%rsp), %rax
cmpl $0x0, 0x3f0(%rax)
je 0x105634
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x3f8(%rax), %rsi
callq 0x1136d0
movq 0x20(%rsp), %rax
movl $0x0, 0x3f0(%rax)
jmp 0x105636
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x1134e0
movq 0x28(%rsp), %rax
movq $0x0, (%rax)
cmpq $0x0, 0x20(%rsp)
je 0x105688
movq 0x20(%rsp), %rdi
callq 0x105690
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x1134e0
movq 0x30(%rsp), %rax
movq $0x0, (%rax)
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_set_compression_level
void PNGAPI
png_set_compression_level(png_structp png_ptr, int level)
{
   png_debug(1, "in png_set_compression_level");

   if (png_ptr == NULL)
      return;
   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL;
   png_ptr->zlib_level = level;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x105c73
jmp 0x105c96
movq -0x8(%rsp), %rax
movl 0x120(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x120(%rax)
movl -0xc(%rsp), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x1a8(%rax)
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_set_compression_mem_level
void PNGAPI
png_set_compression_mem_level(png_structp png_ptr, int mem_level)
{
   png_debug(1, "in png_set_compression_mem_level");

   if (png_ptr == NULL)
      return;
   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL;
   png_ptr->zlib_mem_level = mem_level;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x105cb3
jmp 0x105cd6
movq -0x8(%rsp), %rax
movl 0x120(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x120(%rax)
movl -0xc(%rsp), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x1b4(%rax)
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_set_compression_strategy
void PNGAPI
png_set_compression_strategy(png_structp png_ptr, int strategy)
{
   png_debug(1, "in png_set_compression_strategy");

   if (png_ptr == NULL)
      return;
   png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY;
   png_ptr->zlib_strategy = strategy;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x105cf3
jmp 0x105d16
movq -0x8(%rsp), %rax
movl 0x120(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x120(%rax)
movl -0xc(%rsp), %ecx
movq -0x8(%rsp), %rax
movl %ecx, 0x1b8(%rax)
retq
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x105d37
jmp 0x105dae
cmpl $0xf, 0xc(%rsp)
jle 0x105d51
movq 0x10(%rsp), %rdi
leaq 0x337dd(%rip), %rsi     # 0x139527
callq 0x113940
jmp 0x105d6b
cmpl $0x8, 0xc(%rsp)
jge 0x105d69
movq 0x10(%rsp), %rdi
leaq 0x337f4(%rip), %rsi     # 0x139558
callq 0x113940
jmp 0x105d6b
cmpl $0x8, 0xc(%rsp)
jne 0x105d8b
movq 0x10(%rsp), %rdi
leaq 0x3380b(%rip), %rsi     # 0x139589
callq 0x113940
movl $0x9, 0xc(%rsp)
movq 0x10(%rsp), %rax
movl 0x120(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x120(%rax)
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x1b0(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x105dd7
jmp 0x105e12
cmpl $0x8, 0xc(%rsp)
je 0x105def
movq 0x10(%rsp), %rdi
leaq 0x337c8(%rip), %rsi     # 0x1395b2
callq 0x113940
movq 0x10(%rsp), %rax
movl 0x120(%rax), %ecx
orl $0x10, %ecx
movl %ecx, 0x120(%rax)
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x1ac(%rax)
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngwrite.c
// Function: png_set_write_user_transform_fn
void PNGAPI
png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
   write_user_transform_fn)
{
   png_debug(1, "in png_set_write_user_transform_fn");

   if (png_ptr == NULL)
      return;
   png_ptr->transformations |= PNG_USER_TRANSFORM;
   png_ptr->write_user_transform_fn = write_user_transform_fn;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x105e64
jmp 0x105e8d
movq -0x8(%rsp), %rax
movl 0x124(%rax), %ecx
orq $0x100000, %rcx         # imm = 0x100000
movl %ecx, 0x124(%rax)
movq -0x10(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x108(%rax)
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x106209
jmp 0x1062a6
cmpl $0x0, 0x14(%rsp)
jne 0x106226
movq 0x20(%rsp), %rdi
leaq 0x33575(%rip), %rsi     # 0x139791
callq 0x113940
jmp 0x1062a6
movq 0x20(%rsp), %rax
movl 0x124(%rax), %ecx
orl $0x80, %ecx
movl %ecx, 0x124(%rax)
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x260(%rax)
movw 0x8(%rcx), %cx
movw %cx, 0x268(%rax)
movsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq 0x20(%rsp), %rax
movss %xmm0, 0x25c(%rax)
movl 0x14(%rsp), %eax
movb %al, %cl
movq 0x20(%rsp), %rax
movb %cl, 0x258(%rax)
movl 0x10(%rsp), %edx
xorl %ecx, %ecx
movl $0x100, %eax            # imm = 0x100
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq 0x20(%rsp), %rax
orl 0x124(%rax), %ecx
movl %ecx, 0x124(%rax)
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_set_gamma
void PNGAPI
png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma)
{
   png_debug(1, "in png_set_gamma");

   if (png_ptr == NULL)
      return;

   if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) ||
       (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) ||
       (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE))
     png_ptr->transformations |= PNG_GAMMA;
   png_ptr->gamma = (float)file_gamma;
   png_ptr->screen_gamma = (float)scrn_gamma;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movsd %xmm0, -0x10(%rsp)
movsd %xmm1, -0x18(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x1076de
jmp 0x10777d
movsd -0x10(%rsp), %xmm0
movsd -0x18(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x2b922(%rip), %xmm1    # 0x133018
addsd %xmm1, %xmm0
movaps 0x2bb6f(%rip), %xmm1    # 0x133270
pand %xmm1, %xmm0
movsd 0x3204b(%rip), %xmm1    # 0x139758
ucomisd %xmm1, %xmm0
ja 0x107738
movq -0x8(%rsp), %rax
movzbl 0x24e(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x107738
movq -0x8(%rsp), %rax
movzbl 0x24e(%rax), %eax
cmpl $0x3, %eax
jne 0x10774f
movq -0x8(%rsp), %rax
movl 0x124(%rax), %ecx
orl $0x2000, %ecx           # imm = 0x2000
movl %ecx, 0x124(%rax)
movsd -0x18(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rsp), %rax
movss %xmm0, 0x28c(%rax)
movsd -0x10(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rsp), %rax
movss %xmm0, 0x290(%rax)
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_set_expand
void PNGAPI
png_set_expand(png_structp png_ptr)
{
   png_debug(1, "in png_set_expand");

   if (png_ptr == NULL)
      return;

   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
}

// Assembly:
movq %rdi, -0x8(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x10778f
jmp 0x1077bb
movq -0x8(%rsp), %rax
movl 0x124(%rax), %ecx
orq $0x2001000, %rcx        # imm = 0x2001000
movl %ecx, 0x124(%rax)
movq -0x8(%rsp), %rax
movl 0x120(%rax), %ecx
andl $-0x41, %ecx
movl %ecx, 0x120(%rax)
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_set_palette_to_rgb
void PNGAPI
png_set_palette_to_rgb(png_structp png_ptr)
{
   png_debug(1, "in png_set_palette_to_rgb");

   if (png_ptr == NULL)
      return;

   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
}

// Assembly:
movq %rdi, -0x8(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x1077cf
jmp 0x1077fb
movq -0x8(%rsp), %rax
movl 0x124(%rax), %ecx
orq $0x2001000, %rcx        # imm = 0x2001000
movl %ecx, 0x124(%rax)
movq -0x8(%rsp), %rax
movl 0x120(%rax), %ecx
andl $-0x41, %ecx
movl %ecx, 0x120(%rax)
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_set_expand_gray_1_2_4_to_8
void PNGAPI
png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
{
   png_debug(1, "in png_set_expand_gray_1_2_4_to_8");

   if (png_ptr == NULL)
      return;

   png_ptr->transformations |= PNG_EXPAND;
   png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
}

// Assembly:
movq %rdi, -0x8(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x10780f
jmp 0x10783a
movq -0x8(%rsp), %rax
movl 0x124(%rax), %ecx
orl $0x1000, %ecx           # imm = 0x1000
movl %ecx, 0x124(%rax)
movq -0x8(%rsp), %rax
movl 0x120(%rax), %ecx
andl $-0x41, %ecx
movl %ecx, 0x120(%rax)
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_set_rgb_to_gray
void PNGAPI
png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red,
   double green)
{
   int red_fixed = (int)((float)red*100000.0 + 0.5);
   int green_fixed = (int)((float)green*100000.0 + 0.5);
   if (png_ptr == NULL)
      return;
   png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x31491(%rip), %xmm1    # 0x138d80
mulsd %xmm1, %xmm0
movsd 0x2b715(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x4(%rsp)
movsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x31463(%rip), %xmm1    # 0x138d80
mulsd %xmm1, %xmm0
movsd 0x2b6e7(%rip), %xmm1    # 0x133010
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, (%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x10793e
jmp 0x107953
movq 0x20(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x4(%rsp), %edx
movl (%rsp), %ecx
callq 0x107960
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_set_read_user_transform_fn
void PNGAPI
png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
   read_user_transform_fn)
{
   png_debug(1, "in png_set_read_user_transform_fn");

   if (png_ptr == NULL)
      return;

#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
   png_ptr->transformations |= PNG_USER_TRANSFORM;
   png_ptr->read_user_transform_fn = read_user_transform_fn;
#endif
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x107b04
jmp 0x107b2d
movq -0x8(%rsp), %rax
movl 0x124(%rax), %ecx
orq $0x100000, %rcx         # imm = 0x100000
movl %ecx, 0x124(%rax)
movq -0x10(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x100(%rax)
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_do_chop
void /* PRIVATE */
png_do_chop(png_row_infop row_info, png_bytep row)
{
   png_debug(1, "in png_do_chop");

   if (row_info->bit_depth == 16)
   {
      png_bytep sp = row;
      png_bytep dp = row;
      png_uint_32 i;
      png_uint_32 istop = row_info->width * row_info->channels;

      for (i = 0; i<istop; i++, sp += 2, dp++)
      {
#ifdef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
      /* This does a more accurate scaling of the 16-bit color
       * value, rather than a simple low-byte truncation.
       *
       * What the ideal calculation should be:
       *   *dp = (((((png_uint_32)(*sp) << 8) |
       *          (png_uint_32)(*(sp + 1))) * 255 + 127)
       *          / (png_uint_32)65535L;
       *
       * GRR: no, I think this is what it really should be:
       *   *dp = (((((png_uint_32)(*sp) << 8) |
       *           (png_uint_32)(*(sp + 1))) + 128L)
       *           / (png_uint_32)257L;
       *
       * GRR: here's the exact calculation with shifts:
       *   temp = (((png_uint_32)(*sp) << 8) |
       *           (png_uint_32)(*(sp + 1))) + 128L;
       *   *dp = (temp - (temp >> 8)) >> 8;
       *
       * Approximate calculation with shift/add instead of multiply/divide:
       *   *dp = ((((png_uint_32)(*sp) << 8) |
       *          (png_uint_32)((int)(*(sp + 1)) - *sp)) + 128) >> 8;
       *
       * What we actually do to avoid extra shifting and conversion:
       */

         *dp = *sp + ((((int)(*(sp + 1)) - *sp) > 128) ? 1 : 0);
#else
       /* Simply discard the low order byte */
         *dp = *sp;
#endif
      }
      row_info->bit_depth = 8;
      row_info->pixel_depth = (png_byte)(8 * row_info->channels);
      row_info->rowbytes = row_info->width * row_info->channels;
   }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movzbl 0x11(%rax), %eax
cmpl $0x10, %eax
jne 0x10ffaf
movq -0x10(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movq -0x8(%rsp), %rax
movl (%rax), %eax
movq -0x8(%rsp), %rcx
movzbl 0x12(%rcx), %ecx
imull %ecx, %eax
movl %eax, -0x28(%rsp)
movl $0x0, -0x24(%rsp)
movl -0x24(%rsp), %eax
cmpl -0x28(%rsp), %eax
jae 0x10ff70
movq -0x18(%rsp), %rax
movb (%rax), %cl
movq -0x20(%rsp), %rax
movb %cl, (%rax)
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
movq -0x18(%rsp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rsp)
movq -0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rsp)
jmp 0x10ff2f
movq -0x8(%rsp), %rax
movb $0x8, 0x11(%rax)
movq -0x8(%rsp), %rax
movzbl 0x12(%rax), %eax
shll $0x3, %eax
movb %al, %cl
movq -0x8(%rsp), %rax
movb %cl, 0x13(%rax)
movq -0x8(%rsp), %rax
movl (%rax), %eax
movq -0x8(%rsp), %rcx
movzbl 0x12(%rcx), %ecx
imull %ecx, %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
retq
// File: tomfunkhouser[P]gaps/pkgs/png/pngrtran.c
// Function: png_build_grayscale_palette
void PNGAPI
png_build_grayscale_palette(int bit_depth, png_colorp palette)
{
   int num_palette;
   int color_inc;
   int i;
   int v;

   png_debug(1, "in png_do_build_grayscale_palette");

   if (palette == NULL)
      return;

   switch (bit_depth)
   {
      case 1:
         num_palette = 2;
         color_inc = 0xff;
         break;

      case 2:
         num_palette = 4;
         color_inc = 0x55;
         break;

      case 4:
         num_palette = 16;
         color_inc = 0x11;
         break;

      case 8:
         num_palette = 256;
         color_inc = 1;
         break;

      default:
         num_palette = 0;
         color_inc = 0;
         break;
   }

   for (i = 0, v = 0; i < num_palette; i++, v += color_inc)
   {
      palette[i].red = (png_byte)v;
      palette[i].green = (png_byte)v;
      palette[i].blue = (png_byte)v;
   }
}

// Assembly:
movl %edi, -0x4(%rsp)
movq %rsi, -0x10(%rsp)
cmpq $0x0, -0x10(%rsp)
jne 0x111b96
jmp 0x111c95
movl -0x4(%rsp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rsp)
subl $0x7, %eax
ja 0x111c05
movq -0x28(%rsp), %rax
leaq 0x27b50(%rip), %rcx     # 0x139704
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2, -0x14(%rsp)
movl $0xff, -0x18(%rsp)
jmp 0x111c15
movl $0x4, -0x14(%rsp)
movl $0x55, -0x18(%rsp)
jmp 0x111c15
movl $0x10, -0x14(%rsp)
movl $0x11, -0x18(%rsp)
jmp 0x111c15
movl $0x100, -0x14(%rsp)     # imm = 0x100
movl $0x1, -0x18(%rsp)
jmp 0x111c15
movl $0x0, -0x14(%rsp)
movl $0x0, -0x18(%rsp)
movl $0x0, -0x1c(%rsp)
movl $0x0, -0x20(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0x14(%rsp), %eax
jge 0x111c95
movl -0x20(%rsp), %eax
movb %al, %cl
movq -0x10(%rsp), %rax
movslq -0x1c(%rsp), %rdx
imulq $0x3, %rdx, %rdx
addq %rdx, %rax
movb %cl, (%rax)
movl -0x20(%rsp), %eax
movb %al, %cl
movq -0x10(%rsp), %rax
movslq -0x1c(%rsp), %rdx
imulq $0x3, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x1(%rax)
movl -0x20(%rsp), %eax
movb %al, %cl
movq -0x10(%rsp), %rax
movslq -0x1c(%rsp), %rdx
imulq $0x3, %rdx, %rdx
addq %rdx, %rax
movb %cl, 0x2(%rax)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
movl -0x18(%rsp), %eax
addl -0x20(%rsp), %eax
movl %eax, -0x20(%rsp)
jmp 0x111c25
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngmem.c
// Function: png_create_struct_2
png_voidp /* PRIVATE */
png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
{
#endif /* PNG_USER_MEM_SUPPORTED */
   png_size_t size;
   png_voidp struct_ptr;

   if (type == PNG_STRUCT_INFO)
      size = png_sizeof(png_info);
   else if (type == PNG_STRUCT_PNG)
      size = png_sizeof(png_struct);
   else
      return (NULL);

#ifdef PNG_USER_MEM_SUPPORTED
   if (malloc_fn != NULL)
   {
      png_struct dummy_struct;
      png_structp png_ptr = &dummy_struct;
      png_ptr->mem_ptr=mem_ptr;
      struct_ptr = (*(malloc_fn))(png_ptr, size);
      if (struct_ptr != NULL)
         png_memset(struct_ptr, 0, size);
      return (struct_ptr);
   }
#endif /* PNG_USER_MEM_SUPPORTED */

#if defined(__TURBOC__) && !defined(__FLAT__)
   struct_ptr = (png_voidp)farmalloc(size);
#else
# if defined(_MSC_VER) && defined(MAXSEG_64K)
   struct_ptr = (png_voidp)halloc(size, 1);
# else
   struct_ptr = (png_voidp)malloc(size);
# endif
#endif
   if (struct_ptr != NULL)
      png_memset(struct_ptr, 0, size);

   return (struct_ptr);
}

// Assembly:
subq $0x4d8, %rsp            # imm = 0x4D8
movl %edi, 0x4cc(%rsp)
movq %rsi, 0x4c0(%rsp)
movq %rdx, 0x4b8(%rsp)
cmpl $0x2, 0x4cc(%rsp)
jne 0x1133b6
movq $0x170, 0x4b0(%rsp) # imm = 0x170
jmp 0x1133e1
cmpl $0x1, 0x4cc(%rsp)
jne 0x1133ce
movq $0x498, 0x4b0(%rsp) # imm = 0x498
jmp 0x1133df
movq $0x0, 0x4d0(%rsp)
jmp 0x1134a4
jmp 0x1133e1
cmpq $0x0, 0x4c0(%rsp)
je 0x11345d
leaq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x4b8(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x418(%rax)
movq 0x4c0(%rsp), %rax
movq 0x8(%rsp), %rdi
movq 0x4b0(%rsp), %rsi
callq *%rax
movq %rax, 0x4a8(%rsp)
cmpq $0x0, 0x4a8(%rsp)
je 0x11344b
movq 0x4a8(%rsp), %rdi
movq 0x4b0(%rsp), %rdx
xorl %esi, %esi
callq 0xf280
movq 0x4a8(%rsp), %rax
movq %rax, 0x4d0(%rsp)
jmp 0x1134a4
movq 0x4b0(%rsp), %rdi
callq 0xf6a0
movq %rax, 0x4a8(%rsp)
cmpq $0x0, 0x4a8(%rsp)
je 0x113494
movq 0x4a8(%rsp), %rdi
movq 0x4b0(%rsp), %rdx
xorl %esi, %esi
callq 0xf280
movq 0x4a8(%rsp), %rax
movq %rax, 0x4d0(%rsp)
movq 0x4d0(%rsp), %rax
addq $0x4d8, %rsp            # imm = 0x4D8
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngmem.c
// Function: png_calloc
png_voidp PNGAPI
png_calloc(png_structp png_ptr, png_alloc_size_t size)
{
   png_voidp ret;

   ret = (png_malloc(png_ptr, size));
   if (ret != NULL)
      png_memset(ret,0,(png_size_t)size);
   return (ret);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x1135b0
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
je 0x113598
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
xorl %esi, %esi
callq 0xf280
movq (%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngmem.c
// Function: png_malloc_warn
png_voidp PNGAPI
png_malloc_warn(png_structp png_ptr, png_alloc_size_t size)
{
   png_voidp ptr;
   png_uint_32 save_flags;
   if (png_ptr == NULL)
      return (NULL);

   save_flags = png_ptr->flags;
   png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
   ptr = (png_voidp)png_malloc((png_structp)png_ptr, size);
   png_ptr->flags=save_flags;
   return(ptr);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x113781
movq $0x0, 0x20(%rsp)
jmp 0x1137d5
movq 0x18(%rsp), %rax
movl 0x120(%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rax
movl 0x120(%rax), %ecx
orq $0x100000, %rcx         # imm = 0x100000
movl %ecx, 0x120(%rax)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1135b0
movq %rax, 0x8(%rsp)
movl 0x4(%rsp), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x120(%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/png/pngmem.c
// Function: png_set_mem_fn
void PNGAPI
png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr
  malloc_fn, png_free_ptr free_fn)
{
   if (png_ptr != NULL)
   {
      png_ptr->mem_ptr = mem_ptr;
      png_ptr->malloc_fn = malloc_fn;
      png_ptr->free_fn = free_fn;
   }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
cmpq $0x0, -0x8(%rsp)
je 0x11382f
movq -0x10(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x418(%rax)
movq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x420(%rax)
movq -0x20(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x428(%rax)
retq
// File: tomfunkhouser[P]gaps/pkgs/png/pngerror.c
// Function: png_warning
void PNGAPI
png_warning(png_structp png_ptr, png_const_charp warning_message)
{
   int offset = 0;
   if (png_ptr != NULL)
   {
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
   if (png_ptr->flags&
     (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
#endif
     {
       if (*warning_message == PNG_LITERAL_SHARP)
       {
           for (offset = 1; offset < 15; offset++)
              if (warning_message[offset] == ' ')
                  break;
       }
     }
   }
   if (png_ptr != NULL && png_ptr->warning_fn != NULL)
      (*(png_ptr->warning_fn))(png_ptr, warning_message + offset);
   else
      png_default_warning(png_ptr, warning_message + offset);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x1139a2
movq 0x8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x1139a0
movl $0x1, 0x4(%rsp)
cmpl $0xf, 0x4(%rsp)
jge 0x11399e
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jne 0x11398f
jmp 0x11399e
jmp 0x113991
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x113973
jmp 0x1139a0
jmp 0x1139a2
cmpq $0x0, 0x10(%rsp)
je 0x1139db
movq 0x10(%rsp), %rax
cmpq $0x0, 0xd8(%rax)
je 0x1139db
movq 0x10(%rsp), %rax
movq 0xd8(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movslq 0x4(%rsp), %rcx
addq %rcx, %rsi
callq *%rax
jmp 0x1139f2
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movslq 0x4(%rsp), %rax
addq %rax, %rsi
callq 0x113a00
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngerror.c
// Function: png_chunk_error
void PNGAPI
png_chunk_error(png_structp png_ptr, png_const_charp error_message)
{
   char msg[18+PNG_MAX_ERROR_TEXT];
   if (png_ptr == NULL)
     png_error(png_ptr, error_message);
   else
   {
     png_format_buffer(png_ptr, msg, error_message);
     png_error(png_ptr, msg);
   }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x113a87
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x113860
jmp 0x113aa6
movq 0x60(%rsp), %rdi
movq %rsp, %rsi
movq 0x58(%rsp), %rdx
callq 0x113ab0
movq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0x113860
addq $0x68, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngerror.c
// Function: png_format_buffer
static void /* PRIVATE */
png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
   error_message)
{
   int iout = 0, iin = 0;

   while (iin < 4)
   {
      int c = png_ptr->chunk_name[iin++];
      if (isnonalpha(c))
      {
         buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET;
         buffer[iout++] = png_digit[(c & 0xf0) >> 4];
         buffer[iout++] = png_digit[c & 0x0f];
         buffer[iout++] = PNG_LITERAL_RIGHT_SQUARE_BRACKET;
      }
      else
      {
         buffer[iout++] = (png_byte)c;
      }
   }

   if (error_message == NULL)
      buffer[iout] = '\0';
   else
   {
      buffer[iout++] = ':';
      buffer[iout++] = ' ';
      png_memcpy(buffer + iout, error_message, PNG_MAX_ERROR_TEXT);
      buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0';
   }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
cmpl $0x4, 0x8(%rsp)
jge 0x113bd7
movq 0x20(%rsp), %rax
movl 0x8(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x8(%rsp)
movslq %ecx, %rcx
movzbl 0x244(%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $0x41, 0x4(%rsp)
jl 0x113b23
cmpl $0x7a, 0x4(%rsp)
jg 0x113b23
cmpl $0x5a, 0x4(%rsp)
jle 0x113bb4
cmpl $0x61, 0x4(%rsp)
jge 0x113bb4
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0xc(%rsp)
movslq %ecx, %rcx
movb $0x5b, (%rax,%rcx)
movl 0x4(%rsp), %eax
andl $0xf0, %eax
sarl $0x4, %eax
movslq %eax, %rcx
leaq 0x25d1e(%rip), %rax     # 0x139870
movb (%rax,%rcx), %dl
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0xc(%rsp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl 0x4(%rsp), %eax
andl $0xf, %eax
movslq %eax, %rcx
leaq 0x25cf2(%rip), %rax     # 0x139870
movb (%rax,%rcx), %dl
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0xc(%rsp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0xc(%rsp)
movslq %ecx, %rcx
movb $0x5d, (%rax,%rcx)
jmp 0x113bd2
movl 0x4(%rsp), %eax
movb %al, %dl
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0xc(%rsp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x113ad3
cmpq $0x0, 0x10(%rsp)
jne 0x113bef
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x113c53
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0xc(%rsp)
movslq %ecx, %rcx
movb $0x3a, (%rax,%rcx)
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0xc(%rsp)
movslq %ecx, %rcx
movb $0x20, (%rax,%rcx)
movq 0x18(%rsp), %rdi
movslq 0xc(%rsp), %rax
addq %rax, %rdi
movq 0x10(%rsp), %rsi
movl $0x40, %edx
callq 0xf3d0
movq 0x18(%rsp), %rax
movl 0xc(%rsp), %ecx
addl $0x40, %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngerror.c
// Function: png_chunk_warning
void PNGAPI
png_chunk_warning(png_structp png_ptr, png_const_charp warning_message)
{
   char msg[18+PNG_MAX_ERROR_TEXT];
   if (png_ptr == NULL)
     png_warning(png_ptr, warning_message);
   else
   {
     png_format_buffer(png_ptr, msg, warning_message);
     png_warning(png_ptr, msg);
   }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x113c87
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x113940
jmp 0x113ca6
movq 0x60(%rsp), %rdi
movq %rsp, %rsi
movq 0x58(%rsp), %rdx
callq 0x113ab0
movq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0x113940
addq $0x68, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/pngerror.c
// Function: png_set_error_fn
void PNGAPI
png_set_error_fn(png_structp png_ptr, png_voidp error_ptr,
   png_error_ptr error_fn, png_error_ptr warning_fn)
{
   if (png_ptr == NULL)
      return;
   png_ptr->error_ptr = error_ptr;
   png_ptr->error_fn = error_fn;
   png_ptr->warning_fn = warning_fn;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
cmpq $0x0, -0x8(%rsp)
jne 0x113d1e
jmp 0x113d51
movq -0x10(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0xe0(%rax)
movq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0xd0(%rax)
movq -0x20(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0xd8(%rax)
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/crc32.c
// Function: crc32_combine_
local uLong crc32_combine_(crc1, crc2, len2)
    uLong crc1;
    uLong crc2;
    z_off64_t len2;
{
    int n;
    unsigned long row;
    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */
    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */

    /* degenerate case (also disallow negative lengths) */
    if (len2 <= 0)
        return crc1;

    /* put operator for one zero bit in odd */
    odd[0] = 0xedb88320UL;          /* CRC-32 polynomial */
    row = 1;
    for (n = 1; n < GF2_DIM; n++) {
        odd[n] = row;
        row <<= 1;
    }

    /* put operator for two zero bits in even */
    gf2_matrix_square(even, odd);

    /* put operator for four zero bits in odd */
    gf2_matrix_square(odd, even);

    /* apply len2 zeros to crc1 (first square will put the operator for one
       zero byte, eight zero bits, in even) */
    do {
        /* apply zeros operator for this bit of len2 */
        gf2_matrix_square(even, odd);
        if (len2 & 1)
            crc1 = gf2_matrix_times(even, crc1);
        len2 >>= 1;

        /* if no more bits set, then done */
        if (len2 == 0)
            break;

        /* another iteration of the loop with odd and even swapped */
        gf2_matrix_square(odd, even);
        if (len2 & 1)
            crc1 = gf2_matrix_times(odd, crc1);
        len2 >>= 1;

        /* if no more bits set, then done */
    } while (len2 != 0);

    /* return combined crc */
    crc1 ^= crc2;
    return crc1;
}

// Assembly:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x228(%rsp)
movq %rsi, 0x220(%rsp)
movq %rdx, 0x218(%rsp)
cmpq $0x0, 0x218(%rsp)
jg 0x114c1f
movq 0x228(%rsp), %rax
movq %rax, 0x230(%rsp)
jmp 0x114d86
movl $0xedb88320, %eax       # imm = 0xEDB88320
movq %rax, (%rsp)
movq $0x1, 0x208(%rsp)
movl $0x1, 0x214(%rsp)
cmpl $0x20, 0x214(%rsp)
jge 0x114c83
movq 0x208(%rsp), %rcx
movslq 0x214(%rsp), %rax
movq %rcx, (%rsp,%rax,8)
movq 0x208(%rsp), %rax
shlq %rax
movq %rax, 0x208(%rsp)
movl 0x214(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x214(%rsp)
jmp 0x114c3f
leaq 0x100(%rsp), %rdi
movq %rsp, %rsi
callq 0x114dd0
movq %rsp, %rdi
leaq 0x100(%rsp), %rsi
callq 0x114dd0
leaq 0x100(%rsp), %rdi
movq %rsp, %rsi
callq 0x114dd0
movq 0x218(%rsp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x114ce2
leaq 0x100(%rsp), %rdi
movq 0x228(%rsp), %rsi
callq 0x114e30
movq %rax, 0x228(%rsp)
movq 0x218(%rsp), %rax
sarq %rax
movq %rax, 0x218(%rsp)
cmpq $0x0, 0x218(%rsp)
jne 0x114d02
jmp 0x114d5e
movq %rsp, %rdi
leaq 0x100(%rsp), %rsi
callq 0x114dd0
movq 0x218(%rsp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x114d3c
movq %rsp, %rdi
movq 0x228(%rsp), %rsi
callq 0x114e30
movq %rax, 0x228(%rsp)
movq 0x218(%rsp), %rax
sarq %rax
movq %rax, 0x218(%rsp)
cmpq $0x0, 0x218(%rsp)
jne 0x114ca3
movq 0x220(%rsp), %rax
xorq 0x228(%rsp), %rax
movq %rax, 0x228(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x230(%rsp)
movq 0x230(%rsp), %rax
addq $0x238, %rsp            # imm = 0x238
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/crc32.c
// Function: gf2_matrix_times
local unsigned long gf2_matrix_times(mat, vec)
    unsigned long *mat;
    unsigned long vec;
{
    unsigned long sum;

    sum = 0;
    while (vec) {
        if (vec & 1)
            sum ^= *mat;
        vec >>= 1;
        mat++;
    }
    return sum;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq $0x0, -0x18(%rsp)
cmpq $0x0, -0x10(%rsp)
je 0x114e89
movq -0x10(%rsp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x114e6c
movq -0x8(%rsp), %rax
movq (%rax), %rax
xorq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
shrq %rax
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rsp)
jmp 0x114e43
movq -0x18(%rsp), %rax
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/png/deflate.c
// Function: deflateEnd
int ZEXPORT deflateEnd (strm)
    z_streamp strm;
{
    int status;

    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;

    status = strm->state->status;
    if (status != INIT_STATE &&
        status != EXTRA_STATE &&
        status != NAME_STATE &&
        status != COMMENT_STATE &&
        status != HCRC_STATE &&
        status != BUSY_STATE &&
        status != FINISH_STATE) {
      return Z_STREAM_ERROR;
    }

    /* Deallocate in reverse order of allocations: */
    TRY_FREE(strm, strm->state->pending_buf);
    TRY_FREE(strm, strm->state->head);
    TRY_FREE(strm, strm->state->prev);
    TRY_FREE(strm, strm->state->window);

    ZFREE(strm, strm->state);
    strm->state = Z_NULL;

    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x11536d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x11537a
movl $0xfffffffe, 0x14(%rsp) # imm = 0xFFFFFFFE
jmp 0x1154ce
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, 0x4(%rsp)
cmpl $0x2a, 0x4(%rsp)
je 0x1153cb
cmpl $0x45, 0x4(%rsp)
je 0x1153cb
cmpl $0x49, 0x4(%rsp)
je 0x1153cb
cmpl $0x5b, 0x4(%rsp)
je 0x1153cb
cmpl $0x67, 0x4(%rsp)
je 0x1153cb
cmpl $0x71, 0x4(%rsp)
je 0x1153cb
cmpl $0x29a, 0x4(%rsp)       # imm = 0x29A
je 0x1153cb
movl $0xfffffffe, 0x14(%rsp) # imm = 0xFFFFFFFE
jmp 0x1154ce
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x1153fc
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %rdi
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rcx
movq 0x10(%rcx), %rsi
callq *%rax
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
cmpq $0x0, 0x68(%rax)
je 0x11542d
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %rdi
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rcx
movq 0x68(%rcx), %rsi
callq *%rax
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
cmpq $0x0, 0x60(%rax)
je 0x11545e
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %rdi
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rcx
movq 0x60(%rcx), %rsi
callq *%rax
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rax
cmpq $0x0, 0x50(%rax)
je 0x11548f
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %rdi
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rcx
movq 0x50(%rcx), %rsi
callq *%rax
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x50(%rcx), %rdi
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rsi
callq *%rax
movq 0x8(%rsp), %rax
movq $0x0, 0x38(%rax)
movl 0x4(%rsp), %edx
xorl %eax, %eax
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
cmpl $0x71, %edx
cmovel %ecx, %eax
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/deflate.c
// Function: deflateReset
int ZEXPORT deflateReset (strm)
    z_streamp strm;
{
    deflate_state *s;

    if (strm == Z_NULL || strm->state == Z_NULL ||
        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
        return Z_STREAM_ERROR;
    }

    strm->total_in = strm->total_out = 0;
    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
    strm->data_type = Z_UNKNOWN;

    s = (deflate_state *)strm->state;
    s->pending = 0;
    s->pending_out = s->pending_buf;

    if (s->wrap < 0) {
        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
    }
    s->status = s->wrap ? INIT_STATE : BUSY_STATE;
    strm->adler =
#ifdef GZIP
        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
#endif
        adler32(0L, Z_NULL, 0);
    s->last_flush = Z_NO_FLUSH;

    _tr_init(s);
    lm_init(s);

    return Z_OK;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x115515
movq 0x18(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x115515
movq 0x18(%rsp), %rax
cmpq $0x0, 0x40(%rax)
je 0x115515
movq 0x18(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x115522
movl $0xfffffffe, 0x24(%rsp) # imm = 0xFFFFFFFE
jmp 0x115627
movq 0x18(%rsp), %rax
movq $0x0, 0x28(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x30(%rax)
movq 0x18(%rsp), %rax
movl $0x2, 0x58(%rax)
movq 0x18(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl $0x0, 0x28(%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x2c(%rax)
jge 0x11559e
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
subl 0x2c(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x2c(%rax)
movq 0x10(%rsp), %rax
movl 0x2c(%rax), %edx
movl $0x71, %ecx
movl $0x2a, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x10(%rsp), %rax
cmpl $0x2, 0x2c(%rax)
jne 0x1155de
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
movq %rsi, %rdi
callq 0x113da0
movq %rax, 0x8(%rsp)
jmp 0x1155f1
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
movq %rsi, %rdi
callq 0x131400
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x60(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x40(%rax)
movq 0x10(%rsp), %rdi
callq 0x11ec30
movq 0x10(%rsp), %rdi
callq 0x115890
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/png/deflate.c
// Function: lm_init
local void lm_init (s)
    deflate_state *s;
{
    s->window_size = (ulg)2L*s->w_size;

    CLEAR_HASH(s);

    /* Set the default configuration parameters:
     */
    s->max_lazy_match   = configuration_table[s->level].max_lazy;
    s->good_match       = configuration_table[s->level].good_length;
    s->nice_match       = configuration_table[s->level].nice_length;
    s->max_chain_length = configuration_table[s->level].max_chain;

    s->strstart = 0;
    s->block_start = 0L;
    s->lookahead = 0;
    s->match_length = s->prev_length = MIN_MATCH-1;
    s->match_available = 0;
    s->ins_h = 0;
#ifndef FASTEST
#ifdef ASMV
    match_init(); /* initialize the asm code */
#endif
#endif
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
movl 0x44(%rax), %eax
movl %eax, %ecx
shlq %rcx
movq (%rsp), %rax
movq %rcx, 0x58(%rax)
movq (%rsp), %rax
movq 0x68(%rax), %rax
movq (%rsp), %rcx
movl 0x74(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movw $0x0, (%rax,%rcx,2)
movq (%rsp), %rax
movq 0x68(%rax), %rdi
movq (%rsp), %rax
movl 0x74(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
shlq %rdx
xorl %esi, %esi
callq 0xf280
movq (%rsp), %rax
movslq 0xb4(%rax), %rcx
leaq 0x5935b(%rip), %rax     # 0x16ec50
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x2(%rax), %ecx
movq (%rsp), %rax
movl %ecx, 0xb0(%rax)
movq (%rsp), %rax
movslq 0xb4(%rax), %rcx
leaq 0x59334(%rip), %rax     # 0x16ec50
shlq $0x4, %rcx
addq %rcx, %rax
movzwl (%rax), %ecx
movq (%rsp), %rax
movl %ecx, 0xbc(%rax)
movq (%rsp), %rax
movslq 0xb4(%rax), %rcx
leaq 0x5930e(%rip), %rax     # 0x16ec50
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %ecx
movq (%rsp), %rax
movl %ecx, 0xc0(%rax)
movq (%rsp), %rax
movslq 0xb4(%rax), %rcx
leaq 0x592e7(%rip), %rax     # 0x16ec50
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x6(%rax), %ecx
movq (%rsp), %rax
movl %ecx, 0xac(%rax)
movq (%rsp), %rax
movl $0x0, 0x9c(%rax)
movq (%rsp), %rax
movq $0x0, 0x88(%rax)
movq (%rsp), %rax
movl $0x0, 0xa4(%rax)
movq (%rsp), %rax
movl $0x2, 0xa8(%rax)
movq (%rsp), %rax
movl $0x2, 0x90(%rax)
movq (%rsp), %rax
movl $0x0, 0x98(%rax)
movq (%rsp), %rax
movl $0x0, 0x70(%rax)
popq %rax
retq
// File: tomfunkhouser[P]gaps/pkgs/png/deflate.c
// Function: deflateSetHeader
int ZEXPORT deflateSetHeader (strm, head)
    z_streamp strm;
    gz_headerp head;
{
    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
    if (strm->state->wrap != 2) return Z_STREAM_ERROR;
    strm->state->gzhead = head;
    return Z_OK;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
cmpq $0x0, -0x10(%rsp)
je 0x1159fe
movq -0x10(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x115a08
movl $0xfffffffe, -0x4(%rsp) # imm = 0xFFFFFFFE
jmp 0x115a3b
movq -0x10(%rsp), %rax
movq 0x38(%rax), %rax
cmpl $0x2, 0x2c(%rax)
je 0x115a21
movl $0xfffffffe, -0x4(%rsp) # imm = 0xFFFFFFFE
jmp 0x115a3b
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x30(%rax)
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
// File: tomfunkhouser[P]gaps/pkgs/png/deflate.c
// Function: deflatePrime
int ZEXPORT deflatePrime (strm, bits, value)
    z_streamp strm;
    int bits;
    int value;
{
    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
    strm->state->bi_valid = bits;
    strm->state->bi_buf = (ush)(value & ((1 << bits) - 1));
    return Z_OK;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movl %esi, -0x14(%rsp)
movl %edx, -0x18(%rsp)
cmpq $0x0, -0x10(%rsp)
je 0x115a61
movq -0x10(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x115a6b
movl $0xfffffffe, -0x4(%rsp) # imm = 0xFFFFFFFE
jmp 0x115aaf
movl -0x14(%rsp), %ecx
movq -0x10(%rsp), %rax
movq 0x38(%rax), %rax
movl %ecx, 0x1724(%rax)
movl -0x18(%rsp), %eax
movl -0x14(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
movw %ax, %cx
movq -0x10(%rsp), %rax
movq 0x38(%rax), %rax
movw %cx, 0x1720(%rax)
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/png/deflate.c
// Function: deflateTune
int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
    z_streamp strm;
    int good_length;
    int max_lazy;
    int nice_length;
    int max_chain;
{
    deflate_state *s;

    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
    s = strm->state;
    s->good_match = good_length;
    s->max_lazy_match = max_lazy;
    s->nice_match = nice_length;
    s->max_chain_length = max_chain;
    return Z_OK;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movl %esi, -0x14(%rsp)
movl %edx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movl %r8d, -0x20(%rsp)
cmpq $0x0, -0x10(%rsp)
je 0x116e9a
movq -0x10(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x116ea4
movl $0xfffffffe, -0x4(%rsp) # imm = 0xFFFFFFFE
jmp 0x116ef6
movq -0x10(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rsp)
movl -0x14(%rsp), %ecx
movq -0x28(%rsp), %rax
movl %ecx, 0xbc(%rax)
movl -0x18(%rsp), %ecx
movq -0x28(%rsp), %rax
movl %ecx, 0xb0(%rax)
movl -0x1c(%rsp), %ecx
movq -0x28(%rsp), %rax
movl %ecx, 0xc0(%rax)
movl -0x20(%rsp), %ecx
movq -0x28(%rsp), %rax
movl %ecx, 0xac(%rax)
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax,%rax)