LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: quantize3_ord_dither
METHODDEF(void)
quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		      JSAMPARRAY output_buf, int num_rows)
/* Fast path for out_color_components==3, with ordered dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register int pixcode;
  register JSAMPROW input_ptr;
  register JSAMPROW output_ptr;
  JSAMPROW colorindex0 = cquantize->colorindex[0];
  JSAMPROW colorindex1 = cquantize->colorindex[1];
  JSAMPROW colorindex2 = cquantize->colorindex[2];
  int * dither0;		/* points to active row of dither matrix */
  int * dither1;
  int * dither2;
  int row_index, col_index;	/* current indexes into dither matrix */
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    row_index = cquantize->row_index;
    input_ptr = input_buf[row];
    output_ptr = output_buf[row];
    dither0 = cquantize->odither[0][row_index];
    dither1 = cquantize->odither[1][row_index];
    dither2 = cquantize->odither[2][row_index];
    col_index = 0;

    for (col = width; col > 0; col--) {
      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +
					dither0[col_index]]);
      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +
					dither1[col_index]]);
      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +
					dither2[col_index]]);
      *output_ptr++ = (JSAMPLE) pixcode;
      col_index = (col_index + 1) & ODITHER_MASK;
    }
    row_index = (row_index + 1) & ODITHER_MASK;
    cquantize->row_index = row_index;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
testl %ecx, %ecx
jle 0x83f75
movq 0x270(%rdi), %rax
movq 0x30(%rax), %rdx
movq (%rdx), %r8
movq 0x8(%rdx), %r9
movq 0x10(%rdx), %r10
movl 0x88(%rdi), %edi
movl %ecx, %ecx
movq %rcx, -0x8(%rsp)
movq %rax, -0x20(%rsp)
movl 0x4c(%rax), %eax
movl %eax, -0x2c(%rsp)
movq $0x0, -0x28(%rsp)
testq %rdi, %rdi
je 0x83f48
movslq -0x2c(%rsp), %r14
shlq $0x6, %r14
movq -0x20(%rsp), %rax
movq 0x50(%rax), %r15
addq %r14, %r15
movq 0x58(%rax), %r12
addq %r14, %r12
addq 0x60(%rax), %r14
movq -0x10(%rsp), %rax
movq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %r13
movq -0x18(%rsp), %rax
movq (%rax,%rcx,8), %rbp
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rbp), %esi
movl %edx, %eax
movslq (%r15,%rax,4), %rbx
addq %rsi, %rbx
movzbl 0x1(%rbp), %esi
movslq (%r12,%rax,4), %r11
addq %rsi, %r11
movb (%r9,%r11), %sil
addb (%r8,%rbx), %sil
movzbl 0x2(%rbp), %r11d
movslq (%r14,%rax,4), %rax
addq %r11, %rax
addb (%r10,%rax), %sil
movb %sil, (%r13,%rcx)
incl %edx
andl $0xf, %edx
incq %rcx
addq $0x3, %rbp
cmpl %ecx, %edi
jne 0x83f03
movl -0x2c(%rsp), %ecx
incl %ecx
andl $0xf, %ecx
movq -0x20(%rsp), %rax
movl %ecx, -0x2c(%rsp)
movl %ecx, 0x4c(%rax)
movq -0x28(%rsp), %rcx
incq %rcx
movq %rcx, -0x28(%rsp)
cmpq -0x8(%rsp), %rcx
jne 0x83ebf
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: quantize_ord_dither
METHODDEF(void)
quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		     JSAMPARRAY output_buf, int num_rows)
/* General case, with ordered dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register JSAMPROW input_ptr;
  register JSAMPROW output_ptr;
  JSAMPROW colorindex_ci;
  int * dither;			/* points to active row of dither matrix */
  int row_index, col_index;	/* current indexes into dither matrix */
  int nc = cinfo->out_color_components;
  int ci;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    /* Initialize output values to 0 so can process components separately */
    jzero_far((void FAR *) output_buf[row],
	      (size_t) (width * SIZEOF(JSAMPLE)));
    row_index = cquantize->row_index;
    for (ci = 0; ci < nc; ci++) {
      input_ptr = input_buf[row] + ci;
      output_ptr = output_buf[row];
      colorindex_ci = cquantize->colorindex[ci];
      dither = cquantize->odither[ci][row_index];
      col_index = 0;

      for (col = width; col > 0; col--) {
	/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,
	 * select output value, accumulate into output code for this pixel.
	 * Range-limiting need not be done explicitly, as we have extended
	 * the colorindex table to produce the right answers for out-of-range
	 * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the
	 * required amount of padding.
	 */
	*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
	input_ptr += nc;
	output_ptr++;
	col_index = (col_index + 1) & ODITHER_MASK;
      }
    }
    /* Advance row index for next row */
    row_index = (row_index + 1) & ODITHER_MASK;
    cquantize->row_index = row_index;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
testl %ecx, %ecx
jle 0x84067
movl 0x88(%rdi), %r15d
movl 0x90(%rdi), %r12d
movq 0x270(%rdi), %r13
movslq %r12d, %rbp
movl %ecx, %eax
movq %rax, 0x18(%rsp)
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
movq (%rax,%r14,8), %rdi
movq %r15, %rsi
callq 0x85d17
movslq 0x4c(%r13), %rax
movq %rax, 0x8(%rsp)
testl %r12d, %r12d
jle 0x8404b
movq 0x8(%rsp), %rcx
shlq $0x6, %rcx
xorl %edx, %edx
testq %r15, %r15
je 0x84043
movq 0x50(%r13,%rdx,8), %rsi
addq %rcx, %rsi
movq 0x30(%r13), %rdi
movq (%rdi,%rdx,8), %rdi
movq 0x10(%rsp), %rax
movq (%rax,%r14,8), %r8
movq 0x20(%rsp), %rax
movq (%rax,%r14,8), %r9
addq %rdx, %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
movzbl (%r9), %eax
movl %r11d, %ebx
movslq (%rsi,%rbx,4), %rbx
addq %rax, %rbx
movb (%rdi,%rbx), %al
addb %al, (%r8,%r10)
addq %rbp, %r9
incl %r11d
andl $0xf, %r11d
incq %r10
cmpl %r10d, %r15d
jne 0x8401c
incq %rdx
cmpq %r12, %rdx
jne 0x83fec
movq 0x8(%rsp), %rax
incl %eax
andl $0xf, %eax
movl %eax, 0x4c(%r13)
incq %r14
cmpq 0x18(%rsp), %r14
jne 0x83fc2
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: prescan_quantize
METHODDEF(void)
prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		  JSAMPARRAY output_buf, int num_rows)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register JSAMPROW ptr;
  register histptr histp;
  register hist3d histogram = cquantize->histogram;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    ptr = input_buf[row];
    for (col = width; col > 0; col--) {
      /* get pixel value and index into the histogram */
      histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
			 [GETJSAMPLE(ptr[1]) >> C1_SHIFT]
			 [GETJSAMPLE(ptr[2]) >> C2_SHIFT];
      /* increment, check for overflow and undo increment if so. */
      if (++(*histp) <= 0)
	(*histp)--;
      ptr += 3;
    }
  }
}

// Assembly:
testl %ecx, %ecx
jle 0x845d1
pushq %rbp
pushq %rbx
movq 0x270(%rdi), %rax
movq 0x30(%rax), %rax
movl 0x88(%rdi), %edx
movl %ecx, %ecx
xorl %edi, %edi
testl %edx, %edx
je 0x845c7
movq (%rsi,%rdi,8), %r8
movl %edx, %r9d
movzbl (%r8), %r10d
andl $-0x8, %r10d
movzbl 0x1(%r8), %r11d
movzbl 0x2(%r8), %ebx
shll $0x4, %r11d
andl $-0x40, %r11d
addq (%rax,%r10), %r11
shrl $0x3, %ebx
movzwl (%r11,%rbx,2), %r10d
movl %r10d, %ebp
incw %bp
cmovel %r10d, %ebp
movw %bp, (%r11,%rbx,2)
addq $0x3, %r8
decl %r9d
jne 0x84589
incq %rdi
cmpq %rcx, %rdi
jne 0x8457e
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: pass2_no_dither
METHODDEF(void)
pass2_no_dither (j_decompress_ptr cinfo,
		 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
/* This version performs no dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  hist3d histogram = cquantize->histogram;
  register JSAMPROW inptr, outptr;
  register histptr cachep;
  register int c0, c1, c2;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    inptr = input_buf[row];
    outptr = output_buf[row];
    for (col = width; col > 0; col--) {
      /* get pixel value and index into the cache */
      c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;
      c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;
      c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;
      cachep = & histogram[c0][c1][c2];
      /* If we have not seen this color before, find nearest colormap entry */
      /* and update the cache */
      if (*cachep == 0)
	fill_inverse_cmap(cinfo, c0,c1,c2);
      /* Now emit the colormap index for this cell */
      *outptr++ = (JSAMPLE) (*cachep - 1);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
testl %ecx, %ecx
jle 0x84dfe
movq 0x8(%rsp), %rdx
movq 0x270(%rdx), %rax
movq 0x30(%rax), %r12
movl 0x88(%rdx), %r13d
movl %ecx, %eax
movq %rax, 0x20(%rsp)
movq $0x0, (%rsp)
testq %r13, %r13
je 0x84de8
movq 0x18(%rsp), %rax
movq (%rsp), %rcx
movq (%rax,%rcx,8), %r14
movq 0x10(%rsp), %rax
movq (%rax,%rcx,8), %rbp
xorl %r15d, %r15d
movzbl (%rbp), %eax
movzbl 0x1(%rbp), %edx
shrl $0x2, %edx
movzbl 0x2(%rbp), %ecx
shrl $0x3, %ecx
movl %eax, %edi
andl $-0x8, %edi
movl %edx, %esi
shll $0x6, %esi
addq (%r12,%rdi), %rsi
movzwl (%rsi,%rcx,2), %edi
testw %di, %di
jne 0x84dd5
shrl $0x3, %eax
leaq (%rsi,%rcx,2), %rbx
movzbl %cl, %ecx
movzbl %dl, %edx
movzbl %al, %esi
movq 0x8(%rsp), %rdi
callq 0x85248
movzwl (%rbx), %edi
decb %dil
movb %dil, (%r14,%r15)
incq %r15
addq $0x3, %rbp
cmpl %r15d, %r13d
jne 0x84d8f
movq (%rsp), %rcx
incq %rcx
movq %rcx, (%rsp)
cmpq 0x20(%rsp), %rcx
jne 0x84d71
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0x58, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, %r14
movq %rax, 0x260(%rbx)
leaq 0x145(%rip), %rax       # 0x857b6
movq %rax, (%r14)
movl $0x0, 0x10(%r14)
movl 0x90(%rbx), %eax
imull 0x88(%rbx), %eax
movl %eax, 0x4c(%r14)
cmpl $0x2, 0x19c(%rbx)
jne 0x856c6
leaq 0x131(%rip), %rcx       # 0x857ce
movq %rcx, 0x8(%r14)
leaq 0x1d4(%rip), %rcx       # 0x8587c
movq %rcx, 0x18(%r14)
movq 0x8(%rbx), %rcx
movl %eax, %edx
movq %rbx, %rdi
movl $0x1, %esi
callq *0x8(%rcx)
movq 0x260(%rbx), %r15
jmp 0x856e1
leaq 0x3c8(%rip), %rax       # 0x85a95
movq %rax, 0x8(%r14)
leaq 0x3e7(%rip), %rax       # 0x85abf
movq %rax, 0x18(%r14)
xorl %eax, %eax
movq %r14, %r15
movq %rax, 0x40(%r14)
movq 0x8(%rbx), %rax
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x20(%r15)
movq 0x8(%rbx), %rax
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x28(%r15)
movq 0x8(%rbx), %rax
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x30(%r15)
movq 0x8(%rbx), %rax
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x38(%r15)
movq 0x20(%r15), %rcx
movq 0x28(%r15), %rdx
movq 0x30(%r15), %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 0x85769
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x85819
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 0x85cb7
movl $0x0, 0x48(%r15)
jmp 0x85861
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 0x85848
incl %eax
movq (%r8,%rax,8), %rax
jmp 0x85854
movq 0x40(%r15), %rax
movl $0x1, 0x48(%r15)
movq %rsp, %rcx
movq %rax, 0x8(%rcx)
movl (%rbx), %edx
callq *0x18(%r15)
addl %ebp, (%r14)
subl %ebp, 0x50(%r15)
cmpl $0x0, 0x48(%r15)
jne 0x85871
incl (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x85c4f
movq %rbx, %rdi
callq *0x50(%rax)
movq $0x0, 0x8(%rbx)
movl $0x0, 0x24(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jerror.c
// Function: emit_message
METHODDEF(void)
emit_message (j_common_ptr cinfo, int msg_level)
{
  struct jpeg_error_mgr * err = cinfo->err;

  if (msg_level < 0) {
    /* It's a warning message.  Since corrupt files may generate many warnings,
     * the policy implemented here is to show only the first warning,
     * unless trace_level >= 3.
     */
    if (err->num_warnings == 0 || err->trace_level >= 3)
      (*err->output_message) (cinfo);
    /* Always count warnings in num_warnings. */
    err->num_warnings++;
  } else {
    /* It's a trace message.  Show it if trace_level >= msg_level. */
    if (err->trace_level >= msg_level)
      (*err->output_message) (cinfo);
  }
}

// Assembly:
movq (%rdi), %rcx
testl %esi, %esi
js 0x85dbc
cmpl %esi, 0x7c(%rcx)
jge 0x85deb
retq
pushq %rbx
movq 0x80(%rcx), %rax
testq %rax, %rax
je 0x85dcf
cmpl $0x3, 0x7c(%rcx)
jl 0x85ddf
movq %rcx, %rbx
callq *0x10(%rcx)
movq %rbx, %rcx
movq 0x80(%rbx), %rax
incq %rax
movq %rax, 0x80(%rcx)
popq %rbx
retq
jmpq *0x10(%rcx)
// File: /workspace/github_cpp_makefile_star2_O3/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 0x85e0a
cmpl 0x90(%rdx), %ecx
jle 0x85e31
movq 0x98(%rdx), %rsi
testq %rsi, %rsi
je 0x85e47
movl %ecx, %edi
subl 0xa0(%rdx), %edi
jl 0x85e47
cmpl 0xa4(%rdx), %ecx
jg 0x85e47
movslq %edi, %rdi
leaq (%rsi,%rdi,8), %rsi
jmp 0x85e3f
movq %rcx, %rsi
shlq $0x3, %rsi
addq 0x88(%rdx), %rsi
movq (%rsi), %rsi
testq %rsi, %rsi
jne 0x85e54
movl %ecx, 0x2c(%rdx)
movq 0x88(%rdx), %rcx
movq (%rcx), %rsi
movq %rsi, %rcx
movzbl (%rcx), %edi
testl %edi, %edi
je 0x85e7e
incq %rcx
cmpl $0x25, %edi
jne 0x85e57
cmpb $0x73, (%rcx)
jne 0x85e7e
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_O3/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, %r13d
movl %esi, 0x4(%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %r12
movl $0x3b9ac9e8, %eax       # imm = 0x3B9AC9E8
xorl %edx, %edx
divl %r13d
movl %eax, %r15d
cmpl $0x3b9ac9e9, %r13d      # imm = 0x3B9AC9E9
jb 0x8628f
movq (%r14), %rax
movl $0x46, 0x28(%rax)
movq %r14, %rdi
callq *(%rax)
movl %ebx, %edx
cmpl %ebx, %r15d
cmovael %ebx, %r15d
movl %r15d, 0xa0(%r12)
shlq $0x3, %rdx
movq %r14, %rdi
movl 0x4(%rsp), %esi
callq 0x86026
movq %rax, %r12
testl %ebx, %ebx
je 0x862fa
movl %r13d, %r13d
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 0x8618b
testl %r15d, %r15d
je 0x862f6
movl %r15d, %ecx
movl %ebp, %edx
incl %ebp
movq %rax, (%r12,%rdx,8)
addq %r13, %rax
decl %ecx
jne 0x862e7
cmpl %ebx, %ebp
jb 0x862bc
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_O3/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 0x86351
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 0x86026
movq %rax, %r12
testl %ebx, %ebx
je 0x863b9
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 0x8618b
testl %r15d, %r15d
je 0x863b5
movl %r15d, %ecx
movl %ebp, %edx
incl %ebp
movq %rax, (%r12,%rdx,8)
addq %r13, %rax
decl %ecx
jne 0x863a6
cmpl %ebx, %ebp
jb 0x8637b
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_O3/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, %r13d
movq %rdi, %r12
movq 0x8(%rdi), %rbx
movl $0x1, %esi
cmpl $0x1, %r13d
je 0x86413
movq (%r12), %rax
movl $0xe, 0x28(%rax)
movl %r13d, 0x2c(%rax)
movq (%r12), %rax
movq %r12, %rdi
callq *(%rax)
movl %r13d, %esi
movl $0x98, %edx
movq %r12, %rdi
callq 0x86026
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_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jmemmgr.c
// Function: request_virt_barray
METHODDEF(jvirt_barray_ptr)
request_virt_barray (j_common_ptr cinfo, int pool_id, jboolean pre_zero,
		     JDIMENSION blocksperrow, JDIMENSION numrows,
		     JDIMENSION maxaccess)
/* Request a virtual 2-D coefficient-block array */
{
  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;
  jvirt_barray_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_barray_ptr) alloc_small(cinfo, pool_id,
					  SIZEOF(struct jvirt_barray_control));

  result->mem_buffer = NULL;	/* marks array not yet realized */
  result->rows_in_array = numrows;
  result->blocksperrow = blocksperrow;
  result->maxaccess = maxaccess;
  result->pre_zero = pre_zero;
  result->b_s_open = FALSE;	/* no associated backing-store object */
  result->next = mem->virt_barray_list; /* add to list of virtual arrays */
  mem->virt_barray_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, %r13d
movq %rdi, %r12
movq 0x8(%rdi), %rbx
movl $0x1, %esi
cmpl $0x1, %r13d
je 0x864a9
movq (%r12), %rax
movl $0xe, 0x28(%rax)
movl %r13d, 0x2c(%rax)
movq (%r12), %rax
movq %r12, %rdi
callq *(%rax)
movl %r13d, %esi
movl $0x98, %edx
movq %r12, %rdi
callq 0x86026
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 0x90(%rbx), %rcx
movq %rcx, 0x30(%rax)
movq %rax, 0x90(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x869b3
addl $-0x1, %ebp
jb 0x86af3
movq 0x8(%rbx), %rsi
movl $0xa8, %edx
movq %rbx, %rdi
callq 0x86cb0
movq $0x0, 0x8(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x86cdb
// File: /workspace/github_cpp_makefile_star2_O3/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 0x86bd6
movq %rsi, %rbx
movl 0xc(%rsi), %esi
movl 0x18(%rbx), %ecx
movl 0x1c(%rbx), %r15d
movq %rsi, 0x8(%rsp)
imulq %rsi, %r15
xorl %esi, %esi
testl %edx, %edx
setne %sil
leaq 0x38(%rbx), %r12
leaq 0x38(,%rsi,8), %r14
xorl %ebp, %ebp
movl %ecx, %ecx
subq %rbp, %rax
cmpq %rcx, %rax
cmovgeq %rcx, %rax
movl 0x8(%rbx), %r13d
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 0x86bd6
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 0x86b74
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x86c97
movq %rsi, %rbx
movl 0xc(%rsi), %ebp
shlq $0x7, %rbp
movl 0x18(%rsi), %ecx
movl 0x1c(%rsi), %r15d
imulq %rbp, %r15
xorl %esi, %esi
testl %edx, %edx
setne %sil
leaq 0x38(%rbx), %rdx
movq %rdx, 0x8(%rsp)
leaq 0x38(,%rsi,8), %r14
xorl %r12d, %r12d
movl %ecx, %ecx
subq %r12, %rax
cmpq %rcx, %rax
cmovgeq %rcx, %rax
movl 0x8(%rbx), %r13d
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 0x86c97
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 0x86c35
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x86d10
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
cmpl $0x9, %esi
jl 0x86cfd
leaq 0x2530b(%rip), %rsi     # 0xac000
movq %rbx, %rdi
callq 0x920b4
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_O3/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 0x86d24
movq %rdx, %rax
testq %rdx, %rdx
je 0x86d2a
cmpq $0x7, %rsi
jbe 0x86d30
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 0x2570e(%rip), %rax     # 0xac45c
addq %rsi, %rax
movq %rax, %rsi
jmp 0xe1f0
// File: /workspace/github_cpp_makefile_star2_O3/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
movl %edx, %ecx
movq %rdi, %rbx
movl %edx, %eax
mull %esi
jno 0x86d7a
leaq 0x252b3(%rip), %rsi     # 0xac021
movq %rbx, %rdi
callq 0x9214d
xorl %eax, %eax
jmp 0x86da3
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 0x91fa8
movl %ebp, 0x120(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x86ebd
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq (%rsi), %r15
testq %r15, %r15
je 0x86eb8
movq %rdi, %r14
movq %r15, %rsi
callq 0x86ebe
movq 0x418(%r14), %rdx
movq 0x428(%r14), %rsi
movq %r15, %rdi
callq 0x91f57
movq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x86f61
cmpl $0x0, 0x3f0(%r14)
je 0x86f06
movq 0x3f8(%r14), %rsi
movq %r14, %rdi
callq 0x92016
movq $0x0, 0x3f8(%r14)
movl $0x0, 0x3f0(%r14)
testq %rbx, %rbx
je 0x86f21
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_O3/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 0x86f54
cmpl $0x2, %edx
je 0x86f4c
cmpl $0x1, %edx
jne 0x86f55
orl %ecx, 0xe4(%rsi)
retq
notl %ecx
andl %ecx, 0xe4(%rsi)
retq
leaq 0x250e8(%rip), %rsi     # 0xac044
jmp 0x9214d
// File: /workspace/github_cpp_makefile_star2_O3/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 0x87491
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x3d0(%rdi), %rdi
testq %rdi, %rdi
jne 0x873c6
movl $0x1d, %esi
movq %rbx, %rdi
callq 0x91fa8
movq %rax, %rdi
movq %rax, 0x3d0(%rbx)
movzbl 0x3(%r14), %ecx
andl $0x1f, %ecx
movzbl 0x2(%r14), %eax
movl %eax, %edx
decl %edx
imull $0x2aab, %edx, %edx     # imm = 0x2AAB
movl %edx, %esi
shrl $0x1f, %esi
shrl $0x11, %edx
addl %esi, %edx
shll $0x2, %edx
leal (%rdx,%rdx,2), %edx
negl %edx
addl %edx, %eax
decl %eax
movswq %ax, %rax
leaq 0x25072(%rip), %rdx     # 0xac470
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 0x24c02(%rip), %rdx     # 0xac06e
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_O3/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 0x874ef
movl 0x3f0(%rdi), %ecx
testl %ecx, %ecx
jle 0x874ef
movq 0x3f8(%rdi), %rdx
leal (%rcx,%rcx,4), %edi
addq %rdi, %rdx
addq $-0x5, %rdx
movl (%rsi), %esi
cmpl (%rdx), %esi
je 0x874f0
addq $-0x5, %rdx
decl %ecx
jne 0x874e3
retq
movzbl 0x4(%rdx), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x87a80
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 0x24a7c(%rip), %xmm1    # 0xac4a0
mulpd %xmm1, %xmm0
movapd 0x1a5e0(%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_O3/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 0x87c4f
movq %rsi, %r14
movq %rdi, %rbx
ucomisd 0x2494a(%rip), %xmm0    # 0xac530
jbe 0x87bff
leaq 0x24951(%rip), %rsi     # 0xac540
movq %rbx, %rdi
callq 0x9214d
movsd 0x24931(%rip), %xmm0    # 0xac530
cvtsd2ss %xmm0, %xmm1
movss %xmm1, 0x34(%r14)
movsd 0x24927(%rip), %xmm1    # 0xac538
mulsd %xmm0, %xmm1
addsd 0x1a413(%rip), %xmm1    # 0xa2030
cvttsd2si %xmm1, %eax
movl %eax, 0x148(%r14)
orb $0x1, 0x8(%r14)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x87c4f
jp 0x87c4f
leaq 0x2491b(%rip), %rsi     # 0xac55b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9214d
addq $0x8, %rsp
popq %rbx
popq %r14
retq