LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_start_output
GLOBAL(jboolean)
jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
{
  if (cinfo->global_state != DSTATE_BUFIMAGE &&
      cinfo->global_state != DSTATE_PRESCAN)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  /* Limit scan number to valid range */
  if (scan_number <= 0)
    scan_number = 1;
  if (cinfo->inputctl->eoi_reached &&
      scan_number > cinfo->input_scan_number)
    scan_number = cinfo->input_scan_number;
  cinfo->output_scan_number = scan_number;
  /* Perform any dummy output passes, and set up for the real pass */
  return output_pass_setup(cinfo);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0xcc, %eax
je 0x7be72
cmpl $0xcf, %eax
je 0x7be72
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl $0x2, %ebp
movl $0x1, %eax
cmovgel %ebp, %eax
movq 0x240(%rbx), %rcx
cmpl $0x0, 0x24(%rcx)
je 0x7be95
movl 0xac(%rbx), %ecx
cmpl %ecx, %eax
cmovgel %ecx, %eax
movl %eax, 0xb4(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7bc00
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_finish_output
GLOBAL(jboolean)
jpeg_finish_output (j_decompress_ptr cinfo)
{
  if ((cinfo->global_state == DSTATE_SCANNING ||
       cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
    /* Terminate this pass. */
    /* We do not require the whole pass to have been completed. */
    (*cinfo->master->finish_output_pass) (cinfo);
    cinfo->global_state = DSTATE_BUFPOST;
  } else if (cinfo->global_state != DSTATE_BUFPOST) {
    /* BUFPOST = repeat call after a suspension, anything else is error */
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  }
  /* Read markers looking for SOS or EOI */
  while (cinfo->input_scan_number <= cinfo->output_scan_number &&
	 ! cinfo->inputctl->eoi_reached) {
    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
      return FALSE;		/* Suspend, come back later */
  }
  cinfo->global_state = DSTATE_BUFIMAGE;
  return TRUE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %eax
leal -0xcd(%rax), %ecx
cmpl $0x1, %ecx
ja 0x7bed7
cmpl $0x0, 0x58(%rbx)
je 0x7bed7
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl $0xd0, 0x24(%rbx)
jmp 0x7bef3
cmpl $0xd0, %eax
je 0x7bef3
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0xac(%rbx), %eax
cmpl 0xb4(%rbx), %eax
jg 0x7bf1b
movq 0x240(%rbx), %rax
cmpl $0x0, 0x24(%rax)
jne 0x7bf1b
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
jne 0x7bef3
xorl %eax, %eax
jmp 0x7bf27
movl $0xcf, 0x24(%rbx)
movl $0x1, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdatasrc.c
// Function: jpeg_stdio_src
GLOBAL(void)
jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
{
  my_src_ptr src;

  /* The source object and input buffer are made permanent so that a series
   * of JPEG images can be read from the same file by calling jpeg_stdio_src
   * only before the first one.  (If we discarded the buffer at the end of
   * one image, we'd likely lose the start of the next one.)
   * This makes it unsafe to use this manager and a different source
   * manager serially with the same JPEG object.  Caveat programmer.
   */
  if (cinfo->src == NULL) {	/* first time for this JPEG object? */
    cinfo->src = (struct jpeg_source_mgr *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
				  SIZEOF(my_source_mgr));
    src = (my_src_ptr) cinfo->src;
    src->buffer = (JOCTET *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
				  INPUT_BUF_SIZE * SIZEOF(JOCTET));
  }

  src = (my_src_ptr) cinfo->src;
  src->pub.init_source = init_source;
  src->pub.fill_input_buffer = fill_input_buffer;
  src->pub.skip_input_data = skip_input_data;
  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
  src->pub.term_source = term_source;
  src->infile = infile;
  src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
  src->pub.next_input_byte = NULL; /* until buffer loaded */
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x28(%rdi)
jne 0x7bf69
movq 0x8(%r14), %rax
movl $0x50, %edx
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movq %rax, %r15
movq %rax, 0x28(%r14)
movq 0x8(%r14), %rax
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movq %rax, 0x40(%r15)
movq 0x28(%r14), %rax
leaq 0x40(%rip), %rcx        # 0x7bfb4
movq %rcx, 0x10(%rax)
leaq 0x41(%rip), %rcx        # 0x7bfc0
movq %rcx, 0x18(%rax)
leaq 0xbc(%rip), %rcx        # 0x7c046
movq %rcx, 0x20(%rax)
leaq 0xe93(%rip), %rcx       # 0x7ce28
movq %rcx, 0x28(%rax)
leaq 0xe7(%rip), %rcx        # 0x7c087
movq %rcx, 0x30(%rax)
movq %rbx, 0x38(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdatasrc.c
// Function: fill_input_buffer
METHODDEF(jboolean)
fill_input_buffer (j_decompress_ptr cinfo)
{
  my_src_ptr src = (my_src_ptr) cinfo->src;
  size_t nbytes;

  nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);

  if (nbytes <= 0) {
    if (src->start_of_file)	/* Treat empty input file as fatal error */
      ERREXIT(cinfo, JERR_INPUT_EMPTY);
    WARNMS(cinfo, JWRN_JPEG_EOF);
    /* Insert a fake EOI marker */
    src->buffer[0] = (JOCTET) 0xFF;
    src->buffer[1] = (JOCTET) JPEG_EOI;
    nbytes = 2;
  }

  src->pub.next_input_byte = src->buffer;
  src->pub.bytes_in_buffer = nbytes;
  src->start_of_file = FALSE;

  return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movq 0x38(%r14), %rcx
movq 0x40(%r14), %rdi
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0xe6c0
testq %rax, %rax
jne 0x7c026
cmpl $0x0, 0x48(%r14)
je 0x7bffd
movq (%rbx), %rax
movl $0x2a, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq (%rbx), %rax
movl $0x78, 0x28(%rax)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq *0x8(%rax)
movq 0x40(%r14), %rax
movb $-0x1, (%rax)
movq 0x40(%r14), %rax
movb $-0x27, 0x1(%rax)
movl $0x2, %eax
movq 0x40(%r14), %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movl $0x0, 0x48(%r14)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdatasrc.c
// Function: skip_input_data
METHODDEF(void)
skip_input_data (j_decompress_ptr cinfo, long num_bytes)
{
  my_src_ptr src = (my_src_ptr) cinfo->src;

  /* Just a dumb implementation for now.  Could use fseek() except
   * it doesn't work on pipes.  Not clear that being smart is worth
   * any trouble anyway --- large skips are infrequent.
   */
  if (num_bytes > 0) {
    while (num_bytes > (long) src->pub.bytes_in_buffer) {
      num_bytes -= (long) src->pub.bytes_in_buffer;
      (void) fill_input_buffer(cinfo);
      /* note we assume that fill_input_buffer will never return FALSE,
       * so suspension need not be handled.
       */
    }
    src->pub.next_input_byte += (size_t) num_bytes;
    src->pub.bytes_in_buffer -= (size_t) num_bytes;
  }
}

// Assembly:
testq %rsi, %rsi
jle 0x7c086
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdi), %r15
movq 0x8(%r15), %rax
cmpq %rsi, %rax
jge 0x7c077
subq %rax, %rbx
movq %r14, %rdi
callq 0x7bfc0
movq 0x8(%r15), %rax
cmpq %rax, %rbx
jg 0x7c063
addq %rbx, (%r15)
subq %rbx, %rax
movq %rax, 0x8(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmaster.c
// Function: use_merged_upsample
LOCAL(jboolean)
use_merged_upsample (j_decompress_ptr cinfo)
{
#ifdef UPSAMPLE_MERGING_SUPPORTED
  /* Merging is the equivalent of plain box-filter upsampling */
  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
    return FALSE;
  /* jdmerge.c only supports YCC=>RGB color conversion */
  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
      cinfo->out_color_space != JCS_RGB ||
      cinfo->out_color_components != RGB_PIXELSIZE)
    return FALSE;
  /* and it only handles 2h1v or 2h2v sampling ratios */
  if (cinfo->comp_info[0].h_samp_factor != 2 ||
      cinfo->comp_info[1].h_samp_factor != 1 ||
      cinfo->comp_info[2].h_samp_factor != 1 ||
      cinfo->comp_info[0].v_samp_factor >  2 ||
      cinfo->comp_info[1].v_samp_factor != 1 ||
      cinfo->comp_info[2].v_samp_factor != 1)
    return FALSE;
  /* furthermore, it doesn't work if we've scaled the IDCTs differently */
  if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
      cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
      cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size)
    return FALSE;
  /* ??? also need to test for upsample-time rescaling, when & if supported */
  return TRUE;			/* by golly, it'll work... */
#else
  return FALSE;
#endif
}

// Assembly:
xorl %eax, %eax
cmpl $0x0, 0x64(%rdi)
je 0x7c29f
retq
cmpl $0x0, 0x188(%rdi)
jne 0x7c29e
cmpl $0x3, 0x3c(%rdi)
jne 0x7c29e
cmpl $0x3, 0x38(%rdi)
jne 0x7c29e
cmpl $0x2, 0x40(%rdi)
jne 0x7c29e
cmpl $0x3, 0x90(%rdi)
jne 0x7c29e
movq 0x130(%rdi), %rcx
cmpl $0x2, 0x8(%rcx)
jne 0x7c29e
cmpl $0x1, 0x68(%rcx)
jne 0x7c29e
cmpl $0x1, 0xc8(%rcx)
jne 0x7c29e
cmpl $0x2, 0xc(%rcx)
jg 0x7c29e
cmpl $0x1, 0x6c(%rcx)
jne 0x7c29e
cmpl $0x1, 0xcc(%rcx)
jne 0x7c29e
movl 0x1a0(%rdi), %edx
cmpl %edx, 0x24(%rcx)
jne 0x7c29e
cmpl %edx, 0x84(%rcx)
jne 0x7c29e
xorl %eax, %eax
cmpl %edx, 0xe4(%rcx)
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmaster.c
// Function: jpeg_new_colormap
GLOBAL(void)
jpeg_new_colormap (j_decompress_ptr cinfo)
{
  my_master_ptr master = (my_master_ptr) cinfo->master;

  /* Prevent application from calling me at wrong times */
  if (cinfo->global_state != DSTATE_BUFIMAGE)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  if (cinfo->quantize_colors && cinfo->enable_external_quant &&
      cinfo->colormap != NULL) {
    /* Select 2-pass quantizer for external colormap use */
    cinfo->cquantize = master->quantizer_2pass;
    /* Notify quantizer of colormap change */
    (*cinfo->cquantize->new_color_map) (cinfo);
    master->pub.is_dummy_pass = FALSE; /* just in case */
  } else
    ERREXIT(cinfo, JERR_MODE_CHANGE);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x220(%rdi), %r14
movl 0x24(%rdi), %eax
cmpl $0xcf, %eax
je 0x7c340
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl $0x0, 0x6c(%rbx)
je 0x7c37a
cmpl $0x0, 0x80(%rbx)
je 0x7c37a
cmpq $0x0, 0xa0(%rbx)
je 0x7c37a
movq 0x28(%r14), %rax
movq %rax, 0x270(%rbx)
movq %rbx, %rdi
callq *0x18(%rax)
movl $0x0, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rax
movl $0x2e, 0x28(%rax)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax)
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmaster.c
// Function: finish_output_pass
METHODDEF(void)
finish_output_pass (j_decompress_ptr cinfo)
{
  my_master_ptr master = (my_master_ptr) cinfo->master;

  if (cinfo->quantize_colors)
    (*cinfo->cquantize->finish_pass) (cinfo);
  master->pass_number++;
}

// Assembly:
pushq %rbx
movq 0x220(%rdi), %rbx
cmpl $0x0, 0x6c(%rdi)
je 0x7c853
movq 0x270(%rdi), %rax
callq *0x10(%rax)
incl 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdinput.c
// Function: reset_input_controller
METHODDEF(void)
reset_input_controller (j_decompress_ptr cinfo)
{
  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;

  inputctl->pub.consume_input = consume_markers;
  inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
  inputctl->pub.eoi_reached = FALSE;
  inputctl->inheaders = TRUE;
  /* Reset other modules */
  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
  (*cinfo->marker->reset_marker_reader) (cinfo);
  /* Reset progression state -- would be cleaner if entropy decoder did this */
  cinfo->coef_bits = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x240(%rdi), %rax
leaq -0x2f2(%rip), %rcx      # 0x7c8ac
movq %rcx, (%rax)
xorl %r14d, %r14d
movq %r14, 0x20(%rax)
movl $0x1, 0x28(%rax)
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x248(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %r14, 0xc0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdinput.c
// Function: start_input_pass
METHODDEF(void)
start_input_pass (j_decompress_ptr cinfo)
{
  per_scan_setup(cinfo);
  latch_quant_tables(cinfo);
  (*cinfo->entropy->start_pass) (cinfo);
  (*cinfo->coef->start_input_pass) (cinfo);
  cinfo->inputctl->consume_input = cinfo->coef->consume_data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x1b0(%rdi), %eax
cmpl $0x1, %eax
jne 0x7cc40
movq 0x1b8(%rbx), %rcx
movl 0x1c(%rcx), %eax
movl %eax, 0x1d8(%rbx)
movl 0x20(%rcx), %eax
movl %eax, 0x1dc(%rbx)
movabsq $0x100000001, %rdx      # imm = 0x100000001
movq %rdx, 0x34(%rcx)
movl $0x1, %edx
movl %edx, 0x3c(%rcx)
movl 0xc(%rcx), %esi
movl 0x24(%rcx), %edi
movl %edi, 0x40(%rcx)
movl %edx, 0x44(%rcx)
xorl %edx, %edx
divl %esi
testl %edx, %edx
cmovel %esi, %edx
movl %edx, 0x48(%rcx)
movq $0x1, 0x1e0(%rbx)
jmp 0x7cd4a
leal -0x5(%rax), %ecx
cmpl $-0x5, %ecx
ja 0x7cc67
movq (%rbx), %rcx
movl $0x1a, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movl $0x4, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x30(%rbx), %edi
movslq 0x198(%rbx), %rsi
shlq $0x3, %rsi
callq 0x86a9c
movl %eax, 0x1d8(%rbx)
movl 0x34(%rbx), %edi
movslq 0x19c(%rbx), %rsi
shlq $0x3, %rsi
callq 0x86a9c
movl %eax, 0x1dc(%rbx)
movl $0x0, 0x1e0(%rbx)
cmpl $0x0, 0x1b0(%rbx)
jle 0x7cd4a
xorl %r14d, %r14d
movq 0x1b8(%rbx,%r14,8), %rcx
movl 0x8(%rcx), %esi
movl 0xc(%rcx), %edi
movl %esi, 0x34(%rcx)
movl %edi, 0x38(%rcx)
movl %edi, %ebp
imull %esi, %ebp
movl %ebp, 0x3c(%rcx)
movl 0x24(%rcx), %eax
imull %esi, %eax
movl %eax, 0x40(%rcx)
movl 0x1c(%rcx), %eax
xorl %edx, %edx
divl %esi
testl %edx, %edx
cmovel %esi, %edx
movl %edx, 0x44(%rcx)
movl 0x20(%rcx), %eax
xorl %edx, %edx
divl %edi
testl %edx, %edx
cmovel %edi, %edx
movl %edx, 0x48(%rcx)
movl 0x1e0(%rbx), %eax
addl %ebp, %eax
cmpl $0xb, %eax
jl 0x7cd12
movq (%rbx), %rax
movl $0xd, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
testl %ebp, %ebp
jle 0x7cd37
incl %ebp
movslq 0x1e0(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x1e0(%rbx)
movl %r14d, 0x1e4(%rbx,%rax,4)
decl %ebp
cmpl $0x1, %ebp
jg 0x7cd18
incq %r14
movslq 0x1b0(%rbx), %rax
cmpq %rax, %r14
jl 0x7ccb3
cmpl $0x0, 0x1b0(%rbx)
jle 0x7cdd8
xorl %r15d, %r15d
movq 0x1b8(%rbx,%r15,8), %r12
cmpq $0x0, 0x50(%r12)
jne 0x7cdc9
movl 0x10(%r12), %r14d
cmpq $0x3, %r14
ja 0x7cd80
cmpq $0x0, 0xc8(%rbx,%r14,8)
jne 0x7cd96
movq (%rbx), %rax
movl $0x34, 0x28(%rax)
movl %r14d, 0x2c(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movslq %r14d, %r13
movq 0x8(%rbx), %rax
movl $0x84, %edx
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, %r14
movq 0xc8(%rbx,%r13,8), %rsi
movl $0x84, %edx
movq %rax, %rdi
callq 0xe370
movq %r14, 0x50(%r12)
incq %r15
movslq 0x1b0(%rbx), %rax
cmpq %rax, %r15
jl 0x7cd5a
movq 0x250(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq 0x230(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq 0x230(%rbx), %rax
movq 0x240(%rbx), %rcx
movq 0x8(%rax), %rax
movq %rax, (%rcx)
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/jdmarker.c
// Function: jpeg_resync_to_restart
GLOBAL(jboolean)
jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
{
  int marker = cinfo->unread_marker;
  int action = 1;
  
  /* Always put up a warning. */
  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
  
  /* Outer loop handles repeated decision after scanning forward. */
  for (;;) {
    if (marker < (int) M_SOF0)
      action = 2;		/* invalid marker */
    else if (marker < (int) M_RST0 || marker > (int) M_RST7)
      action = 3;		/* valid non-restart marker */
    else {
      if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||
	  marker == ((int) M_RST0 + ((desired+2) & 7)))
	action = 3;		/* one of the next two expected restarts */
      else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||
	       marker == ((int) M_RST0 + ((desired-2) & 7)))
	action = 2;		/* a prior restart, so advance */
      else
	action = 1;		/* desired restart or too far away */
    }
    TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
    switch (action) {
    case 1:
      /* Discard marker and let entropy decoder resume processing. */
      cinfo->unread_marker = 0;
      return TRUE;
    case 2:
      /* Scan to the next marker, and repeat the decision loop. */
      if (! next_marker(cinfo))
	return FALSE;
      marker = cinfo->unread_marker;
      break;
    case 3:
      /* Return without advancing past this marker. */
      /* Entropy decoder will be forced to process an empty segment. */
      return TRUE;
    }
  } /* end loop */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl 0x21c(%rdi), %r12d
movq (%rdi), %rax
movl $0x79, 0x28(%rax)
movl %r12d, 0x2c(%rax)
movq (%rdi), %rax
movl %esi, 0x30(%rax)
movq (%rdi), %rax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq *0x8(%rax)
leal 0x1(%r14), %ebp
andl $0x7, %ebp
movl $0xd0, %eax
orl %eax, %ebp
leal 0x2(%r14), %r15d
andl $0x7, %r15d
orl %eax, %r15d
leal -0x1(%r14), %ecx
andl $0x7, %ecx
orl %eax, %ecx
movl %ecx, 0x4(%rsp)
addl $0x6, %r14d
andl $0x7, %r14d
orl %eax, %r14d
movl $0x2, %r13d
cmpl $0xc0, %r12d
jge 0x7cedd
movq (%rbx), %rax
movl $0x61, 0x28(%rax)
movl %r12d, 0x2c(%rax)
movq (%rbx), %rax
movl %r13d, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x4, %esi
callq *0x8(%rax)
cmpl $0x2, %r13d
jne 0x7cf16
movq %rbx, %rdi
callq 0x7cf3e
testl %eax, %eax
je 0x7cf2d
movl 0x21c(%rbx), %r12d
jmp 0x7ce90
leal -0xd8(%r12), %eax
movl $0x3, %r13d
cmpl $-0x8, %eax
jb 0x7ce9f
cmpl %ebp, %r12d
je 0x7ce9f
cmpl %r15d, %r12d
je 0x7ce9f
movl $0x2, %r13d
cmpl 0x4(%rsp), %r12d
je 0x7ce9f
xorl %r13d, %r13d
cmpl %r14d, %r12d
sete %r13b
incl %r13d
jmp 0x7ce9f
movl $0x1, %eax
cmpl $0x3, %r13d
je 0x7cf2f
movl $0x0, 0x21c(%rbx)
jmp 0x7cf2f
xorl %eax, %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/jdmarker.c
// Function: next_marker
LOCAL(jboolean)
next_marker (j_decompress_ptr cinfo)
{
  int c;
  INPUT_VARS(cinfo);

  for (;;) {
    INPUT_BYTE(cinfo, c, return FALSE);
    /* Skip any non-FF bytes.
     * This may look a bit inefficient, but it will not occur in a valid file.
     * We sync after each discarded byte so that a suspending data source
     * can discard the byte from its buffer.
     */
    while (c != 0xFF) {
      cinfo->marker->discarded_bytes++;
      INPUT_SYNC(cinfo);
      INPUT_BYTE(cinfo, c, return FALSE);
    }
    /* This loop swallows any duplicate FF bytes.  Extra FFs are legal as
     * pad bytes, so don't count them in discarded_bytes.  We assume there
     * will not be so many consecutive FF bytes as to overflow a suspending
     * data source's input buffer.
     */
    do {
      INPUT_BYTE(cinfo, c, return FALSE);
    } while (c == 0xFF);
    if (c != 0)
      break;			/* found a valid marker, exit loop */
    /* Reach here if we found a stuffed-zero data sequence (FF/00).
     * Discard it and loop back to try again.
     */
    cinfo->marker->discarded_bytes += 2;
    INPUT_SYNC(cinfo);
  }

  if (cinfo->marker->discarded_bytes != 0) {
    WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
    cinfo->marker->discarded_bytes = 0;
  }

  cinfo->unread_marker = c;

  INPUT_SYNC(cinfo);
  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movq (%r14), %r12
movq 0x8(%r14), %r15
testq %r15, %r15
jne 0x7cf6f
movq %rbx, %rdi
callq *0x18(%r14)
testl %eax, %eax
je 0x7d058
movq (%r14), %r12
movq 0x8(%r14), %r15
leaq 0x1(%r12), %rax
decq %r15
cmpb $-0x1, (%r12)
je 0x7cfbb
movq 0x248(%rbx), %rcx
incl 0x24(%rcx)
movq %rax, (%r14)
movq %r15, 0x8(%r14)
testq %r15, %r15
jne 0x7cfaa
movq %rbx, %rdi
callq *0x18(%r14)
testl %eax, %eax
je 0x7d058
movq (%r14), %rax
movq 0x8(%r14), %r15
leaq 0x1(%rax), %r12
decq %r15
cmpb $-0x1, (%rax)
movq %r12, %rax
jne 0x7cf7e
jmp 0x7cfbe
movq %rax, %r12
testq %r15, %r15
jne 0x7cfd9
movq %rbx, %rdi
callq *0x18(%r14)
testl %eax, %eax
je 0x7d058
movq (%r14), %r12
movq 0x8(%r14), %r15
decq %r15
movzbl (%r12), %ebp
incq %r12
cmpl $0xff, %ebp
je 0x7cfbe
testl %ebp, %ebp
jne 0x7d007
movq 0x248(%rbx), %rax
addl $0x2, 0x24(%rax)
movq %r12, (%r14)
movq %r15, 0x8(%r14)
jmp 0x7cf54
movq 0x248(%rbx), %rax
movl 0x24(%rax), %eax
testl %eax, %eax
je 0x7d044
movq (%rbx), %rcx
movl $0x74, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movl %ebp, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq *0x8(%rax)
movq 0x248(%rbx), %rax
movl $0x0, 0x24(%rax)
movl %ebp, 0x21c(%rbx)
movq %r12, (%r14)
movq %r15, 0x8(%r14)
movl $0x1, %eax
jmp 0x7d05a
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: jinit_marker_reader
GLOBAL(void)
jinit_marker_reader (j_decompress_ptr cinfo)
{
  my_marker_ptr marker;
  int i;

  /* Create subobject in permanent pool */
  marker = (my_marker_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
				SIZEOF(my_marker_reader));
  cinfo->marker = (struct jpeg_marker_reader *) marker;
  /* Initialize public method pointers */
  marker->pub.reset_marker_reader = reset_marker_reader;
  marker->pub.read_markers = read_markers;
  marker->pub.read_restart_marker = read_restart_marker;
  /* Initialize COM/APPn processing.
   * By default, we examine and then discard APP0 and APP14,
   * but simply discard COM and all other APPn.
   */
  marker->process_COM = skip_variable;
  marker->length_limit_COM = 0;
  for (i = 0; i < 16; i++) {
    marker->process_APPn[i] = skip_variable;
    marker->length_limit_APPn[i] = 0;
  }
  marker->process_APPn[0] = get_interesting_appn;
  marker->process_APPn[14] = get_interesting_appn;
  /* Reset marker processing state */
  reset_marker_reader(cinfo);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0x108, %edx            # imm = 0x108
xorl %esi, %esi
callq *(%rax)
movq %rax, 0x248(%rbx)
leaq 0x98(%rip), %rcx        # 0x7d11a
movq %rcx, (%rax)
leaq 0xb9(%rip), %rcx        # 0x7d145
movq %rcx, 0x8(%rax)
leaq 0xc8b(%rip), %rcx       # 0x7dd22
movq %rcx, 0x10(%rax)
leaq 0xd03(%rip), %rdx       # 0x7dda5
movq %rdx, 0x28(%rax)
movl $0x0, 0xb0(%rax)
movq $-0x20, %rcx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqu %xmm0, 0xb0(%rax,%rcx,4)
movq $0x0, 0xf4(%rax,%rcx,2)
addq $0x4, %rcx
jne 0x7d0c1
leaq 0xd88(%rip), %rcx       # 0x7de6b
movq %rcx, 0x30(%rax)
movq %rcx, 0xa0(%rax)
movq 0x248(%rbx), %rax
xorl %ecx, %ecx
movq %rcx, 0x130(%rbx)
movl %ecx, 0xac(%rbx)
movl %ecx, 0x21c(%rbx)
movq %rcx, 0x18(%rax)
movl %ecx, 0x24(%rax)
movq %rcx, 0xf8(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: read_restart_marker
METHODDEF(jboolean)
read_restart_marker (j_decompress_ptr cinfo)
{
  /* Obtain a marker unless we already did. */
  /* Note that next_marker will complain if it skips any data. */
  if (cinfo->unread_marker == 0) {
    if (! next_marker(cinfo))
      return FALSE;
  }

  if (cinfo->unread_marker ==
      ((int) M_RST0 + cinfo->marker->next_restart_num)) {
    /* Normal case --- swallow the marker and let entropy decoder continue */
    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);
    cinfo->unread_marker = 0;
  } else {
    /* Uh-oh, the restart markers have been messed up. */
    /* Let the data source manager determine how to resync. */
    if (! (*cinfo->src->resync_to_restart) (cinfo,
					    cinfo->marker->next_restart_num))
      return FALSE;
  }

  /* Update next-restart state */
  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;

  return TRUE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x21c(%rdi)
jne 0x7dd3b
movq %rbx, %rdi
callq 0x7cf3e
testl %eax, %eax
je 0x7dda1
movq 0x248(%rbx), %rax
movl 0x20(%rax), %esi
leal 0xd0(%rsi), %eax
cmpl %eax, 0x21c(%rbx)
jne 0x7dd7a
movq (%rbx), %rax
movl $0x62, 0x28(%rax)
movl %esi, 0x2c(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x3, %esi
callq *0x8(%rax)
movl $0x0, 0x21c(%rbx)
jmp 0x7dd88
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
testl %eax, %eax
je 0x7dda1
movq 0x248(%rbx), %rax
movl 0x20(%rax), %ecx
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x20(%rax)
movl $0x1, %eax
jmp 0x7dda3
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: skip_variable
METHODDEF(jboolean)
skip_variable (j_decompress_ptr cinfo)
/* Skip over an unknown or uninteresting variable-length marker */
{
  INT32 length;
  INPUT_VARS(cinfo);

  INPUT_2BYTES(cinfo, length, return FALSE);
  length -= 2;
  
  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);

  INPUT_SYNC(cinfo);		/* do before skip_input_data */
  if (length > 0)
    (*cinfo->src->skip_input_data) (cinfo, (long) length);

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movq 0x8(%r15), %r12
testq %r12, %r12
jne 0x7ddd3
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7de5a
movq 0x8(%r15), %r12
movq (%r15), %r13
movzbl (%r13), %ebp
decq %r12
je 0x7dde5
incq %r13
jmp 0x7ddf7
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7de5a
movq (%r15), %r13
movq 0x8(%r15), %r12
shll $0x8, %ebp
decq %r12
movzbl (%r13), %eax
incq %r13
movq %rbp, %r14
orq %rax, %r14
addq %rax, %rbp
addq $-0x2, %rbp
movq (%rbx), %rax
movl $0x5b, 0x28(%rax)
movl 0x21c(%rbx), %ecx
movl %ecx, 0x2c(%rax)
movq (%rbx), %rax
movl %ebp, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x1, %esi
callq *0x8(%rax)
movq %r13, (%r15)
movq %r12, 0x8(%r15)
cmpq $0x3, %r14
jb 0x7de53
movq 0x28(%rbx), %rax
movq %rbx, %rdi
movq %rbp, %rsi
callq *0x20(%rax)
movl $0x1, %eax
jmp 0x7de5c
xorl %eax, %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/jdmarker.c
// Function: get_interesting_appn
METHODDEF(jboolean)
get_interesting_appn (j_decompress_ptr cinfo)
/* Process an APP0 or APP14 marker without saving it */
{
  INT32 length;
  JOCTET b[APPN_DATA_LEN];
  unsigned int i, numtoread;
  INPUT_VARS(cinfo);

  INPUT_2BYTES(cinfo, length, return FALSE);
  length -= 2;

  /* get the interesting part of the marker data */
  if (length >= APPN_DATA_LEN)
    numtoread = APPN_DATA_LEN;
  else if (length > 0)
    numtoread = (unsigned int) length;
  else
    numtoread = 0;
  for (i = 0; i < numtoread; i++)
    INPUT_BYTE(cinfo, b[i], return FALSE);
  length -= numtoread;

  /* process it */
  switch (cinfo->unread_marker) {
  case M_APP0:
    examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);
    break;
  case M_APP14:
    examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);
    break;
  default:
    /* can't get here unless jpeg_save_markers chooses wrong processor */
    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
    break;
  }

  /* skip any remaining data -- could be lots */
  INPUT_SYNC(cinfo);
  if (length > 0)
    (*cinfo->src->skip_input_data) (cinfo, (long) length);

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movq 0x8(%r15), %r12
testq %r12, %r12
jne 0x7de9c
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7df6a
movq 0x8(%r15), %r12
movq (%r15), %r13
movzbl (%r13), %r14d
decq %r12
je 0x7deae
incq %r13
jmp 0x7dec4
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7df6a
movq (%r15), %r13
movq 0x8(%r15), %r12
shll $0x8, %r14d
movzbl (%r13), %eax
movq %r14, %rcx
orq %rax, %rcx
leaq (%r14,%rax), %rdx
addq $-0x2, %rdx
xorl %eax, %eax
cmpq $0x3, %rcx
movq %rdx, 0x10(%rsp)
cmovbl %eax, %edx
cmpq $0x10, %rcx
movl $0xe, %eax
cmovbl %edx, %eax
incq %r13
decq %r12
movl %eax, %r14d
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x7df35
xorl %ebp, %ebp
testq %r12, %r12
jne 0x7df1f
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7df6a
movq (%r15), %r13
movq 0x8(%r15), %r12
movb (%r13), %al
movb %al, 0x1a(%rsp,%rbp)
incq %rbp
incq %r13
decq %r12
cmpq %rbp, %r14
jne 0x7df08
movq 0x10(%rsp), %rax
subq %r14, %rax
movq %rax, %r14
movl 0x21c(%rbx), %eax
cmpl $0xee, %eax
je 0x7df6e
cmpl $0xe0, %eax
jne 0x7df84
leaq 0x1a(%rsp), %rsi
movq %rbx, %rdi
movl 0xc(%rsp), %edx
movq %r14, %rcx
callq 0x7e698
jmp 0x7df99
xorl %ebp, %ebp
jmp 0x7dfb7
leaq 0x1a(%rsp), %rsi
movq %rbx, %rdi
movl 0xc(%rsp), %edx
movq %r14, %rcx
callq 0x7e899
jmp 0x7df99
movq (%rbx), %rcx
movl $0x44, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %r13, (%r15)
movq %r12, 0x8(%r15)
movl $0x1, %ebp
testq %r14, %r14
jle 0x7dfb7
movq 0x28(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x20(%rax)
movl %ebp, %eax
addq $0x28, %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/jdmarker.c
// Function: jpeg_save_markers
GLOBAL(void)
jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
		   unsigned int length_limit)
{
  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
  long maxlength;
  jpeg_marker_parser_method processor;

  /* Length limit mustn't be larger than what we can allocate
   * (should only be a concern in a 16-bit environment).
   */
  maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);
  if (((long) length_limit) > maxlength)
    length_limit = (unsigned int) maxlength;

  /* Choose processor routine to use.
   * APP0/APP14 have special requirements.
   */
  if (length_limit) {
    processor = save_marker;
    /* If saving APP0/APP14, save at least enough for our internal use. */
    if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)
      length_limit = APP0_DATA_LEN;
    else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)
      length_limit = APP14_DATA_LEN;
  } else {
    processor = skip_variable;
    /* If discarding APP0/APP14, use our regular on-the-fly processor. */
    if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)
      processor = get_interesting_appn;
  }

  if (marker_code == (int) M_COM) {
    marker->process_COM = processor;
    marker->length_limit_COM = length_limit;
  } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {
    marker->process_APPn[marker_code - (int) M_APP0] = processor;
    marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;
  } else
    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
}

// Assembly:
movq 0x8(%rdi), %rax
movq 0x60(%rax), %r8
addq $-0x20, %r8
movl %edx, %eax
cmpq %rax, %r8
cmovgel %edx, %r8d
testl %r8d, %r8d
je 0x7e015
leaq 0x9f(%rip), %rax        # 0x7e088
cmpl $0xe0, %esi
jne 0x7dffc
movl $0xe, %ecx
cmpl $0xe, %r8d
jb 0x7e039
cmpl $0xd, %r8d
movl $0xc, %ecx
cmovael %r8d, %ecx
cmpl $0xee, %esi
cmovnel %r8d, %ecx
jmp 0x7e039
cmpl $0xee, %esi
leaq -0x1b7(%rip), %rcx      # 0x7de6b
leaq -0x284(%rip), %rax      # 0x7dda5
cmoveq %rcx, %rax
cmpl $0xe0, %esi
cmoveq %rcx, %rax
xorl %ecx, %ecx
movq 0x248(%rdi), %rdx
cmpl $0xfe, %esi
jne 0x7e053
movq %rax, 0x28(%rdx)
movl %ecx, 0xb0(%rdx)
retq
movl %esi, %r8d
andl $-0x10, %r8d
cmpl $0xe0, %r8d
jne 0x7e076
addl $0xffffff20, %esi       # imm = 0xFFFFFF20
movq %rax, 0x30(%rdx,%rsi,8)
movl %ecx, 0xb4(%rdx,%rsi,4)
retq
movq (%rdi), %rax
movl $0x44, 0x28(%rax)
movl %esi, 0x2c(%rax)
movq (%rdi), %rax
jmpq *(%rax)
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: jpeg_set_marker_processor
GLOBAL(void)
jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,
			   jpeg_marker_parser_method routine)
{
  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;

  if (marker_code == (int) M_COM)
    marker->process_COM = routine;
  else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)
    marker->process_APPn[marker_code - (int) M_APP0] = routine;
  else
    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
}

// Assembly:
movq 0x248(%rdi), %rax
cmpl $0xfe, %esi
jne 0x7e345
movq %rdx, 0x28(%rax)
retq
movl %esi, %ecx
andl $-0x10, %ecx
cmpl $0xe0, %ecx
jne 0x7e35e
addl $0xffffff20, %esi       # imm = 0xFFFFFF20
movq %rdx, 0x30(%rax,%rsi,8)
retq
movq (%rdi), %rax
movl $0x44, 0x28(%rax)
movl %esi, 0x2c(%rax)
movq (%rdi), %rax
jmpq *(%rax)
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: examine_app14
LOCAL(void)
examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
	       unsigned int datalen, INT32 remaining)
/* Examine first few bytes from an APP14.
 * Take appropriate action if it is an Adobe marker.
 * datalen is # of bytes at data[], remaining is length of rest of marker data.
 */
{
  unsigned int version, flags0, flags1, transform;

  if (datalen >= APP14_DATA_LEN &&
      GETJOCTET(data[0]) == 0x41 &&
      GETJOCTET(data[1]) == 0x64 &&
      GETJOCTET(data[2]) == 0x6F &&
      GETJOCTET(data[3]) == 0x62 &&
      GETJOCTET(data[4]) == 0x65) {
    /* Found Adobe APP14 marker */
    version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
    flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
    flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
    transform = GETJOCTET(data[11]);
    TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
    cinfo->saw_Adobe_marker = TRUE;
    cinfo->Adobe_transform = (UINT8) transform;
  } else {
    /* Start of APP14 does not match "Adobe", or too short */
    TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0xc, %edx
jb 0x7e929
cmpb $0x41, (%rsi)
jne 0x7e929
cmpb $0x64, 0x1(%rsi)
jne 0x7e929
cmpb $0x6f, 0x2(%rsi)
jne 0x7e929
cmpb $0x62, 0x3(%rsi)
jne 0x7e929
cmpb $0x65, 0x4(%rsi)
jne 0x7e929
movzwl 0x5(%rsi), %eax
rolw $0x8, %ax
movzwl 0x7(%rsi), %ecx
movzwl %ax, %eax
rolw $0x8, %cx
movzwl %cx, %ecx
movzwl 0x9(%rsi), %edx
rolw $0x8, %dx
movzwl %dx, %edx
movzbl 0xb(%rsi), %ebp
movq (%rbx), %r8
movl %eax, 0x2c(%r8)
movl %ecx, 0x30(%r8)
movl %edx, 0x34(%r8)
movl %ebp, 0x38(%r8)
movl $0x4c, 0x28(%r8)
movq %rbx, %rdi
movl $0x1, %esi
callq *0x8(%r8)
movl $0x1, 0x180(%rbx)
movb %bpl, 0x184(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq (%rbx), %rax
movl $0x4e, 0x28(%rax)
addl %edx, %ecx
movl %ecx, 0x2c(%rax)
movq (%rbx), %rax
movq 0x8(%rax), %rax
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdhuff.c
// Function: jpeg_huff_decode
GLOBAL(int)
jpeg_huff_decode (bitread_working_state * state,
		  register bit_buf_type get_buffer, register int bits_left,
		  d_derived_tbl * htbl, int min_bits)
{
  register int l = min_bits;
  register INT32 code;

  /* HUFF_DECODE has determined that the code is at least min_bits */
  /* bits long, so fetch that many bits in one swoop. */

  CHECK_BIT_BUFFER(*state, l, return -1);
  code = GET_BITS(l);

  /* Collect the rest of the Huffman code one bit at a time. */
  /* This is per Figure F.16 in the JPEG spec. */

  while (code > htbl->maxcode[l]) {
    code <<= 1;
    CHECK_BIT_BUFFER(*state, 1, return -1);
    code |= GET_BITS(1);
    l++;
  }

  /* Unload the local registers */
  state->get_buffer = get_buffer;
  state->bits_left = bits_left;

  /* With garbage input we may reach the sentinel value l = 17. */

  if (l > 16) {
    WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
    return 0;			/* fake a zero as the safest result */
  }

  return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdi, %r14
cmpl %r8d, %edx
jge 0x7ed4e
movq %r14, %rdi
movl %ebp, %ecx
callq 0x7ebdf
testl %eax, %eax
je 0x7edf9
movq 0x10(%r14), %rsi
movl 0x18(%r14), %edx
subl %ebp, %edx
movq %rsi, %rax
movl %edx, %ecx
sarq %cl, %rax
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %ebp, %ecx
shll %cl, %r15d
notl %r15d
andl %eax, %r15d
movslq %ebp, %rax
cmpq %r15, (%rbx,%rax,8)
jge 0x7edb9
movslq %ebp, %r12
testl %edx, %edx
jg 0x7ed92
movq %r14, %rdi
movl $0x1, %ecx
callq 0x7ebdf
testl %eax, %eax
je 0x7edf9
movq 0x10(%r14), %rsi
movl 0x18(%r14), %edx
movq %r15, %rax
addq %r15, %rax
decl %edx
xorl %r15d, %r15d
btq %rdx, %rsi
setb %r15b
orq %rax, %r15
leaq 0x1(%r12), %rax
cmpq 0x8(%rbx,%r12,8), %r15
movq %rax, %r12
jg 0x7ed75
movl %eax, %ebp
movq %rsi, 0x10(%r14)
movl %edx, 0x18(%r14)
cmpl $0x11, %ebp
jl 0x7ede0
movq 0x20(%r14), %rdi
movq (%rdi), %rax
movl $0x76, 0x28(%rax)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq *0x8(%rax)
xorl %eax, %eax
jmp 0x7edfe
movq 0x118(%rbx), %rcx
addl 0x90(%rbx,%rax,8), %r15d
movslq %r15d, %rax
movzbl 0x11(%rcx,%rax), %eax
jmp 0x7edfe
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdhuff.c
// Function: jinit_huff_decoder
GLOBAL(void)
jinit_huff_decoder (j_decompress_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_decoder));
  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
  entropy->pub.start_pass = start_pass_huff_decoder;
  entropy->pub.decode_mcu = decode_mcu;

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0x170, %edx            # imm = 0x170
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x250(%rbx)
leaq 0x2c(%rip), %rcx        # 0x7ee55
movq %rcx, (%rax)
leaq 0x186(%rip), %rcx       # 0x7efb9
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
xorl %ecx, %ecx
movups %xmm0, 0x60(%rax,%rcx,8)
addq $0x2, %rcx
cmpq $0x4, %rcx
jne 0x7ee44
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdphuff.c
// Function: jinit_phuff_decoder
GLOBAL(void)
jinit_phuff_decoder (j_decompress_ptr cinfo)
{
  phuff_entropy_ptr entropy;
  int *coef_bit_ptr;
  int ci, i;

  entropy = (phuff_entropy_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(phuff_entropy_decoder));
  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
  entropy->pub.start_pass = start_pass_phuff_decoder;

  /* Mark derived tables unallocated */
  for (i = 0; i < NUM_HUFF_TBLS; i++) {
    entropy->derived_tbls[i] = NULL;
  }

  /* Create progression status table */
  cinfo->coef_bits = (int (*)[DCTSIZE2])
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				cinfo->num_components*DCTSIZE2*SIZEOF(int));
  coef_bit_ptr = & cinfo->coef_bits[0][0];
  for (ci = 0; ci < cinfo->num_components; ci++) 
    for (i = 0; i < DCTSIZE2; i++)
      *coef_bit_ptr++ = -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0x68, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x250(%rbx)
leaq 0x5b(%rip), %rcx        # 0x7f58c
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movq 0x8(%rbx), %rax
movslq 0x38(%rbx), %rdx
shlq $0x8, %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0xc0(%rbx)
cmpl $0x0, 0x38(%rbx)
jle 0x7f587
movq %rax, %r14
xorl %ebp, %ebp
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movl $0xff, %esi
callq 0xe260
addq $0x100, %r14            # imm = 0x100
incl %ebp
cmpl 0x38(%rbx), %ebp
jl 0x7f567
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdphuff.c
// Function: decode_mcu_DC_refine
METHODDEF(jboolean)
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{   
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  int p1 = 1 << cinfo->Al;	/* 1 in the bit position being coded */
  int blkn;
  JBLOCKROW block;
  BITREAD_STATE_VARS;

  /* Process restart marker if needed; may have to suspend */
  if (cinfo->restart_interval) {
    if (entropy->restarts_to_go == 0)
      if (! process_restart(cinfo))
	return FALSE;
  }

  /* Not worth the cycles to check insufficient_data here,
   * since we will not change the data anyway if we read zeroes.
   */

  /* Load up working state */
  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);

  /* Outer loop handles each block in the MCU */

  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
    block = MCU_data[blkn];

    /* Encoded data is simply the next bit of the two's-complement DC value */
    CHECK_BIT_BUFFER(br_state, 1, return FALSE);
    if (GET_BITS(1))
      (*block)[0] |= p1;
    /* Note: since we use |=, repeating the assignment later is safe */
  }

  /* Completed MCU, so update state */
  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);

  /* Account for restart interval (no-op if not using restarts) */
  entropy->restarts_to_go--;

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movb 0x218(%rdi), %cl
movl $0x1, %ebp
shll %cl, %ebp
movq %rsi, %r14
movq 0x250(%rdi), %r12
cmpl $0x0, 0x170(%rdi)
je 0x7fd8a
cmpl $0x0, 0x3c(%r12)
jne 0x7fd8a
movq %rbx, %rdi
callq 0x802e6
testl %eax, %eax
je 0x7fe20
movq %rbx, 0x20(%rsp)
movq 0x28(%rbx), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%r12), %rsi
movl 0x20(%r12), %edx
cmpl $0x0, 0x1e0(%rbx)
jle 0x7fdf6
xorl %r13d, %r13d
movq (%r14,%r13,8), %r15
testl %edx, %edx
jg 0x7fddb
movq %rsp, %rdi
movl $0x1, %ecx
callq 0x7ebdf
testl %eax, %eax
je 0x7fe20
movq 0x10(%rsp), %rsi
movl 0x18(%rsp), %edx
decl %edx
btq %rdx, %rsi
jae 0x7fde7
orw %bp, (%r15)
incq %r13
movslq 0x1e0(%rbx), %rax
cmpq %rax, %r13
jl 0x7fdb9
movq (%rsp), %rax
movq 0x28(%rbx), %rcx
movq %rax, (%rcx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rcx)
movq %rsi, 0x18(%r12)
movl %edx, 0x20(%r12)
decl 0x3c(%r12)
movl $0x1, %eax
jmp 0x7fe22
xorl %eax, %eax
addq $0x28, %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/jdphuff.c
// Function: process_restart
LOCAL(jboolean)
process_restart (j_decompress_ptr cinfo)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  int ci;

  /* Throw away any unused bits remaining in bit buffer; */
  /* include any full bytes in next_marker's count of discarded bytes */
  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
  entropy->bitstate.bits_left = 0;

  /* Advance past the RSTn marker */
  if (! (*cinfo->marker->read_restart_marker) (cinfo))
    return FALSE;

  /* Re-initialize DC predictions to 0 */
  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
    entropy->saved.last_dc_val[ci] = 0;
  /* Re-init EOB run count, too */
  entropy->saved.EOBRUN = 0;

  /* Reset restart counter */
  entropy->restarts_to_go = cinfo->restart_interval;

  /* Reset out-of-data flag, unless read_restart_marker left us smack up
   * against a marker.  In that case we will end up treating the next data
   * segment as empty, and we can avoid producing bogus output pixels by
   * leaving the flag set.
   */
  if (cinfo->unread_marker == 0)
    entropy->pub.insufficient_data = FALSE;

  return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x248(%rdi), %rax
movq 0x250(%rdi), %r14
movl 0x20(%r14), %ecx
leal 0x7(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x3, %edx
addl %edx, 0x24(%rax)
movl $0x0, 0x20(%r14)
callq *0x10(%rax)
testl %eax, %eax
je 0x80369
cmpl $0x0, 0x1b0(%rbx)
jle 0x8033f
xorl %eax, %eax
movl $0x0, 0x2c(%r14,%rax,4)
incq %rax
movslq 0x1b0(%rbx), %rcx
cmpq %rcx, %rax
jl 0x80327
movl $0x0, 0x28(%r14)
movl 0x170(%rbx), %eax
movl %eax, 0x3c(%r14)
movl $0x1, %eax
cmpl $0x0, 0x21c(%rbx)
jne 0x8036b
movl $0x0, 0x10(%r14)
jmp 0x8036b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdmainct.c
// Function: process_data_simple_main
METHODDEF(void)
process_data_simple_main (j_decompress_ptr cinfo,
			  JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
			  JDIMENSION out_rows_avail)
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;
  JDIMENSION rowgroups_avail;

  /* Read input data if we haven't filled the main buffer yet */
  if (! mainp->buffer_full) {
    if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))
      return;			/* suspension forced, can do nothing more */
    mainp->buffer_full = TRUE;	/* OK, we have an iMCU row to work with */
  }

  /* There are always min_DCT_scaled_size row groups in an iMCU row. */
  rowgroups_avail = (JDIMENSION) cinfo->min_DCT_scaled_size;
  /* Note: at the bottom of the image, we may pass extra garbage row groups
   * to the postprocessor.  The postprocessor has to check for bottom
   * of image anyway (at row resolution), so no point in us doing it too.
   */

  /* Feed the postprocessor */
  (*cinfo->post->post_process_data) (cinfo, mainp->buffer,
				     &mainp->rowgroup_ctr, rowgroups_avail,
				     output_buf, out_row_ctr, out_rows_avail);

  /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
  if (mainp->rowgroup_ctr >= rowgroups_avail) {
    mainp->buffer_full = FALSE;
    mainp->rowgroup_ctr = 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x228(%rdi), %r13
cmpl $0x0, 0x60(%r13)
jne 0x80b25
movq 0x230(%r15), %rax
leaq 0x10(%r13), %rsi
movq %r15, %rdi
callq *0x18(%rax)
testl %eax, %eax
je 0x80b5b
movl $0x1, 0x60(%r13)
movl 0x1a0(%r15), %r12d
movq 0x238(%r15), %rax
leaq 0x10(%r13), %rsi
leaq 0x64(%r13), %rdx
movl %ebp, (%rsp)
movq %r15, %rdi
movl %r12d, %ecx
movq %r14, %r8
movq %rbx, %r9
callq *0x8(%rax)
cmpl %r12d, 0x64(%r13)
jb 0x80b5b
movq $0x0, 0x60(%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq