LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmerge.c
// Function: jinit_merged_upsampler
GLOBAL(void)
jinit_merged_upsampler (j_decompress_ptr cinfo)
{
  my_upsample_ptr upsample;

  upsample = (my_upsample_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_upsampler));
  cinfo->upsample = (struct jpeg_upsampler *) upsample;
  upsample->pub.start_pass = start_pass_merged_upsample;
  upsample->pub.need_context_rows = FALSE;

  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;

  if (cinfo->max_v_samp_factor == 2) {
    upsample->pub.upsample = merged_2v_upsample;
    upsample->upmethod = h2v2_merged_upsample;
    /* Allocate a spare row buffer */
    upsample->spare_row = (JSAMPROW)
      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
		(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
  } else {
    upsample->pub.upsample = merged_1v_upsample;
    upsample->upmethod = h2v1_merged_upsample;
    /* No spare row needed */
    upsample->spare_row = NULL;
  }

  build_ycc_rgb_table(cinfo);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0x58, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, %r14
movq %rax, 0x260(%rbx)
leaq 0x144(%rip), %rax       # 0x865b8
movq %rax, (%r14)
movl $0x0, 0x10(%r14)
movl 0x90(%rbx), %eax
imull 0x88(%rbx), %eax
movl %eax, 0x4c(%r14)
cmpl $0x2, 0x19c(%rbx)
jne 0x864c2
leaq 0x130(%rip), %rcx       # 0x865d0
movq %rcx, 0x8(%r14)
leaq 0x1d9(%rip), %rcx       # 0x86684
movq %rcx, 0x18(%r14)
movq 0x8(%rbx), %rcx
movl %eax, %edx
movq %rbx, %rdi
movl $0x1, %esi
callq *0x8(%rcx)
jmp 0x864da
leaq 0x3d5(%rip), %rax       # 0x8689e
movq %rax, 0x8(%r14)
leaq 0x3f4(%rip), %rax       # 0x868c8
movq %rax, 0x18(%r14)
xorl %eax, %eax
movq %rax, 0x40(%r14)
movq 0x260(%rbx), %r14
movq 0x8(%rbx), %rax
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x20(%r14)
movq 0x8(%rbx), %rax
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x28(%r14)
movq 0x8(%rbx), %rax
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x30(%r14)
movq 0x8(%rbx), %rax
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x38(%r14)
movq 0x20(%r14), %rcx
movq 0x28(%r14), %rdx
movq 0x30(%r14), %rsi
movl $0x2c8d00, %edi         # imm = 0x2C8D00
movl $0x5b6900, %r8d         # imm = 0x5B6900
movq $-0xe25100, %r9         # imm = 0xFF1DAF00
movq $-0xb2f480, %r10        # imm = 0xFF4D0B80
xorl %r11d, %r11d
movq %r10, %rbx
shrq $0x10, %rbx
movl %ebx, (%rcx,%r11)
movq %r9, %rbx
shrq $0x10, %rbx
movl %ebx, (%rdx,%r11)
movq %r8, (%rsi,%r11,2)
movq %rdi, (%rax,%r11,2)
addq $0x4, %r11
addq $-0x581a, %rdi          # imm = 0xA7E6
addq $-0xb6d2, %r8           # imm = 0xFFFF492E
addq $0x1c5a2, %r9           # imm = 0x1C5A2
addq $0x166e9, %r10          # imm = 0x166E9
cmpq $0x400, %r11            # imm = 0x400
jne 0x86569
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmerge.c
// Function: merged_2v_upsample
METHODDEF(void)
merged_2v_upsample (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
/* 2:1 vertical sampling case: may need a spare row. */
{
  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  JSAMPROW work_ptrs[2];
  JDIMENSION num_rows;		/* number of rows returned to caller */

  if (upsample->spare_full) {
    /* If we have a spare row saved from a previous cycle, just return it. */
    jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
		      1, upsample->out_row_width);
    num_rows = 1;
    upsample->spare_full = FALSE;
  } else {
    /* Figure number of rows to return to caller. */
    num_rows = 2;
    /* Not more than the distance to the end of the image. */
    if (num_rows > upsample->rows_to_go)
      num_rows = upsample->rows_to_go;
    /* And not more than what the client can accept: */
    out_rows_avail -= *out_row_ctr;
    if (num_rows > out_rows_avail)
      num_rows = out_rows_avail;
    /* Create output pointer array for upsampler. */
    work_ptrs[0] = output_buf[*out_row_ctr];
    if (num_rows > 1) {
      work_ptrs[1] = output_buf[*out_row_ctr + 1];
    } else {
      work_ptrs[1] = upsample->spare_row;
      upsample->spare_full = TRUE;
    }
    /* Now do the upsampling. */
    (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
  }

  /* Adjust counts */
  *out_row_ctr += num_rows;
  upsample->rows_to_go -= num_rows;
  /* When the buffer is emptied, declare this input row group consumed */
  if (! upsample->spare_full)
    (*in_row_group_ctr)++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %rdx, %rbx
movq 0x260(%rdi), %r15
cmpl $0x0, 0x48(%r15)
je 0x8661b
leaq 0x40(%r15), %rdi
movl (%r14), %eax
leaq (%r8,%rax,8), %rdx
movl 0x4c(%r15), %r9d
movl $0x1, %ebp
xorl %esi, %esi
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x86abf
movl $0x0, 0x48(%r15)
jmp 0x86669
movl 0x40(%rsp), %ecx
movl 0x50(%r15), %edx
movl (%r14), %eax
subl %eax, %ecx
cmpl %ecx, %edx
cmovbl %edx, %ecx
movq (%r8,%rax,8), %rdx
movq %rdx, (%rsp)
movl $0x2, %ebp
cmpl $0x2, %ecx
cmovbl %ecx, %ebp
jb 0x8664f
incl %eax
movq (%r8,%rax,8), %rax
movq %rax, 0x8(%rsp)
jmp 0x86660
movq 0x40(%r15), %rax
movq %rax, 0x8(%rsp)
movl $0x1, 0x48(%r15)
movl (%rbx), %edx
movq %rsp, %rcx
callq *0x18(%r15)
addl %ebp, (%r14)
subl %ebp, 0x50(%r15)
cmpl $0x0, 0x48(%r15)
jne 0x86679
incl (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmerge.c
// Function: merged_1v_upsample
METHODDEF(void)
merged_1v_upsample (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
/* 1:1 vertical sampling case: much easier, never need a spare row. */
{
  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;

  /* Just do the upsampling. */
  (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
			 output_buf + *out_row_ctr);
  /* Adjust counts */
  (*out_row_ctr)++;
  (*in_row_group_ctr)++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %rdx, %r14
movq 0x260(%rdi), %rax
movl (%rdx), %edx
movl (%r9), %ecx
leaq (%r8,%rcx,8), %rcx
callq *0x18(%rax)
incl (%rbx)
incl (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcomapi.c
// Function: jpeg_destroy
GLOBAL(void)
jpeg_destroy (j_common_ptr cinfo)
{
  /* We need only tell the memory manager to release everything. */
  /* NB: mem pointer is NULL if memory mgr failed to initialize. */
  if (cinfo->mem != NULL)
    (*cinfo->mem->self_destruct) (cinfo);
  cinfo->mem = NULL;		/* be safe if jpeg_destroy is called twice */
  cinfo->global_state = 0;	/* mark it destroyed */
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x86a57
movq %rbx, %rdi
callq *0x50(%rax)
movq $0x0, 0x8(%rbx)
movl $0x0, 0x24(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jerror.c
// Function: format_message
METHODDEF(void)
format_message (j_common_ptr cinfo, char * buffer)
{
  struct jpeg_error_mgr * err = cinfo->err;
  int msg_code = err->msg_code;
  const char * msgtext = NULL;
  const char * msgptr;
  char ch;
  jboolean isstring;

  /* Look up message string in proper table */
  if (msg_code > 0 && msg_code <= err->last_jpeg_message) {
    msgtext = err->jpeg_message_table[msg_code];
  } else if (err->addon_message_table != NULL &&
	     msg_code >= err->first_addon_message &&
	     msg_code <= err->last_addon_message) {
    msgtext = err->addon_message_table[msg_code - err->first_addon_message];
  }

  /* Defend against bogus message number */
  if (msgtext == NULL) {
    err->msg_parm.i[0] = msg_code;
    msgtext = err->jpeg_message_table[0];
  }

  /* Check for string parameter, as indicated by %s in the message text */
  isstring = FALSE;
  msgptr = msgtext;
  while ((ch = *msgptr++) != '\0') {
    if (ch == '%') {
      if (*msgptr == 's') isstring = TRUE;
      break;
    }
  }

  /* Format the message into the passed buffer */
  if (isstring)
    sprintf(buffer, msgtext, err->msg_parm.s);
  else
    sprintf(buffer, msgtext,
	    err->msg_parm.i[0], err->msg_parm.i[1],
	    err->msg_parm.i[2], err->msg_parm.i[3],
	    err->msg_parm.i[4], err->msg_parm.i[5],
	    err->msg_parm.i[6], err->msg_parm.i[7]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq (%rdi), %rdx
movslq 0x28(%rdx), %rcx
testq %rcx, %rcx
jle 0x86c06
cmpl 0x90(%rdx), %ecx
jle 0x86c28
movq 0x98(%rdx), %rsi
testq %rsi, %rsi
je 0x86c24
movl %ecx, %edi
subl 0xa0(%rdx), %edi
jl 0x86c24
cmpl 0xa4(%rdx), %ecx
jle 0x86c38
xorl %esi, %esi
jmp 0x86c42
movq %rcx, %rsi
shlq $0x3, %rsi
addq 0x88(%rdx), %rsi
jmp 0x86c3f
movslq %edi, %rdi
leaq (%rsi,%rdi,8), %rsi
movq (%rsi), %rsi
testq %rsi, %rsi
jne 0x86c54
movl %ecx, 0x2c(%rdx)
movq 0x88(%rdx), %rcx
movq (%rcx), %rsi
movq %rsi, %rcx
movzbl (%rcx), %edi
testl %edi, %edi
je 0x86c7e
incq %rcx
cmpl $0x25, %edi
jne 0x86c57
cmpb $0x73, (%rcx)
jne 0x86c7e
addq $0x2c, %rdx
movq %rax, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xe0e0
movl 0x2c(%rdx), %r10d
movl 0x30(%rdx), %ecx
movl 0x34(%rdx), %r8d
movl 0x38(%rdx), %r9d
movl 0x3c(%rdx), %r11d
movl 0x40(%rdx), %ebx
movl 0x44(%rdx), %r14d
movl 0x48(%rdx), %r15d
movq %rax, %rdi
movl %r10d, %edx
xorl %eax, %eax
pushq %r15
pushq %r14
pushq %rbx
pushq %r11
callq 0xe0e0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jmemmgr.c
// Function: alloc_large
METHODDEF(void FAR *)
alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)
/* Allocate a "large" object */
{
  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  large_pool_ptr hdr_ptr;
  size_t odd_bytes;

  /* Check for unsatisfiable request (do now to ensure no overflow below) */
  if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)))
    out_of_memory(cinfo, 3);	/* request exceeds malloc's ability */

  /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */
  odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE);
  if (odd_bytes > 0)
    sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes;

  /* Always make a new pool */
  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */

  hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +
					    SIZEOF(large_pool_hdr));
  if (hdr_ptr == NULL)
    out_of_memory(cinfo, 4);	/* jpeg_get_large failed */
  mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);

  /* Success, initialize the new pool header and add to list */
  hdr_ptr->hdr.next = mem->large_list[pool_id];
  /* We maintain space counts in each pool header for statistical purposes,
   * even though they are not needed for allocation.
   */
  hdr_ptr->hdr.bytes_used = sizeofobject;
  hdr_ptr->hdr.bytes_left = 0;
  mem->large_list[pool_id] = hdr_ptr;

  return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rdi), %r13
cmpq $0x3b9ac9e9, %rdx       # imm = 0x3B9AC9E9
jb 0x86fc4
movq (%r14), %rax
movabsq $0x300000036, %rcx      # imm = 0x300000036
movq %rcx, 0x28(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
addq $0x7, %rbx
andq $-0x8, %rbx
cmpl $0x2, %ebp
jb 0x86fe6
movq (%r14), %rax
movl $0xe, 0x28(%rax)
movl %ebp, 0x2c(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
leaq 0x18(%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x87a88
movq %rax, %r15
testq %rax, %rax
jne 0x87016
movq (%r14), %rax
movabsq $0x400000036, %rcx      # imm = 0x400000036
movq %rcx, 0x28(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
addq %r12, 0x98(%r13)
movslq %ebp, %rax
movq 0x78(%r13,%rax,8), %rcx
movq %rcx, (%r15)
movq %rbx, 0x8(%r15)
movq $0x0, 0x10(%r15)
movq %r15, 0x78(%r13,%rax,8)
addq $0x18, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jmemmgr.c
// Function: alloc_sarray
METHODDEF(JSAMPARRAY)
alloc_sarray (j_common_ptr cinfo, int pool_id,
	      JDIMENSION samplesperrow, JDIMENSION numrows)
/* Allocate a 2-D sample array */
{
  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  JSAMPARRAY result;
  JSAMPROW workspace;
  JDIMENSION rowsperchunk, currow, i;
  long ltemp;

  /* Calculate max # of rows allowed in one allocation chunk */
  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
	  ((long) samplesperrow * SIZEOF(JSAMPLE));
  if (ltemp <= 0)
    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
  if (ltemp < (long) numrows)
    rowsperchunk = (JDIMENSION) ltemp;
  else
    rowsperchunk = numrows;
  mem->last_rowsperchunk = rowsperchunk;

  /* Get space for row pointers (small object) */
  result = (JSAMPARRAY) alloc_small(cinfo, pool_id,
				    (size_t) (numrows * SIZEOF(JSAMPROW)));

  /* Get the rows themselves (large objects) */
  currow = 0;
  while (currow < numrows) {
    rowsperchunk = MIN(rowsperchunk, numrows - currow);
    workspace = (JSAMPROW) alloc_large(cinfo, pool_id,
	(size_t) ((size_t) rowsperchunk * (size_t) samplesperrow
		  * SIZEOF(JSAMPLE)));
    for (i = rowsperchunk; i > 0; i--) {
      result[currow++] = workspace;
      workspace += samplesperrow;
    }
  }

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ecx
movl %esi, 0x4(%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %r12
movl %edx, %r13d
movl $0x3b9ac9e8, %eax       # imm = 0x3B9AC9E8
xorl %edx, %edx
divq %r13
movq %rax, %r15
cmpl $0x3b9ac9e9, %ecx       # imm = 0x3B9AC9E9
jb 0x87090
movq (%r14), %rax
movl $0x46, 0x28(%rax)
movq %r14, %rdi
callq *(%rax)
movl %ebx, %edx
cmpq %rdx, %r15
cmovael %ebx, %r15d
movl %r15d, 0xa0(%r12)
shlq $0x3, %rdx
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0x86e26
movq %rax, %r12
testl %ebx, %ebx
je 0x870f8
xorl %ebp, %ebp
movl %r15d, %eax
movl %ebx, %r15d
subl %ebp, %r15d
cmpl %r15d, %eax
cmovbl %eax, %r15d
movq %r15, %rdx
imulq %r13, %rdx
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0x86f8b
testl %r15d, %r15d
je 0x870f4
movl %r15d, %ecx
movl %ebp, %edx
incl %ebp
movq %rax, (%r12,%rdx,8)
addq %r13, %rax
decl %ecx
jne 0x870e5
cmpl %ebx, %ebp
jb 0x870ba
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jmemmgr.c
// Function: alloc_barray
METHODDEF(JBLOCKARRAY)
alloc_barray (j_common_ptr cinfo, int pool_id,
	      JDIMENSION blocksperrow, JDIMENSION numrows)
/* Allocate a 2-D coefficient-block array */
{
  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  JBLOCKARRAY result;
  JBLOCKROW workspace;
  JDIMENSION rowsperchunk, currow, i;
  long ltemp;

  /* Calculate max # of rows allowed in one allocation chunk */
  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
	  ((long) blocksperrow * SIZEOF(JBLOCK));
  if (ltemp <= 0)
    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
  if (ltemp < (long) numrows)
    rowsperchunk = (JDIMENSION) ltemp;
  else
    rowsperchunk = numrows;
  mem->last_rowsperchunk = rowsperchunk;

  /* Get space for row pointers (small object) */
  result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,
				     (size_t) (numrows * SIZEOF(JBLOCKROW)));

  /* Get the rows themselves (large objects) */
  currow = 0;
  while (currow < numrows) {
    rowsperchunk = MIN(rowsperchunk, numrows - currow);
    workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,
	(size_t) ((size_t) rowsperchunk * (size_t) blocksperrow
		  * SIZEOF(JBLOCK)));
    for (i = rowsperchunk; i > 0; i--) {
      result[currow++] = workspace;
      workspace += blocksperrow;
    }
  }

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ecx
movl %esi, 0x4(%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %r12
movl %edx, %r13d
shlq $0x7, %r13
movl $0x3b9ac9e8, %eax       # imm = 0x3B9AC9E8
xorl %edx, %edx
divq %r13
movq %rax, %r15
cmpl $0x773594, %ecx         # imm = 0x773594
jb 0x8714f
movq (%r14), %rax
movl $0x46, 0x28(%rax)
movq %r14, %rdi
callq *(%rax)
movl %ebx, %edx
cmpq %rdx, %r15
cmovael %ebx, %r15d
movl %r15d, 0xa0(%r12)
shlq $0x3, %rdx
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0x86e26
movq %rax, %r12
testl %ebx, %ebx
je 0x871b7
xorl %ebp, %ebp
movl %r15d, %eax
movl %ebx, %r15d
subl %ebp, %r15d
cmpl %r15d, %eax
cmovbl %eax, %r15d
movq %r13, %rdx
imulq %r15, %rdx
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0x86f8b
testl %r15d, %r15d
je 0x871b3
movl %r15d, %ecx
movl %ebp, %edx
incl %ebp
movq %rax, (%r12,%rdx,8)
addq %r13, %rax
decl %ecx
jne 0x871a4
cmpl %ebx, %ebp
jb 0x87179
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jmemmgr.c
// Function: request_virt_sarray
METHODDEF(jvirt_sarray_ptr)
request_virt_sarray (j_common_ptr cinfo, int pool_id, jboolean pre_zero,
		     JDIMENSION samplesperrow, JDIMENSION numrows,
		     JDIMENSION maxaccess)
/* Request a virtual 2-D sample array */
{
  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  jvirt_sarray_ptr result;

  /* Only IMAGE-lifetime virtual arrays are currently supported */
  if (pool_id != JPOOL_IMAGE)
    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);	/* safety check */

  /* get control block */
  result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,
					  SIZEOF(struct jvirt_sarray_control));

  result->mem_buffer = NULL;	/* marks array not yet realized */
  result->rows_in_array = numrows;
  result->samplesperrow = samplesperrow;
  result->maxaccess = maxaccess;
  result->pre_zero = pre_zero;
  result->b_s_open = FALSE;	/* no associated backing-store object */
  result->next = mem->virt_sarray_list; /* add to list of virtual arrays */
  mem->virt_sarray_list = result;

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movl %r8d, %r15d
movl %ecx, %r14d
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r13
movq 0x8(%rdi), %rbx
cmpl $0x1, %esi
je 0x87208
movq (%r13), %rax
movl $0xe, 0x28(%rax)
movl %r12d, 0x2c(%rax)
movq (%r13), %rax
movq %r13, %rdi
callq *(%rax)
movl $0x98, %edx
movq %r13, %rdi
movl %r12d, %esi
callq 0x86e26
movq $0x0, (%rax)
movl %r15d, 0x8(%rax)
movl %r14d, 0xc(%rax)
movl 0x4(%rsp), %ecx
movl %ecx, 0x10(%rax)
movl %ebp, 0x24(%rax)
movl $0x0, 0x2c(%rax)
movq 0x88(%rbx), %rcx
movq %rcx, 0x30(%rax)
movq %rax, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jmemmgr.c
// Function: self_destruct
METHODDEF(void)
self_destruct (j_common_ptr cinfo)
{
  int pool;

  /* Close all backing store, release all memory.
   * Releasing pools in reverse order might help avoid fragmentation
   * with some (brain-damaged) malloc libraries.
   */
  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {
    free_pool(cinfo, pool);
  }

  /* Release the memory manager control block too. */
  jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr));
  cinfo->mem = NULL;		/* ensures I will be called only once */

  jpeg_mem_term(cinfo);		/* system-dependent cleanup */
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x8778d
addl $-0x1, %ebp
jb 0x878cb
movq 0x8(%rbx), %rsi
movl $0xa8, %edx
movq %rbx, %rdi
callq 0x87a80
movq $0x0, 0x8(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x87aab
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jmemmgr.c
// Function: do_sarray_io
LOCAL(void)
do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, jboolean writing)
/* Do backing store read or write of a virtual sample array */
{
  long bytesperrow, file_offset, byte_count, rows, thisrow, i;

  bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);
  file_offset = ptr->cur_start_row * bytesperrow;
  /* Loop to read or write each allocation chunk in mem_buffer */
  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
    /* One chunk, but check for short chunk at end of buffer */
    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
    /* Transfer no more than is currently defined */
    thisrow = (long) ptr->cur_start_row + i;
    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
    /* Transfer no more than fits in file */
    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
    if (rows <= 0)		/* this chunk might be past end of file! */
      break;
    byte_count = rows * bytesperrow;
    if (writing)
      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
					    (void FAR *) ptr->mem_buffer[i],
					    file_offset, byte_count);
    else
      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
					   (void FAR *) ptr->mem_buffer[i],
					   file_offset, byte_count);
    file_offset += byte_count;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl 0x14(%rsi), %eax
testq %rax, %rax
je 0x879ab
movq %rsi, %rbx
movl 0xc(%rsi), %ecx
movl 0x1c(%rsi), %r15d
movq %rcx, 0x8(%rsp)
imulq %rcx, %r15
xorl %ecx, %ecx
testl %edx, %edx
setne %cl
leaq 0x38(%rsi), %r12
leaq 0x38(,%rcx,8), %r14
xorl %ebp, %ebp
movl 0x8(%rbx), %r13d
movl 0x18(%rbx), %ecx
subq %rbp, %rax
cmpq %rcx, %rax
cmovgeq %rcx, %rax
movl 0x1c(%rbx), %ecx
addq %rbp, %rcx
movl 0x20(%rbx), %edx
subq %rcx, %rdx
cmpq %rdx, %rax
cmovlq %rax, %rdx
subq %rcx, %r13
cmpq %r13, %rdx
cmovlq %rdx, %r13
testq %r13, %r13
jle 0x879ab
imulq 0x8(%rsp), %r13
movq (%rbx), %rax
movq (%rax,%rbp,8), %rdx
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rcx
movq %r13, %r8
callq *(%rbx,%r14)
addq %r13, %r15
movl 0x14(%rbx), %eax
movl 0x18(%rbx), %ecx
addq %rcx, %rbp
cmpq %rax, %rbp
jb 0x87948
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jmemmgr.c
// Function: do_barray_io
LOCAL(void)
do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, jboolean writing)
/* Do backing store read or write of a virtual coefficient-block array */
{
  long bytesperrow, file_offset, byte_count, rows, thisrow, i;

  bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);
  file_offset = ptr->cur_start_row * bytesperrow;
  /* Loop to read or write each allocation chunk in mem_buffer */
  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {
    /* One chunk, but check for short chunk at end of buffer */
    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);
    /* Transfer no more than is currently defined */
    thisrow = (long) ptr->cur_start_row + i;
    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);
    /* Transfer no more than fits in file */
    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);
    if (rows <= 0)		/* this chunk might be past end of file! */
      break;
    byte_count = rows * bytesperrow;
    if (writing)
      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,
					    (void FAR *) ptr->mem_buffer[i],
					    file_offset, byte_count);
    else
      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,
					   (void FAR *) ptr->mem_buffer[i],
					   file_offset, byte_count);
    file_offset += byte_count;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl 0x14(%rsi), %eax
testq %rax, %rax
je 0x87a69
movq %rsi, %rbx
movl 0xc(%rsi), %ebp
shlq $0x7, %rbp
movl 0x1c(%rsi), %r15d
imulq %rbp, %r15
xorl %ecx, %ecx
testl %edx, %edx
setne %cl
leaq 0x38(%rsi), %rdx
movq %rdx, 0x8(%rsp)
leaq 0x38(,%rcx,8), %r14
xorl %r12d, %r12d
movl 0x8(%rbx), %r13d
movl 0x18(%rbx), %ecx
subq %r12, %rax
cmpq %rcx, %rax
cmovgeq %rcx, %rax
movl 0x1c(%rbx), %ecx
addq %r12, %rcx
movl 0x20(%rbx), %edx
subq %rcx, %rdx
cmpq %rdx, %rax
cmovlq %rax, %rdx
subq %rcx, %r13
cmpq %r13, %rdx
cmovlq %rdx, %r13
testq %r13, %r13
jle 0x87a69
imulq %rbp, %r13
movq (%rbx), %rax
movq (%rax,%r12,8), %rdx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rcx
movq %r13, %r8
callq *(%rbx,%r14)
addq %r13, %r15
movl 0x14(%rbx), %eax
movl 0x18(%rbx), %ecx
addq %rcx, %r12
cmpq %rax, %r12
jb 0x87a06
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_set_sig_bytes
void PNGAPI
png_set_sig_bytes(png_structp png_ptr, int num_bytes)
{
   png_debug(1, "in png_set_sig_bytes");

   if (png_ptr == NULL)
      return;

   if (num_bytes > 8)
      png_error(png_ptr, "Too many bytes for PNG signature");

   png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes);
}

// Assembly:
testq %rdi, %rdi
je 0x87ae0
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
cmpl $0x9, %esi
jl 0x87acd
leaq 0x244fb(%rip), %rsi     # 0xabfc0
movq %rbx, %rdi
callq 0x92dd0
xorl %eax, %eax
testl %ebp, %ebp
cmovgl %ebp, %eax
movb %al, 0x254(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_sig_cmp
int PNGAPI
png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check)
{
   png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
   if (num_to_check > 8)
      num_to_check = 8;
   else if (num_to_check < 1)
      return (-1);

   if (start > 7)
      return (-1);

   if (start + num_to_check > 8)
      num_to_check = 8 - start;

   return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check)));
}

// Assembly:
movl $0x8, %eax
cmpq $0x8, %rdx
ja 0x87af4
movq %rdx, %rax
testq %rdx, %rdx
je 0x87afa
cmpq $0x7, %rsi
jbe 0x87b00
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
leaq (%rax,%rsi), %rcx
movl $0x8, %edx
subq %rsi, %rdx
cmpq $0x9, %rcx
cmovbq %rax, %rdx
addq %rsi, %rdi
leaq 0x248fe(%rip), %rax     # 0xac41c
addq %rsi, %rax
movq %rax, %rsi
jmp 0xe1f0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_zalloc
voidpf /* PRIVATE */
png_zalloc(voidpf png_ptr, uInt items, uInt size)
{
   png_voidp ptr;
   png_structp p=(png_structp)png_ptr;
   png_uint_32 save_flags=p->flags;
   png_alloc_size_t num_bytes;

   if (png_ptr == NULL)
      return (NULL);
   if (items > PNG_UINT_32_MAX/size)
   {
     png_warning (p, "Potential overflow in png_zalloc()");
     return (NULL);
   }
   num_bytes = (png_alloc_size_t)items * size;

   p->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
   ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes);
   p->flags=save_flags;

   return ((voidpf)ptr);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x87b4b
movl %edx, %ecx
movq %rdi, %rbx
movl %edx, %eax
mull %esi
jno 0x87b4f
leaq 0x2449e(%rip), %rsi     # 0xabfe1
movq %rbx, %rdi
callq 0x92e6e
xorl %eax, %eax
jmp 0x87b78
movl 0x120(%rbx), %ebp
movl %esi, %eax
movl %ecx, %esi
imulq %rax, %rsi
movl %ebp, %eax
orl $0x100000, %eax         # imm = 0x100000
movl %eax, 0x120(%rbx)
movq %rbx, %rdi
callq 0x92cb5
movl %ebp, 0x120(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_destroy_info_struct
void PNGAPI
png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
{
   png_infop info_ptr = NULL;

   png_debug(1, "in png_destroy_info_struct");

   if (png_ptr == NULL)
      return;

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

   if (info_ptr != NULL)
   {
      png_info_destroy(png_ptr, info_ptr);

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

// Assembly:
testq %rdi, %rdi
je 0x87c9f
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x87c6a
movq (%rbx), %r15
jmp 0x87c6d
xorl %r15d, %r15d
testq %r15, %r15
je 0x87c9a
movq %r14, %rdi
movq %r15, %rsi
callq 0x87ca0
movq 0x418(%r14), %rdx
movq 0x428(%r14), %rsi
movq %r15, %rdi
callq 0x92c64
movq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_info_destroy
void /* PRIVATE */
png_info_destroy(png_structp png_ptr, png_infop info_ptr)
{
   png_debug(1, "in png_info_destroy");

   png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);

#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
   if (png_ptr->num_chunk_list)
   {
      png_free(png_ptr, png_ptr->chunk_list);
      png_ptr->chunk_list = NULL;
      png_ptr->num_chunk_list = 0;
   }
#endif

   png_info_init_3(&info_ptr, png_sizeof(png_info));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x7fff, %edx           # imm = 0x7FFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x87d43
cmpl $0x0, 0x3f0(%r14)
je 0x87ce8
movq 0x3f8(%r14), %rsi
movq %r14, %rdi
callq 0x92d32
movq $0x0, 0x3f8(%r14)
movl $0x0, 0x3f0(%r14)
testq %rbx, %rbx
je 0x87d03
movl $0x170, %edx            # imm = 0x170
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe260
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_data_freer
void PNGAPI
png_data_freer(png_structp png_ptr, png_infop info_ptr,
   int freer, png_uint_32 mask)
{
   png_debug(1, "in png_data_freer");

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

   if (freer == PNG_DESTROY_WILL_FREE_DATA)
      info_ptr->free_me |= mask;
   else if (freer == PNG_USER_WILL_FREE_DATA)
      info_ptr->free_me &= ~mask;
   else
      png_warning(png_ptr,
         "Unknown freer parameter in png_data_freer");
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %r8b
orb %al, %r8b
jne 0x87d36
cmpl $0x2, %edx
je 0x87d2e
cmpl $0x1, %edx
jne 0x87d37
orl %ecx, 0xe4(%rsi)
retq
notl %ecx
andl %ecx, 0xe4(%rsi)
retq
leaq 0x242c6(%rip), %rsi     # 0xac004
jmp 0x92e6e
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_convert_to_rfc1123
png_charp PNGAPI
png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
{
   static PNG_CONST char short_months[12][4] =
        {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
         "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

   if (png_ptr == NULL)
      return (NULL);
   if (png_ptr->time_buffer == NULL)
   {
      png_ptr->time_buffer = (png_charp)png_malloc(png_ptr, (png_uint_32)(29*
         png_sizeof(char)));
   }

#ifdef USE_FAR_KEYWORD
   {
      char near_time_buf[29];
      png_snprintf6(near_time_buf, 29, "%d %s %d %02d:%02d:%02d +0000",
          ptime->day % 32, short_months[(ptime->month - 1) % 12],
          ptime->year, ptime->hour % 24, ptime->minute % 60,
          ptime->second % 61);
      png_memcpy(png_ptr->time_buffer, near_time_buf,
          29*png_sizeof(char));
   }
#else
   png_snprintf6(png_ptr->time_buffer, 29, "%d %s %d %02d:%02d:%02d +0000",
       ptime->day % 32, short_months[(ptime->month - 1) % 12],
       ptime->year, ptime->hour % 24, ptime->minute % 60,
       ptime->second % 61);
#endif
   return ((png_charp)png_ptr->time_buffer);
}

// Assembly:
testq %rdi, %rdi
je 0x88275
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x3d0(%rdi)
jne 0x8819e
movl $0x1d, %esi
movq %rbx, %rdi
callq 0x92cb5
movq %rax, 0x3d0(%rbx)
movq 0x3d0(%rbx), %rdi
movzbl 0x3(%r14), %ecx
andl $0x1f, %ecx
movzbl 0x2(%r14), %eax
movl %eax, %edx
decl %edx
movslq %edx, %rdx
imulq $0x2aaaaaab, %rdx, %rdx # imm = 0x2AAAAAAB
movq %rdx, %rsi
shrq $0x3f, %rsi
shrq $0x21, %rdx
addl %esi, %edx
shll $0x2, %edx
leal (%rdx,%rdx,2), %edx
negl %edx
addl %edx, %eax
decl %eax
cltq
leaq 0x2424e(%rip), %rdx     # 0xac430
leaq (%rdx,%rax,4), %r8
movzwl (%r14), %r9d
movzbl 0x4(%r14), %eax
imull $0xab, %eax, %edx
shrl $0x9, %edx
andl $-0x8, %edx
leal (%rdx,%rdx,2), %edx
subb %dl, %al
movzbl %al, %r10d
movzbl 0x5(%r14), %eax
imull $0x89, %eax, %edx
shrl $0xd, %edx
imull $0x3c, %edx, %edx
subb %dl, %al
movzbl %al, %r11d
movzbl 0x6(%r14), %eax
leal (%rax,%rax,2), %edx
leal (%rax,%rdx,4), %edx
shrl $0x8, %edx
movl %eax, %esi
subb %dl, %sil
shrb %sil
addb %dl, %sil
shrb $0x5, %sil
movzbl %sil, %edx
imull $0x3d, %edx, %edx
subb %dl, %al
movzbl %al, %r14d
subq $0x8, %rsp
leaq 0x23dde(%rip), %rdx     # 0xac02e
movl $0x1d, %esi
xorl %eax, %eax
pushq %r14
pushq %r11
pushq %r10
callq 0xe750
addq $0x20, %rsp
movq 0x3d0(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_handle_as_unknown
int PNGAPI
png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
{
   /* Check chunk_name and return "keep" value if it's on the list, else 0 */
   int i;
   png_bytep p;
   if (png_ptr == NULL || chunk_name == NULL || png_ptr->num_chunk_list<=0)
      return 0;
   p = png_ptr->chunk_list + png_ptr->num_chunk_list*5 - 5;
   for (i = png_ptr->num_chunk_list; i; i--, p -= 5)
      if (!png_memcmp(chunk_name, p, 4))
        return ((int)*(p + 4));
   return 0;
}

// Assembly:
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x882d3
movl 0x3f0(%rdi), %ecx
testl %ecx, %ecx
jle 0x882d3
movq 0x3f8(%rdi), %rdx
leal (%rcx,%rcx,4), %edi
addq %rdi, %rdx
addq $-0x5, %rdx
movl (%rsi), %esi
cmpl (%rdx), %esi
je 0x882d4
addq $-0x5, %rdx
decl %ecx
jne 0x882c7
retq
movzbl 0x4(%rdx), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/png.c
// Function: png_64bit_product
void /* PRIVATE */
png_64bit_product (long v1, long v2, unsigned long *hi_product,
   unsigned long *lo_product)
{
   int a, b, c, d;
   long lo, hi, x, y;

   a = (v1 >> 16) & 0xffff;
   b = v1 & 0xffff;
   c = (v2 >> 16) & 0xffff;
   d = v2 & 0xffff;

   lo = b * d;                   /* BD */
   x = a * d + c * b;            /* AD + CB */
   y = ((lo >> 16) & 0xffff) + x;

   lo = (lo & 0xffff) | ((y & 0xffff) << 16);
   hi = (y >> 16) & 0xffff;

   hi += a * c;                  /* AC */

   *hi_product = (unsigned long)hi;
   *lo_product = (unsigned long)lo;
}

// Assembly:
movl %edi, %eax
shrl $0x10, %eax
movl $0xffff, %r9d           # imm = 0xFFFF
andl %r9d, %edi
movl %esi, %r8d
shrl $0x10, %r8d
andl %r9d, %esi
movl %esi, %r10d
imull %edi, %r10d
imull %eax, %esi
imull %r8d, %edi
addl %esi, %edi
movl %r10d, %esi
shrl $0x10, %esi
addq %rdi, %rsi
andl %r9d, %r10d
movl %esi, %edi
shll $0x10, %edi
orl %r10d, %edi
shrq $0x10, %rsi
imull %eax, %r8d
addq %rsi, %r8
movq %r8, (%rdx)
movq %rdi, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_cHRM
void PNGAPI
png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
   double white_x, double white_y, double red_x, double red_y,
   double green_x, double green_y, double blue_x, double blue_y)
{
   png_debug1(1, "in %s storage function", "cHRM");

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

   info_ptr->x_white = (float)white_x;
   info_ptr->y_white = (float)white_y;
   info_ptr->x_red   = (float)red_x;
   info_ptr->y_red   = (float)red_y;
   info_ptr->x_green = (float)green_x;
   info_ptr->y_green = (float)green_y;
   info_ptr->x_blue  = (float)blue_x;
   info_ptr->y_blue  = (float)blue_y;
#ifdef PNG_FIXED_POINT_SUPPORTED
   info_ptr->int_x_white = (png_fixed_point)(white_x*100000.+0.5);
   info_ptr->int_y_white = (png_fixed_point)(white_y*100000.+0.5);
   info_ptr->int_x_red   = (png_fixed_point)(  red_x*100000.+0.5);
   info_ptr->int_y_red   = (png_fixed_point)(  red_y*100000.+0.5);
   info_ptr->int_x_green = (png_fixed_point)(green_x*100000.+0.5);
   info_ptr->int_y_green = (png_fixed_point)(green_y*100000.+0.5);
   info_ptr->int_x_blue  = (png_fixed_point)( blue_x*100000.+0.5);
   info_ptr->int_y_blue  = (png_fixed_point)( blue_y*100000.+0.5);
#endif
   info_ptr->valid |= PNG_INFO_cHRM;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x88870
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
cvtpd2ps %xmm2, %xmm1
cvtpd2ps %xmm0, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
unpcklpd %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0]
unpcklpd %xmm7, %xmm6            # xmm6 = xmm6[0],xmm7[0]
cvtpd2ps %xmm6, %xmm1
cvtpd2ps %xmm4, %xmm5
movupd %xmm3, 0xa0(%rsi)
unpcklpd %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0]
movapd 0x23c4c(%rip), %xmm1    # 0xac460
mulpd %xmm1, %xmm0
movapd 0x197f0(%rip), %xmm3    # 0xa2010
addpd %xmm3, %xmm0
mulpd %xmm1, %xmm2
addpd %xmm3, %xmm2
cvttpd2dq %xmm2, %xmm2
cvttpd2dq %xmm0, %xmm0
movupd %xmm5, 0xb0(%rsi)
unpcklpd %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
movupd %xmm0, 0x14c(%rsi)
mulpd %xmm1, %xmm4
mulpd %xmm1, %xmm6
addpd %xmm3, %xmm6
cvttpd2dq %xmm6, %xmm0
addpd %xmm3, %xmm4
cvttpd2dq %xmm4, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movupd %xmm1, 0x15c(%rsi)
orb $0x4, 0x8(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_gAMA
void PNGAPI
png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
{
   double png_gamma;

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

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

   /* Check for overflow */
   if (file_gamma > 21474.83)
   {
      png_warning(png_ptr, "Limiting gamma to 21474.83");
      png_gamma=21474.83;
   }
   else
      png_gamma = file_gamma;
   info_ptr->gamma = (float)png_gamma;
#ifdef PNG_FIXED_POINT_SUPPORTED
   info_ptr->int_gamma = (int)(png_gamma*100000.+.5);
#endif
   info_ptr->valid |= PNG_INFO_gAMA;
   if (png_gamma == 0.0)
      png_warning(png_ptr, "Setting gamma=0");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x88a3f
movq %rsi, %r14
movq %rdi, %rbx
ucomisd 0x23b1a(%rip), %xmm0    # 0xac4f0
jbe 0x889ef
leaq 0x23b21(%rip), %rsi     # 0xac500
movq %rbx, %rdi
callq 0x92e6e
movsd 0x23b01(%rip), %xmm0    # 0xac4f0
cvtsd2ss %xmm0, %xmm1
movss %xmm1, 0x34(%r14)
movsd 0x23af7(%rip), %xmm1    # 0xac4f8
mulsd %xmm0, %xmm1
addsd 0x19623(%rip), %xmm1    # 0xa2030
cvttsd2si %xmm1, %eax
movl %eax, 0x148(%r14)
orb $0x1, 0x8(%r14)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x88a3f
jp 0x88a3f
leaq 0x23aeb(%rip), %rsi     # 0xac51b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x92e6e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_gAMA_fixed
void PNGAPI
png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
   int_gamma)
{
   png_fixed_point png_gamma;

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

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

   if (int_gamma > (png_fixed_point)PNG_UINT_31_MAX)
   {
      png_warning(png_ptr, "Limiting gamma to 21474.83");
      png_gamma=PNG_UINT_31_MAX;
   }
   else
   {
      if (int_gamma < 0)
      {
         png_warning(png_ptr, "Setting negative gamma to zero");
         png_gamma = 0;
      }
      else
         png_gamma = int_gamma;
   }
#ifdef PNG_FLOATING_POINT_SUPPORTED
   info_ptr->gamma = (float)(png_gamma/100000.);
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
   info_ptr->int_gamma = png_gamma;
#endif
   info_ptr->valid |= PNG_INFO_gAMA;
   if (png_gamma == 0)
      png_warning(png_ptr, "Setting gamma=0");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x88a9c
movq %rsi, %r14
movq %rdi, %rbx
testl %edx, %edx
jns 0x88a76
leaq 0x23abf(%rip), %rsi     # 0xac52b
movq %rbx, %rdi
callq 0x92e6e
xorl %edx, %edx
cvtsi2sd %edx, %xmm0
divsd 0x23a76(%rip), %xmm0    # 0xac4f8
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x34(%r14)
movl %edx, 0x148(%r14)
orb $0x1, 0x8(%r14)
testl %edx, %edx
je 0x88aa4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x23a70(%rip), %rsi     # 0xac51b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x92e6e
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_hIST
void PNGAPI
png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
{
   int i;

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

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

   if (info_ptr->num_palette == 0 || info_ptr->num_palette
       > PNG_MAX_PALETTE_LENGTH)
   {
      png_warning(png_ptr,
         "Invalid palette size, hIST allocation skipped");
      return;
   }

   png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
   /* Changed from info->num_palette to PNG_MAX_PALETTE_LENGTH in
    * version 1.2.1
    */
   png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr,
      PNG_MAX_PALETTE_LENGTH * png_sizeof(png_uint_16));
   if (png_ptr->hist == NULL)
   {
      png_warning(png_ptr, "Insufficient memory for hIST chunk data");
      return;
   }

   for (i = 0; i < info_ptr->num_palette; i++)
      png_ptr->hist[i] = hist[i];
   info_ptr->hist = png_ptr->hist;
   info_ptr->valid |= PNG_INFO_hIST;

   info_ptr->free_me |= PNG_FREE_HIST;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x88b4e
movq %rsi, %rbx
movq %rdi, %r15
movl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
addl 0x20(%rsi), %eax
movzwl %ax, %eax
cmpl $0xfeff, %eax           # imm = 0xFEFF
ja 0x88af0
leaq 0x23a5c(%rip), %rsi     # 0xac54a
jmp 0x88b5b
movq %rdx, %r14
movq %r15, %rdi
movq %rbx, %rsi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x87d43
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
callq 0x92d72
movq %rax, 0x398(%r15)
testq %rax, %rax
je 0x88b54
cmpw $0x0, 0x20(%rbx)
je 0x88b3c
xorl %ecx, %ecx
movzwl (%r14,%rcx,2), %edx
movw %dx, (%rax,%rcx,2)
incq %rcx
movzwl 0x20(%rbx), %edx
cmpq %rdx, %rcx
jb 0x88b27
movq %rax, 0x98(%rbx)
orb $0x40, 0x8(%rbx)
orb $0x8, 0xe4(%rbx)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x23a1d(%rip), %rsi     # 0xac578
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x92e6e
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_IHDR
void PNGAPI
png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
   png_uint_32 width, png_uint_32 height, int bit_depth,
   int color_type, int interlace_type, int compression_type,
   int filter_type)
{
   png_debug1(1, "in %s storage function", "IHDR");

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

   info_ptr->width = width;
   info_ptr->height = height;
   info_ptr->bit_depth = (png_byte)bit_depth;
   info_ptr->color_type = (png_byte)color_type;
   info_ptr->compression_type = (png_byte)compression_type;
   info_ptr->filter_type = (png_byte)filter_type;
   info_ptr->interlace_type = (png_byte)interlace_type;

   png_check_IHDR (png_ptr, info_ptr->width, info_ptr->height,
       info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
       info_ptr->compression_type, info_ptr->filter_type);

   if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
      info_ptr->channels = 1;
   else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
      info_ptr->channels = 3;
   else
      info_ptr->channels = 1;
   if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
      info_ptr->channels++;
   info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth);

   /* Check for potential overflow */
   if (width > (PNG_UINT_32_MAX
                 >> 3)      /* 8-byte RGBA pixels */
                 - 64       /* bigrowbuf hack */
                 - 1        /* filter byte */
                 - 7*8      /* rounding of width to multiple of 8 pixels */
                 - 8)       /* extra max_pixel_depth pad */
      info_ptr->rowbytes = 0;
   else
      info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
jne 0x88c2d
movq %rsi, %rbx
movl 0x30(%rsp), %r11d
movl 0x28(%rsp), %r10d
movl 0x20(%rsp), %eax
movl %ebp, (%rsi)
movl %ecx, 0x4(%rsi)
movb %r8b, 0x24(%rsi)
movb %r9b, 0x25(%rsi)
movb %r10b, 0x26(%rsi)
movb %r11b, 0x27(%rsi)
movb %al, 0x28(%rsi)
movl $0xff, %edx
andl %edx, %r8d
andl %edx, %r9d
andl %edx, %eax
andl %edx, %r10d
andl %edx, %r11d
movl %ebp, %esi
movl %ecx, %edx
movl %r8d, %ecx
movl %r9d, %r8d
movl %eax, %r9d
pushq %r11
pushq %r10
callq 0x88526
addq $0x10, %rsp
movb 0x25(%rbx), %al
cmpb $0x3, %al
je 0x88be2
testb $0x2, %al
jne 0x88be8
movb $0x1, 0x29(%rbx)
jmp 0x88bec
movb $0x3, 0x29(%rbx)
testb $0x4, %al
je 0x88bf3
incb 0x29(%rbx)
movb 0x24(%rbx), %al
mulb 0x29(%rbx)
movb %al, 0x2a(%rbx)
cmpl $0x1fffff7e, %ebp       # imm = 0x1FFFFF7E
jbe 0x88c08
xorl %eax, %eax
jmp 0x88c29
movl %ebp, %ecx
cmpb $0x8, %al
jb 0x88c1a
shrb $0x3, %al
movzbl %al, %eax
imulq %rcx, %rax
jmp 0x88c29
movzbl %al, %eax
imulq %rcx, %rax
addq $0x7, %rax
shrq $0x3, %rax
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_PLTE
void PNGAPI
png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
   png_colorp palette, int num_palette)
{

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

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

   if (num_palette < 0 || num_palette > PNG_MAX_PALETTE_LENGTH)
   {
      if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
         png_error(png_ptr, "Invalid palette length");
      else
      {
         png_warning(png_ptr, "Invalid palette length");
         return;
      }
   }

   /* It may not actually be necessary to set png_ptr->palette here;
    * we do it for backward compatibility with the way the png_handle_tRNS
    * function used to do the allocation.
    */
   png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);

   /* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead
    * of num_palette entries, in case of an invalid PNG file that has
    * too-large sample values.
    */
   png_ptr->palette = (png_colorp)png_calloc(png_ptr,
      PNG_MAX_PALETTE_LENGTH * png_sizeof(png_color));
   png_memcpy(png_ptr->palette, palette, num_palette * png_sizeof(png_color));
   info_ptr->palette = png_ptr->palette;
   info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;

   info_ptr->free_me |= PNG_FREE_PLTE;

   info_ptr->valid |= PNG_INFO_PLTE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x88f11
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x101, %ebp            # imm = 0x101
jb 0x88eb7
cmpb $0x3, 0x25(%rbx)
jne 0x88f1c
leaq 0x23784(%rip), %rsi     # 0xac633
movq %r14, %rdi
callq 0x92dd0
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
callq 0x87d43
movl $0x300, %esi            # imm = 0x300
movq %r14, %rdi
callq 0x92c97
movq %rax, 0x238(%r14)
movslq %ebp, %rcx
leaq (%rcx,%rcx,2), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0xe370
movq 0x238(%r14), %rax
movq %rax, 0x18(%rbx)
movw %bp, 0x240(%r14)
movw %bp, 0x20(%rbx)
orb $0x10, 0xe5(%rbx)
orb $0x8, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x23710(%rip), %rsi     # 0xac633
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x92e6e