LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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        # 0x79232
movq %rax, (%rbx)
movl 0x114(%r14), %eax
cmpl $0x2, %eax
je 0x791f0
cmpl $0x1, %eax
je 0x791d8
testl %eax, %eax
jne 0x79208
leaq 0x373(%rip), %rax       # 0x7953e
movq %rax, 0x8(%rbx)
leaq 0xdd2(%rip), %rax       # 0x79fa8
jmp 0x791ea
leaq 0x35f(%rip), %rax       # 0x7953e
movq %rax, 0x8(%rbx)
leaq 0x5fe(%rip), %rax       # 0x797e8
movq %rax, 0x10(%rbx)
jmp 0x79217
leaq 0x472(%rip), %rax       # 0x79669
movq %rax, 0x8(%rbx)
leaq 0xa0e(%rip), %rax       # 0x79c10
movq %rax, 0x38(%rbx)
jmp 0x79217
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_O3/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 0x7a9c6
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 0x7a9ef
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
leaq 0x8(%rbx), %rdi
xorl %r12d, %r12d
movl $0x270, %edx            # imm = 0x270
xorl %esi, %esi
callq 0xe260
movq %r14, (%rbx)
movq %r15, 0x18(%rbx)
movl $0x1, 0x20(%rbx)
movq %rbx, %rdi
callq 0x85ed0
movq %r12, 0x10(%rbx)
movq %r12, 0x28(%rbx)
movq %r12, 0x190(%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 %rbx, %rdi
callq 0x7c39f
movq %rbx, %rdi
callq 0x7bb60
movl $0xc8, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl 0x24(%rdi), %eax
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0xc8, %ecx
je 0x7aab6
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x7aae9
movl %eax, %r14d
cmpl $0x2, %eax
jne 0x7aae1
testl %ebp, %ebp
je 0x7aad9
movq (%rbx), %rax
movl $0x33, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x85c04
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7ad97
cmpl $0x0, 0x58(%rbx)
je 0x7adbc
cmpl $0xd2, %eax
je 0x7aded
cmpl $0xcf, %eax
je 0x7ade6
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
jmp 0x7aded
movl 0xa8(%rbx), %eax
cmpl 0x8c(%rbx), %eax
jae 0x7add9
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 0x7ae07
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
jne 0x7aded
xorl %eax, %eax
jmp 0x7ae1e
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq %rbx, %rdi
callq 0x85c04
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
movl 0x24(%rdi), %eax
cmpl $0xcc, %eax
je 0x7aef0
cmpl $0xcb, %eax
je 0x7ae7a
cmpl $0xca, %eax
jne 0x7ae5c
movq %rbx, %rdi
callq 0x7b68b
cmpl $0x0, 0x58(%rbx)
je 0x7ae73
movl $0xcf, 0x24(%rbx)
movl $0x1, %eax
popq %rbx
retq
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
jmp 0x7aef0
movl $0xcb, 0x24(%rbx)
movq 0x240(%rbx), %rax
cmpl $0x0, 0x20(%rax)
je 0x7aee4
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x7ae95
movq %rbx, %rdi
callq *(%rcx)
movq 0x240(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
je 0x7ae5a
cmpl $0x2, %eax
je 0x7aee4
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
sete %dl
andl $-0x3, %eax
cmpl $0x1, %eax
setne %al
orb %dl, %al
jne 0x7ae8b
movq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rax
incq %rdx
movq %rdx, 0x8(%rcx)
cmpq %rax, %rdx
jl 0x7ae8b
movl 0x1a4(%rbx), %edx
addq %rdx, %rax
movq %rax, 0x10(%rcx)
jmp 0x7ae8b
movl 0xac(%rbx), %eax
movl %eax, 0xb4(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x7aef6
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7af26
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 0x7afc3
leaq 0xa8(%rbx), %r14
movl 0xa8(%rbx), %ebp
movl 0x8c(%rbx), %eax
cmpl %eax, %ebp
jae 0x7af91
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x7af6c
movl %ebp, %edx
movq %rdx, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq %rbx, %rdi
callq *(%rcx)
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)
movl 0xa8(%rbx), %eax
cmpl %ebp, %eax
movl %eax, %ebp
jne 0x7af44
jmp 0x7afd8
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
xorl %ebp, %ebp
cmpl $0x0, 0x10(%rax)
jne 0x7af44
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_O3/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 0x7b014
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 0x7b066
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x7b03a
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 0x7b07d
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_O3/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 0x7b0b6
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 0x7b11c
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x7b0dc
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 0x7b0ff
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 0x7b131
addl %r15d, 0xa8(%rbx)
jmp 0x7b134
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
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7b170
cmpl $0xcf, %eax
je 0x7b170
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 0x7b193
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 0x7aef6
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7b1d5
cmpl $0x0, 0x58(%rbx)
je 0x7b1dc
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl $0xd0, 0x24(%rbx)
jmp 0x7b1f1
cmpl $0xd0, %eax
je 0x7b1f1
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 0x7b219
movq 0x240(%rbx), %rax
cmpl $0x0, 0x24(%rax)
jne 0x7b219
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
jne 0x7b1f1
xorl %eax, %eax
jmp 0x7b225
movl $0xcf, 0x24(%rbx)
movl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x28(%rdi), %rax
testq %rax, %rax
jne 0x7b268
movq %rdi, %r14
movq 0x8(%rdi), %rax
movl $0x50, %edx
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        # 0x7b2af
movq %rcx, 0x10(%rax)
leaq 0x41(%rip), %rcx        # 0x7b2bb
movq %rcx, 0x18(%rax)
leaq 0xbc(%rip), %rcx        # 0x7b341
movq %rcx, 0x20(%rax)
leaq 0xeb0(%rip), %rcx       # 0x7c140
movq %rcx, 0x28(%rax)
leaq 0xe7(%rip), %rcx        # 0x7b382
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_O3/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 0x7b381
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdi), %r15
movq 0x8(%r15), %rax
cmpq %rsi, %rax
jge 0x7b372
subq %rax, %rbx
movq %r14, %rdi
callq 0x7b2bb
movq 0x8(%r15), %rax
cmpq %rax, %rbx
jg 0x7b35e
addq %rbx, (%r15)
subq %rbx, %rax
movq %rax, 0x8(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7b59a
retq
cmpl $0x0, 0x188(%rdi)
jne 0x7b599
cmpl $0x3, 0x3c(%rdi)
jne 0x7b599
cmpl $0x3, 0x38(%rdi)
jne 0x7b599
cmpl $0x2, 0x40(%rdi)
jne 0x7b599
cmpl $0x3, 0x90(%rdi)
jne 0x7b599
movq 0x130(%rdi), %rcx
cmpl $0x2, 0x8(%rcx)
jne 0x7b599
cmpl $0x1, 0x68(%rcx)
jne 0x7b599
cmpl $0x1, 0xc8(%rcx)
jne 0x7b599
cmpl $0x2, 0xc(%rcx)
jg 0x7b599
cmpl $0x1, 0x6c(%rcx)
jne 0x7b599
cmpl $0x1, 0xcc(%rcx)
jne 0x7b599
movl 0x24(%rcx), %edx
cmpl 0x1a0(%rdi), %edx
jne 0x7b599
cmpl %edx, 0x84(%rcx)
jne 0x7b599
xorl %eax, %eax
cmpl %edx, 0xe4(%rcx)
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7b63b
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl $0x0, 0x6c(%rbx)
je 0x7b675
cmpl $0x0, 0x80(%rbx)
je 0x7b675
cmpq $0x0, 0xa0(%rbx)
je 0x7b675
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_O3/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 0x7bb59
movq 0x270(%rdi), %rax
callq *0x10(%rax)
incl 0x18(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 -0x306(%rip), %rcx      # 0x7bbb4
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_O3/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 0x7bf5c
movq 0x1b8(%rbx), %rsi
movl 0x1c(%rsi), %eax
movl %eax, 0x1d8(%rbx)
movl 0x20(%rsi), %eax
movl %eax, 0x1dc(%rbx)
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x34(%rsi)
movl $0x1, %ecx
movl %ecx, 0x3c(%rsi)
movl 0xc(%rsi), %edi
movl 0x24(%rsi), %edx
movl %edx, 0x40(%rsi)
movl %ecx, 0x44(%rsi)
xorl %edx, %edx
divl %edi
testl %edx, %edx
cmovel %edi, %edx
movl %edx, 0x48(%rsi)
movq $0x1, 0x1e0(%rbx)
jmp 0x7c06e
leal -0x5(%rax), %ecx
cmpl $-0x5, %ecx
ja 0x7bf83
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 0x85c94
movl %eax, 0x1d8(%rbx)
movl 0x34(%rbx), %edi
movslq 0x19c(%rbx), %rsi
shlq $0x3, %rsi
callq 0x85c94
movl %eax, 0x1dc(%rbx)
movl $0x0, 0x1e0(%rbx)
cmpl $0x0, 0x1b0(%rbx)
jle 0x7c0f1
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 0x7c02e
movq (%rbx), %rax
movl $0xd, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
testl %ebp, %ebp
jle 0x7c053
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
ja 0x7c034
incq %r14
movslq 0x1b0(%rbx), %rcx
cmpq %rcx, %r14
jl 0x7bfcf
testl %ecx, %ecx
jle 0x7c0f1
xorl %r15d, %r15d
movq 0x1b8(%rbx,%r15,8), %r12
cmpq $0x0, 0x50(%r12)
jne 0x7c0e6
movl 0x10(%r12), %r14d
cmpq $0x3, %r14
ja 0x7c097
cmpq $0x0, 0xc8(%rbx,%r14,8)
jne 0x7c0ad
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)
movl 0x1b0(%rbx), %ecx
incq %r15
movslq %ecx, %rax
cmpq %rax, %r15
jl 0x7c071
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_O3/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), %r15d
movq (%rdi), %rax
movl $0x79, 0x28(%rax)
movl %r15d, 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), %r12d
andl $0x7, %r12d
orl %eax, %r12d
leal -0x1(%r14), %r13d
andl $0x7, %r13d
orl %eax, %r13d
addl $0x6, %r14d
andl $0x7, %r14d
orl %eax, %r14d
cmpl $0xc0, %r15d
jl 0x7c1cf
leal -0xd8(%r15), %eax
cmpl $-0x8, %eax
jb 0x7c20e
cmpl %ebp, %r15d
je 0x7c20e
cmpl %r12d, %r15d
je 0x7c20e
cmpl %r13d, %r15d
je 0x7c1cf
cmpl %r14d, %r15d
jne 0x7c236
movq (%rbx), %rax
movl $0x61, 0x28(%rax)
movl %r15d, 0x2c(%rax)
movq (%rbx), %rax
movl $0x2, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x4, %esi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x7c27a
testl %eax, %eax
je 0x7c20a
movl 0x21c(%rbx), %r15d
jmp 0x7c1a6
xorl %eax, %eax
jmp 0x7c26b
movq (%rbx), %rax
movl $0x61, 0x28(%rax)
movl %r15d, 0x2c(%rax)
movq (%rbx), %rax
movl $0x3, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x4, %esi
callq *0x8(%rax)
jmp 0x7c266
movq (%rbx), %rax
movl $0x61, 0x28(%rax)
movl %r15d, 0x2c(%rax)
movq (%rbx), %rax
movl $0x1, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x4, %esi
callq *0x8(%rax)
movl $0x0, 0x21c(%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_O3/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 0x7c2ab
movq %rbx, %rdi
callq *0x18(%r14)
testl %eax, %eax
je 0x7c394
movq (%r14), %r12
movq 0x8(%r14), %r15
leaq 0x1(%r12), %rax
decq %r15
cmpb $-0x1, (%r12)
je 0x7c2f7
movq 0x248(%rbx), %rcx
incl 0x24(%rcx)
movq %rax, (%r14)
movq %r15, 0x8(%r14)
testq %r15, %r15
jne 0x7c2e6
movq %rbx, %rdi
callq *0x18(%r14)
testl %eax, %eax
je 0x7c394
movq (%r14), %rax
movq 0x8(%r14), %r15
leaq 0x1(%rax), %r12
decq %r15
cmpb $-0x1, (%rax)
movq %r12, %rax
jne 0x7c2ba
jmp 0x7c2fa
movq %rax, %r12
testq %r15, %r15
jne 0x7c315
movq %rbx, %rdi
callq *0x18(%r14)
testl %eax, %eax
je 0x7c394
movq (%r14), %r12
movq 0x8(%r14), %r15
decq %r15
movzbl (%r12), %ebp
incq %r12
cmpl $0xff, %ebp
je 0x7c2fa
testl %ebp, %ebp
jne 0x7c343
movq 0x248(%rbx), %rax
addl $0x2, 0x24(%rax)
movq %r12, (%r14)
movq %r15, 0x8(%r14)
jmp 0x7c290
movq 0x248(%rbx), %rax
movl 0x24(%rax), %eax
testl %eax, %eax
je 0x7c380
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 0x7c396
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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        # 0x7c456
movq %rcx, (%rax)
leaq 0xb9(%rip), %rcx        # 0x7c481
movq %rcx, 0x8(%rax)
leaq 0xcaf(%rip), %rcx       # 0x7d082
movq %rcx, 0x10(%rax)
leaq 0xd2a(%rip), %rdx       # 0x7d108
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 0x7c3fd
leaq 0xdaf(%rip), %rcx       # 0x7d1ce
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_O3/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
movl 0x21c(%rdi), %eax
testl %eax, %eax
jne 0x7d0a2
movq %rbx, %rdi
callq 0x7c27a
testl %eax, %eax
je 0x7d104
movl 0x21c(%rbx), %eax
movq 0x248(%rbx), %rcx
movl 0x20(%rcx), %esi
leal 0xd0(%rsi), %ecx
cmpl %ecx, %eax
jne 0x7d0dd
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 0x7d0eb
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
testl %eax, %eax
je 0x7d104
movq 0x248(%rbx), %rax
movl 0x20(%rax), %ecx
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x20(%rax)
movl $0x1, %eax
jmp 0x7d106
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7d136
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7d1bd
movq 0x8(%r15), %r12
movq (%r15), %r13
movzbl (%r13), %ebp
decq %r12
je 0x7d148
incq %r13
jmp 0x7d15a
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7d1bd
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 0x7d1b6
movq 0x28(%rbx), %rax
movq %rbx, %rdi
movq %rbp, %rsi
callq *0x20(%rax)
movl $0x1, %eax
jmp 0x7d1bf
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_O3/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 0x7d1ff
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7d2ce
movq 0x8(%r15), %r12
movq (%r15), %r13
movzbl (%r13), %r14d
decq %r12
je 0x7d211
incq %r13
jmp 0x7d227
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7d2ce
movq (%r15), %r13
movq 0x8(%r15), %r12
shll $0x8, %r14d
movzbl (%r13), %eax
movq %r14, %rcx
orq %rax, %rcx
addq %r14, %rax
addq $-0x2, %rax
xorl %r14d, %r14d
cmpq $0x3, %rcx
movq %rax, 0x10(%rsp)
cmovbl %r14d, %eax
cmpq $0x10, %rcx
movl $0xe, %edx
cmovbl %eax, %edx
incq %r13
decq %r12
testl %edx, %edx
je 0x7d29d
movl %edx, 0xc(%rsp)
movl %edx, %r14d
xorl %ebp, %ebp
testq %r12, %r12
jne 0x7d283
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x7d2ce
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 0x7d26c
movl 0xc(%rsp), %edx
movq 0x10(%rsp), %rax
subq %r14, %rax
movq %rax, %r14
movl 0x21c(%rbx), %eax
cmpl $0xee, %eax
je 0x7d2d2
cmpl $0xe0, %eax
jne 0x7d2e4
leaq 0x1a(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rcx
callq 0x7d9ef
jmp 0x7d2f9
xorl %ebp, %ebp
jmp 0x7d317
leaq 0x1a(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rcx
callq 0x7dc29
jmp 0x7d2f9
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 0x7d317
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