LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: reset_marker_reader
METHODDEF(void)
reset_marker_reader (j_decompress_ptr cinfo)
{
  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;

  cinfo->comp_info = NULL;		/* until allocated by get_sof */
  cinfo->input_scan_number = 0;		/* no SOS seen yet */
  cinfo->unread_marker = 0;		/* no pending marker */
  marker->pub.saw_SOI = FALSE;		/* set internal state too */
  marker->pub.saw_SOF = FALSE;
  marker->pub.discarded_bytes = 0;
  marker->cur_marker = NULL;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq 0x248(%rax), %rax
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq $0x0, 0x130(%rax)
movq -0x8(%rsp), %rax
movl $0x0, 0xac(%rax)
movq -0x8(%rsp), %rax
movl $0x0, 0x21c(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x18(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x1c(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x24(%rax)
movq -0x10(%rsp), %rax
movq $0x0, 0xf8(%rax)
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpl $0x0, 0x21c(%rax)
jne 0xe5d35
movq 0x8(%rsp), %rdi
callq 0xe5500
cmpl $0x0, %eax
jne 0xe5d33
movl $0x0, 0x14(%rsp)
jmp 0xe5e0b
jmp 0xe5d35
movq 0x8(%rsp), %rax
movl 0x21c(%rax), %eax
movq 0x8(%rsp), %rcx
movq 0x248(%rcx), %rcx
movl 0x20(%rcx), %ecx
addl $0xd0, %ecx
cmpl %ecx, %eax
jne 0xe5dab
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl $0x62, 0x28(%rax)
movq 0x8(%rsp), %rax
movq 0x248(%rax), %rax
movl 0x20(%rax), %ecx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x2c(%rax)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rsp), %rdi
movl $0x3, %esi
callq *%rax
movq 0x8(%rsp), %rax
movl $0x0, 0x21c(%rax)
jmp 0xe5ddf
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rsp), %rdi
movq 0x8(%rsp), %rcx
movq 0x248(%rcx), %rcx
movl 0x20(%rcx), %esi
callq *%rax
cmpl $0x0, %eax
jne 0xe5ddd
movl $0x0, 0x14(%rsp)
jmp 0xe5e0b
jmp 0xe5ddf
movq 0x8(%rsp), %rax
movq 0x248(%rax), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
andl $0x7, %ecx
movq 0x8(%rsp), %rax
movq 0x248(%rax), %rax
movl %ecx, 0x20(%rax)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xe5e97
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rsp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xe5e7c
movl $0x0, 0x34(%rsp)
jmp 0xe5fd5
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movzbl (%rax), %eax
shll $0x8, %eax
movl %eax, %eax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xe5f08
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rsp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xe5eed
movl $0x0, 0x34(%rsp)
jmp 0xe5fd5
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movzbl (%rax), %eax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
subq $0x2, %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl $0x5b, 0x28(%rax)
movq 0x28(%rsp), %rax
movl 0x21c(%rax), %ecx
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x2c(%rax)
movq 0x20(%rsp), %rax
movl %eax, %ecx
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x30(%rax)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq *%rax
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x20(%rsp)
jle 0xe5fcd
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x20(%rax), %rax
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq *%rax
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x248(%rax), %rax
movq %rax, 0x8(%rsp)
cmpl $0xfe, 0x1c(%rsp)
jne 0xe69bd
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
jmp 0xe6a21
cmpl $0xe0, 0x1c(%rsp)
jl 0xe69ef
cmpl $0xef, 0x1c(%rsp)
jg 0xe69ef
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rax
movl 0x1c(%rsp), %ecx
subl $0xe0, %ecx
movslq %ecx, %rcx
movq %rdx, 0x30(%rax,%rcx,8)
jmp 0xe6a1f
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl $0x44, 0x28(%rax)
movl 0x1c(%rsp), %ecx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x2c(%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdi
callq *%rax
jmp 0xe6a21
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: first_marker
LOCAL(jboolean)
first_marker (j_decompress_ptr cinfo)
/* Like next_marker, but used to obtain the initial SOI marker. */
/* For this marker, we do not allow preceding garbage or fill; otherwise,
 * we might well scan an entire input file before realizing it ain't JPEG.
 * If an application wants to process non-JFIF files, it must seek to the
 * SOI before calling the JPEG library.
 */
{
  int c, c2;
  INPUT_VARS(cinfo);

  INPUT_BYTE(cinfo, c, return FALSE);
  INPUT_BYTE(cinfo, c2, return FALSE);
  if (c != 0xFF || c2 != (int) M_SOI)
    ERREXIT2(cinfo, JERR_NO_SOI, c, c2);

  cinfo->unread_marker = c2;

  INPUT_SYNC(cinfo);
  return TRUE;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0xe6aa7
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rsp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xe6a8c
movl $0x0, 0x34(%rsp)
jmp 0xe6bbf
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movzbl (%rax), %eax
movl %eax, 0x24(%rsp)
jmp 0xe6acf
cmpq $0x0, 0x8(%rsp)
jne 0xe6b14
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rsp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xe6af9
movl $0x0, 0x34(%rsp)
jmp 0xe6bbf
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movzbl (%rax), %eax
movl %eax, 0x20(%rsp)
cmpl $0xff, 0x24(%rsp)
jne 0xe6b4e
cmpl $0xd8, 0x20(%rsp)
je 0xe6b8d
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl $0x35, 0x28(%rax)
movl 0x24(%rsp), %ecx
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x2c(%rax)
movl 0x20(%rsp), %ecx
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x30(%rax)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rdi
callq *%rax
movl 0x20(%rsp), %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x21c(%rax)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: get_soi
LOCAL(jboolean)
get_soi (j_decompress_ptr cinfo)
/* Process an SOI marker */
{
  int i;
  
  TRACEMS(cinfo, 1, JTRC_SOI);

  if (cinfo->marker->saw_SOI)
    ERREXIT(cinfo, JERR_SOI_DUPLICATE);

  /* Reset all parameters that are defined to be reset by SOI */

  for (i = 0; i < NUM_ARITH_TBLS; i++) {
    cinfo->arith_dc_L[i] = 0;
    cinfo->arith_dc_U[i] = 1;
    cinfo->arith_ac_K[i] = 5;
  }
  cinfo->restart_interval = 0;

  /* Set initial assumptions for colorspace etc */

  cinfo->jpeg_color_space = JCS_UNKNOWN;
  cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */

  cinfo->saw_JFIF_marker = FALSE;
  cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */
  cinfo->JFIF_minor_version = 1;
  cinfo->density_unit = 0;
  cinfo->X_density = 1;
  cinfo->Y_density = 1;
  cinfo->saw_Adobe_marker = FALSE;
  cinfo->Adobe_transform = 0;

  cinfo->marker->saw_SOI = TRUE;

  return TRUE;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x66, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq *%rax
movq 0x10(%rsp), %rax
movq 0x248(%rax), %rax
cmpl $0x0, 0x18(%rax)
je 0xe6c33
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x3d, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movl $0x0, 0xc(%rsp)
cmpl $0x10, 0xc(%rsp)
jge 0xe6c85
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movb $0x0, 0x140(%rax,%rcx)
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movb $0x1, 0x150(%rax,%rcx)
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movb $0x5, 0x160(%rax,%rcx)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xe6c3b
movq 0x10(%rsp), %rax
movl $0x0, 0x170(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x3c(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x188(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x174(%rax)
movq 0x10(%rsp), %rax
movb $0x1, 0x178(%rax)
movq 0x10(%rsp), %rax
movb $0x1, 0x179(%rax)
movq 0x10(%rsp), %rax
movb $0x0, 0x17a(%rax)
movq 0x10(%rsp), %rax
movw $0x1, 0x17c(%rax)
movq 0x10(%rsp), %rax
movw $0x1, 0x17e(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x180(%rax)
movq 0x10(%rsp), %rax
movb $0x0, 0x184(%rax)
movq 0x10(%rsp), %rax
movq 0x248(%rax), %rax
movl $0x1, 0x18(%rax)
movl $0x1, %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movq %rcx, 0x18(%rsp)
cmpl $0xc, 0x24(%rsp)
jb 0xe914d
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x41, %eax
jne 0xe914d
movq 0x28(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x64, %eax
jne 0xe914d
movq 0x28(%rsp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x6f, %eax
jne 0xe914d
movq 0x28(%rsp), %rax
movzbl 0x3(%rax), %eax
cmpl $0x62, %eax
jne 0xe914d
movq 0x28(%rsp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x65, %eax
jne 0xe914d
movq 0x28(%rsp), %rax
movzbl 0x5(%rax), %eax
shll $0x8, %eax
movq 0x28(%rsp), %rcx
movzbl 0x6(%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %rax
movzbl 0x7(%rax), %eax
shll $0x8, %eax
movq 0x28(%rsp), %rcx
movzbl 0x8(%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movzbl 0x9(%rax), %eax
shll $0x8, %eax
movq 0x28(%rsp), %rcx
movzbl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rax
movzbl 0xb(%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
addq $0x2c, %rax
movq %rax, (%rsp)
movl 0x14(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, (%rax)
movl 0x10(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x4(%rax)
movl 0xc(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x8(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl $0x4c, 0x28(%rax)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq *%rax
movq 0x30(%rsp), %rax
movl $0x1, 0x180(%rax)
movl 0x8(%rsp), %eax
movb %al, %cl
movq 0x30(%rsp), %rax
movb %cl, 0x184(%rax)
jmp 0xe918a
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl $0x4e, 0x28(%rax)
movl 0x24(%rsp), %eax
addq 0x18(%rsp), %rax
movl %eax, %ecx
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x2c(%rax)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq *%rax
addq $0x38, %rsp
retq
nop
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
movl $0x1, %esi
movl $0x170, %edx            # imm = 0x170
callq *%rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x250(%rax)
movq 0x8(%rsp), %rax
leaq 0x68(%rip), %rcx        # 0xe9cf0
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
leaq 0x2d9(%rip), %rcx       # 0xe9f70
movq %rcx, 0x8(%rax)
movl $0x0, 0x4(%rsp)
cmpl $0x4, 0x4(%rsp)
jge 0xe9cdd
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq $0x0, 0x60(%rax,%rcx,8)
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq $0x0, 0x40(%rax,%rcx,8)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xe9ca3
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdhuff.c
// Function: process_restart
LOCAL(jboolean)
process_restart (j_decompress_ptr cinfo)
{
  huff_entropy_ptr entropy = (huff_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;

  /* 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x250(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x20(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x18(%rsp), %rax
movq 0x248(%rax), %rax
addl 0x24(%rax), %ecx
movl %ecx, 0x24(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x20(%rax)
movq 0x18(%rsp), %rax
movq 0x248(%rax), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xea900
movl $0x0, 0x24(%rsp)
jmp 0xea96d
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x1b0(%rcx), %eax
jge 0xea938
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl $0x0, 0x28(%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xea908
movq 0x18(%rsp), %rax
movl 0x170(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x38(%rax)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x21c(%rax)
jne 0xea965
movq 0x10(%rsp), %rax
movl $0x0, 0x10(%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x68, %edx
callq *%rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x250(%rax)
movq 0x18(%rsp), %rax
leaq 0xe8(%rip), %rcx        # 0xeaab0
movq %rcx, (%rax)
movl $0x0, 0x8(%rsp)
cmpl $0x4, 0x8(%rsp)
jge 0xea9fa
movq 0x18(%rsp), %rax
movslq 0x8(%rsp), %rcx
movq $0x0, 0x40(%rax,%rcx,8)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xea9d3
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rcx
movl 0x38(%rcx), %ecx
shll $0x6, %ecx
movslq %ecx, %rdx
shlq $0x2, %rdx
movl $0x1, %esi
callq *%rax
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0xc0(%rax)
movq 0x20(%rsp), %rax
movq 0xc0(%rax), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x38(%rcx), %eax
jge 0xeaa9c
movl $0x0, 0x8(%rsp)
cmpl $0x40, 0x8(%rsp)
jge 0xeaa8d
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, 0x10(%rsp)
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xeaa62
jmp 0xeaa8f
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xeaa4c
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x250(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x20(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq 0x18(%rsp), %rax
movq 0x248(%rax), %rax
addl 0x24(%rax), %ecx
movl %ecx, 0x24(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x20(%rax)
movq 0x18(%rsp), %rax
movq 0x248(%rax), %rax
movq 0x10(%rax), %rax
movq 0x18(%rsp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xec390
movl $0x0, 0x24(%rsp)
jmp 0xec409
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl 0x1b0(%rcx), %eax
jge 0xec3c8
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl $0x0, 0x2c(%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xec398
movq 0x10(%rsp), %rax
movl $0x0, 0x28(%rax)
movq 0x18(%rsp), %rax
movl 0x170(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x3c(%rax)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x21c(%rax)
jne 0xec401
movq 0x10(%rsp), %rax
movl $0x0, 0x10(%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdmainct.c
// Function: start_pass_main
METHODDEF(void)
start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;

  switch (pass_mode) {
  case JBUF_PASS_THRU:
    if (cinfo->upsample->need_context_rows) {
      mainp->pub.process_data = process_data_context_main;
      make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
      mainp->whichptr = 0;	/* Read first iMCU row into xbuffer[0] */
      mainp->context_state = CTX_PREPARE_FOR_IMCU;
      mainp->iMCU_row_ctr = 0;
    } else {
      /* Simple case with no context needed */
      mainp->pub.process_data = process_data_simple_main;
    }
    mainp->buffer_full = FALSE;	/* Mark buffer empty */
    mainp->rowgroup_ctr = 0;
    break;
#ifdef QUANT_2PASS_SUPPORTED
  case JBUF_CRANK_DEST:
    /* For last pass of 2-pass quantization, just crank the postprocessor */
    mainp->pub.process_data = process_data_crank_post;
    break;
#endif
  default:
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    break;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movq 0x228(%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0xec5fe
jmp 0xec5ec
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0xec67d
jmp 0xec68f
movq 0x20(%rsp), %rax
movq 0x260(%rax), %rax
cmpl $0x0, 0x10(%rax)
je 0xec653
movq 0x10(%rsp), %rax
leaq 0x234(%rip), %rcx       # 0xec850
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rdi
callq 0xecad0
movq 0x10(%rsp), %rax
movl $0x0, 0x78(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x7c(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x84(%rax)
jmp 0xec663
movq 0x10(%rsp), %rax
leaq 0x671(%rip), %rcx       # 0xeccd0
movq %rcx, 0x8(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x60(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x64(%rax)
jmp 0xec6b0
movq 0x10(%rsp), %rax
leaq 0x737(%rip), %rcx       # 0xecdc0
movq %rcx, 0x8(%rax)
jmp 0xec6b0
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl $0x4, 0x28(%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdi
callq *%rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movl %ecx, 0x1c(%rsp)
movq 0x30(%rsp), %rax
movq 0x228(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x60(%rax)
jne 0xecd39
movq 0x30(%rsp), %rax
movq 0x230(%rax), %rax
movq 0x18(%rax), %rax
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x10, %rsi
callq *%rax
cmpl $0x0, %eax
jne 0xecd2d
jmp 0xecdae
movq 0x10(%rsp), %rax
movl $0x1, 0x60(%rax)
movq 0x30(%rsp), %rax
movl 0x1a0(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rax
movq 0x238(%rax), %rax
movq 0x8(%rax), %rax
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x10, %rsi
movq 0x10(%rsp), %rdx
addq $0x64, %rdx
movl 0xc(%rsp), %ecx
movq 0x28(%rsp), %r8
movq 0x20(%rsp), %r9
movl 0x1c(%rsp), %r10d
movl %r10d, (%rsp)
callq *%rax
movq 0x10(%rsp), %rax
movl 0x64(%rax), %eax
cmpl 0xc(%rsp), %eax
jb 0xecdae
movq 0x10(%rsp), %rax
movl $0x0, 0x60(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x64(%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdmainct.c
// Function: set_bottom_pointers
LOCAL(void)
set_bottom_pointers (j_decompress_ptr cinfo)
/* Change the pointer lists to duplicate the last sample row at the bottom
 * of the image.  whichptr indicates which xbuffer holds the final iMCU row.
 * Also sets rowgroups_avail to indicate number of nondummy row groups in row.
 */
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;
  int ci, i, rgroup, iMCUheight, rows_left;
  jpeg_component_info *compptr;
  JSAMPARRAY xbuf;

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    /* Count sample rows in one iMCU row and in one row group */
    iMCUheight = compptr->v_samp_factor * compptr->DCT_scaled_size;
    rgroup = iMCUheight / cinfo->min_DCT_scaled_size;
    /* Count nondummy sample rows remaining for this component */
    rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);
    if (rows_left == 0) rows_left = iMCUheight;
    /* Count nondummy row groups.  Should get same answer for each component,
     * so we need only do it once.
     */
    if (ci == 0) {
      mainp->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);
    }
    /* Duplicate the last real sample row rgroup*2 times; this pads out the
     * last partial rowgroup and ensures at least one full rowgroup of context.
     */
    xbuf = mainp->xbuffer[mainp->whichptr][ci];
    for (i = 0; i < rgroup * 2; i++) {
      xbuf[rows_left + i] = xbuf[rows_left-1];
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq 0x228(%rax), %rax
movq %rax, -0x10(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x8(%rsp), %rax
movq 0x130(%rax), %rax
movq %rax, -0x30(%rsp)
movl -0x14(%rsp), %eax
movq -0x8(%rsp), %rcx
cmpl 0x38(%rcx), %eax
jge 0xecf49
movq -0x30(%rsp), %rax
movl 0xc(%rax), %eax
movq -0x30(%rsp), %rcx
imull 0x24(%rcx), %eax
movl %eax, -0x20(%rsp)
movl -0x20(%rsp), %eax
movq -0x8(%rsp), %rcx
cltd
idivl 0x1a0(%rcx)
movl %eax, -0x1c(%rsp)
movq -0x30(%rsp), %rax
movl 0x2c(%rax), %eax
xorl %edx, %edx
divl -0x20(%rsp)
movl %edx, -0x24(%rsp)
cmpl $0x0, -0x24(%rsp)
jne 0xece9b
movl -0x20(%rsp), %eax
movl %eax, -0x24(%rsp)
cmpl $0x0, -0x14(%rsp)
jne 0xecebe
movl -0x24(%rsp), %eax
subl $0x1, %eax
cltd
idivl -0x1c(%rsp)
movl %eax, %ecx
addl $0x1, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0x80(%rax)
movq -0x10(%rsp), %rax
movq -0x10(%rsp), %rcx
movslq 0x78(%rcx), %rcx
movq 0x68(%rax,%rcx,8), %rax
movslq -0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rsp)
movl $0x0, -0x18(%rsp)
movl -0x18(%rsp), %eax
movl -0x1c(%rsp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0xecf29
movq -0x38(%rsp), %rax
movl -0x24(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rsp), %rax
movl -0x24(%rsp), %ecx
addl -0x18(%rsp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0xecee7
jmp 0xecf2b
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
movq -0x30(%rsp), %rax
addq $0x60, %rax
movq %rax, -0x30(%rsp)
jmp 0xece3f
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdmainct.c
// Function: set_wraparound_pointers
LOCAL(void)
set_wraparound_pointers (j_decompress_ptr cinfo)
/* Set up the "wraparound" pointers at top and bottom of the pointer lists.
 * This changes the pointer list state from top-of-image to the normal state.
 */
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;
  int ci, i, rgroup;
  int M = cinfo->min_DCT_scaled_size;
  jpeg_component_info *compptr;
  JSAMPARRAY xbuf0, xbuf1;

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) /
      cinfo->min_DCT_scaled_size; /* height of a row group of component */
    xbuf0 = mainp->xbuffer[0][ci];
    xbuf1 = mainp->xbuffer[1][ci];
    for (i = 0; i < rgroup; i++) {
      xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];
      xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];
      xbuf0[rgroup*(M+2) + i] = xbuf0[i];
      xbuf1[rgroup*(M+2) + i] = xbuf1[i];
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq 0x228(%rax), %rax
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
movl 0x1a0(%rax), %eax
movl %eax, -0x20(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x8(%rsp), %rax
movq 0x130(%rax), %rax
movq %rax, -0x28(%rsp)
movl -0x14(%rsp), %eax
movq -0x8(%rsp), %rcx
cmpl 0x38(%rcx), %eax
jge 0xed0f1
movq -0x28(%rsp), %rax
movl 0xc(%rax), %eax
movq -0x28(%rsp), %rcx
imull 0x24(%rcx), %eax
movq -0x8(%rsp), %rcx
cltd
idivl 0x1a0(%rcx)
movl %eax, -0x1c(%rsp)
movq -0x10(%rsp), %rax
movq 0x68(%rax), %rax
movslq -0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rsp)
movq -0x10(%rsp), %rax
movq 0x70(%rax), %rax
movslq -0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rsp)
movl $0x0, -0x18(%rsp)
movl -0x18(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jge 0xed0d1
movq -0x30(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl -0x20(%rsp), %edx
addl $0x1, %edx
imull %edx, %ecx
addl -0x18(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x30(%rsp), %rax
movl -0x18(%rsp), %ecx
subl -0x1c(%rsp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl -0x20(%rsp), %edx
addl $0x1, %edx
imull %edx, %ecx
addl -0x18(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rsp), %rax
movl -0x18(%rsp), %ecx
subl -0x1c(%rsp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rsp), %rax
movslq -0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x30(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl -0x20(%rsp), %esi
addl $0x2, %esi
imull %esi, %ecx
addl -0x18(%rsp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rsp), %rax
movslq -0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x38(%rsp), %rax
movl -0x1c(%rsp), %ecx
movl -0x20(%rsp), %esi
addl $0x2, %esi
imull %esi, %ecx
addl -0x18(%rsp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0xecff7
jmp 0xed0d3
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
movq -0x28(%rsp), %rax
addq $0x60, %rax
movq %rax, -0x28(%rsp)
jmp 0xecf8e
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdcoefct.c
// Function: start_output_pass
METHODDEF(void)
start_output_pass (j_decompress_ptr cinfo)
{
#ifdef BLOCK_SMOOTHING_SUPPORTED
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;

  /* If multipass, check to see whether to use block smoothing on this pass */
  if (coef->pub.coef_arrays != NULL) {
    if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
      coef->pub.decompress_data = decompress_smooth_data;
    else
      coef->pub.decompress_data = decompress_data;
  }
#endif
  cinfo->output_iMCU_row = 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x230(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0xed3c4
movq 0x10(%rsp), %rax
cmpl $0x0, 0x68(%rax)
je 0xed3b2
movq 0x10(%rsp), %rdi
callq 0xeddb0
cmpl $0x0, %eax
je 0xed3b2
movq 0x8(%rsp), %rax
leaq 0xc14(%rip), %rcx       # 0xedfc0
movq %rcx, 0x18(%rax)
jmp 0xed3c2
movq 0x8(%rsp), %rax
leaq 0x2f2(%rip), %rcx       # 0xed6b0
movq %rcx, 0x18(%rax)
jmp 0xed3c4
movq 0x10(%rsp), %rax
movl $0x0, 0xb8(%rax)
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdcoefct.c
// Function: start_iMCU_row
LOCAL(void)
start_iMCU_row (j_decompress_ptr cinfo)
/* Reset within-iMCU-row counters for a new row (input side) */
{
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;

  /* In an interleaved scan, an MCU row is the same as an iMCU row.
   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
   * But at the bottom of the image, process only what's left.
   */
  if (cinfo->comps_in_scan > 1) {
    coef->MCU_rows_per_iMCU_row = 1;
  } else {
    if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))
      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
    else
      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
  }

  coef->MCU_ctr = 0;
  coef->MCU_vert_offset = 0;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq 0x230(%rax), %rax
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
cmpl $0x1, 0x1b0(%rax)
jle 0xedd42
movq -0x10(%rsp), %rax
movl $0x1, 0x30(%rax)
jmp 0xedd91
movq -0x8(%rsp), %rax
movl 0xb0(%rax), %eax
movq -0x8(%rsp), %rcx
movl 0x1a4(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0xedd78
movq -0x8(%rsp), %rax
movq 0x1b8(%rax), %rax
movl 0xc(%rax), %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0x30(%rax)
jmp 0xedd8f
movq -0x8(%rsp), %rax
movq 0x1b8(%rax), %rax
movl 0x48(%rax), %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0x30(%rax)
jmp 0xedd91
movq -0x10(%rsp), %rax
movl $0x0, 0x28(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x2c(%rax)
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: post_process_1pass
METHODDEF(void)
post_process_1pass (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION num_rows, max_rows;

  /* Fill the buffer, but not more than what we can dump out in one go. */
  /* Note we rely on the upsampler to detect bottom of image. */
  max_rows = out_rows_avail - *out_row_ctr;
  if (max_rows > post->strip_height)
    max_rows = post->strip_height;
  num_rows = 0;
  (*cinfo->upsample->upsample) (cinfo,
		input_buf, in_row_group_ctr, in_row_groups_avail,
		post->buffer, &num_rows, max_rows);
  /* Quantize and emit data. */
  (*cinfo->cquantize->color_quantize) (cinfo,
		post->buffer, output_buf + *out_row_ctr, (int) num_rows);
  *out_row_ctr += num_rows;
}

// Assembly:
subq $0x48, %rsp
movl 0x50(%rsp), %eax
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x238(%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x50(%rsp), %eax
movq 0x18(%rsp), %rcx
subl (%rcx), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jbe 0xeef5f
movq 0x10(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
movq 0x40(%rsp), %rax
movq 0x260(%rax), %rax
movq 0x8(%rax), %rax
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl 0x2c(%rsp), %ecx
movq 0x10(%rsp), %r8
movq 0x18(%r8), %r8
movl 0x8(%rsp), %r10d
leaq 0xc(%rsp), %r9
movl %r10d, (%rsp)
callq *%rax
movq 0x40(%rsp), %rax
movq 0x270(%rax), %rax
movq 0x8(%rax), %rax
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movl (%rcx), %ecx
shlq $0x3, %rcx
addq %rcx, %rdx
movl 0xc(%rsp), %ecx
callq *%rax
movl 0xc(%rsp), %ecx
movq 0x18(%rsp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: post_process_prepass
METHODDEF(void)
post_process_prepass (j_decompress_ptr cinfo,
		      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		      JDIMENSION in_row_groups_avail,
		      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		      JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION old_next_row, num_rows;

  /* Reposition virtual buffer if at start of strip. */
  if (post->next_row == 0) {
    post->buffer = (*cinfo->mem->access_virt_sarray)
	((j_common_ptr) cinfo, post->whole_image,
	 post->starting_row, post->strip_height, TRUE);
  }

  /* Upsample some data (up to a strip height's worth). */
  old_next_row = post->next_row;
  (*cinfo->upsample->upsample) (cinfo,
		input_buf, in_row_group_ctr, in_row_groups_avail,
		post->buffer, &post->next_row, post->strip_height);

  /* Allow quantizer to scan new data.  No data is emitted, */
  /* but we advance out_row_ctr so outer loop can tell when we're done. */
  if (post->next_row > old_next_row) {
    num_rows = post->next_row - old_next_row;
    (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,
					 (JSAMPARRAY) NULL, (int) num_rows);
    *out_row_ctr += num_rows;
  }

  /* Advance if we filled the strip. */
  if (post->next_row >= post->strip_height) {
    post->starting_row += post->strip_height;
    post->next_row = 0;
  }
}

// Assembly:
subq $0x48, %rsp
movl 0x50(%rsp), %eax
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x238(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x28(%rax)
jne 0xef070
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rax
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rsi
movq 0x10(%rsp), %rcx
movl 0x24(%rcx), %edx
movq 0x10(%rsp), %rcx
movl 0x20(%rcx), %ecx
movl $0x1, %r8d
callq *%rax
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rax
movl 0x28(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x40(%rsp), %rax
movq 0x260(%rax), %rax
movq 0x8(%rax), %rax
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl 0x2c(%rsp), %ecx
movq 0x10(%rsp), %r8
movq 0x18(%r8), %r8
movq 0x10(%rsp), %r9
addq $0x28, %r9
movq 0x10(%rsp), %r10
movl 0x20(%r10), %r10d
movl %r10d, (%rsp)
callq *%rax
movq 0x10(%rsp), %rax
movl 0x28(%rax), %eax
cmpl 0xc(%rsp), %eax
jbe 0xef11c
movq 0x10(%rsp), %rax
movl 0x28(%rax), %eax
subl 0xc(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq 0x270(%rax), %rax
movq 0x8(%rax), %rax
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rsi
movl 0xc(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rsi
movl 0x8(%rsp), %ecx
xorl %edx, %edx
callq *%rax
movl 0x8(%rsp), %ecx
movq 0x18(%rsp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movl 0x28(%rax), %eax
movq 0x10(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jb 0xef14d
movq 0x10(%rsp), %rax
movl 0x20(%rax), %ecx
movq 0x10(%rsp), %rax
addl 0x24(%rax), %ecx
movl %ecx, 0x24(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x28(%rax)
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jddctmgr.c
// Function: jinit_inverse_dct
GLOBAL(void)
jinit_inverse_dct (j_decompress_ptr cinfo)
{
  my_idct_ptr idct;
  int ci;
  jpeg_component_info *compptr;

  idct = (my_idct_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_idct_controller));
  cinfo->idct = (struct jpeg_inverse_dct *) idct;
  idct->pub.start_pass = start_pass;

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    /* Allocate and pre-zero a multiplier table for each component */
    compptr->dct_table =
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  SIZEOF(multiplier_table));
    MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));
    /* Mark multiplier table not yet set up for any method */
    idct->cur_method[ci] = -1;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x80, %edx
callq *%rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x258(%rax)
movq 0x18(%rsp), %rax
leaq 0xa8(%rip), %rcx        # 0xef3d0
movq %rcx, (%rax)
movl $0x0, 0x14(%rsp)
movq 0x20(%rsp), %rax
movq 0x130(%rax), %rax
movq %rax, 0x8(%rsp)
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x38(%rcx), %eax
jge 0xef3bd
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x100, %edx            # imm = 0x100
callq *%rax
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x8(%rsp), %rax
movq 0x58(%rax), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0xf280
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movl $0xffffffff, 0x58(%rax,%rcx,4) # imm = 0xFFFFFFFF
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x8(%rsp), %rax
addq $0x60, %rax
movq %rax, 0x8(%rsp)
jmp 0xef344
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jidctred.c
// Function: jpeg_idct_1x1
GLOBAL(void)
jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	       JCOEFPTR coef_block,
	       JSAMPARRAY output_buf, JDIMENSION output_col)
{
  int dcval;
  ISLOW_MULT_TYPE * quantptr;
  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
  SHIFT_TEMPS

  /* We hardly need an inverse DCT routine for this: just take the
   * average pixel value, which is one-eighth of the DC coefficient.
   */
  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
  dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
  dcval = (int) DESCALE((INT32) dcval, 3);

  output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
movl %r8d, -0x24(%rsp)
movq -0x8(%rsp), %rax
movq 0x1a8(%rax), %rax
addq $0x80, %rax
movq %rax, -0x38(%rsp)
movq -0x10(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x30(%rsp)
movq -0x18(%rsp), %rax
movswl (%rax), %eax
movq -0x30(%rsp), %rcx
imull (%rcx), %eax
movl %eax, -0x28(%rsp)
movslq -0x28(%rsp), %rax
addq $0x4, %rax
sarq $0x3, %rax
movl %eax, -0x28(%rsp)
movq -0x38(%rsp), %rax
movl -0x28(%rsp), %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x20(%rsp), %rax
movq (%rax), %rax
movl -0x24(%rsp), %ecx
movb %dl, (%rax,%rcx)
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdsample.c
// Function: h2v1_upsample
METHODDEF(void)
h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  JSAMPARRAY output_data = *output_data_ptr;
  register JSAMPROW inptr, outptr;
  register JSAMPLE invalue;
  JSAMPROW outend;
  int inrow;

  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
    inptr = input_data[inrow];
    outptr = output_data[inrow];
    outend = outptr + cinfo->output_width;
    while (outptr < outend) {
      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
      *outptr++ = invalue;
      *outptr++ = invalue;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
movq -0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rsp)
movl $0x0, -0x4c(%rsp)
movl -0x4c(%rsp), %eax
movq -0x8(%rsp), %rcx
cmpl 0x19c(%rcx), %eax
jge 0xf31b1
movq -0x18(%rsp), %rax
movslq -0x4c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rsp)
movq -0x28(%rsp), %rax
movslq -0x4c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rsp)
movq -0x38(%rsp), %rax
movq -0x8(%rsp), %rcx
movl 0x88(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x48(%rsp)
movq -0x38(%rsp), %rax
cmpq -0x48(%rsp), %rax
jae 0xf319f
movq -0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rsp)
movb (%rax), %al
movb %al, -0x39(%rsp)
movb -0x39(%rsp), %cl
movq -0x38(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rsp)
movb %cl, (%rax)
movb -0x39(%rsp), %cl
movq -0x38(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rsp)
movb %cl, (%rax)
jmp 0xf314c
jmp 0xf31a1
movl -0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rsp)
jmp 0xf30f9
retq
nopw %cs:(%rax,%rax)