LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x99e05
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 0x99d7c
cmpl %eax, %r8d
jne 0x99d7c
movl %ebx, %r8d
jmp 0x99df0
cmpl %r9d, %r11d
jge 0x99d8f
movl %r8d, %r9d
addw %r11w, 0xaac(%rdi,%r9,4)
jmp 0x99dc4
testl %r8d, %r8d
je 0x99dae
cmpl %ebx, %r8d
je 0x99da5
movl %r8d, %r9d
incw 0xaac(%rdi,%r9,4)
incw 0xaec(%rdi)
jmp 0x99dc4
cmpl $0x9, %r14d
jg 0x99dbd
incw 0xaf0(%rdi)
jmp 0x99dc4
incw 0xaf4(%rdi)
xorl %r11d, %r11d
testl %eax, %eax
je 0x99de4
xorl %r10d, %r10d
cmpl %eax, %r8d
sete %r10b
movl $0x4, %r9d
subl %r10d, %r9d
xorl $0x7, %r10d
jmp 0x99df0
movl $0x3, %r9d
movl $0x8a, %r10d
incq %rcx
movl %r11d, %r14d
movl %r8d, %ebx
cmpq %rcx, %rdx
jne 0x99d61
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9a3a5
leaq 0x1845c(%rip), %rsi     # 0xb27fc
callq 0x92dd0
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_O1/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 0x8c0a8
movzbl (%r14), %r15d
shll $0x18, %r15d
movzbl 0x1(%r14), %r12d
movzbl 0x2(%r14), %ebp
movzbl 0x3(%r14), %r14d
jns 0x9a414
leaq 0x183f0(%rip), %rsi     # 0xb27fc
movq %rbx, %rdi
callq 0x92dd0
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 0x87b84
movl $0x4, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x87b9b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9a471
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_O1/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 0x9a53e
movq 0x198(%rbx), %rsi
movq 0x1a0(%rbx), %rdx
movq %rbx, %rdi
callq 0x9a4db
subq %r15, %r14
cmpq %r15, %r14
ja 0x9a520
testq %r14, %r14
je 0x9a555
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9a4db
movq %rbx, %rdi
callq 0x9a5b7
xorl %ebp, %ebp
testl %eax, %eax
je 0x9a5aa
movb 0x244(%rbx), %al
testb $0x20, %al
jne 0x9a578
testb $0x4, 0x121(%rbx)
jne 0x9a581
jmp 0x9a59b
testb $0x2, 0x121(%rbx)
jne 0x9a597
leaq 0x128d7(%rip), %rsi     # 0xace5f
movq %rbx, %rdi
callq 0x92fa4
movl $0x1, %ebp
jmp 0x9a5aa
testb $0x20, %al
je 0x9a56d
leaq 0x128bd(%rip), %rsi     # 0xace5f
movq %rbx, %rdi
callq 0x92ebb
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
notl %eax
testb $0x5, %al
je 0x9aca4
leaq 0x17d18(%rip), %rsi     # 0xb29b4
movq %r14, %rdi
callq 0x92dd0
orb $0x18, 0x11c(%r14)
testl %ebx, %ebx
je 0x9acbf
leaq 0x17d0e(%rip), %rsi     # 0xb29c5
movq %r14, %rdi
callq 0x92e6e
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9a507
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9be2e
leaq 0x1726b(%rip), %rsi     # 0xb300f
movq %rbx, %rdi
callq 0x92dd0
cmpl $0x201, %ebp            # imm = 0x201
ja 0x9be3f
movl %ebp, %eax
shrl %eax
movzwl 0x240(%rbx), %ecx
cmpl %ecx, %eax
jne 0x9be3f
cmpl $0x2, %ebp
jb 0x9bdfe
movl %eax, %r12d
xorl %r13d, %r13d
leaq 0xe(%rsp), %r15
movl $0x2, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9a4db
movzwl 0xe(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x10(%rsp,%r13,2)
incq %r13
cmpq %r13, %r12
jne 0x9bdd7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9a507
testl %eax, %eax
jne 0x9be1c
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88aba
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x4, %al
jne 0x9be48
testb $0x2, %al
jne 0x9be72
leaq 0x17203(%rip), %rsi     # 0xb3040
jmp 0x9be4f
leaq 0x17228(%rip), %rsi     # 0xb306e
jmp 0x9be4f
leaq 0x171d9(%rip), %rsi     # 0xb3028
movq %rbx, %rdi
callq 0x92e6e
movq %rbx, %rdi
movl %ebp, %esi
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9a507
testq %r14, %r14
je 0x9bdac
testb $0x40, 0x8(%r14)
je 0x9bdac
leaq 0x171cc(%rip), %rsi     # 0xb3059
jmp 0x9be4f
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9bf03
leaq 0x171da(%rip), %rsi     # 0xb308a
movq %rbx, %rdi
callq 0x92dd0
cmpl $0x9, %ebp
jne 0x9bf1c
leaq 0x7(%rsp), %rsi
movl $0x9, %edx
movq %rbx, %rdi
callq 0x9a4db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9a507
testl %eax, %eax
jne 0x9befa
movl 0x7(%rsp), %edx
movl 0xb(%rsp), %ecx
bswapl %edx
bswapl %ecx
movzbl 0xf(%rsp), %r8d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88e4a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
testb $0x4, %al
jne 0x9bf25
testq %r14, %r14
je 0x9beb8
testb $-0x80, 0x8(%r14)
je 0x9beb8
leaq 0x171a1(%rip), %rsi     # 0xb30bb
jmp 0x9bf2c
leaq 0x171ad(%rip), %rsi     # 0xb30d0
jmp 0x9bf2c
leaq 0x17177(%rip), %rsi     # 0xb30a3
movq %rbx, %rdi
callq 0x92e6e
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x9a507
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9bfc1
leaq 0x17185(%rip), %rsi     # 0xb30ec
movq %rbx, %rdi
callq 0x92dd0
cmpl $0x9, %ebp
jne 0x9bfda
leaq 0x7(%rsp), %rsi
movl $0x9, %edx
movq %rbx, %rdi
callq 0x9a4db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9a507
testl %eax, %eax
jne 0x9c07a
movzbl 0x7(%rsp), %eax
testb %al, %al
js 0x9c004
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 0x9c022
testb $0x4, %al
jne 0x9bfe3
testq %r14, %r14
je 0x9bf6f
testb $0x1, 0x9(%r14)
je 0x9bf6f
leaq 0x17145(%rip), %rsi     # 0xb311d
jmp 0x9bfea
leaq 0x17151(%rip), %rsi     # 0xb3132
jmp 0x9bfea
leaq 0x1711b(%rip), %rsi     # 0xb3105
movq %rbx, %rdi
callq 0x92e6e
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x9a507
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 0x9c04b
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 0x9c069
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 0x88c34
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
testb $0x1, 0x11c(%rdi)
jne 0x9c5c0
leaq 0x16d5b(%rip), %rsi     # 0xb3311
movq %rbx, %rdi
callq 0x92dd0
jmp 0x9c5cc
testq %r14, %r14
je 0x9c5cc
testb $0x2, 0x9(%r14)
jne 0x9c640
movl 0x11c(%rbx), %eax
testb $0x4, %al
je 0x9c5df
orl $0x8, %eax
movl %eax, 0x11c(%rbx)
cmpl $0x7, %ebp
jne 0x9c637
leaq 0x1(%rsp), %rsi
movl $0x7, %edx
movq %rbx, %rdi
callq 0x9a4db
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9a507
testl %eax, %eax
jne 0x9c62e
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 0x89452
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x16d00(%rip), %rsi     # 0xb333e
jmp 0x9c647
leaq 0x16ce2(%rip), %rsi     # 0xb3329
movq %rbx, %rdi
callq 0x92e6e
movq %rbx, %rdi
movl %ebp, %esi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x9a507
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9df15
movq 0x8(%rdi), %rax
cmpl $0x1, %ecx
je 0x9def6
cmpl $0x4, %ecx
je 0x9deed
cmpl $0x2, %ecx
jne 0x9df15
leaq 0x15975(%rip), %rcx     # 0xb3860
jmp 0x9defd
leaq 0x15a6c(%rip), %rcx     # 0xb3960
jmp 0x9defd
leaq 0x15863(%rip), %rcx     # 0xb3760
testq %rax, %rax
jle 0x9df15
addq %rsi, %rax
movzbl (%rsi), %edx
movb (%rcx,%rdx), %dl
movb %dl, (%rsi)
incq %rsi
cmpq %rax, %rsi
jb 0x9df05
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa1478
cmpb $0x2, 0x254(%rbx)
ja 0x9e2ab
orb $0x10, 0x11d(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9e30d
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
movl %r14d, %edx
callq 0x9e30e
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x9e383
movl $0x82, 0x490(%rbx)
movl 0x234(%rbx), %eax
bswapl %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movq %rbx, %rdi
callq 0xa1478
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9e7f4
movl 0x408(%rbx), %eax
andl $0x1, %eax
orl %r14d, %eax
jne 0x9e810
cmpb $0x3, 0x24e(%rbx)
jne 0x9e890
leaq 0x15513(%rip), %rsi     # 0xb3d1b
movq %rbx, %rdi
callq 0x92dd0
testb $0x2, 0x24e(%rbx)
jne 0x9e822
leaq 0x1551f(%rip), %rsi     # 0xb3d3f
jmp 0x9e897
movw %r14w, 0x240(%rbx)
leal (%r14,%r14,2), %edx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x9e30e
testl %r14d, %r14d
je 0x9e875
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 0x9e383
addq $0x3, %r15
decl %r14d
jne 0x9e845
movq %rbx, %rdi
callq 0x9e3c2
orb $0x2, 0x11c(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x15484(%rip), %rsi     # 0xb3d1b
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x92e6e
// File: /workspace/github_cpp_makefile_star2_O1/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 0xdab9(%rip), %xmm0     # 0xac4f8
addsd 0x35e9(%rip), %xmm0     # 0xa2030
cvttsd2si %xmm0, %rax
movl $0x414d4167, (%rsi)     # imm = 0x414D4167
bswapl %eax
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
movl $0x4, %ecx
callq 0x9e2b1
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_gAMA_fixed
void /* PRIVATE */
png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
{
   PNG_gAMA;
   png_byte buf[4];

   png_debug(1, "in png_write_gAMA");

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

// Assembly:
subq $0x18, %rsp
leaq 0x10(%rsp), %rax
movb $0x0, 0x4(%rax)
movl $0x414d4167, (%rax)     # imm = 0x414D4167
bswapl %esi
leaq 0xc(%rsp), %rdx
movl %esi, (%rdx)
movl $0x4, %ecx
movq %rax, %rsi
callq 0x9e2b1
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9eac4
leaq 0x152ec(%rip), %rsi     # 0xb3da8
movq %rbx, %rdi
callq 0x92e6e
leaq 0xf(%rsp), %rdx
movb %bpl, (%rdx)
leaq 0x10(%rsp), %rsi
movl $0x1, %ecx
movq %rbx, %rdi
callq 0x9e2b1
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9f11f
movslq 0x8(%r14), %rdx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x9e383
cmpl $0x0, 0xc(%r14)
jle 0x9f15c
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rsi
movq 0x1a0(%rbx), %rdx
movq %rbx, %rdi
callq 0x9e383
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x92d32
incq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jl 0x9f129
cmpl $0x0, 0x10(%r14)
je 0x9f16f
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x92d32
leaq 0x128(%rbx), %r14
movl 0x148(%rbx), %eax
movq 0x1a0(%rbx), %rdx
cmpl %edx, %eax
jae 0x9f199
movq 0x198(%rbx), %rsi
subq %rax, %rdx
movq %rbx, %rdi
callq 0x9e383
movq %r14, %rdi
callq 0x9388a
movl $0x0, 0x180(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9f36a
movb 0x3(%rsi), %al
testb %al, %al
je 0x9f3f2
cmpb 0x250(%rdi), %al
ja 0x9f3f2
movb %al, 0xc(%rsp)
movl $0x1, %ecx
jmp 0x9f3de
movl $0x8, %ecx
cmpl $0x3, %edx
je 0x9f37b
movzbl 0x250(%rdi), %ecx
movb (%rsi), %al
testb %al, %al
sete %r8b
movzbl %al, %r9d
cmpl %r9d, %ecx
setb %r9b
orb %r8b, %r9b
jne 0x9f3f2
movb 0x1(%rsi), %r8b
testb %r8b, %r8b
sete %r9b
movzbl %r8b, %r10d
cmpl %r10d, %ecx
setb %r10b
orb %r9b, %r10b
jne 0x9f3f2
movb 0x2(%rsi), %r9b
testb %r9b, %r9b
sete %r10b
movzbl %r9b, %r11d
cmpl %r11d, %ecx
setb %cl
orb %r10b, %cl
cmpb $0x1, %cl
je 0x9f3f2
movb %al, 0xc(%rsp)
movb %r8b, 0xd(%rsp)
movb %r9b, 0xe(%rsp)
movl $0x3, %ecx
testb $0x4, %dl
je 0x9f409
movb 0x4(%rsi), %al
testb %al, %al
je 0x9f3f2
cmpb 0x250(%rdi), %al
jbe 0x9f402
leaq 0x14a92(%rip), %rsi     # 0xb3e8b
addq $0x18, %rsp
jmp 0x92e6e
movb %al, 0xc(%rsp,%rcx)
incq %rcx
leaq 0x10(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x9e2b1
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngwutil.c
// Function: png_write_cHRM_fixed
void /* PRIVATE */
png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
   png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y,
   png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x,
   png_fixed_point blue_y)
{
   PNG_cHRM;
   png_byte buf[32];

   png_debug(1, "in png_write_cHRM");

   /* Each value is saved in 1/100,000ths */
#ifdef PNG_CHECK_cHRM_SUPPORTED
   if (png_check_cHRM_fixed(png_ptr, white_x, white_y, red_x, red_y,
      green_x, green_y, blue_x, blue_y))
#endif
   {
      png_save_uint_32(buf, (png_uint_32)white_x);
      png_save_uint_32(buf + 4, (png_uint_32)white_y);

      png_save_uint_32(buf + 8, (png_uint_32)red_x);
      png_save_uint_32(buf + 12, (png_uint_32)red_y);

      png_save_uint_32(buf + 16, (png_uint_32)green_x);
      png_save_uint_32(buf + 20, (png_uint_32)green_y);

      png_save_uint_32(buf + 24, (png_uint_32)blue_x);
      png_save_uint_32(buf + 28, (png_uint_32)blue_y);

      png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebx
movq %rdi, %r14
movb $0x0, 0xc(%rsp)
movl $0x4d524863, 0x8(%rsp)  # imm = 0x4D524863
movl 0x80(%rsp), %eax
movl 0x78(%rsp), %r10d
movl 0x70(%rsp), %r11d
subq $0x8, %rsp
movl %edx, %r13d
movl %ecx, %r12d
movl %r8d, %r15d
movl %r9d, %ebp
pushq %rax
pushq %r10
pushq %r11
callq 0x88344
addq $0x20, %rsp
testl %eax, %eax
je 0x9f73a
movl %ebx, %eax
shrl $0x18, %eax
leaq 0x10(%rsp), %rdx
movb %al, (%rdx)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, 0x1(%rdx)
movb %bh, 0x12(%rsp)
movb %bl, 0x3(%rdx)
movl %r13d, %ecx
movl %r13d, %eax
shrl $0x18, %eax
movb %al, 0x4(%rdx)
movl %r13d, %eax
shrl $0x10, %eax
movb %al, 0x5(%rdx)
movb %ch, 0x16(%rsp)
movb %cl, 0x7(%rdx)
movl %r12d, %ecx
movl %r12d, %eax
shrl $0x18, %eax
movb %al, 0x8(%rdx)
movl %r12d, %eax
shrl $0x10, %eax
movb %al, 0x9(%rdx)
movb %ch, 0x1a(%rsp)
movb %cl, 0xb(%rdx)
movl %r15d, %ecx
movl %r15d, %eax
shrl $0x18, %eax
movb %al, 0xc(%rdx)
movl %r15d, %eax
shrl $0x10, %eax
movb %al, 0xd(%rdx)
movb %ch, 0x1e(%rsp)
movb %cl, 0xf(%rdx)
movl %ebp, %ecx
movl %ebp, %eax
shrl $0x18, %eax
movb %al, 0x10(%rdx)
movl %ebp, %eax
shrl $0x10, %eax
movb %al, 0x11(%rdx)
movb %ch, 0x22(%rsp)
movb %cl, 0x13(%rdx)
movl 0x70(%rsp), %ecx
movl %ecx, %eax
shrl $0x18, %eax
movb %al, 0x14(%rdx)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x15(%rdx)
movb %ch, 0x26(%rsp)
movb %cl, 0x17(%rdx)
movl 0x78(%rsp), %ecx
movl %ecx, %eax
shrl $0x18, %eax
movb %al, 0x18(%rdx)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x19(%rdx)
movb %ch, 0x2a(%rsp)
movb %cl, 0x1b(%rdx)
movl 0x80(%rsp), %ecx
movl %ecx, %eax
shrl $0x18, %eax
movb %al, 0x1c(%rdx)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x1d(%rdx)
movb %ch, 0x2e(%rsp)
movb %cl, 0x1f(%rdx)
leaq 0x8(%rsp), %rsi
movl $0x20, %ecx
movq %r14, %rdi
callq 0x9e2b1
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/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 0x9f7dc
cmpl $0x2, %r8d
je 0x9f78e
cmpl $0x3, %r8d
jne 0x9f809
testl %ecx, %ecx
jle 0x9f782
movzwl 0x240(%rdi), %edx
cmpl %ecx, %edx
jge 0x9f833
leaq 0x1471f(%rip), %rsi     # 0xb3ea8
jmp 0x9f82a
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 0x9f812
shrl $0x8, %eax
shrl $0x8, %ecx
shrl $0x8, %edx
orb %al, %cl
orb %dl, %cl
je 0x9f812
leaq 0x1473d(%rip), %rsi     # 0xb3f17
jmp 0x9f82a
movzwl 0x8(%rdx), %eax
movb 0x24f(%rdi), %cl
movl $0x1, %edx
shll %cl, %edx
cmpl %eax, %edx
jle 0x9f823
rolw $0x8, %ax
leaq 0x12(%rsp), %rdx
movw %ax, (%rdx)
leaq 0xc(%rsp), %rsi
movl $0x2, %ecx
jmp 0x9f840
leaq 0x14747(%rip), %rsi     # 0xb3f57
jmp 0x9f82a
leaq 0xc(%rsp), %rsi
leaq 0x12(%rsp), %rdx
movl $0x6, %ecx
jmp 0x9f840
leaq 0x146ad(%rip), %rsi     # 0xb3ed7
addq $0x18, %rsp
jmp 0x92e6e
movq %rsi, %rax
movl %ecx, %ecx
leaq 0xc(%rsp), %rsi
movq %rax, %rdx
callq 0x9e2b1
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9f899
movzwl 0x240(%rdi), %eax
testw %ax, %ax
jne 0x9f875
testb $0x1, 0x408(%rdi)
jne 0x9f881
movzbl (%rsi), %ecx
cmpw %cx, %ax
jbe 0x9f91d
movb (%rsi), %al
leaq 0x12(%rsp), %rdx
movb %al, (%rdx)
leaq 0xc(%rsp), %rsi
movl $0x1, %ecx
jmp 0x9f935
testb $0x2, %dl
jne 0x9f8cf
movzwl 0x8(%rsi), %eax
movb 0x24f(%rdi), %cl
movl $0x1, %edx
shll %cl, %edx
cmpl %eax, %edx
jle 0x9f93f
rolw $0x8, %ax
leaq 0x12(%rsp), %rdx
movw %ax, (%rdx)
leaq 0xc(%rsp), %rsi
movl $0x2, %ecx
jmp 0x9f935
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 0x9f926
shrl $0x8, %eax
shrl $0x8, %ecx
shrl $0x8, %edx
orb %al, %cl
orb %dl, %cl
je 0x9f926
leaq 0x14684(%rip), %rsi     # 0xb3f9f
jmp 0x9f946
leaq 0x1465a(%rip), %rsi     # 0xb3f7e
jmp 0x9f946
leaq 0xc(%rsp), %rsi
leaq 0x12(%rsp), %rdx
movl $0x6, %ecx
callq 0x9e2b1
addq $0x18, %rsp
retq
leaq 0x14699(%rip), %rsi     # 0xb3fdf
addq $0x18, %rsp
jmp 0x92e6e
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9f993
leaq 0x146a1(%rip), %rsi     # 0xb401f
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x92e6e
movl %edx, %r15d
movq %rsi, %r14
leal (%r15,%r15), %edx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x9e30e
testl %r15d, %r15d
jle 0x9f9e0
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 0x9e383
incq %r13
cmpq %r13, %r12
jne 0x9f9ba
movq %rbx, %rdi
callq 0x9e3c2
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9ec1f
testq %rax, %rax
je 0x9fa8f
movq %rax, %r15
testq %r14, %r14
je 0x9fa3f
cmpb $0x0, (%r14)
je 0x9fa3f
movq %r14, %rdi
callq 0xe1e0
movq %rax, %r12
jmp 0x9fa42
xorl %r12d, %r12d
leal (%r12,%r15), %edx
incl %edx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x9e30e
movq 0x8(%rsp), %r13
incq %r15
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x9e383
testq %r12, %r12
je 0x9fa7c
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x9e383
movq %rbx, %rdi
callq 0x9e3c2
movq %rbx, %rdi
movq %r13, %rsi
callq 0x92d32
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x14(%rsp)
movl $0x7458547a, 0x10(%rsp) # imm = 0x7458547A
movq $0x0, 0x38(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movl $0x0, 0x30(%rsp)
leaq 0x18(%rsp), %rdx
callq 0x9ec1f
testq %rax, %rax
je 0x9fbaf
testq %r15, %r15
je 0x9fb94
cmpl $-0x1, %ebp
je 0x9fb94
cmpb $0x0, (%r15)
je 0x9fb94
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 0x9ee4b
leal (%r14,%rax), %edx
addl $0x2, %edx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x9e30e
movq 0x18(%rsp), %r15
incq %r14
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x9e383
movq %rbx, %rdi
movq %r15, %rsi
callq 0x92d32
leaq 0xf(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9e383
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9f0fb
movq %rbx, %rdi
callq 0x9e3c2
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9f9f6
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x9fbb7
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x92d32
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9fda6
leaq 0x143e4(%rip), %rsi     # 0xb417c
movq %r14, %rdi
movl %ecx, %r15d
callq 0x92e6e
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 0x9e2b1
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq