LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: pqdownheap
local void pqdownheap(s, tree, k)
    deflate_state *s;
    ct_data *tree;  /* the tree to restore */
    int k;               /* node to move down */
{
    int v = s->heap[k];
    int j = k << 1;  /* left son of k */
    while (j <= s->heap_len) {
        /* Set j to the smallest of the two sons: */
        if (j < s->heap_len &&
            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
            j++;
        }
        /* Exit if v is smaller than both sons */
        if (smaller(tree, v, s->heap[j], s->depth)) break;

        /* Exchange v with the smallest son */
        s->heap[k] = s->heap[j];  k = j;

        /* And continue down the tree, setting j to the left son of k */
        j <<= 1;
    }
    s->heap[k] = v;
}

// Assembly:
movl %edx, %eax
movl 0xbb0(%rdi,%rax,4), %eax
leal (%rdx,%rdx), %r8d
movl 0x14a4(%rdi), %r10d
cmpl %r10d, %r8d
jle 0x99305
movl %edx, %r9d
jmp 0x993b7
pushq %rbp
pushq %r14
pushq %rbx
movslq %eax, %rcx
cmpl %r10d, %r8d
jge 0x99342
movl %r8d, %r11d
orl $0x1, %r11d
movslq %r11d, %rbx
movslq 0xbb0(%rdi,%rbx,4), %r9
movslq %r8d, %r10
movslq 0xbb0(%rdi,%r10,4), %r14
movzwl (%rsi,%r14,4), %ebp
cmpw %bp, (%rsi,%r9,4)
jae 0x99397
movq %rbx, %r10
movl %r11d, %r9d
jmp 0x99348
movslq %r8d, %r10
movl %r8d, %r9d
movl 0xbb0(%rdi,%r10,4), %r8d
movslq %r8d, %r10
movzwl (%rsi,%r10,4), %r11d
cmpw %r11w, (%rsi,%rcx,4)
jb 0x993b0
jne 0x99373
movb 0x14ac(%rdi,%rcx), %r11b
cmpb 0x14ac(%rdi,%r10), %r11b
jbe 0x993b0
movslq %edx, %rdx
movl %r8d, 0xbb0(%rdi,%rdx,4)
leal (%r9,%r9), %r8d
movl 0x14a4(%rdi), %r10d
movl %r9d, %edx
cmpl %r10d, %r8d
jle 0x9930c
jmp 0x993b3
jne 0x99345
movb 0x14ac(%rdi,%r9), %bpl
movl %r8d, %r9d
cmpb 0x14ac(%rdi,%r14), %bpl
jbe 0x9933a
jmp 0x99348
movl %edx, %r9d
popq %rbx
popq %r14
popq %rbp
movslq %r9d, %rcx
movl %eax, 0xbb0(%rdi,%rcx,4)
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/trees.c
// Function: scan_tree
local void scan_tree (s, tree, max_code)
    deflate_state *s;
    ct_data *tree;   /* the tree to be scanned */
    int max_code;    /* and its largest code of non zero frequency */
{
    int n;                     /* iterates over all tree elements */
    int prevlen = -1;          /* last emitted length */
    int curlen;                /* length of current code */
    int nextlen = tree[0].Len; /* length of next code */
    int count = 0;             /* repeat count of the current code */
    int max_count = 7;         /* max repeat count */
    int min_count = 4;         /* min repeat count */

    if (nextlen == 0) max_count = 138, min_count = 3;
    tree[max_code+1].Len = (ush)0xffff; /* guard */

    for (n = 0; n <= max_code; n++) {
        curlen = nextlen; nextlen = tree[n+1].Len;
        if (++count < max_count && curlen == nextlen) {
            continue;
        } else if (count < min_count) {
            s->bl_tree[curlen].Freq += count;
        } else if (curlen != 0) {
            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
            s->bl_tree[REP_3_6].Freq++;
        } else if (count <= 10) {
            s->bl_tree[REPZ_3_10].Freq++;
        } else {
            s->bl_tree[REPZ_11_138].Freq++;
        }
        count = 0; prevlen = curlen;
        if (nextlen == 0) {
            max_count = 138, min_count = 3;
        } else if (curlen == nextlen) {
            max_count = 6, min_count = 3;
        } else {
            max_count = 7, min_count = 4;
        }
    }
}

// Assembly:
movzwl 0x2(%rsi), %eax
movslq %edx, %rcx
movw $0xffff, 0x6(%rsi,%rcx,4) # imm = 0xFFFF
testl %ecx, %ecx
js 0x994a7
pushq %r14
pushq %rbx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
movl $0x8a, %ecx
movl $0x7, %r10d
cmovel %ecx, %r10d
addl $0x3, %r9d
incl %edx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r14d, %r14d
movl %eax, %r8d
movzwl 0x6(%rsi,%rcx,4), %eax
leal 0x1(%r14), %r11d
cmpl %r10d, %r11d
jge 0x9941e
cmpl %eax, %r8d
jne 0x9941e
movl %ebx, %r8d
jmp 0x99492
cmpl %r9d, %r11d
jge 0x99431
movl %r8d, %r9d
addw %r11w, 0xaac(%rdi,%r9,4)
jmp 0x99466
testl %r8d, %r8d
je 0x99450
cmpl %ebx, %r8d
je 0x99447
movl %r8d, %r9d
incw 0xaac(%rdi,%r9,4)
incw 0xaec(%rdi)
jmp 0x99466
cmpl $0x9, %r14d
jg 0x9945f
incw 0xaf0(%rdi)
jmp 0x99466
incw 0xaf4(%rdi)
xorl %r11d, %r11d
testl %eax, %eax
je 0x99486
xorl %r10d, %r10d
cmpl %eax, %r8d
sete %r10b
movl $0x4, %r9d
subl %r10d, %r9d
xorl $0x7, %r10d
jmp 0x99492
movl $0x3, %r9d
movl $0x8a, %r10d
incq %rcx
movl %r11d, %r14d
movl %r8d, %ebx
cmpq %rcx, %rdx
jne 0x99403
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_get_uint_31
png_uint_32 PNGAPI
png_get_uint_31(png_structp png_ptr, png_bytep buf)
{
   png_uint_32 i = png_get_uint_32(buf);
   if (i > PNG_UINT_31_MAX)
     png_error(png_ptr, "PNG unsigned integer out of range");
   return (i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movzbl (%rsi), %ebp
shll $0x18, %ebp
movzbl 0x1(%rsi), %r14d
movzbl 0x2(%rsi), %ebx
movzbl 0x3(%rsi), %r15d
jns 0x999ed
leaq 0x18e68(%rip), %rsi     # 0xb2850
callq 0x920b4
shll $0x10, %r14d
orl %r15d, %r14d
shll $0x8, %ebx
orl %r14d, %ebx
orl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_read_chunk_header
png_uint_32 /* PRIVATE */
png_read_chunk_header(png_structp png_ptr)
{
   png_byte buf[8];
   png_uint_32 length;

#ifdef PNG_IO_STATE_SUPPORTED
   /* Inform the I/O callback that the chunk header is being read.
    * PNG_IO_CHUNK_HDR requires a single I/O call.
    */
   png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_HDR;
#endif

   /* Read the length and the chunk name */
   png_read_data(png_ptr, buf, 8);
   length = png_get_uint_31(png_ptr, buf);

   /* Put the chunk name into png_ptr->chunk_name */
   png_memcpy(png_ptr->chunk_name, buf + 4, 4);

   png_debug2(0, "Reading %s chunk, length = %lu",
      png_ptr->chunk_name, length);

   /* Reset the crc and run it over the chunk name */
   png_reset_crc(png_ptr);
   png_calculate_crc(png_ptr, png_ptr->chunk_name, 4);

   /* Check to see if chunk name is valid */
   png_check_chunk_name(png_ptr, png_ptr->chunk_name);

#ifdef PNG_IO_STATE_SUPPORTED
   /* Inform the I/O callback that chunk data will (possibly) be read.
    * PNG_IO_CHUNK_DATA does NOT require a specific number of I/O calls.
    */
   png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_DATA;
#endif

   return length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x21, 0x490(%rdi)
leaq 0x8(%rsp), %r14
movl $0x8, %edx
movq %r14, %rsi
callq 0x8b300
movzbl (%r14), %r15d
shll $0x18, %r15d
movzbl 0x1(%r14), %r12d
movzbl 0x2(%r14), %ebp
movzbl 0x3(%r14), %r14d
jns 0x99a5c
leaq 0x18dfc(%rip), %rsi     # 0xb2850
movq %rbx, %rdi
callq 0x920b4
shll $0x10, %r12d
orl %r14d, %r12d
shll $0x8, %ebp
orl %r12d, %ebp
orl %r15d, %ebp
leaq 0x244(%rbx), %r14
movl 0xc(%rsp), %eax
movl %eax, 0x244(%rbx)
movq %rbx, %rdi
callq 0x86daf
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x86dc6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x99ab9
movl $0x41, 0x490(%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_crc_finish
int /* PRIVATE */
png_crc_finish(png_structp png_ptr, png_uint_32 skip)
{
   png_size_t i;
   png_size_t istop = png_ptr->zbuf_size;

   for (i = (png_size_t)skip; i > istop; i -= istop)
   {
      png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
   }
   if (i)
   {
      png_crc_read(png_ptr, png_ptr->zbuf, i);
   }

   if (png_crc_error(png_ptr))
   {
      if (((png_ptr->chunk_name[0] & 0x20) &&                /* Ancillary */
          !(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) ||
          (!(png_ptr->chunk_name[0] & 0x20) &&             /* Critical  */
          (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE)))
      {
         png_chunk_warning(png_ptr, "CRC error");
      }
      else
      {
         png_chunk_benign_error(png_ptr, "CRC error");
         return (0);
      }
      return (1);
   }

   return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1a0(%rdi), %r15
movl %esi, %r14d
cmpq %r14, %r15
jae 0x99b86
movq 0x198(%rbx), %rsi
movq 0x1a0(%rbx), %rdx
movq %rbx, %rdi
callq 0x99b23
subq %r15, %r14
cmpq %r15, %r14
ja 0x99b68
testq %r14, %r14
je 0x99b9d
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x99b23
movq %rbx, %rdi
callq 0x99bf8
xorl %ebp, %ebp
testl %eax, %eax
je 0x99beb
testb $0x20, 0x244(%rbx)
movl 0x120(%rbx), %eax
jne 0x99bd6
btl $0xa, %eax
jae 0x99bdc
leaq 0x132e8(%rip), %rsi     # 0xaceaf
movq %rbx, %rdi
callq 0x92281
movl $0x1, %ebp
jmp 0x99beb
btl $0x9, %eax
jae 0x99bc0
leaq 0x132cc(%rip), %rsi     # 0xaceaf
movq %rbx, %rdi
callq 0x9219d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_IEND
void /* PRIVATE */
png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   png_debug(1, "in png_handle_IEND");

   if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT))
   {
      png_error(png_ptr, "No image in file");
   }

   png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND);

   if (length != 0)
   {
      png_warning(png_ptr, "Incorrect IEND chunk length");
   }
   png_crc_finish(png_ptr, length);

   info_ptr = info_ptr + 0; /* Quiet compiler warnings about unused info_ptr */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movl 0x11c(%rdi), %eax
movl %eax, %ecx
notl %ecx
testb $0x5, %cl
je 0x9a2e8
leaq 0x1872f(%rip), %rsi     # 0xb2a08
movq %r14, %rdi
callq 0x920b4
movl 0x11c(%r14), %eax
orl $0x18, %eax
movl %eax, 0x11c(%r14)
testl %ebx, %ebx
je 0x9a307
leaq 0x1871c(%rip), %rsi     # 0xb2a19
movq %r14, %rdi
callq 0x9214d
jmp 0x9a309
xorl %ebx, %ebx
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x99b4f
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_hIST
void /* PRIVATE */
png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   unsigned int num, i;
   png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH];

   png_debug(1, "in png_handle_hIST");

   if (!(png_ptr->mode & PNG_HAVE_IHDR))
      png_error(png_ptr, "Missing IHDR before hIST");
   else if (png_ptr->mode & PNG_HAVE_IDAT)
   {
      png_warning(png_ptr, "Invalid hIST after IDAT");
      png_crc_finish(png_ptr, length);
      return;
   }
   else if (!(png_ptr->mode & PNG_HAVE_PLTE))
   {
      png_warning(png_ptr, "Missing PLTE before hIST");
      png_crc_finish(png_ptr, length);
      return;
   }
   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST))
   {
      png_warning(png_ptr, "Duplicate hIST chunk");
      png_crc_finish(png_ptr, length);
      return;
   }

   num = length / 2 ;
   if (num != (unsigned int) png_ptr->num_palette || num >
      (unsigned int) PNG_MAX_PALETTE_LENGTH)
   {
      png_warning(png_ptr, "Incorrect hIST chunk length");
      png_crc_finish(png_ptr, length);
      return;
   }

   for (i = 0; i < num; i++)
   {
      png_byte buf[2];

      png_crc_read(png_ptr, buf, 2);
      readbuf[i] = png_get_uint_16(buf);
   }

   if (png_crc_finish(png_ptr, 0))
      return;

   png_set_hIST(png_ptr, info_ptr, readbuf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
testb $0x1, %al
jne 0x9b47b
leaq 0x17c72(%rip), %rsi     # 0xb3063
movq %rbx, %rdi
callq 0x920b4
cmpl $0x201, %ebp            # imm = 0x201
ja 0x9b48c
movl %ebp, %eax
shrl %eax
movzwl 0x240(%rbx), %ecx
cmpl %ecx, %eax
jne 0x9b48c
cmpl $0x2, %ebp
jb 0x9b44b
movl %eax, %r12d
xorl %r13d, %r13d
leaq 0xe(%rsp), %r15
movl $0x2, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x99b23
movzwl 0xe(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x10(%rsp,%r13,2)
incq %r13
cmpq %r13, %r12
jne 0x9b424
movq %rbx, %rdi
xorl %esi, %esi
callq 0x99b4f
testl %eax, %eax
jne 0x9b469
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x87cca
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x4, %al
jne 0x9b495
testb $0x2, %al
jne 0x9b4bf
leaq 0x17c0a(%rip), %rsi     # 0xb3094
jmp 0x9b49c
leaq 0x17c2f(%rip), %rsi     # 0xb30c2
jmp 0x9b49c
leaq 0x17be0(%rip), %rsi     # 0xb307c
movq %rbx, %rdi
callq 0x9214d
movq %rbx, %rdi
movl %ebp, %esi
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x99b4f
testq %r14, %r14
je 0x9b3f9
testb $0x40, 0x8(%r14)
je 0x9b3f9
leaq 0x17bd3(%rip), %rsi     # 0xb30ad
jmp 0x9b49c
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_pHYs
void /* PRIVATE */
png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   png_byte buf[9];
   png_uint_32 res_x, res_y;
   int unit_type;

   png_debug(1, "in png_handle_pHYs");

   if (!(png_ptr->mode & PNG_HAVE_IHDR))
      png_error(png_ptr, "Missing IHDR before pHYs");
   else if (png_ptr->mode & PNG_HAVE_IDAT)
   {
      png_warning(png_ptr, "Invalid pHYs after IDAT");
      png_crc_finish(png_ptr, length);
      return;
   }
   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
   {
      png_warning(png_ptr, "Duplicate pHYs chunk");
      png_crc_finish(png_ptr, length);
      return;
   }

   if (length != 9)
   {
      png_warning(png_ptr, "Incorrect pHYs chunk length");
      png_crc_finish(png_ptr, length);
      return;
   }

   png_crc_read(png_ptr, buf, 9);
   if (png_crc_finish(png_ptr, 0))
      return;

   res_x = png_get_uint_32(buf);
   res_y = png_get_uint_32(buf + 4);
   unit_type = buf[8];
   png_set_pHYs(png_ptr, info_ptr, res_x, res_y, unit_type);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
testb $0x1, %al
jne 0x9b550
leaq 0x17be1(%rip), %rsi     # 0xb30de
movq %rbx, %rdi
callq 0x920b4
cmpl $0x9, %ebp
jne 0x9b569
leaq 0x7(%rsp), %rsi
movl $0x9, %edx
movq %rbx, %rdi
callq 0x99b23
movq %rbx, %rdi
xorl %esi, %esi
callq 0x99b4f
testl %eax, %eax
jne 0x9b547
movl 0x7(%rsp), %edx
movl 0xb(%rsp), %ecx
bswapl %edx
bswapl %ecx
movzbl 0xf(%rsp), %r8d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88063
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
testb $0x4, %al
jne 0x9b572
testq %r14, %r14
je 0x9b505
testb $-0x80, 0x8(%r14)
je 0x9b505
leaq 0x17ba8(%rip), %rsi     # 0xb310f
jmp 0x9b579
leaq 0x17bb4(%rip), %rsi     # 0xb3124
jmp 0x9b579
leaq 0x17b7e(%rip), %rsi     # 0xb30f7
movq %rbx, %rdi
callq 0x9214d
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x99b4f
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_oFFs
void /* PRIVATE */
png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   png_byte buf[9];
   png_int_32 offset_x, offset_y;
   int unit_type;

   png_debug(1, "in png_handle_oFFs");

   if (!(png_ptr->mode & PNG_HAVE_IHDR))
      png_error(png_ptr, "Missing IHDR before oFFs");
   else if (png_ptr->mode & PNG_HAVE_IDAT)
   {
      png_warning(png_ptr, "Invalid oFFs after IDAT");
      png_crc_finish(png_ptr, length);
      return;
   }
   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs))
   {
      png_warning(png_ptr, "Duplicate oFFs chunk");
      png_crc_finish(png_ptr, length);
      return;
   }

   if (length != 9)
   {
      png_warning(png_ptr, "Incorrect oFFs chunk length");
      png_crc_finish(png_ptr, length);
      return;
   }

   png_crc_read(png_ptr, buf, 9);
   if (png_crc_finish(png_ptr, 0))
      return;

   offset_x = png_get_int_32(buf);
   offset_y = png_get_int_32(buf + 4);
   unit_type = buf[8];
   png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, unit_type);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
testb $0x1, %al
jne 0x9b60e
leaq 0x17b8c(%rip), %rsi     # 0xb3140
movq %rbx, %rdi
callq 0x920b4
cmpl $0x9, %ebp
jne 0x9b627
leaq 0x7(%rsp), %rsi
movl $0x9, %edx
movq %rbx, %rdi
callq 0x99b23
movq %rbx, %rdi
xorl %esi, %esi
callq 0x99b4f
testl %eax, %eax
jne 0x9b6c7
movzbl 0x7(%rsp), %eax
testb %al, %al
js 0x9b651
shll $0x18, %eax
movzbl 0x8(%rsp), %ecx
shll $0x10, %ecx
orl %eax, %ecx
movzbl 0x9(%rsp), %eax
shll $0x8, %eax
orl %ecx, %eax
movzbl 0xa(%rsp), %edx
orl %eax, %edx
jmp 0x9b66f
testb $0x4, %al
jne 0x9b630
testq %r14, %r14
je 0x9b5bc
testb $0x1, 0x9(%r14)
je 0x9b5bc
leaq 0x17b4c(%rip), %rsi     # 0xb3171
jmp 0x9b637
leaq 0x17b58(%rip), %rsi     # 0xb3186
jmp 0x9b637
leaq 0x17b22(%rip), %rsi     # 0xb3159
movq %rbx, %rdi
callq 0x9214d
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x99b4f
movzbl 0x8(%rsp), %ecx
shll $0x10, %ecx
shll $0x18, %eax
orl %ecx, %eax
movzbl 0x9(%rsp), %ecx
shll $0x8, %ecx
orl %eax, %ecx
movzbl 0xa(%rsp), %edx
orl %ecx, %edx
movzbl 0xb(%rsp), %eax
testb %al, %al
js 0x9b698
shll $0x18, %eax
movzbl 0xc(%rsp), %ecx
shll $0x10, %ecx
orl %eax, %ecx
movzbl 0xd(%rsp), %eax
shll $0x8, %eax
orl %ecx, %eax
movzbl 0xe(%rsp), %ecx
orl %eax, %ecx
jmp 0x9b6b6
movzbl 0xc(%rsp), %ecx
shll $0x10, %ecx
shll $0x18, %eax
orl %ecx, %eax
movzbl 0xd(%rsp), %esi
shll $0x8, %esi
orl %eax, %esi
movzbl 0xe(%rsp), %ecx
orl %esi, %ecx
movzbl 0xf(%rsp), %r8d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x87e4d
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngrutil.c
// Function: png_handle_tIME
void /* PRIVATE */
png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
   png_byte buf[7];
   png_time mod_time;

   png_debug(1, "in png_handle_tIME");

   if (!(png_ptr->mode & PNG_HAVE_IHDR))
      png_error(png_ptr, "Out of place tIME chunk");
   else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME))
   {
      png_warning(png_ptr, "Duplicate tIME chunk");
      png_crc_finish(png_ptr, length);
      return;
   }

   if (png_ptr->mode & PNG_HAVE_IDAT)
      png_ptr->mode |= PNG_AFTER_IDAT;

   if (length != 7)
   {
      png_warning(png_ptr, "Incorrect tIME chunk length");
      png_crc_finish(png_ptr, length);
      return;
   }

   png_crc_read(png_ptr, buf, 7);
   if (png_crc_finish(png_ptr, 0))
      return;

   mod_time.second = buf[6];
   mod_time.minute = buf[5];
   mod_time.hour = buf[4];
   mod_time.day = buf[3];
   mod_time.month = buf[2];
   mod_time.year = png_get_uint_16(buf);

   png_set_tIME(png_ptr, info_ptr, &mod_time);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x11c(%rdi), %eax
testb $0x1, %al
jne 0x9bbec
leaq 0x17789(%rip), %rsi     # 0xb3365
movq %rbx, %rdi
callq 0x920b4
movl 0x11c(%rbx), %eax
jmp 0x9bbf8
testq %r14, %r14
je 0x9bbf8
testb $0x2, 0x9(%r14)
jne 0x9bc66
testb $0x4, %al
je 0x9bc05
orl $0x8, %eax
movl %eax, 0x11c(%rbx)
cmpl $0x7, %ebp
jne 0x9bc5d
leaq 0x1(%rsp), %rsi
movl $0x7, %edx
movq %rbx, %rdi
callq 0x99b23
movq %rbx, %rdi
xorl %esi, %esi
callq 0x99b4f
testl %eax, %eax
jne 0x9bc54
movb 0x7(%rsp), %al
leaq 0x8(%rsp), %rdx
movb %al, 0x6(%rdx)
movl 0x3(%rsp), %eax
movl %eax, 0x2(%rdx)
movzwl 0x1(%rsp), %eax
rolw $0x8, %ax
movw %ax, (%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8864e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1772e(%rip), %rsi     # 0xb3392
jmp 0x9bc6d
leaq 0x17710(%rip), %rsi     # 0xb337d
movq %rbx, %rdi
callq 0x9214d
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x99b4f
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngtrans.c
// Function: png_do_packswap
void /* PRIVATE */
png_do_packswap(png_row_infop row_info, png_bytep row)
{
   png_debug(1, "in png_do_packswap");

   if (
       row_info->bit_depth < 8)
   {
      png_bytep rp, end, table;

      end = row + row_info->rowbytes;

      if (row_info->bit_depth == 1)
         table = (png_bytep)onebppswaptable;
      else if (row_info->bit_depth == 2)
         table = (png_bytep)twobppswaptable;
      else if (row_info->bit_depth == 4)
         table = (png_bytep)fourbppswaptable;
      else
         return;

      for (rp = row; rp < end; rp++)
         *rp = table[*rp];
   }
}

// Assembly:
movzbl 0x11(%rdi), %ecx
cmpl $0x7, %ecx
ja 0x9d50f
movq 0x8(%rdi), %rax
cmpl $0x1, %ecx
je 0x9d4f0
cmpl $0x4, %ecx
je 0x9d4e7
cmpl $0x2, %ecx
jne 0x9d50f
leaq 0x163cb(%rip), %rcx     # 0xb38b0
jmp 0x9d4f7
leaq 0x164c2(%rip), %rcx     # 0xb39b0
jmp 0x9d4f7
leaq 0x162b9(%rip), %rcx     # 0xb37b0
testq %rax, %rax
jle 0x9d50f
addq %rsi, %rax
movzbl (%rsi), %edx
movb (%rcx,%rdx), %dl
movb %dl, (%rsi)
incq %rsi
cmpq %rax, %rsi
jb 0x9d4ff
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_sig
void PNGAPI
png_write_sig(png_structp png_ptr)
{
   png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};

#ifdef PNG_IO_STATE_SUPPORTED
   /* Inform the I/O callback that the signature is being written */
   png_ptr->io_state = PNG_IO_WRITING | PNG_IO_SIGNATURE;
#endif

   /* Write the rest of the 8 byte signature */
   png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
      (png_size_t)(8 - png_ptr->sig_bytes));
   if (png_ptr->sig_bytes < 3)
      png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movabsq $0xa1a0a0d474e5089, %rax # imm = 0xA1A0A0D474E5089
movq %rax, 0x8(%rsp)
movl $0x12, 0x490(%rdi)
movzbl 0x254(%rdi), %eax
leaq (%rsp,%rax), %rsi
addq $0x8, %rsi
movl $0x8, %edx
subq %rax, %rdx
callq 0xa0aec
cmpb $0x2, 0x254(%rbx)
ja 0x9d8b7
orb $0x10, 0x11d(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_chunk
void PNGAPI
png_write_chunk(png_structp png_ptr, png_bytep chunk_name,
   png_bytep data, png_size_t length)
{
   if (png_ptr == NULL)
      return;
   png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length);
   png_write_chunk_data(png_ptr, data, (png_size_t)length);
   png_write_chunk_end(png_ptr);
}

// Assembly:
testq %rdi, %rdi
je 0x9d919
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
movl %r14d, %edx
callq 0x9d91a
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x9d98f
movl $0x82, 0x490(%rbx)
movl 0x234(%rbx), %eax
bswapl %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movq %rbx, %rdi
callq 0xa0aec
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_PLTE
void /* PRIVATE */
png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
{
   PNG_PLTE;
   png_uint_32 i;
   png_colorp pal_ptr;
   png_byte buf[3];

   png_debug(1, "in png_write_PLTE");

   if ((
#ifdef PNG_MNG_FEATURES_SUPPORTED
        !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
#endif
        num_pal == 0) || num_pal > 256)
   {
     if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
     {
        png_error(png_ptr, "Invalid number of colors in palette");
     }
     else
     {
        png_warning(png_ptr, "Invalid number of colors in palette");
        return;
     }
   }

   if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR))
   {
      png_warning(png_ptr,
        "Ignoring request to write a PLTE chunk in grayscale PNG");
      return;
   }

   png_ptr->num_palette = (png_uint_16)num_pal;
   png_debug1(3, "num_palette = %d", png_ptr->num_palette);

   png_write_chunk_start(png_ptr, (png_bytep)png_PLTE,
     (png_uint_32)(num_pal * 3));
#ifdef PNG_POINTER_INDEXING_SUPPORTED
   for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++)
   {
      buf[0] = pal_ptr->red;
      buf[1] = pal_ptr->green;
      buf[2] = pal_ptr->blue;
      png_write_chunk_data(png_ptr, buf, (png_size_t)3);
   }
#else
   /* This is a little slower but some buggy compilers need to do this
    * instead
    */
   pal_ptr=palette;
   for (i = 0; i < num_pal; i++)
   {
      buf[0] = pal_ptr[i].red;
      buf[1] = pal_ptr[i].green;
      buf[2] = pal_ptr[i].blue;
      png_write_chunk_data(png_ptr, buf, (png_size_t)3);
   }
#endif
   png_write_chunk_end(png_ptr);
   png_ptr->mode |= PNG_HAVE_PLTE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movb $0x0, 0x14(%rsp)
movl $0x45544c50, 0x10(%rsp) # imm = 0x45544C50
cmpl $0x100, %edx            # imm = 0x100
ja 0x9de22
movl 0x408(%rbx), %eax
andl $0x1, %eax
orl %r14d, %eax
jne 0x9de3e
cmpb $0x3, 0x24e(%rbx)
jne 0x9debe
leaq 0x15f35(%rip), %rsi     # 0xb3d6b
movq %rbx, %rdi
callq 0x920b4
testb $0x2, 0x24e(%rbx)
jne 0x9de50
leaq 0x15f41(%rip), %rsi     # 0xb3d8f
jmp 0x9dec5
movw %r14w, 0x240(%rbx)
leal (%r14,%r14,2), %edx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x9d91a
testl %r14d, %r14d
je 0x9dea3
leaq 0xd(%rsp), %r12
movb (%r15), %al
movb %al, 0xd(%rsp)
movb 0x1(%r15), %al
movb %al, 0xe(%rsp)
movb 0x2(%r15), %al
movb %al, 0xf(%rsp)
movl $0x3, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9d98f
addq $0x3, %r15
decl %r14d
jne 0x9de73
movq %rbx, %rdi
callq 0x9d9ce
orb $0x2, 0x11c(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x15ea6(%rip), %rsi     # 0xb3d6b
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x9214d
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_gAMA
void /* PRIVATE */
png_write_gAMA(png_structp png_ptr, double file_gamma)
{
   PNG_gAMA;
   png_uint_32 igamma;
   png_byte buf[4];

   png_debug(1, "in png_write_gAMA");

   /* file_gamma is saved in 1/100,000ths */
   igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5);
   png_save_uint_32(buf, igamma);
   png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);
}

// Assembly:
subq $0x18, %rsp
leaq 0x10(%rsp), %rsi
movb $0x0, 0x4(%rsi)
mulsd 0xe4cb(%rip), %xmm0     # 0xac538
addsd 0x3fbb(%rip), %xmm0     # 0xa2030
cvttsd2si %xmm0, %rax
movl $0x414d4167, (%rsi)     # imm = 0x414D4167
bswapl %eax
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
movl $0x4, %ecx
callq 0x9d8bd
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_sRGB
void /* PRIVATE */
png_write_sRGB(png_structp png_ptr, int srgb_intent)
{
   PNG_sRGB;
   png_byte buf[1];

   png_debug(1, "in png_write_sRGB");

   if (srgb_intent >= PNG_sRGB_INTENT_LAST)
         png_warning(png_ptr,
            "Invalid sRGB rendering intent specified");
   buf[0]=(png_byte)srgb_intent;
   png_write_chunk(png_ptr, (png_bytep)png_sRGB, buf, (png_size_t)1);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movb $0x0, 0x14(%rsp)
movl $0x42475273, 0x10(%rsp) # imm = 0x42475273
cmpl $0x4, %esi
jl 0x9e0f2
leaq 0x15d0e(%rip), %rsi     # 0xb3df8
movq %rbx, %rdi
callq 0x9214d
leaq 0xf(%rsp), %rdx
movb %bpl, (%rdx)
leaq 0x10(%rsp), %rsi
movl $0x1, %ecx
movq %rbx, %rdi
callq 0x9d8bd
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_compressed_data_out
static void /* PRIVATE */
png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
{
   int i;

   /* Handle the no-compression case */
   if (comp->input)
   {
      png_write_chunk_data(png_ptr, (png_bytep)comp->input,
                            (png_size_t)comp->input_len);
      return;
   }

   /* Write saved output buffers, if any */
   for (i = 0; i < comp->num_output_ptr; i++)
   {
      png_write_chunk_data(png_ptr, (png_bytep)comp->output_ptr[i],
         (png_size_t)png_ptr->zbuf_size);
      png_free(png_ptr, comp->output_ptr[i]);
   }
   if (comp->max_output_ptr != 0)
      png_free(png_ptr, comp->output_ptr);
   /* Write anything left in zbuf */
   if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)
      png_write_chunk_data(png_ptr, png_ptr->zbuf,
         (png_size_t)(png_ptr->zbuf_size - png_ptr->zstream.avail_out));

   /* Reset zlib for another zTXt/iTXt or image data */
   deflateReset(&png_ptr->zstream);
   png_ptr->zstream.data_type = Z_BINARY;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x9e776
movslq 0x8(%r14), %rdx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x9d98f
cmpl $0x0, 0xc(%r14)
jle 0x9e7b3
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rsi
movq 0x1a0(%rbx), %rdx
movq %rbx, %rdi
callq 0x9d98f
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x92016
incq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jl 0x9e780
cmpl $0x0, 0x10(%r14)
je 0x9e7c6
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x92016
leaq 0x128(%rbx), %r14
movl 0x148(%rbx), %eax
movq 0x1a0(%rbx), %rdx
cmpl %edx, %eax
jae 0x9e7f0
movq 0x198(%rbx), %rsi
subq %rax, %rdx
movq %rbx, %rdi
callq 0x9d98f
movq %r14, %rdi
callq 0x92b77
movl $0x0, 0x180(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_sBIT
void /* PRIVATE */
png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type)
{
   PNG_sBIT;
   png_byte buf[4];
   png_size_t size;

   png_debug(1, "in png_write_sBIT");

   /* Make sure we don't depend upon the order of PNG_COLOR_8 */
   if (color_type & PNG_COLOR_MASK_COLOR)
   {
      png_byte maxbits;

      maxbits = (png_byte)(color_type==PNG_COLOR_TYPE_PALETTE ? 8 :
                png_ptr->usr_bit_depth);
      if (sbit->red == 0 || sbit->red > maxbits ||
          sbit->green == 0 || sbit->green > maxbits ||
          sbit->blue == 0 || sbit->blue > maxbits)
      {
         png_warning(png_ptr, "Invalid sBIT depth specified");
         return;
      }
      buf[0] = sbit->red;
      buf[1] = sbit->green;
      buf[2] = sbit->blue;
      size = 3;
   }
   else
   {
      if (sbit->gray == 0 || sbit->gray > png_ptr->usr_bit_depth)
      {
         png_warning(png_ptr, "Invalid sBIT depth specified");
         return;
      }
      buf[0] = sbit->gray;
      size = 1;
   }

   if (color_type & PNG_COLOR_MASK_ALPHA)
   {
      if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth)
      {
         png_warning(png_ptr, "Invalid sBIT depth specified");
         return;
      }
      buf[size++] = sbit->alpha;
   }

   png_write_chunk(png_ptr, (png_bytep)png_sBIT, buf, size);
}

// Assembly:
subq $0x18, %rsp
movb $0x0, 0x14(%rsp)
movl $0x54494273, 0x10(%rsp) # imm = 0x54494273
testb $0x2, %dl
jne 0x9e9c1
movb 0x3(%rsi), %al
testb %al, %al
je 0x9ea49
cmpb 0x250(%rdi), %al
ja 0x9ea49
movb %al, 0xc(%rsp)
movl $0x1, %ecx
jmp 0x9ea35
movl $0x8, %ecx
cmpl $0x3, %edx
je 0x9e9d2
movzbl 0x250(%rdi), %ecx
movb (%rsi), %al
testb %al, %al
sete %r8b
movzbl %al, %r9d
cmpl %r9d, %ecx
setb %r9b
orb %r8b, %r9b
jne 0x9ea49
movb 0x1(%rsi), %r8b
testb %r8b, %r8b
sete %r9b
movzbl %r8b, %r10d
cmpl %r10d, %ecx
setb %r10b
orb %r9b, %r10b
jne 0x9ea49
movb 0x2(%rsi), %r9b
testb %r9b, %r9b
sete %r10b
movzbl %r9b, %r11d
cmpl %r11d, %ecx
setb %cl
orb %r10b, %cl
cmpb $0x1, %cl
je 0x9ea49
movb %al, 0xc(%rsp)
movb %r8b, 0xd(%rsp)
movb %r9b, 0xe(%rsp)
movl $0x3, %ecx
testb $0x4, %dl
je 0x9ea60
movb 0x4(%rsi), %al
testb %al, %al
je 0x9ea49
cmpb 0x250(%rdi), %al
jbe 0x9ea59
leaq 0x1548b(%rip), %rsi     # 0xb3edb
addq $0x18, %rsp
jmp 0x9214d
movb %al, 0xc(%rsp,%rcx)
incq %rcx
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x9d8bd
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_tRNS
void /* PRIVATE */
png_write_tRNS(png_structp png_ptr, png_bytep trans_alpha, png_color_16p tran,
   int num_trans, int color_type)
{
   PNG_tRNS;
   png_byte buf[6];

   png_debug(1, "in png_write_tRNS");

   if (color_type == PNG_COLOR_TYPE_PALETTE)
   {
      if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette)
      {
         png_warning(png_ptr, "Invalid number of transparent colors specified");
         return;
      }
      /* Write the chunk out as it is */
      png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans_alpha,
        (png_size_t)num_trans);
   }
   else if (color_type == PNG_COLOR_TYPE_GRAY)
   {
      /* One 16 bit value */
      if (tran->gray >= (1 << png_ptr->bit_depth))
      {
         png_warning(png_ptr,
           "Ignoring attempt to write tRNS chunk out-of-range for bit_depth");
         return;
      }
      png_save_uint_16(buf, tran->gray);
      png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)2);
   }
   else if (color_type == PNG_COLOR_TYPE_RGB)
   {
      /* Three 16 bit values */
      png_save_uint_16(buf, tran->red);
      png_save_uint_16(buf + 2, tran->green);
      png_save_uint_16(buf + 4, tran->blue);
      if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))
      {
         png_warning(png_ptr,
           "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8");
         return;
      }
      png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)6);
   }
   else
   {
      png_warning(png_ptr, "Can't write tRNS with an alpha channel");
   }
}

// Assembly:
subq $0x18, %rsp
movb $0x0, 0x10(%rsp)
movl $0x534e5274, 0xc(%rsp)  # imm = 0x534E5274
testl %r8d, %r8d
je 0x9ee33
cmpl $0x2, %r8d
je 0x9ede5
cmpl $0x3, %r8d
jne 0x9ee60
testl %ecx, %ecx
jle 0x9edd9
movzwl 0x240(%rdi), %edx
cmpl %ecx, %edx
jae 0x9ee8a
leaq 0x15118(%rip), %rsi     # 0xb3ef8
jmp 0x9ee81
movzwl 0x2(%rdx), %eax
movl %eax, %ecx
rolw $0x8, %cx
movw %cx, 0x12(%rsp)
movzwl 0x4(%rdx), %ecx
movl %ecx, %esi
rolw $0x8, %si
movw %si, 0x14(%rsp)
movzwl 0x6(%rdx), %edx
movl %edx, %esi
rolw $0x8, %si
movw %si, 0x16(%rsp)
cmpb $0x8, 0x24f(%rdi)
jne 0x9ee69
shrl $0x8, %eax
shrl $0x8, %ecx
shrl $0x8, %edx
orb %al, %cl
orb %dl, %cl
je 0x9ee69
leaq 0x15136(%rip), %rsi     # 0xb3f67
jmp 0x9ee81
movzwl 0x8(%rdx), %eax
movb 0x24f(%rdi), %cl
movl $0x1, %edx
shll %cl, %edx
cmpl %eax, %edx
jle 0x9ee7a
rolw $0x8, %ax
leaq 0x12(%rsp), %rdx
movw %ax, (%rdx)
leaq 0xc(%rsp), %rsi
movl $0x2, %ecx
jmp 0x9ee97
leaq 0x15140(%rip), %rsi     # 0xb3fa7
jmp 0x9ee81
leaq 0xc(%rsp), %rsi
leaq 0x12(%rsp), %rdx
movl $0x6, %ecx
jmp 0x9ee97
leaq 0x150a6(%rip), %rsi     # 0xb3f27
addq $0x18, %rsp
jmp 0x9214d
movq %rsi, %rax
movl %ecx, %ecx
leaq 0xc(%rsp), %rsi
movq %rax, %rdx
callq 0x9d8bd
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_bKGD
void /* PRIVATE */
png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
{
   PNG_bKGD;
   png_byte buf[6];

   png_debug(1, "in png_write_bKGD");

   if (color_type == PNG_COLOR_TYPE_PALETTE)
   {
      if (
#ifdef PNG_MNG_FEATURES_SUPPORTED
          (png_ptr->num_palette ||
          (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) &&
#endif
         back->index >= png_ptr->num_palette)
      {
         png_warning(png_ptr, "Invalid background palette index");
         return;
      }
      buf[0] = back->index;
      png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)1);
   }
   else if (color_type & PNG_COLOR_MASK_COLOR)
   {
      png_save_uint_16(buf, back->red);
      png_save_uint_16(buf + 2, back->green);
      png_save_uint_16(buf + 4, back->blue);
      if (png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4]))
      {
         png_warning(png_ptr,
           "Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8");
         return;
      }
      png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)6);
   }
   else
   {
      if (back->gray >= (1 << png_ptr->bit_depth))
      {
         png_warning(png_ptr,
           "Ignoring attempt to write bKGD chunk out-of-range for bit_depth");
         return;
      }
      png_save_uint_16(buf, back->gray);
      png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)2);
   }
}

// Assembly:
subq $0x18, %rsp
movb $0x0, 0x10(%rsp)
movl $0x44474b62, 0xc(%rsp)  # imm = 0x44474B62
cmpl $0x3, %edx
jne 0x9eee8
movzwl 0x240(%rdi), %ecx
testw %cx, %cx
jne 0x9eed0
testb $0x1, 0x408(%rdi)
jne 0x9ef8c
movzbl (%rsi), %eax
cmpw %ax, %cx
ja 0x9ef8e
leaq 0x150eb(%rip), %rsi     # 0xb3fce
jmp 0x9ef83
testb $0x2, %dl
jne 0x9ef1d
movzwl 0x8(%rsi), %eax
movb 0x24f(%rdi), %cl
movl $0x1, %edx
shll %cl, %edx
cmpl %eax, %edx
jle 0x9ef7c
rolw $0x8, %ax
leaq 0x12(%rsp), %rdx
movw %ax, (%rdx)
leaq 0xc(%rsp), %rsi
movl $0x2, %ecx
jmp 0x9ef9f
movzwl 0x2(%rsi), %eax
movl %eax, %ecx
rolw $0x8, %cx
movw %cx, 0x12(%rsp)
movzwl 0x4(%rsi), %ecx
movl %ecx, %edx
rolw $0x8, %dx
movw %dx, 0x14(%rsp)
movzwl 0x6(%rsi), %edx
movl %edx, %esi
rolw $0x8, %si
movw %si, 0x16(%rsp)
cmpb $0x8, 0x24f(%rdi)
jne 0x9ef6b
shrl $0x8, %eax
shrl $0x8, %ecx
shrl $0x8, %edx
orb %al, %cl
orb %dl, %cl
je 0x9ef6b
leaq 0x15086(%rip), %rsi     # 0xb3fef
jmp 0x9ef83
leaq 0xc(%rsp), %rsi
leaq 0x12(%rsp), %rdx
movl $0x6, %ecx
jmp 0x9ef9f
leaq 0x150ac(%rip), %rsi     # 0xb402f
addq $0x18, %rsp
jmp 0x9214d
movb (%rsi), %al
leaq 0x12(%rsp), %rdx
movb %al, (%rdx)
leaq 0xc(%rsp), %rsi
movl $0x1, %ecx
callq 0x9d8bd
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_hIST
void /* PRIVATE */
png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist)
{
   PNG_hIST;
   int i;
   png_byte buf[3];

   png_debug(1, "in png_write_hIST");

   if (num_hist > (int)png_ptr->num_palette)
   {
      png_debug2(3, "num_hist = %d, num_palette = %d", num_hist,
         png_ptr->num_palette);
      png_warning(png_ptr, "Invalid number of histogram entries specified");
      return;
   }

   png_write_chunk_start(png_ptr, (png_bytep)png_hIST,
     (png_uint_32)(num_hist * 2));
   for (i = 0; i < num_hist; i++)
   {
      png_save_uint_16(buf, hist[i]);
      png_write_chunk_data(png_ptr, buf, (png_size_t)2);
   }
   png_write_chunk_end(png_ptr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movb $0x0, 0xc(%rsp)
movl $0x54534968, 0x8(%rsp)  # imm = 0x54534968
movzwl 0x240(%rdi), %eax
cmpl %edx, %eax
jge 0x9efed
leaq 0x15097(%rip), %rsi     # 0xb406f
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x9214d
movl %edx, %r15d
movq %rsi, %r14
leal (%r15,%r15), %edx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x9d91a
testl %r15d, %r15d
jle 0x9f03a
movl %r15d, %r12d
xorl %r13d, %r13d
leaq 0x5(%rsp), %r15
movzwl (%r14,%r13,2), %eax
rolw $0x8, %ax
movw %ax, 0x5(%rsp)
movl $0x2, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9d98f
incq %r13
cmpq %r13, %r12
jne 0x9f014
movq %rbx, %rdi
callq 0x9d9ce
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_tEXt
void /* PRIVATE */
png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text,
   png_size_t text_len)
{
   PNG_tEXt;
   png_size_t key_len;
   png_charp new_key;

   png_debug(1, "in png_write_tEXt");

   if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0)
      return;

   if (text == NULL || *text == '\0')
      text_len = 0;
   else
      text_len = png_strlen(text);

   /* Make sure we include the 0 after the key */
   png_write_chunk_start(png_ptr, (png_bytep)png_tEXt,
      (png_uint_32)(key_len + text_len + 1));
   /*
    * We leave it to the application to meet PNG-1.0 requirements on the
    * contents of the text.  PNG-1.0 through PNG-1.2 discourage the use of
    * any non-Latin-1 characters except for NEWLINE.  ISO PNG will forbid them.
    * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
    */
   png_write_chunk_data(png_ptr, (png_bytep)new_key,
     (png_size_t)(key_len + 1));
   if (text_len)
      png_write_chunk_data(png_ptr, (png_bytep)text, (png_size_t)text_len);

   png_write_chunk_end(png_ptr);
   png_free(png_ptr, new_key);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movb $0x0, 0x4(%rsp)
movl $0x74584574, (%rsp)     # imm = 0x74584574
leaq 0x8(%rsp), %rdx
callq 0x9e27b
testq %rax, %rax
je 0x9f0e9
movq %rax, %r15
testq %r14, %r14
je 0x9f099
cmpb $0x0, (%r14)
je 0x9f099
movq %r14, %rdi
callq 0xe1e0
movq %rax, %r12
jmp 0x9f09c
xorl %r12d, %r12d
leal (%r12,%r15), %edx
incl %edx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x9d91a
movq 0x8(%rsp), %r13
incq %r15
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x9d98f
testq %r12, %r12
je 0x9f0d6
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x9d98f
movq %rbx, %rdi
callq 0x9d9ce
movq %rbx, %rdi
movq %r13, %rsi
callq 0x92016
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_zTXt
void /* PRIVATE */
png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text,
   png_size_t text_len, int compression)
{
   PNG_zTXt;
   png_size_t key_len;
   char buf[1];
   png_charp new_key;
   compression_state comp;

   png_debug(1, "in png_write_zTXt");

   comp.num_output_ptr = 0;
   comp.max_output_ptr = 0;
   comp.output_ptr = NULL;
   comp.input = NULL;
   comp.input_len = 0;

   if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0)
   {
      png_free(png_ptr, new_key);
      return;
   }

   if (text == NULL || *text == '\0' || compression==PNG_TEXT_COMPRESSION_NONE)
   {
      png_write_tEXt(png_ptr, new_key, text, (png_size_t)0);
      png_free(png_ptr, new_key);
      return;
   }

   text_len = png_strlen(text);

   /* Compute the compressed data; do it now for the length */
   text_len = png_text_compress(png_ptr, text, text_len, compression,
       &comp);

   /* Write start of chunk */
   png_write_chunk_start(png_ptr, (png_bytep)png_zTXt,
     (png_uint_32)(key_len+text_len + 2));
   /* Write key */
   png_write_chunk_data(png_ptr, (png_bytep)new_key,
     (png_size_t)(key_len + 1));
   png_free(png_ptr, new_key);

   buf[0] = (png_byte)compression;
   /* Write compression */
   png_write_chunk_data(png_ptr, (png_bytep)buf, (png_size_t)1);
   /* Write the compressed data */
   png_write_compressed_data_out(png_ptr, &comp);

   /* Close the chunk */
   png_write_chunk_end(png_ptr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %r8d, %ebp
movq %rdx, %r15
movq %rdi, %rbx
movb $0x0, 0x1c(%rsp)
movl $0x7458547a, 0x18(%rsp) # imm = 0x7458547A
movq $0x0, 0x38(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movl $0x0, 0x30(%rsp)
leaq 0x10(%rsp), %rdx
callq 0x9e27b
testq %rax, %rax
je 0x9f1ee
testq %r15, %r15
je 0x9f1f8
cmpl $-0x1, %ebp
je 0x9f207
cmpb $0x0, (%r15)
je 0x9f207
movq %rax, %r14
movq %r15, %rdi
callq 0xe1e0
leaq 0x20(%rsp), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
movl %ebp, %ecx
movq %r12, %r8
callq 0x9e4ac
leal (%r14,%rax), %edx
addl $0x2, %edx
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x9d91a
movq 0x10(%rsp), %r15
incq %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x9d98f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x92016
leaq 0xf(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9d98f
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9e752
movq %rbx, %rdi
callq 0x9d9ce
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
jmp 0x9f220
movq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
jmp 0x9f215
movq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9f050
movq %rbx, %rdi
movq %r14, %rsi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x92016
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_oFFs
void /* PRIVATE */
png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
   int unit_type)
{
   PNG_oFFs;
   png_byte buf[9];

   png_debug(1, "in png_write_oFFs");

   if (unit_type >= PNG_OFFSET_LAST)
      png_warning(png_ptr, "Unrecognized unit type for oFFs chunk");

   png_save_int_32(buf, x_offset);
   png_save_int_32(buf + 4, y_offset);
   buf[8] = (png_byte)unit_type;

   png_write_chunk(png_ptr, (png_bytep)png_oFFs, buf, (png_size_t)9);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %ecx
movl %esi, %ebx
movq %rdi, %r14
movb $0x0, 0xc(%rsp)
movl $0x7346466f, 0x8(%rsp)  # imm = 0x7346466F
cmpl $0x2, %ebp
jl 0x9f41b
leaq 0x14dbf(%rip), %rsi     # 0xb41cc
movq %r14, %rdi
movl %ecx, %r15d
callq 0x9214d
movl %r15d, %ecx
movl %ebx, %eax
shrl $0x18, %eax
leaq 0xf(%rsp), %rdx
movb %al, (%rdx)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x1(%rdx)
movb %bh, 0x11(%rsp)
movb %bl, 0x3(%rdx)
movl %ecx, %eax
shrl $0x18, %eax
movb %al, 0x4(%rdx)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x5(%rdx)
movb %ch, 0x15(%rsp)
movb %cl, 0x7(%rdx)
movb %bpl, 0x8(%rdx)
leaq 0x8(%rsp), %rsi
movl $0x9, %ecx
movq %r14, %rdi
callq 0x9d8bd
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_sCAL
void /* PRIVATE */
png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
{
   PNG_sCAL;
   char buf[64];
   png_size_t total_len;

   png_debug(1, "in png_write_sCAL");

   buf[0] = (char)unit;
   png_snprintf(buf + 1, 63, "%12.12e", width);
   total_len = 1 + png_strlen(buf + 1) + 1;
   png_snprintf(buf + total_len, 64-total_len, "%12.12e", height);
   total_len += png_strlen(buf + total_len);

   png_debug1(3, "sCAL total length = %u", (unsigned int)total_len);
   png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movsd %xmm1, (%rsp)
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movb $0x0, 0x4(%r14)
movl $0x4c414373, (%r14)     # imm = 0x4C414373
leaq 0x11(%rsp), %r15
movb %sil, -0x1(%r15)
leaq 0x14b8c(%rip), %r12     # 0xb41f2
movl $0x3f, %esi
movq %r15, %rdi
movq %r12, %rdx
movb $0x1, %al
callq 0xe750
movq %r15, %rdi
callq 0xe1e0
movq %rax, %r15
leaq (%rsp,%rax), %r13
addq $0x12, %r13
movl $0x3e, %esi
subq %rax, %rsi
movq %r13, %rdi
movq %r12, %rdx
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0xe750
movq %r13, %rdi
callq 0xe1e0
leaq (%rax,%r15), %rcx
addq $0x2, %rcx
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9d8bd
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_pHYs
void /* PRIVATE */
png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,
   png_uint_32 y_pixels_per_unit,
   int unit_type)
{
   PNG_pHYs;
   png_byte buf[9];

   png_debug(1, "in png_write_pHYs");

   if (unit_type >= PNG_RESOLUTION_LAST)
      png_warning(png_ptr, "Unrecognized unit type for pHYs chunk");

   png_save_uint_32(buf, x_pixels_per_unit);
   png_save_uint_32(buf + 4, y_pixels_per_unit);
   buf[8] = (png_byte)unit_type;

   png_write_chunk(png_ptr, (png_bytep)png_pHYs, buf, (png_size_t)9);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %ecx
movl %esi, %ebx
movq %rdi, %r14
movb $0x0, 0xc(%rsp)
movl $0x73594870, 0x8(%rsp)  # imm = 0x73594870
cmpl $0x2, %ebp
jl 0x9f70d
leaq 0x14afb(%rip), %rsi     # 0xb41fa
movq %r14, %rdi
movl %ecx, %r15d
callq 0x9214d
movl %r15d, %ecx
movl %ebx, %eax
shrl $0x18, %eax
leaq 0xf(%rsp), %rdx
movb %al, (%rdx)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x1(%rdx)
movb %bh, 0x11(%rsp)
movb %bl, 0x3(%rdx)
movl %ecx, %eax
shrl $0x18, %eax
movb %al, 0x4(%rdx)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x5(%rdx)
movb %ch, 0x15(%rsp)
movb %cl, 0x7(%rdx)
movb %bpl, 0x8(%rdx)
leaq 0x8(%rsp), %rsi
movl $0x9, %ecx
movq %r14, %rdi
callq 0x9d8bd
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq