LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: cmyk_ycck_convert
METHODDEF(void)
cmyk_ycck_convert (j_compress_ptr cinfo,
		   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		   JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register INT32 * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr0, outptr1, outptr2, outptr3;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr0 = output_buf[0][output_row];
    outptr1 = output_buf[1][output_row];
    outptr2 = output_buf[2][output_row];
    outptr3 = output_buf[3][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
      g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
      b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
      /* K passes through as-is */
      outptr3[col] = inptr[3];	/* don't need GETJSAMPLE here */
      inptr += 4;
      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
       * must be too; we do not need an explicit range-limiting operation.
       * Hence the value being shifted is never negative, and we don't
       * need the general RIGHT_SHIFT macro.
       */
      /* Y */
      outptr0[col] = (JSAMPLE)
		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
		 >> SCALEBITS);
      /* Cb */
      outptr1[col] = (JSAMPLE)
		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
		 >> SCALEBITS);
      /* Cr */
      outptr2[col] = (JSAMPLE)
		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
		 >> SCALEBITS);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, -0xc(%rsp)
movq %rdx, -0x8(%rsp)
testl %r8d, %r8d
jle 0x7703c
movq 0x1d8(%rdi), %rax
movq 0x10(%rax), %rax
movl 0x30(%rdi), %ecx
movl $0xff, %r9d
testq %rcx, %rcx
je 0x77023
movl -0xc(%rsp), %r14d
movq -0x8(%rsp), %rdx
movq (%rdx), %r10
movq 0x8(%rdx), %r11
movq (%r10,%r14,8), %r10
movq (%r11,%r14,8), %r11
movq 0x10(%rdx), %rbx
movq (%rbx,%r14,8), %rbx
movq 0x18(%rdx), %r15
movq (%r15,%r14,8), %r14
movq (%rsi), %r15
xorl %r12d, %r12d
movzbl (%r15,%r12,4), %r13d
xorl %r9d, %r13d
movzbl 0x1(%r15,%r12,4), %ebp
xorl %r9d, %ebp
movzbl 0x2(%r15,%r12,4), %edi
xorl %r9d, %edi
movb 0x3(%r15,%r12,4), %dl
movb %dl, (%r14,%r12)
movl 0x800(%rax,%rbp,8), %edx
addl (%rax,%r13,8), %edx
addl 0x1000(%rax,%rdi,8), %edx
shrl $0x10, %edx
movb %dl, (%r10,%r12)
movl 0x2000(%rax,%rbp,8), %edx
addl 0x1800(%rax,%r13,8), %edx
addl 0x2800(%rax,%rdi,8), %edx
shrl $0x10, %edx
movb %dl, (%r11,%r12)
movl 0x3000(%rax,%rbp,8), %edx
addl 0x2800(%rax,%r13,8), %edx
addl 0x3800(%rax,%rdi,8), %edx
shrl $0x10, %edx
movb %dl, (%rbx,%r12)
incq %r12
cmpq %r12, %rcx
jne 0x76fa5
leal -0x1(%r8), %r10d
addq $0x8, %rsi
incl -0xc(%rsp)
cmpl $0x2, %r8d
movl %r10d, %r8d
jge 0x76f6d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: sep_downsample
METHODDEF(void)
sep_downsample (j_compress_ptr cinfo,
		JSAMPIMAGE input_buf, JDIMENSION in_row_index,
		JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
{
  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
  int ci;
  jpeg_component_info * compptr;
  JSAMPARRAY in_ptr, out_ptr;

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    in_ptr = input_buf[ci] + in_row_index;
    out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
    (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
  }
}

// Assembly:
cmpl $0x0, 0x4c(%rdi)
jle 0x77273
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r15d
movq %rcx, %rbp
movq %rsi, %rbx
movq %rdi, %r12
movq 0x58(%rdi), %r13
movq 0x1e0(%rdi), %rcx
movq %rcx, 0x10(%rsp)
movl %edx, %ecx
xorl %r14d, %r14d
shlq $0x3, %rcx
movq %rcx, 0x8(%rsp)
movq (%rbx,%r14,8), %rdx
addq 0x8(%rsp), %rdx
movl 0xc(%r13), %ecx
imull %r15d, %ecx
shlq $0x3, %rcx
addq (%rbp,%r14,8), %rcx
movq %r12, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rax
callq *0x18(%rax,%r14,8)
incq %r14
addq $0x60, %r13
movslq 0x4c(%r12), %rax
cmpq %rax, %r14
jl 0x7722a
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/jcsample.c
// Function: fullsize_downsample
METHODDEF(void)
fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		     JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  /* Copy the data */
  jcopy_sample_rows(input_data, 0, output_data, 0,
		    cinfo->max_v_samp_factor, cinfo->image_width);
  /* Edge-expand */
  expand_right_edge(output_data, cinfo->max_v_samp_factor,
		    cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x30(%rdi), %r9d
movl 0x13c(%rdi), %r8d
movq %rdx, %rdi
xorl %esi, %esi
movq %rcx, %rdx
xorl %ecx, %ecx
callq 0x86abf
movslq 0x13c(%r15), %r12
testq %r12, %r12
setle %al
movl 0x30(%r15), %r15d
movl 0x1c(%r14), %r14d
shll $0x3, %r14d
movl %r14d, %ecx
subl %r15d, %ecx
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x77492
movl %r15d, %eax
notl %eax
addl %eax, %r14d
incq %r14
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rdi
movzbl -0x1(%rdi,%r15), %esi
addq %r15, %rdi
movq %r14, %rdx
callq 0xe260
incq %r13
cmpq %r13, %r12
jne 0x77475
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: h2v1_downsample
METHODDEF(void)
h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int outrow;
  JDIMENSION outcol;
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  register JSAMPROW inptr, outptr;
  register int bias;

  /* Expand input data enough to let all the output samples be generated
   * by the standard loop.  Special-casing padded output would be more
   * efficient.
   */
  expand_right_edge(input_data, cinfo->max_v_samp_factor,
		    cinfo->image_width, output_cols * 2);

  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
    outptr = output_data[outrow];
    inptr = input_data[outrow];
    bias = 0;			/* bias = 0,1,0,1,... for successive samples */
    for (outcol = 0; outcol < output_cols; outcol++) {
      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])
			      + bias) >> 1);
      bias ^= 1;		/* 0=>1, 1=>0 */
      inptr += 2;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movl 0x1c(%rsi), %ebp
movslq 0x13c(%rdi), %r13
testq %r13, %r13
setle %al
movl 0x30(%rdi), %ebx
movl %ebp, %r12d
shll $0x4, %r12d
movl %r12d, %ecx
subl %ebx, %ecx
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x77508
movl %ebx, %eax
notl %eax
addl %eax, %r12d
incq %r12
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
movzbl -0x1(%rdi,%rbx), %esi
addq %rbx, %rdi
movq %r12, %rdx
callq 0xe260
incq %r15
cmpq %r15, %r13
jne 0x774ec
movq 0x8(%rsp), %rbx
cmpl $0x0, 0xc(%rbx)
movq 0x10(%rsp), %r11
jle 0x7755f
shll $0x3, %ebp
movl %ebp, %eax
xorl %ecx, %ecx
testl %ebp, %ebp
je 0x77553
movq (%r14,%rcx,8), %rdx
movq (%r11,%rcx,8), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movzbl (%rdx,%rdi,2), %r9d
movzbl 0x1(%rdx,%rdi,2), %r10d
addl %r8d, %r9d
addl %r10d, %r9d
shrl %r9d
movb %r9b, (%rsi,%rdi)
xorl $0x1, %r8d
incq %rdi
cmpl %edi, %eax
jne 0x77530
incq %rcx
movslq 0xc(%rbx), %rdx
cmpq %rdx, %rcx
jl 0x7751f
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/jcsample.c
// Function: h2v2_downsample
METHODDEF(void)
h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int inrow, outrow;
  JDIMENSION outcol;
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  register JSAMPROW inptr0, inptr1, outptr;
  register int bias;

  /* Expand input data enough to let all the output samples be generated
   * by the standard loop.  Special-casing padded output would be more
   * efficient.
   */
  expand_right_edge(input_data, cinfo->max_v_samp_factor,
		    cinfo->image_width, output_cols * 2);

  inrow = 0;
  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
    outptr = output_data[outrow];
    inptr0 = input_data[inrow];
    inptr1 = input_data[inrow+1];
    bias = 1;			/* bias = 1,2,1,2,... for successive samples */
    for (outcol = 0; outcol < output_cols; outcol++) {
      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
			      GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])
			      + bias) >> 2);
      bias ^= 3;		/* 1=>2, 2=>1 */
      inptr0 += 2; inptr1 += 2;
    }
    inrow += 2;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movl 0x1c(%rsi), %ebp
movslq 0x13c(%rdi), %r13
testq %r13, %r13
setle %al
movl 0x30(%rdi), %ebx
movl %ebp, %r12d
shll $0x4, %r12d
movl %r12d, %ecx
subl %ebx, %ecx
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x7789e
movl %ebx, %eax
notl %eax
addl %eax, %r12d
incq %r12
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
movzbl -0x1(%rdi,%rbx), %esi
addq %rbx, %rdi
movq %r12, %rdx
callq 0xe260
incq %r15
cmpq %r15, %r13
jne 0x77882
movq 0x8(%rsp), %r13
cmpl $0x0, 0xc(%r13)
movq 0x10(%rsp), %r12
jle 0x77918
shll $0x3, %ebp
movl %ebp, %eax
xorl %ecx, %ecx
xorl %edx, %edx
testl %ebp, %ebp
je 0x77908
movq (%r14,%rdx,8), %rsi
movq 0x8(%r14,%rdx,8), %rdi
movq (%r12,%rcx,8), %r8
movl $0x1, %r9d
xorl %r10d, %r10d
movzbl (%rsi,%r10,2), %r11d
movzbl 0x1(%rsi,%r10,2), %ebx
movzbl (%rdi,%r10,2), %r15d
addl %ebx, %r15d
movzbl 0x1(%rdi,%r10,2), %ebx
addl %r9d, %r11d
addl %r15d, %r11d
addl %ebx, %r11d
shrl $0x2, %r11d
movb %r11b, (%r8,%r10)
xorl $0x3, %r9d
incq %r10
cmpl %r10d, %eax
jne 0x778d2
addq $0x2, %rdx
incq %rcx
movslq 0xc(%r13), %rsi
cmpq %rsi, %rcx
jl 0x778b8
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/jchuff.c
// Function: jinit_huff_encoder
GLOBAL(void)
jinit_huff_encoder (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy;
  int i;

  entropy = (huff_entropy_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(huff_entropy_encoder));
  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
  entropy->pub.start_pass = start_pass_huff;

  /* Mark tables unallocated */
  for (i = 0; i < NUM_HUFF_TBLS; i++) {
    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
#ifdef ENTROPY_OPT_SUPPORTED
    entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;
#endif
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0xc0, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x1f0(%rbx)
leaq 0x35(%rip), %rcx        # 0x77f2b
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movq $-0x4, %rcx
movups %xmm0, 0x80(%rax,%rcx,8)
movups %xmm0, 0xc0(%rax,%rcx,8)
movups %xmm0, 0xa0(%rax,%rcx,8)
addq $0x2, %rcx
jne 0x77f0b
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: finish_pass_gather
METHODDEF(void)
finish_pass_gather (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  int ci, dctbl, actbl;
  jpeg_component_info * compptr;
  JHUFF_TBL **htblptr;
  jboolean did_dc[NUM_HUFF_TBLS];
  jboolean did_ac[NUM_HUFF_TBLS];

  /* It's important not to apply jpeg_gen_optimal_table more than once
   * per table, because it clobbers the input frequency counts!
   */
  MEMZERO(did_dc, SIZEOF(did_dc));
  MEMZERO(did_ac, SIZEOF(did_ac));

  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
    compptr = cinfo->cur_comp_info[ci];
    dctbl = compptr->dc_tbl_no;
    actbl = compptr->ac_tbl_no;
    if (! did_dc[dctbl]) {
      htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];
      if (*htblptr == NULL)
	*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);
      did_dc[dctbl] = TRUE;
    }
    if (! did_ac[actbl]) {
      htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];
      if (*htblptr == NULL)
	*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);
      did_ac[actbl] = TRUE;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq 0x1f0(%rdi), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
cmpl $0x0, 0x144(%rdi)
jle 0x783b3
movq %rdi, %rbx
xorl %r15d, %r15d
movq 0x148(%rbx,%r15,8), %rax
movslq 0x14(%rax), %r13
movslq 0x18(%rax), %r12
cmpl $0x0, 0x10(%rsp,%r13,4)
jne 0x7835e
cmpq $0x0, 0x80(%rbx,%r13,8)
jne 0x7833d
movq %rbx, %rdi
callq 0x86a82
movq %rax, 0x80(%rbx,%r13,8)
movq 0x80(%rbx,%r13,8), %rsi
movq 0x80(%r14,%r13,8), %rdx
movq %rbx, %rdi
callq 0x77c97
movl $0x1, 0x10(%rsp,%r13,4)
cmpl $0x0, (%rsp,%r12,4)
jne 0x783a0
cmpq $0x0, 0xa0(%rbx,%r12,8)
jne 0x78380
movq %rbx, %rdi
callq 0x86a82
movq %rax, 0xa0(%rbx,%r12,8)
movq 0xa0(%rbx,%r12,8), %rsi
movq 0xa0(%r14,%r12,8), %rdx
movq %rbx, %rdi
callq 0x77c97
movl $0x1, (%rsp,%r12,4)
incq %r15
movslq 0x144(%rbx), %rax
cmpq %rax, %r15
jl 0x7830a
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: finish_pass_huff
METHODDEF(void)
finish_pass_huff (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  working_state state;

  /* Load up working state ... flush_bits needs it */
  state.next_output_byte = cinfo->dest->next_output_byte;
  state.free_in_buffer = cinfo->dest->free_in_buffer;
  ASSIGN_STATE(state.cur, entropy->saved);
  state.cinfo = cinfo;

  /* Flush out the last data */
  if (! flush_bits(&state))
    ERREXIT(cinfo, JERR_CANT_SUSPEND);

  /* Update state */
  cinfo->dest->next_output_byte = state.next_output_byte;
  cinfo->dest->free_in_buffer = state.free_in_buffer;
  ASSIGN_STATE(entropy->saved, state.cur);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq 0x1f0(%rdi), %rax
movq 0x28(%rdi), %rcx
movq (%rcx), %rdx
leaq 0x18(%rsp), %r14
movq %rdx, -0x10(%r14)
movq 0x8(%rcx), %rcx
movq %rcx, -0x8(%r14)
leaq 0x18(%rax), %r15
movups 0x18(%rax), %xmm0
movups 0x28(%rax), %xmm1
movups %xmm0, (%r14)
movups %xmm1, 0x10(%r14)
movq %rdi, 0x20(%r14)
leaq 0x8(%rsp), %rdi
callq 0x78d56
testl %eax, %eax
jne 0x78d25
movq (%rbx), %rax
movl $0x18, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rbx), %rcx
movq %rax, (%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rcx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: flush_bits
LOCAL(jboolean)
flush_bits (working_state * state)
{
  if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
    return FALSE;
  state->cur.put_buffer = 0;	/* and reset bit-buffer to empty */
  state->cur.put_bits = 0;
  return TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x18(%rdi), %eax
movb $0x11, %cl
subb %al, %cl
movl $0x7f, %r14d
shlq %cl, %r14
addl $0x7, %eax
orq 0x10(%rdi), %r14
movl %eax, %r15d
cmpl $0x8, %eax
jl 0x78e18
movl %r14d, %eax
shrl $0x10, %eax
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movb %al, (%rcx)
decq 0x8(%rbx)
jne 0x78dbd
movq 0x30(%rbx), %rdi
movq 0x28(%rdi), %r12
callq *0x18(%r12)
testl %eax, %eax
je 0x78e09
movq (%r12), %rax
movq %rax, (%rbx)
movq 0x8(%r12), %rax
movq %rax, 0x8(%rbx)
movl %r14d, %eax
notl %eax
testl $0xff0000, %eax         # imm = 0xFF0000
jne 0x78dfd
movq (%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%rbx)
movb $0x0, (%rax)
decq 0x8(%rbx)
jne 0x78dfd
movq 0x30(%rbx), %rdi
movq 0x28(%rdi), %r12
callq *0x18(%r12)
testl %eax, %eax
je 0x78e09
movq (%r12), %rax
movq %rax, (%rbx)
movq 0x8(%r12), %rax
movq %rax, 0x8(%rbx)
shlq $0x8, %r14
leal -0x8(%r15), %eax
movb $0x1, %cl
jmp 0x78e0e
xorl %ecx, %ecx
movl %r15d, %eax
testb %cl, %cl
jne 0x78d78
jmp 0x78e20
movq %r14, 0x10(%rbx)
movl %r15d, 0x18(%rbx)
xorl %eax, %eax
cmpl $0x7, %r15d
jg 0x78e3c
movq $0x0, 0x10(%rbx)
movl $0x0, 0x18(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: encode_mcu_DC_refine
METHODDEF(jboolean)
encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  register int temp;
  int blkn;
  int Al = cinfo->Al;
  JBLOCKROW block;

  entropy->next_output_byte = cinfo->dest->next_output_byte;
  entropy->free_in_buffer = cinfo->dest->free_in_buffer;

  /* Emit restart marker if needed */
  if (cinfo->restart_interval)
    if (entropy->restarts_to_go == 0)
      emit_restart(entropy, entropy->next_restart_num);

  /* Encode the MCU data blocks */
  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
    block = MCU_data[blkn];

    /* We simply emit the Al'th bit of the DC coefficient value. */
    temp = (*block)[0];
    emit_bits(entropy, (unsigned int) (temp >> Al), 1);
  }

  cinfo->dest->next_output_byte = entropy->next_output_byte;
  cinfo->dest->free_in_buffer = entropy->free_in_buffer;

  /* Update restart-interval state too */
  if (cinfo->restart_interval) {
    if (entropy->restarts_to_go == 0) {
      entropy->restarts_to_go = cinfo->restart_interval;
      entropy->next_restart_num++;
      entropy->next_restart_num &= 7;
    }
    entropy->restarts_to_go--;
  }

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r14
movq 0x1f0(%rdi), %rbx
movl 0x1a8(%rdi), %ebp
movq 0x28(%rdi), %rax
movq (%rax), %rcx
movq %rcx, 0x20(%rbx)
movq 0x8(%rax), %rax
movq %rax, 0x28(%rbx)
cmpl $0x0, 0x118(%rdi)
je 0x794d5
cmpl $0x0, 0x70(%rbx)
jne 0x794d5
movl 0x74(%rbx), %esi
movq %rbx, %rdi
callq 0x799ff
cmpl $0x0, 0x170(%r14)
jle 0x7959c
xorl %r12d, %r12d
cmpl $0x0, 0x18(%rbx)
jne 0x79589
movl 0x38(%rbx), %r13d
movq (%rsp), %rax
movq (%rax,%r12,8), %rax
movswl (%rax), %eax
xorl %r15d, %r15d
btl %ebp, %eax
setb %r15b
movb $0x17, %cl
subb %r13b, %cl
shlq %cl, %r15
orq 0x30(%rbx), %r15
cmpl $0x7, %r13d
jl 0x7957e
addl $0x9, %r13d
movl %r15d, %eax
shrl $0x10, %eax
movq 0x20(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rbx)
movb %al, (%rcx)
decq 0x28(%rbx)
jne 0x79541
movq %rbx, %rdi
callq 0x79d4a
movl %r15d, %eax
notl %eax
testl $0xff0000, %eax         # imm = 0xFF0000
jne 0x7956a
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $0x0, (%rax)
decq 0x28(%rbx)
jne 0x7956a
movq %rbx, %rdi
callq 0x79d4a
shlq $0x8, %r15
addl $-0x8, %r13d
cmpl $0xf, %r13d
jg 0x7951f
addl $-0x8, %r13d
jmp 0x79581
incl %r13d
movq %r15, 0x30(%rbx)
movl %r13d, 0x38(%rbx)
incq %r12
movslq 0x170(%r14), %rax
cmpq %rax, %r12
jl 0x794e6
movq 0x20(%rbx), %rax
movq 0x28(%r14), %rcx
movq %rax, (%rcx)
movq 0x28(%rbx), %rax
movq %rax, 0x8(%rcx)
movl 0x118(%r14), %eax
testl %eax, %eax
je 0x795d1
cmpl $0x0, 0x70(%rbx)
jne 0x795ce
movl %eax, 0x70(%rbx)
movl 0x74(%rbx), %eax
incl %eax
andl $0x7, %eax
movl %eax, 0x74(%rbx)
decl 0x70(%rbx)
movl $0x1, %eax
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/jcphuff.c
// Function: finish_pass_gather_phuff
METHODDEF(void)
finish_pass_gather_phuff (j_compress_ptr cinfo)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  jboolean is_DC_band;
  int ci, tbl;
  jpeg_component_info * compptr;
  JHUFF_TBL **htblptr;
  jboolean did[NUM_HUFF_TBLS];

  /* Flush out buffered data (all we care about is counting the EOB symbol) */
  emit_eobrun(entropy);

  is_DC_band = (cinfo->Ss == 0);

  /* It's important not to apply jpeg_gen_optimal_table more than once
   * per table, because it clobbers the input frequency counts!
   */
  MEMZERO(did, SIZEOF(did));

  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
    compptr = cinfo->cur_comp_info[ci];
    if (is_DC_band) {
      if (cinfo->Ah != 0)	/* DC refinement needs no table */
	continue;
      tbl = compptr->dc_tbl_no;
    } else {
      tbl = compptr->ac_tbl_no;
    }
    if (! did[tbl]) {
      if (is_DC_band)
        htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];
      else
        htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];
      if (*htblptr == NULL)
        *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);
      did[tbl] = TRUE;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x1f0(%rdi), %r14
movq %r14, %rdi
callq 0x79b8b
movl 0x19c(%rbx), %ebp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
cmpl $0x0, 0x144(%rbx)
jle 0x799a4
xorl %eax, %eax
testl %ebp, %ebp
setne %al
shll $0x5, %eax
leaq (%rbx,%rax), %r15
addq $0x80, %r15
xorl %r12d, %r12d
movq 0x148(%rbx,%r12,8), %rax
movl $0x18, %ecx
testl %ebp, %ebp
je 0x79983
movslq (%rax,%rcx), %r13
cmpl $0x0, (%rsp,%r13,4)
jne 0x7998c
cmpq $0x0, (%r15,%r13,8)
jne 0x79965
movq %rbx, %rdi
callq 0x86a82
movq %rax, (%r15,%r13,8)
movq (%r15,%r13,8), %rsi
movq 0x98(%r14,%r13,8), %rdx
movq %rbx, %rdi
callq 0x77c97
movl $0x1, (%rsp,%r13,4)
jmp 0x7998c
cmpl $0x0, 0x1a4(%rbx)
je 0x7999d
incq %r12
movslq 0x144(%rbx), %rax
cmpq %rax, %r12
jl 0x79936
jmp 0x799a4
movl $0x14, %ecx
jmp 0x79947
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/jcphuff.c
// Function: finish_pass_phuff
METHODDEF(void)
finish_pass_phuff (j_compress_ptr cinfo)
{   
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;

  entropy->next_output_byte = cinfo->dest->next_output_byte;
  entropy->free_in_buffer = cinfo->dest->free_in_buffer;

  /* Flush out any buffered data */
  emit_eobrun(entropy);
  flush_bits(entropy);

  cinfo->dest->next_output_byte = entropy->next_output_byte;
  cinfo->dest->free_in_buffer = entropy->free_in_buffer;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x1f0(%rdi), %r14
movq (%rax), %rcx
movq %rcx, 0x20(%r14)
movq 0x8(%rax), %rax
movq %rax, 0x28(%r14)
movq %r14, %rdi
callq 0x79b8b
movq %r14, %rdi
callq 0x79ca3
movq 0x20(%r14), %rax
movq 0x28(%rbx), %rcx
movq %rax, (%rcx)
movq 0x28(%r14), %rax
movq %rax, 0x8(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: emit_restart
LOCAL(void)
emit_restart (phuff_entropy_ptr entropy, int restart_num)
{
  int ci;

  emit_eobrun(entropy);

  if (! entropy->gather_statistics) {
    flush_bits(entropy);
    emit_byte(entropy, 0xFF);
    emit_byte(entropy, JPEG_RST0 + restart_num);
  }

  if (entropy->cinfo->Ss == 0) {
    /* Re-initialize DC predictions to 0 */
    for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)
      entropy->last_dc_val[ci] = 0;
  } else {
    /* Re-initialize all AC-related fields to 0 */
    entropy->EOBRUN = 0;
    entropy->BE = 0;
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x79b8b
cmpl $0x0, 0x18(%rbx)
jne 0x79a58
movq %rbx, %rdi
callq 0x79ca3
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $-0x1, (%rax)
decq 0x28(%rbx)
jne 0x79a37
movq %rbx, %rdi
callq 0x79d4a
addb $-0x30, %bpl
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb %bpl, (%rax)
decq 0x28(%rbx)
jne 0x79a58
movq %rbx, %rdi
callq 0x79d4a
movq 0x40(%rbx), %rax
cmpl $0x0, 0x19c(%rax)
je 0x79a6f
movq $0x0, 0x5c(%rbx)
jmp 0x79a91
cmpl $0x0, 0x144(%rax)
jle 0x79a91
xorl %ecx, %ecx
movl $0x0, 0x48(%rbx,%rcx,4)
incq %rcx
movslq 0x144(%rax), %rdx
cmpq %rdx, %rcx
jl 0x79a7a
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: emit_eobrun
LOCAL(void)
emit_eobrun (phuff_entropy_ptr entropy)
{
  register int temp, nbits;

  if (entropy->EOBRUN > 0) {	/* if there is any pending EOBRUN */
    temp = entropy->EOBRUN;
    nbits = 0;
    while ((temp >>= 1))
      nbits++;
    /* safety check: shouldn't happen given limited correction-bit buffer */
    if (nbits > 14)
      ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);

    emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);
    if (nbits)
      emit_bits(entropy, entropy->EOBRUN, nbits);

    entropy->EOBRUN = 0;

    /* Emit any buffered correction bits */
    emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);
    entropy->BE = 0;
  }
}

// Assembly:
movl 0x5c(%rdi), %eax
testl %eax, %eax
je 0x79ca2
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
cmpl $0x1, %eax
je 0x79bb5
xorl %r14d, %r14d
sarl %eax
incl %r14d
cmpl $0x1, %eax
ja 0x79bab
cmpl $0xf, %r14d
jb 0x79bcb
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
movl $0x28, 0x28(%rax)
callq *(%rax)
movl 0x58(%rbx), %esi
movl %r14d, %edx
shll $0x4, %edx
movq %rbx, %rdi
callq 0x79a98
testl %r14d, %r14d
je 0x79c81
cmpl $0x0, 0x18(%rbx)
jne 0x79c81
movq $-0x1, %r15
movl %r14d, %ecx
shlq %cl, %r15
notl %r15d
andl 0x5c(%rbx), %r15d
addl 0x38(%rbx), %r14d
movb $0x18, %cl
subb %r14b, %cl
shlq %cl, %r15
orq 0x30(%rbx), %r15
cmpl $0x8, %r14d
jl 0x79c77
movl %r15d, %eax
shrl $0x10, %eax
movq 0x20(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rbx)
movb %al, (%rcx)
decq 0x28(%rbx)
jne 0x79c3b
movq %rbx, %rdi
callq 0x79d4a
movl %r15d, %eax
notl %eax
testl $0xff0000, %eax         # imm = 0xFF0000
jne 0x79c64
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $0x0, (%rax)
decq 0x28(%rbx)
jne 0x79c64
movq %rbx, %rdi
callq 0x79d4a
shlq $0x8, %r15
leal -0x8(%r14), %eax
cmpl $0xf, %r14d
movl %eax, %r14d
jg 0x79c19
jmp 0x79c7a
movl %r14d, %eax
movq %r15, 0x30(%rbx)
movl %eax, 0x38(%rbx)
xorl %ebp, %ebp
movl %ebp, 0x5c(%rbx)
movq 0x68(%rbx), %rsi
movl 0x60(%rbx), %edx
movq %rbx, %rdi
callq 0x79d88
movl %ebp, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: dump_buffer
LOCAL(void)
dump_buffer (phuff_entropy_ptr entropy)
/* Empty the output buffer; we do not support suspension in this module. */
{
  struct jpeg_destination_mgr * dest = entropy->cinfo->dest;

  if (! (*dest->empty_output_buffer) (entropy->cinfo))
    ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);
  /* After a successful buffer dump, must reset buffer pointers */
  entropy->next_output_byte = dest->next_output_byte;
  entropy->free_in_buffer = dest->free_in_buffer;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
movq 0x28(%rdi), %r14
callq *0x18(%r14)
testl %eax, %eax
jne 0x79d71
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
movl $0x18, 0x28(%rax)
callq *(%rax)
movq (%r14), %rax
movq %rax, 0x20(%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: emit_buffered_bits
LOCAL(void)
emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,
		    unsigned int nbits)
{
  if (entropy->gather_statistics)
    return;			/* no real work */

  while (nbits > 0) {
    emit_bits(entropy, (unsigned int) (*bufstart), 1);
    bufstart++;
    nbits--;
  }
}

// Assembly:
testl %edx, %edx
je 0x79e4e
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r15
cmpl $0x0, 0x18(%rdi)
jne 0x79e46
movl %edx, %ebx
movq %rsi, %r14
cmpl $0x0, 0x18(%r15)
jne 0x79e3b
movl 0x38(%r15), %ebp
movzbl (%r14), %r12d
andl $0x1, %r12d
movb $0x17, %cl
subb %bpl, %cl
shlq %cl, %r12
orq 0x30(%r15), %r12
cmpl $0x7, %ebp
jl 0x79e31
addl $0x9, %ebp
movl %r12d, %eax
shrl $0x10, %eax
movq 0x20(%r15), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%r15)
movb %al, (%rcx)
decq 0x28(%r15)
jne 0x79df7
movq %r15, %rdi
callq 0x79d4a
movl %r12d, %eax
notl %eax
testl $0xff0000, %eax         # imm = 0xFF0000
jne 0x79e20
movq 0x20(%r15), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%r15)
movb $0x0, (%rax)
decq 0x28(%r15)
jne 0x79e20
movq %r15, %rdi
callq 0x79d4a
shlq $0x8, %r12
addl $-0x8, %ebp
cmpl $0xf, %ebp
jg 0x79dd5
addl $-0x8, %ebp
jmp 0x79e33
incl %ebp
movq %r12, 0x30(%r15)
movl %ebp, 0x38(%r15)
incq %r14
decl %ebx
jne 0x79daa
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcdctmgr.c
// Function: jinit_forward_dct
GLOBAL(void)
jinit_forward_dct (j_compress_ptr cinfo)
{
  my_fdct_ptr fdct;
  int i;

  fdct = (my_fdct_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_fdct_controller));
  cinfo->fdct = (struct jpeg_forward_dct *) fdct;
  fdct->pub.start_pass = start_pass_fdctmgr;

  switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
  case JDCT_ISLOW:
    fdct->pub.forward_DCT = forward_DCT;
    fdct->do_dct = jpeg_fdct_islow;
    break;
#endif
#ifdef DCT_IFAST_SUPPORTED
  case JDCT_IFAST:
    fdct->pub.forward_DCT = forward_DCT;
    fdct->do_dct = jpeg_fdct_ifast;
    break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
  case JDCT_FLOAT:
    fdct->pub.forward_DCT = forward_DCT_float;
    fdct->do_float_dct = jpeg_fdct_float;
    break;
#endif
  default:
    ERREXIT(cinfo, JERR_NOT_COMPILED);
    break;
  }

  /* Mark divisor tables unallocated */
  for (i = 0; i < NUM_QUANT_TBLS; i++) {
    fdct->divisors[i] = NULL;
#ifdef DCT_FLOAT_SUPPORTED
    fdct->float_divisors[i] = NULL;
#endif
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rax
movl $0x60, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, %rbx
movq %rax, 0x1e8(%r14)
leaq 0x86(%rip), %rax        # 0x79efe
movq %rax, (%rbx)
movl 0x114(%r14), %eax
cmpl $0x2, %eax
je 0x79ebc
cmpl $0x1, %eax
je 0x79ea4
testl %eax, %eax
jne 0x79ed4
leaq 0x387(%rip), %rax       # 0x7a21e
movq %rax, 0x8(%rbx)
leaq 0xde6(%rip), %rax       # 0x7ac88
jmp 0x79eb6
leaq 0x373(%rip), %rax       # 0x7a21e
movq %rax, 0x8(%rbx)
leaq 0x612(%rip), %rax       # 0x7a4c8
movq %rax, 0x10(%rbx)
jmp 0x79ee3
leaq 0x486(%rip), %rax       # 0x7a349
movq %rax, 0x8(%rbx)
leaq 0xa22(%rip), %rax       # 0x7a8f0
movq %rax, 0x38(%rbx)
jmp 0x79ee3
movq (%r14), %rax
movl $0x30, 0x28(%rax)
movq %r14, %rdi
callq *(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapimin.c
// Function: jpeg_CreateDecompress
GLOBAL(void)
jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
{
  int i;

  /* Guard against version mismatches between library and caller. */
  cinfo->mem = NULL;		/* so jpeg_destroy knows mem mgr not called */
  if (version != JPEG_LIB_VERSION)
    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
  if (structsize != SIZEOF(struct jpeg_decompress_struct))
    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, 
	     (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);

  /* For debugging purposes, we zero the whole master structure.
   * But the application has already set the err pointer, and may have set
   * client_data, so we have to save and restore those fields.
   * Note: if application hasn't set client_data, tools like Purify may
   * complain here.
   */
  {
    struct jpeg_error_mgr * err = cinfo->err;
    void * client_data = cinfo->client_data; /* ignore Purify complaint here */
    MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));
    cinfo->err = err;
    cinfo->client_data = client_data;
  }
  cinfo->is_decompressor = TRUE;

  /* Initialize a memory manager instance for this object */
  jinit_memory_mgr((j_common_ptr) cinfo);

  /* Zero out pointers to permanent structures. */
  cinfo->progress = NULL;
  cinfo->src = NULL;

  for (i = 0; i < NUM_QUANT_TBLS; i++)
    cinfo->quant_tbl_ptrs[i] = NULL;

  for (i = 0; i < NUM_HUFF_TBLS; i++) {
    cinfo->dc_huff_tbl_ptrs[i] = NULL;
    cinfo->ac_huff_tbl_ptrs[i] = NULL;
  }

  /* Initialize marker processor so application can override methods
   * for COM, APPn markers before calling jpeg_read_header.
   */
  cinfo->marker_list = NULL;
  jinit_marker_reader(cinfo);

  /* And initialize the overall input controller. */
  jinit_input_controller(cinfo);

  /* OK, I'm ready */
  cinfo->global_state = DSTATE_START;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
cmpl $0x3e, %esi
je 0x7b6a6
movq (%rbx), %rax
movabsq $0x3e0000000c, %rcx     # imm = 0x3E0000000C
movq %rcx, 0x28(%rax)
movq (%rbx), %rax
movl %esi, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpq $0x278, %r14            # imm = 0x278
je 0x7b6cf
movq (%rbx), %rax
movabsq $0x27800000015, %rcx    # imm = 0x27800000015
movq %rcx, 0x28(%rax)
movq (%rbx), %rax
movl %r14d, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq (%rbx), %r14
movq 0x18(%rbx), %r15
xorl %r12d, %r12d
movl $0x278, %edx            # imm = 0x278
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe260
movq %r14, (%rbx)
movq %r15, 0x18(%rbx)
movl $0x1, 0x20(%rbx)
movq %rbx, %rdi
callq 0x86cd0
movq %r12, 0x10(%rbx)
movq %r12, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xc8(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xe8(%rbx)
movups %xmm0, 0xf8(%rbx)
movups %xmm0, 0x108(%rbx)
movups %xmm0, 0x118(%rbx)
movq %r12, 0x190(%rbx)
movq %rbx, %rdi
callq 0x7d063
movq %rbx, %rdi
callq 0x7c858
movl $0xc8, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapimin.c
// Function: jpeg_read_header
GLOBAL(int)
jpeg_read_header (j_decompress_ptr cinfo, jboolean require_image)
{
  int retcode;

  if (cinfo->global_state != DSTATE_START &&
      cinfo->global_state != DSTATE_INHEADER)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  retcode = jpeg_consume_input(cinfo);

  switch (retcode) {
  case JPEG_REACHED_SOS:
    retcode = JPEG_HEADER_OK;
    break;
  case JPEG_REACHED_EOI:
    if (require_image)		/* Complain if application wanted an image */
      ERREXIT(cinfo, JERR_NO_IMAGE);
    /* Reset to start state; it would be safer to require the application to
     * call jpeg_abort, but we can't change it now for compatibility reasons.
     * A side effect is to free any temporary memory (there shouldn't be any).
     */
    jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */
    retcode = JPEG_HEADER_TABLES_ONLY;
    break;
  case JPEG_SUSPENDED:
    /* no work */
    break;
  }

  return retcode;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x24(%rdi), %eax
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0xc8, %ecx
je 0x7b794
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x7b7c8
cmpl $0x2, %eax
jne 0x7b7c1
testl %ebp, %ebp
je 0x7b7b4
movq (%rbx), %rax
movl $0x33, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x86a0c
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapimin.c
// Function: jpeg_finish_decompress
GLOBAL(jboolean)
jpeg_finish_decompress (j_decompress_ptr cinfo)
{
  if ((cinfo->global_state == DSTATE_SCANNING ||
       cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {
    /* Terminate final pass of non-buffered mode */
    if (cinfo->output_scanline < cinfo->output_height)
      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
    (*cinfo->master->finish_output_pass) (cinfo);
    cinfo->global_state = DSTATE_STOPPING;
  } else if (cinfo->global_state == DSTATE_BUFIMAGE) {
    /* Finishing after a buffered-image operation */
    cinfo->global_state = DSTATE_STOPPING;
  } else if (cinfo->global_state != DSTATE_STOPPING) {
    /* STOPPING = repeat call after a suspension, anything else is error */
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  }
  /* Read until EOI */
  while (! cinfo->inputctl->eoi_reached) {
    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
      return FALSE;		/* Suspend, come back later */
  }
  /* Do final cleanup */
  (*cinfo->src->term_source) (cinfo);
  /* We can use jpeg_abort to release memory and reset global_state */
  jpeg_abort((j_common_ptr) cinfo);
  return TRUE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %eax
leal -0xcd(%rax), %ecx
cmpl $0x1, %ecx
ja 0x7ba76
cmpl $0x0, 0x58(%rbx)
je 0x7ba9b
cmpl $0xd2, %eax
je 0x7bacc
cmpl $0xcf, %eax
je 0x7bac5
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
jmp 0x7bacc
movl 0xa8(%rbx), %eax
cmpl 0x8c(%rbx), %eax
jae 0x7bab8
movq (%rbx), %rax
movl $0x43, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl $0xd2, 0x24(%rbx)
movq 0x240(%rbx), %rax
cmpl $0x0, 0x24(%rax)
jne 0x7bae6
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
jne 0x7bacc
xorl %eax, %eax
jmp 0x7bafd
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq %rbx, %rdi
callq 0x86a0c
movl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_start_decompress
GLOBAL(jboolean)
jpeg_start_decompress (j_decompress_ptr cinfo)
{
  if (cinfo->global_state == DSTATE_READY) {
    /* First call: initialize master control, select active modules */
    jinit_master_decompress(cinfo);
    if (cinfo->buffered_image) {
      /* No more work here; expecting jpeg_start_output next */
      cinfo->global_state = DSTATE_BUFIMAGE;
      return TRUE;
    }
    cinfo->global_state = DSTATE_PRELOAD;
  }
  if (cinfo->global_state == DSTATE_PRELOAD) {
    /* If file has multiple scans, absorb them all into the coef buffer */
    if (cinfo->inputctl->has_multiple_scans) {
#ifdef D_MULTISCAN_FILES_SUPPORTED
      for (;;) {
	int retcode;
	/* Call progress monitor hook if present */
	if (cinfo->progress != NULL)
	  (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
	/* Absorb some more input */
	retcode = (*cinfo->inputctl->consume_input) (cinfo);
	if (retcode == JPEG_SUSPENDED)
	  return FALSE;
	if (retcode == JPEG_REACHED_EOI)
	  break;
	/* Advance progress counter if appropriate */
	if (cinfo->progress != NULL &&
	    (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
	  if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
	    /* jdmaster underestimated number of scans; ratchet up one scan */
	    cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
	  }
	}
      }
#else
      ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif /* D_MULTISCAN_FILES_SUPPORTED */
    }
    cinfo->output_scan_number = cinfo->input_scan_number;
  } else if (cinfo->global_state != DSTATE_PRESCAN)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  /* Perform any dummy output passes, and set up for the final pass */
  return output_pass_setup(cinfo);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0xca, 0x24(%rdi)
jne 0x7bb30
movq %rbx, %rdi
callq 0x7c390
cmpl $0x0, 0x58(%rbx)
je 0x7bb29
movl $0xcf, 0x24(%rbx)
movl $0x1, %eax
popq %rbx
retq
movl $0xcb, 0x24(%rbx)
movl 0x24(%rbx), %eax
cmpl $0xcc, %eax
je 0x7bbfa
cmpl $0xcb, %eax
jne 0x7bbd7
movq 0x240(%rbx), %rax
cmpl $0x0, 0x20(%rax)
je 0x7bbee
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x7bb68
movq %rbx, %rdi
callq *(%rax)
movq 0x240(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
je 0x7bb84
cmpl $0x2, %eax
jne 0x7bb8b
movl $0x2, %eax
jmp 0x7bbc7
movl $0x1, %eax
jmp 0x7bbc7
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
sete %dl
andl $-0x3, %eax
cmpl $0x1, %eax
setne %sil
xorl %eax, %eax
orb %dl, %sil
jne 0x7bbc7
movq 0x8(%rcx), %rsi
movq 0x10(%rcx), %rdx
incq %rsi
movq %rsi, 0x8(%rcx)
cmpq %rdx, %rsi
jl 0x7bbc7
movl 0x1a4(%rbx), %esi
addq %rsi, %rdx
movq %rdx, 0x10(%rcx)
testl %eax, %eax
je 0x7bb5a
cmpl $0x1, %eax
jne 0x7bbee
xorl %eax, %eax
jmp 0x7bb27
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
jmp 0x7bbfa
movl 0xac(%rbx), %eax
movl %eax, 0xb4(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x7bc00
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: output_pass_setup
LOCAL(jboolean)
output_pass_setup (j_decompress_ptr cinfo)
{
  if (cinfo->global_state != DSTATE_PRESCAN) {
    /* First call: do pass setup */
    (*cinfo->master->prepare_for_output_pass) (cinfo);
    cinfo->output_scanline = 0;
    cinfo->global_state = DSTATE_PRESCAN;
  }
  /* Loop over any required dummy passes */
  while (cinfo->master->is_dummy_pass) {
#ifdef QUANT_2PASS_SUPPORTED
    /* Crank through the dummy pass */
    while (cinfo->output_scanline < cinfo->output_height) {
      JDIMENSION last_scanline;
      /* Call progress monitor hook if present */
      if (cinfo->progress != NULL) {
	cinfo->progress->pass_counter = (long) cinfo->output_scanline;
	cinfo->progress->pass_limit = (long) cinfo->output_height;
	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
      }
      /* Process some data */
      last_scanline = cinfo->output_scanline;
      (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
				    &cinfo->output_scanline, (JDIMENSION) 0);
      if (cinfo->output_scanline == last_scanline)
	return FALSE;		/* No progress made, must suspend */
    }
    /* Finish up dummy pass, and set up for another one */
    (*cinfo->master->finish_output_pass) (cinfo);
    (*cinfo->master->prepare_for_output_pass) (cinfo);
    cinfo->output_scanline = 0;
#else
    ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif /* QUANT_2PASS_SUPPORTED */
  }
  /* Ready for application to drive output pass through
   * jpeg_read_scanlines or jpeg_read_raw_data.
   */
  cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0xcc, 0x24(%rdi)
je 0x7bc30
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl $0x0, 0xa8(%rbx)
movl $0xcc, 0x24(%rbx)
movq 0x220(%rbx), %rax
cmpl $0x0, 0x10(%rax)
je 0x7bcc5
leaq 0xa8(%rbx), %r14
movl 0x8c(%rbx), %eax
movl 0xa8(%rbx), %ecx
cmpl %eax, %ecx
jae 0x7bc95
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x7bc6e
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
callq *(%rdx)
movl 0xa8(%rbx), %ebp
movq 0x228(%rbx), %rax
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq *0x8(%rax)
cmpl %ebp, 0xa8(%rbx)
jne 0x7bc48
jmp 0x7bcda
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl $0x0, 0xa8(%rbx)
movq 0x220(%rbx), %rax
cmpl $0x0, 0x10(%rax)
jne 0x7bc48
cmpl $0x1, 0x5c(%rbx)
movl $0xce, %eax
sbbl $0x0, %eax
movl %eax, 0x24(%rbx)
movl $0x1, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_read_scanlines
GLOBAL(JDIMENSION)
jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
		     JDIMENSION max_lines)
{
  JDIMENSION row_ctr;

  if (cinfo->global_state != DSTATE_SCANNING)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  if (cinfo->output_scanline >= cinfo->output_height) {
    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
    return 0;
  }

  /* Call progress monitor hook if present */
  if (cinfo->progress != NULL) {
    cinfo->progress->pass_counter = (long) cinfo->output_scanline;
    cinfo->progress->pass_limit = (long) cinfo->output_height;
    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  }

  /* Process some data */
  row_ctr = 0;
  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
  cinfo->output_scanline += row_ctr;
  return row_ctr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0xcd, %eax
je 0x7bd16
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x8c(%rbx), %eax
movl 0xa8(%rbx), %ecx
cmpl %eax, %ecx
jae 0x7bd68
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x7bd3c
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
callq *(%rdx)
leaq 0x4(%rsp), %r15
movl $0x0, (%r15)
movq 0x228(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq *0x8(%rax)
movl (%r15), %eax
addl %eax, 0xa8(%rbx)
jmp 0x7bd7f
movq (%rbx), %rax
movl $0x7b, 0x28(%rax)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq *0x8(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_read_raw_data
GLOBAL(JDIMENSION)
jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
		    JDIMENSION max_lines)
{
  JDIMENSION lines_per_iMCU_row;

  if (cinfo->global_state != DSTATE_RAW_OK)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  if (cinfo->output_scanline >= cinfo->output_height) {
    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
    return 0;
  }

  /* Call progress monitor hook if present */
  if (cinfo->progress != NULL) {
    cinfo->progress->pass_counter = (long) cinfo->output_scanline;
    cinfo->progress->pass_limit = (long) cinfo->output_height;
    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  }

  /* Verify that at least one iMCU row can be returned. */
  lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
  if (max_lines < lines_per_iMCU_row)
    ERREXIT(cinfo, JERR_BUFFER_SIZE);

  /* Decompress directly into user's buffer. */
  if (! (*cinfo->coef->decompress_data) (cinfo, data))
    return 0;			/* suspension forced, can do nothing more */

  /* OK, we processed one iMCU row. */
  cinfo->output_scanline += lines_per_iMCU_row;
  return lines_per_iMCU_row;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0xce, %eax
je 0x7bdb8
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x8c(%rbx), %eax
movl 0xa8(%rbx), %ecx
cmpl %eax, %ecx
jae 0x7be1e
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x7bdde
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
callq *(%rdx)
movl 0x1a0(%rbx), %r15d
imull 0x19c(%rbx), %r15d
cmpl %ebp, %r15d
jbe 0x7be01
movq (%rbx), %rax
movl $0x17, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x230(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x18(%rax)
testl %eax, %eax
je 0x7be33
addl %r15d, 0xa8(%rbx)
jmp 0x7be36
movq (%rbx), %rax
movl $0x7b, 0x28(%rax)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq *0x8(%rax)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq