LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdatadst.c
// Function: init_destination
METHODDEF(void)
init_destination (j_compress_ptr cinfo)
{
  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;

  /* Allocate the output buffer --- it will be released when done with image */
  dest->buffer = (JOCTET *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  OUTPUT_BUF_SIZE * SIZEOF(JOCTET));

  dest->pub.next_output_byte = dest->buffer;
  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
callq *%rax
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq $0x1000, 0x8(%rax)      # imm = 0x1000
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdatadst.c
// Function: empty_output_buffer
METHODDEF(jboolean)
empty_output_buffer (j_compress_ptr cinfo)
{
  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;

  if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=
      (size_t) OUTPUT_BUF_SIZE)
    ERREXIT(cinfo, JERR_FILE_WRITE);

  dest->pub.next_output_byte = dest->buffer;
  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;

  return TRUE;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rcx
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0xf980
cmpq $0x1000, %rax           # imm = 0x1000
je 0xd7171
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x25, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq $0x1000, 0x8(%rax)      # imm = 0x1000
movl $0x1, %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdatadst.c
// Function: term_destination
METHODDEF(void)
term_destination (j_compress_ptr cinfo)
{
  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
  size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;

  /* Write any data remaining in the buffer */
  if (datacount > 0) {
    if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
      ERREXIT(cinfo, JERR_FILE_WRITE);
  }
  fflush(dest->outfile);
  /* Make sure we wrote the output file OK */
  if (ferror(dest->outfile))
    ERREXIT(cinfo, JERR_FILE_WRITE);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movl $0x1000, %eax           # imm = 0x1000
subq 0x8(%rcx), %rax
movq %rax, (%rsp)
cmpq $0x0, (%rsp)
jbe 0xd7219
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rdi
movq (%rsp), %rdx
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rcx
movl $0x1, %esi
callq 0xf980
cmpq (%rsp), %rax
je 0xd7217
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x25, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
jmp 0xd7219
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0xf5d0
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0xf940
cmpl $0x0, %eax
je 0xd725b
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x25, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
addq $0x18, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcinit.c
// Function: jinit_compress_master
GLOBAL(void)
jinit_compress_master (j_compress_ptr cinfo)
{
  /* Initialize master control (includes parameter checking/processing) */
  jinit_c_master_control(cinfo, FALSE /* full compression */);

  /* Preprocessing */
  if (! cinfo->raw_data_in) {
    jinit_color_converter(cinfo);
    jinit_downsampler(cinfo);
    jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
  }
  /* Forward DCT */
  jinit_forward_dct(cinfo);
  /* Entropy encoding: either Huffman or arithmetic coding. */
  if (cinfo->arith_code) {
    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
  } else {
    if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
      jinit_phuff_encoder(cinfo);
#else
      ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
    } else
      jinit_huff_encoder(cinfo);
  }

  /* Need a full-image coefficient buffer in any multi-pass mode. */
  jinit_c_coef_controller(cinfo,
		(jboolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);

  jinit_marker_writer(cinfo);

  /* We can now tell the memory manager to allocate virtual arrays. */
  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);

  /* Write the datastream header (SOI) immediately.
   * Frame and scan headers are postponed till later.
   * This lets application insert special markers after the SOI.
   */
  (*cinfo->marker->write_file_header) (cinfo);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xd7390
movq 0x10(%rsp), %rax
cmpl $0x0, 0x100(%rax)
jne 0xd72a3
movq 0x10(%rsp), %rdi
callq 0xdb4d0
movq 0x10(%rsp), %rdi
callq 0xdc280
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xd9d90
movq 0x10(%rsp), %rdi
callq 0xe0640
movq 0x10(%rsp), %rax
cmpl $0x0, 0x104(%rax)
je 0xd72de
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x1, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
jmp 0xd7304
movq 0x10(%rsp), %rax
cmpl $0x0, 0x134(%rax)
je 0xd72f8
movq 0x10(%rsp), %rdi
callq 0xdef70
jmp 0xd7302
movq 0x10(%rsp), %rdi
callq 0xddd60
jmp 0xd7304
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rcx
movb $0x1, %al
cmpl $0x1, 0xf0(%rcx)
movb %al, 0xf(%rsp)
jg 0xd7334
movq 0x10(%rsp), %rax
cmpl $0x0, 0x108(%rax)
setne %al
movb %al, 0xf(%rsp)
movq (%rsp), %rdi
movb 0xf(%rsp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0xda790
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xd9ab0
movq 0x10(%rsp), %rdi
callq 0xd8bf0
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movq 0x10(%rsp), %rax
movq 0x1d0(%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmaster.c
// Function: jinit_c_master_control
GLOBAL(void)
jinit_c_master_control (j_compress_ptr cinfo, jboolean transcode_only)
{
  my_master_ptr master;

  master = (my_master_ptr)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  SIZEOF(my_comp_master));
  cinfo->master = (struct jpeg_comp_master *) master;
  master->pub.prepare_for_pass = prepare_for_pass;
  master->pub.pass_startup = pass_startup;
  master->pub.finish_pass = finish_pass_master;
  master->pub.is_last_pass = FALSE;

  /* Validate parameters, determine derived values */
  initial_setup(cinfo);

  if (cinfo->scan_info != NULL) {
#ifdef C_MULTISCAN_FILES_SUPPORTED
    validate_script(cinfo);
#else
    ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
  } else {
    cinfo->progressive_mode = FALSE;
    cinfo->num_scans = 1;
  }

  if (cinfo->progressive_mode)	/*  TEMPORARY HACK ??? */
    cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */

  /* Initialize my private state */
  if (transcode_only) {
    /* no main pass in transcoding */
    if (cinfo->optimize_coding)
      master->pass_type = huff_opt_pass;
    else
      master->pass_type = output_pass;
  } else {
    /* for normal compression, first pass is always this type: */
    master->pass_type = main_pass;
  }
  master->scan_number = 0;
  master->pass_number = 0;
  if (cinfo->optimize_coding)
    master->total_passes = cinfo->num_scans * 2;
  else
    master->total_passes = cinfo->num_scans;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
movl $0x1, %esi
movl $0x30, %edx
callq *%rax
movq %rax, (%rsp)
movq (%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x1b0(%rax)
movq (%rsp), %rax
leaq 0x117(%rip), %rcx       # 0xd74f0
movq %rcx, (%rax)
movq (%rsp), %rax
leaq 0x429(%rip), %rcx       # 0xd7810
movq %rcx, 0x8(%rax)
movq (%rsp), %rax
leaq 0x46a(%rip), %rcx       # 0xd7860
movq %rcx, 0x10(%rax)
movq (%rsp), %rax
movl $0x0, 0x1c(%rax)
movq 0x10(%rsp), %rdi
callq 0xd7930
movq 0x10(%rsp), %rax
cmpq $0x0, 0xf8(%rax)
je 0xd742a
movq 0x10(%rsp), %rdi
callq 0xd7d60
jmp 0xd7448
movq 0x10(%rsp), %rax
movl $0x0, 0x134(%rax)
movq 0x10(%rsp), %rax
movl $0x1, 0xf0(%rax)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x134(%rax)
je 0xd7465
movq 0x10(%rsp), %rax
movl $0x1, 0x108(%rax)
cmpl $0x0, 0xc(%rsp)
je 0xd7494
movq 0x10(%rsp), %rax
cmpl $0x0, 0x108(%rax)
je 0xd7487
movq (%rsp), %rax
movl $0x1, 0x20(%rax)
jmp 0xd7492
movq (%rsp), %rax
movl $0x2, 0x20(%rax)
jmp 0xd749f
movq (%rsp), %rax
movl $0x0, 0x20(%rax)
movq (%rsp), %rax
movl $0x0, 0x2c(%rax)
movq (%rsp), %rax
movl $0x0, 0x24(%rax)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x108(%rax)
je 0xd74d9
movq 0x10(%rsp), %rax
movl 0xf0(%rax), %ecx
shll %ecx
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
jmp 0xd74eb
movq 0x10(%rsp), %rax
movl 0xf0(%rax), %ecx
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
addq $0x18, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmaster.c
// Function: finish_pass_master
METHODDEF(void)
finish_pass_master (j_compress_ptr cinfo)
{
  my_master_ptr master = (my_master_ptr) cinfo->master;

  /* The entropy coder always needs an end-of-pass call,
   * either to analyze statistics or to flush its output buffer.
   */
  (*cinfo->entropy->finish_pass) (cinfo);

  /* Update state for next pass */
  switch (master->pass_type) {
  case main_pass:
    /* next pass is either output of scan 0 (after optimization)
     * or output of scan 1 (if no optimization).
     */
    master->pass_type = output_pass;
    if (! cinfo->optimize_coding)
      master->scan_number++;
    break;
  case huff_opt_pass:
    /* next pass is always output of current scan */
    master->pass_type = output_pass;
    break;
  case output_pass:
    /* next pass is either optimization or output of next scan */
    if (cinfo->optimize_coding)
      master->pass_type = huff_opt_pass;
    master->scan_number++;
    break;
  }

  master->pass_number++;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x1b0(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x1f0(%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq 0x8(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0xd78b4
jmp 0xd789e
movl 0x4(%rsp), %eax
subl $0x1, %eax
je 0xd78de
jmp 0xd78a9
movl 0x4(%rsp), %eax
subl $0x2, %eax
je 0xd78ec
jmp 0xd7914
movq 0x8(%rsp), %rax
movl $0x2, 0x20(%rax)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x108(%rax)
jne 0xd78dc
movq 0x8(%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0xd7914
movq 0x8(%rsp), %rax
movl $0x2, 0x20(%rax)
jmp 0xd7914
movq 0x10(%rsp), %rax
cmpl $0x0, 0x108(%rax)
je 0xd7906
movq 0x8(%rsp), %rax
movl $0x1, 0x20(%rax)
movq 0x8(%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq 0x8(%rsp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: jinit_marker_writer
GLOBAL(void)
jinit_marker_writer (j_compress_ptr cinfo)
{
  my_marker_ptr marker;

  /* Create the subobject */
  marker = (my_marker_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_marker_writer));
  cinfo->marker = (struct jpeg_marker_writer *) marker;
  /* Initialize method pointers */
  marker->pub.write_file_header = write_file_header;
  marker->pub.write_frame_header = write_frame_header;
  marker->pub.write_scan_header = write_scan_header;
  marker->pub.write_file_trailer = write_file_trailer;
  marker->pub.write_tables_only = write_tables_only;
  marker->pub.write_marker_header = write_marker_header;
  marker->pub.write_marker_byte = write_marker_byte;
  /* Initialize private state */
  marker->last_restart_interval = 0;
}

// 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 $0x40, %edx
callq *%rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x1d0(%rax)
movq 0x8(%rsp), %rax
leaq 0x78(%rip), %rcx        # 0xd8cb0
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
leaq 0xd9(%rip), %rcx        # 0xd8d20
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rax
leaq 0x279(%rip), %rcx       # 0xd8ed0
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rax
leaq 0x3b9(%rip), %rcx       # 0xd9020
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
leaq 0x3c9(%rip), %rcx       # 0xd9040
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
leaq 0x4a9(%rip), %rcx       # 0xd9130
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rax
leaq 0x4f9(%rip), %rcx       # 0xd9190
movq %rcx, 0x30(%rax)
movq 0x8(%rsp), %rax
movl $0x0, 0x38(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: write_file_header
METHODDEF(void)
write_file_header (j_compress_ptr cinfo)
{
  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;

  emit_marker(cinfo, M_SOI);	/* first the SOI */

  /* SOI is defined to reset restart interval to 0 */
  marker->last_restart_interval = 0;

  if (cinfo->write_JFIF_header)	/* next an optional JFIF APP0 */
    emit_jfif_app0(cinfo);
  if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
    emit_adobe_app14(cinfo);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x1d0(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movl $0xd8, %esi
callq 0xd91b0
movq 0x8(%rsp), %rax
movl $0x0, 0x38(%rax)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x120(%rax)
je 0xd8cfd
movq 0x10(%rsp), %rdi
callq 0xd91e0
movq 0x10(%rsp), %rax
cmpl $0x0, 0x12c(%rax)
je 0xd8d15
movq 0x10(%rsp), %rdi
callq 0xd92c0
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: write_scan_header
METHODDEF(void)
write_scan_header (j_compress_ptr cinfo)
{
  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
  int i;
  jpeg_component_info *compptr;

  if (cinfo->arith_code) {
    /* Emit arith conditioning info.  We may have some duplication
     * if the file has multiple scans, but it's so small it's hardly
     * worth worrying about.
     */
    emit_dac(cinfo);
  } else {
    /* Emit Huffman tables.
     * Note that emit_dht() suppresses any duplicate tables.
     */
    for (i = 0; i < cinfo->comps_in_scan; i++) {
      compptr = cinfo->cur_comp_info[i];
      if (cinfo->progressive_mode) {
	/* Progressive mode: only DC or only AC tables are used in one scan */
	if (cinfo->Ss == 0) {
	  if (cinfo->Ah == 0)	/* DC needs no table for refinement scan */
	    emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
	} else {
	  emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
	}
      } else {
	/* Sequential mode: need both DC and AC tables */
	emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
	emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
      }
    }
  }

  /* Emit DRI if required --- note that DRI value could change for each scan.
   * We avoid wasting space with unnecessary DRIs, however.
   */
  if (cinfo->restart_interval != marker->last_restart_interval) {
    emit_dri(cinfo);
    marker->last_restart_interval = cinfo->restart_interval;
  }

  emit_sos(cinfo);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x1d0(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x104(%rax)
je 0xd8f07
movq 0x20(%rsp), %rdi
callq 0xd9750
jmp 0xd8fd3
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x144(%rcx), %eax
jge 0xd8fd1
movq 0x20(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq 0x148(%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x134(%rax)
je 0xd8f94
movq 0x20(%rsp), %rax
cmpl $0x0, 0x19c(%rax)
jne 0xd8f7b
movq 0x20(%rsp), %rax
cmpl $0x0, 0x1a4(%rax)
jne 0xd8f79
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rax
movl 0x14(%rax), %esi
xorl %edx, %edx
callq 0xd9760
jmp 0xd8f92
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rax
movl 0x18(%rax), %esi
movl $0x1, %edx
callq 0xd9760
jmp 0xd8fbf
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rax
movl 0x14(%rax), %esi
xorl %edx, %edx
callq 0xd9760
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rax
movl 0x18(%rax), %esi
movl $0x1, %edx
callq 0xd9760
jmp 0xd8fc1
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0xd8f0f
jmp 0xd8fd3
movq 0x20(%rsp), %rax
movl 0x118(%rax), %eax
movq 0x18(%rsp), %rcx
cmpl 0x38(%rcx), %eax
je 0xd9005
movq 0x20(%rsp), %rdi
callq 0xd98f0
movq 0x20(%rsp), %rax
movl 0x118(%rax), %ecx
movq 0x18(%rsp), %rax
movl %ecx, 0x38(%rax)
movq 0x20(%rsp), %rdi
callq 0xd9930
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: write_tables_only
METHODDEF(void)
write_tables_only (j_compress_ptr cinfo)
{
  int i;

  emit_marker(cinfo, M_SOI);

  for (i = 0; i < NUM_QUANT_TBLS; i++) {
    if (cinfo->quant_tbl_ptrs[i] != NULL)
      (void) emit_dqt(cinfo, i);
  }

  if (! cinfo->arith_code) {
    for (i = 0; i < NUM_HUFF_TBLS; i++) {
      if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
	emit_dht(cinfo, i, FALSE);
      if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
	emit_dht(cinfo, i, TRUE);
    }
  }

  emit_marker(cinfo, M_EOI);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0xd8, %esi
callq 0xd91b0
movl $0x0, 0xc(%rsp)
cmpl $0x4, 0xc(%rsp)
jge 0xd9096
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
cmpq $0x0, 0x60(%rax,%rcx,8)
je 0xd9087
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0xd9490
jmp 0xd9089
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xd9060
movq 0x10(%rsp), %rax
cmpl $0x0, 0x104(%rax)
jne 0xd9111
movl $0x0, 0xc(%rsp)
cmpl $0x4, 0xc(%rsp)
jge 0xd910f
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
cmpq $0x0, 0x80(%rax,%rcx,8)
je 0xd90d8
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
xorl %edx, %edx
callq 0xd9760
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
cmpq $0x0, 0xa0(%rax,%rcx,8)
je 0xd9100
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
movl $0x1, %edx
callq 0xd9760
jmp 0xd9102
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xd90ac
jmp 0xd9111
movq 0x10(%rsp), %rdi
movl $0xd9, %esi
callq 0xd91b0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: write_marker_header
METHODDEF(void)
write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
/* Emit an arbitrary marker header */
{
  if (datalen > (unsigned int) 65533)		/* safety check */
    ERREXIT(cinfo, JERR_BAD_LENGTH);

  emit_marker(cinfo, (JPEG_MARKER) marker);

  emit_2bytes(cinfo, (int) (datalen + 2));	/* total length */
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl %edx, 0x8(%rsp)
cmpl $0xfffd, 0x8(%rsp)      # imm = 0xFFFD
jbe 0xd916c
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0xb, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0xd91b0
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %esi
addl $0x2, %esi
callq 0xd9450
addq $0x18, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_jfif_app0
LOCAL(void)
emit_jfif_app0 (j_compress_ptr cinfo)
/* Emit a JFIF-compliant APP0 marker */
{
  /*
   * Length of APP0 block	(2 bytes)
   * Block ID			(4 bytes - ASCII "JFIF")
   * Zero byte			(1 byte to terminate the ID string)
   * Version Major, Minor	(2 bytes - major first)
   * Units			(1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
   * Xdpu			(2 bytes - dots per unit horizontal)
   * Ydpu			(2 bytes - dots per unit vertical)
   * Thumbnail X size		(1 byte)
   * Thumbnail Y size		(1 byte)
   */
  
  emit_marker(cinfo, M_APP0);
  
  emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */

  emit_byte(cinfo, 0x4A);	/* Identifier: ASCII "JFIF" */
  emit_byte(cinfo, 0x46);
  emit_byte(cinfo, 0x49);
  emit_byte(cinfo, 0x46);
  emit_byte(cinfo, 0);
  emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */
  emit_byte(cinfo, cinfo->JFIF_minor_version);
  emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
  emit_2bytes(cinfo, (int) cinfo->X_density);
  emit_2bytes(cinfo, (int) cinfo->Y_density);
  emit_byte(cinfo, 0);		/* No thumbnail image */
  emit_byte(cinfo, 0);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rdi
movl $0xe0, %esi
callq 0xd91b0
movq (%rsp), %rdi
movl $0x10, %esi
callq 0xd9450
movq (%rsp), %rdi
movl $0x4a, %esi
callq 0xd93c0
movq (%rsp), %rdi
movl $0x46, %esi
callq 0xd93c0
movq (%rsp), %rdi
movl $0x49, %esi
callq 0xd93c0
movq (%rsp), %rdi
movl $0x46, %esi
callq 0xd93c0
movq (%rsp), %rdi
xorl %esi, %esi
callq 0xd93c0
movq (%rsp), %rdi
movq (%rsp), %rax
movzbl 0x124(%rax), %esi
callq 0xd93c0
movq (%rsp), %rdi
movq (%rsp), %rax
movzbl 0x125(%rax), %esi
callq 0xd93c0
movq (%rsp), %rdi
movq (%rsp), %rax
movzbl 0x126(%rax), %esi
callq 0xd93c0
movq (%rsp), %rdi
movq (%rsp), %rax
movzwl 0x128(%rax), %esi
callq 0xd9450
movq (%rsp), %rdi
movq (%rsp), %rax
movzwl 0x12a(%rax), %esi
callq 0xd9450
movq (%rsp), %rdi
xorl %esi, %esi
callq 0xd93c0
movq (%rsp), %rdi
xorl %esi, %esi
callq 0xd93c0
popq %rax
retq
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_adobe_app14
LOCAL(void)
emit_adobe_app14 (j_compress_ptr cinfo)
/* Emit an Adobe APP14 marker */
{
  /*
   * Length of APP14 block	(2 bytes)
   * Block ID			(5 bytes - ASCII "Adobe")
   * Version Number		(2 bytes - currently 100)
   * Flags0			(2 bytes - currently 0)
   * Flags1			(2 bytes - currently 0)
   * Color transform		(1 byte)
   *
   * Although Adobe TN 5116 mentions Version = 101, all the Adobe files
   * now in circulation seem to use Version = 100, so that's what we write.
   *
   * We write the color transform byte as 1 if the JPEG color space is
   * YCbCr, 2 if it's YCCK, 0 otherwise.  Adobe's definition has to do with
   * whether the encoder performed a transformation, which is pretty useless.
   */
  
  emit_marker(cinfo, M_APP14);
  
  emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */

  emit_byte(cinfo, 0x41);	/* Identifier: ASCII "Adobe" */
  emit_byte(cinfo, 0x64);
  emit_byte(cinfo, 0x6F);
  emit_byte(cinfo, 0x62);
  emit_byte(cinfo, 0x65);
  emit_2bytes(cinfo, 100);	/* Version */
  emit_2bytes(cinfo, 0);	/* Flags0 */
  emit_2bytes(cinfo, 0);	/* Flags1 */
  switch (cinfo->jpeg_color_space) {
  case JCS_YCbCr:
    emit_byte(cinfo, 1);	/* Color transform = 1 */
    break;
  case JCS_YCCK:
    emit_byte(cinfo, 2);	/* Color transform = 2 */
    break;
  default:
    emit_byte(cinfo, 0);	/* Color transform = 0 */
    break;
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl $0xee, %esi
callq 0xd91b0
movq 0x10(%rsp), %rdi
movl $0xe, %esi
callq 0xd9450
movq 0x10(%rsp), %rdi
movl $0x41, %esi
callq 0xd93c0
movq 0x10(%rsp), %rdi
movl $0x64, %esi
movl %esi, 0x4(%rsp)
callq 0xd93c0
movq 0x10(%rsp), %rdi
movl $0x6f, %esi
callq 0xd93c0
movq 0x10(%rsp), %rdi
movl $0x62, %esi
callq 0xd93c0
movq 0x10(%rsp), %rdi
movl $0x65, %esi
callq 0xd93c0
movl 0x4(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0xd9450
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movl %esi, 0x8(%rsp)
callq 0xd9450
movl 0x8(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0xd9450
movq 0x10(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0xc(%rsp)
subl $0x3, %eax
je 0xd9380
jmp 0xd9375
movl 0xc(%rsp), %eax
subl $0x5, %eax
je 0xd9391
jmp 0xd93a2
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0xd93c0
jmp 0xd93ae
movq 0x10(%rsp), %rdi
movl $0x2, %esi
callq 0xd93c0
jmp 0xd93ae
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xd93c0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_byte
LOCAL(void)
emit_byte (j_compress_ptr cinfo, int val)
/* Emit a byte */
{
  struct jpeg_destination_mgr * dest = cinfo->dest;

  *(dest->next_output_byte)++ = (JOCTET) val;
  if (--dest->free_in_buffer == 0) {
    if (! (*dest->empty_output_buffer) (cinfo))
      ERREXIT(cinfo, JERR_CANT_SUSPEND);
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, (%rsp)
movl 0xc(%rsp), %eax
movb %al, %cl
movq (%rsp), %rdx
movq (%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
movb %cl, (%rax)
movq (%rsp), %rcx
movq 0x8(%rcx), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0xd9440
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xd943e
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x18, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
jmp 0xd9440
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_dqt
LOCAL(int)
emit_dqt (j_compress_ptr cinfo, int index)
/* Emit a DQT marker */
/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
{
  JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
  int prec;
  int i;

  if (qtbl == NULL)
    ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);

  prec = 0;
  for (i = 0; i < DCTSIZE2; i++) {
    if (qtbl->quantval[i] > 255)
      prec = 1;
  }

  if (! qtbl->sent_table) {
    emit_marker(cinfo, M_DQT);

    emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);

    emit_byte(cinfo, index + (prec<<4));

    for (i = 0; i < DCTSIZE2; i++) {
      /* The table entries must be emitted in zigzag order. */
      unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
      if (prec)
	emit_byte(cinfo, (int) (qval >> 8));
      emit_byte(cinfo, (int) (qval & 0xFF));
    }

    qtbl->sent_table = TRUE;
  }

  return prec;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq 0x60(%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0xd94e9
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl $0x34, 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
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
cmpl $0x40, 0x8(%rsp)
jge 0xd952c
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0xff, %eax
jle 0xd951d
movl $0x1, 0xc(%rsp)
jmp 0xd951f
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xd94f9
movq 0x10(%rsp), %rax
cmpl $0x0, 0x80(%rax)
jne 0xd95f6
movq 0x20(%rsp), %rdi
movl $0xdb, %esi
callq 0xd91b0
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %ecx
movl $0x43, %esi
movl $0x83, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
callq 0xd9450
movq 0x20(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0xc(%rsp), %eax
shll $0x4, %eax
addl %eax, %esi
callq 0xd93c0
movl $0x0, 0x8(%rsp)
cmpl $0x40, 0x8(%rsp)
jge 0xd95e7
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rdx
leaq 0x5dfbe(%rip), %rcx     # 0x137560
movslq (%rcx,%rdx,4), %rcx
movzwl (%rax,%rcx,2), %eax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0xd95c6
movq 0x20(%rsp), %rdi
movl 0x4(%rsp), %esi
shrl $0x8, %esi
callq 0xd93c0
movq 0x20(%rsp), %rdi
movl 0x4(%rsp), %esi
andl $0xff, %esi
callq 0xd93c0
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xd958a
movq 0x10(%rsp), %rax
movl $0x1, 0x80(%rax)
movl 0xc(%rsp), %eax
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_sof
LOCAL(void)
emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
/* Emit a SOF marker */
{
  int ci;
  jpeg_component_info *compptr;
  
  emit_marker(cinfo, code);
  
  emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */

  /* Make sure image isn't bigger than SOF field can handle */
  if ((long) cinfo->image_height > 65535L ||
      (long) cinfo->image_width > 65535L)
    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);

  emit_byte(cinfo, cinfo->data_precision);
  emit_2bytes(cinfo, (int) cinfo->image_height);
  emit_2bytes(cinfo, (int) cinfo->image_width);

  emit_byte(cinfo, cinfo->num_components);

  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    emit_byte(cinfo, compptr->component_id);
    emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
    emit_byte(cinfo, compptr->quant_tbl_no);
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0xd91b0
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
imull $0x3, 0x4c(%rax), %esi
addl $0x2, %esi
addl $0x5, %esi
addl $0x1, %esi
callq 0xd9450
movq 0x10(%rsp), %rax
movl 0x34(%rax), %eax
cmpq $0xffff, %rax           # imm = 0xFFFF
jg 0xd9657
movq 0x10(%rsp), %rax
movl 0x30(%rax), %eax
cmpq $0xffff, %rax           # imm = 0xFFFF
jle 0xd9687
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x29, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0xffff, 0x2c(%rax)     # imm = 0xFFFF
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x48(%rax), %esi
callq 0xd93c0
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x34(%rax), %esi
callq 0xd9450
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x30(%rax), %esi
callq 0xd9450
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x4c(%rax), %esi
callq 0xd93c0
movl $0x0, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, (%rsp)
movl 0x8(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x4c(%rcx), %eax
jge 0xd9747
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movl (%rax), %esi
callq 0xd93c0
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movl 0x8(%rax), %esi
shll $0x4, %esi
movq (%rsp), %rax
addl 0xc(%rax), %esi
callq 0xd93c0
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movl 0x10(%rax), %esi
callq 0xd93c0
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
movq (%rsp), %rax
addq $0x60, %rax
movq %rax, (%rsp)
jmp 0xd96e4
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_dht
LOCAL(void)
emit_dht (j_compress_ptr cinfo, int index, jboolean is_ac)
/* Emit a DHT marker */
{
  JHUFF_TBL * htbl;
  int length, i;
  
  if (is_ac) {
    htbl = cinfo->ac_huff_tbl_ptrs[index];
    index += 0x10;		/* output index has AC bit set */
  } else {
    htbl = cinfo->dc_huff_tbl_ptrs[index];
  }

  if (htbl == NULL)
    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
  
  if (! htbl->sent_table) {
    emit_marker(cinfo, M_DHT);
    
    length = 0;
    for (i = 1; i <= 16; i++)
      length += htbl->bits[i];
    
    emit_2bytes(cinfo, length + 2 + 1 + 16);
    emit_byte(cinfo, index);
    
    for (i = 1; i <= 16; i++)
      emit_byte(cinfo, htbl->bits[i]);
    
    for (i = 0; i < length; i++)
      emit_byte(cinfo, htbl->huffval[i]);
    
    htbl->sent_table = TRUE;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
cmpl $0x0, 0x18(%rsp)
je 0xd979c
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq 0xa0(%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
addl $0x10, %eax
movl %eax, 0x1c(%rsp)
jmp 0xd97b3
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq 0x80(%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0xd97eb
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl $0x32, 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
movq 0x10(%rsp), %rax
cmpl $0x0, 0x114(%rax)
jne 0xd98e6
movq 0x20(%rsp), %rdi
movl $0xc4, %esi
callq 0xd91b0
movl $0x0, 0xc(%rsp)
movl $0x1, 0x8(%rsp)
cmpl $0x10, 0x8(%rsp)
jg 0xd9846
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movzbl (%rax,%rcx), %eax
addl 0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xd981c
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
addl $0x2, %esi
addl $0x1, %esi
addl $0x10, %esi
callq 0xd9450
movq 0x20(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0xd93c0
movl $0x1, 0x8(%rsp)
cmpl $0x10, 0x8(%rsp)
jg 0xd989f
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movzbl (%rax,%rcx), %esi
callq 0xd93c0
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xd9873
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0xd98d7
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movzbl 0x11(%rax,%rcx), %esi
callq 0xd93c0
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xd98a7
movq 0x10(%rsp), %rax
movl $0x1, 0x114(%rax)
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_sos
LOCAL(void)
emit_sos (j_compress_ptr cinfo)
/* Emit a SOS marker */
{
  int i, td, ta;
  jpeg_component_info *compptr;
  
  emit_marker(cinfo, M_SOS);
  
  emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
  
  emit_byte(cinfo, cinfo->comps_in_scan);
  
  for (i = 0; i < cinfo->comps_in_scan; i++) {
    compptr = cinfo->cur_comp_info[i];
    emit_byte(cinfo, compptr->component_id);
    td = compptr->dc_tbl_no;
    ta = compptr->ac_tbl_no;
    if (cinfo->progressive_mode) {
      /* Progressive mode: only DC or only AC tables are used in one scan;
       * furthermore, Huffman coding of DC refinement uses no table at all.
       * We emit 0 for unused field(s); this is recommended by the P&M text
       * but does not seem to be specified in the standard.
       */
      if (cinfo->Ss == 0) {
	ta = 0;			/* DC scan */
	if (cinfo->Ah != 0 && !cinfo->arith_code)
	  td = 0;		/* no DC table either */
      } else {
	td = 0;			/* AC scan */
      }
    }
    emit_byte(cinfo, (td << 4) + ta);
  }

  emit_byte(cinfo, cinfo->Ss);
  emit_byte(cinfo, cinfo->Se);
  emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movl $0xda, %esi
callq 0xd91b0
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x144(%rax), %esi
shll %esi
addl $0x2, %esi
addl $0x1, %esi
addl $0x3, %esi
callq 0xd9450
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x144(%rax), %esi
callq 0xd93c0
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x144(%rcx), %eax
jge 0xd9a53
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq 0x148(%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rax
movl (%rax), %esi
callq 0xd93c0
movq 0x8(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, 0x18(%rsp)
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x134(%rax)
je 0xd9a2e
movq 0x20(%rsp), %rax
cmpl $0x0, 0x19c(%rax)
jne 0xd9a24
movl $0x0, 0x14(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x1a4(%rax)
je 0xd9a22
movq 0x20(%rsp), %rax
cmpl $0x0, 0x104(%rax)
jne 0xd9a22
movl $0x0, 0x18(%rsp)
jmp 0xd9a2c
movl $0x0, 0x18(%rsp)
jmp 0xd9a2e
movq 0x20(%rsp), %rdi
movl 0x18(%rsp), %esi
shll $0x4, %esi
addl 0x14(%rsp), %esi
callq 0xd93c0
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xd9985
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x19c(%rax), %esi
callq 0xd93c0
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x1a0(%rax), %esi
callq 0xd93c0
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x1a4(%rax), %esi
shll $0x4, %esi
movq 0x20(%rsp), %rax
addl 0x1a8(%rax), %esi
callq 0xd93c0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmainct.c
// Function: jinit_c_main_controller
GLOBAL(void)
jinit_c_main_controller (j_compress_ptr cinfo, jboolean need_full_buffer)
{
  my_main_ptr mainp;
  int ci;
  jpeg_component_info *compptr;

  mainp = (my_main_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_main_controller));
  cinfo->main = (struct jpeg_c_main_controller *) mainp;
  mainp->pub.start_pass = start_pass_main;

  /* We don't need to create a buffer in raw-data mode. */
  if (cinfo->raw_data_in)
    return;

  /* Create the buffer.  It holds downsampled data, so each component
   * may be of a different size.
   */
  if (need_full_buffer) {
#ifdef FULL_MAIN_BUFFER_SUPPORTED
    /* Allocate a full-image virtual array for each component */
    /* Note we pad the bottom to a multiple of the iMCU height */
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      mainp->whole_image[ci] = (*cinfo->mem->request_virt_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
	 compptr->width_in_blocks * DCTSIZE,
	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
				(long) compptr->v_samp_factor) * DCTSIZE,
	 (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
    }
#else
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif
  } else {
#ifdef FULL_MAIN_BUFFER_SUPPORTED
    mainp->whole_image[0] = NULL; /* flag for no virtual arrays */
#endif
    /* Allocate a strip buffer for each component */
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      mainp->buffer[ci] = (*cinfo->mem->alloc_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE,
	 compptr->width_in_blocks * DCTSIZE,
	 (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));
    }
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x70, %edx
callq *%rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x1b8(%rax)
movq 0x10(%rsp), %rax
leaq 0xc4(%rip), %rcx        # 0xd9bc0
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x100(%rax)
je 0xd9b12
jmp 0xd9bb9
cmpl $0x0, 0x1c(%rsp)
je 0xd9b3c
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
jmp 0xd9bb9
movl $0x0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, (%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4c(%rcx), %eax
jge 0xd9bb7
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rdi
movq (%rsp), %rcx
movl 0x1c(%rcx), %edx
shll $0x3, %edx
movq (%rsp), %rcx
movl 0xc(%rcx), %ecx
shll $0x3, %ecx
movl $0x1, %esi
callq *%rax
movq %rax, %rdx
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movq (%rsp), %rax
addq $0x60, %rax
movq %rax, (%rsp)
jmp 0xd9b51
jmp 0xd9bb9
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmainct.c
// Function: start_pass_main
METHODDEF(void)
start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;

  /* Do nothing in raw-data mode. */
  if (cinfo->raw_data_in)
    return;

  mainp->cur_iMCU_row = 0;	/* initialize counters */
  mainp->rowgroup_ctr = 0;
  mainp->suspended = FALSE;
  mainp->pass_mode = pass_mode;	/* save mode for use by process_data */

  switch (pass_mode) {
  case JBUF_PASS_THRU:
#ifdef FULL_MAIN_BUFFER_SUPPORTED
    if (mainp->whole_image[0] != NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif
    mainp->pub.process_data = process_data_simple_main;
    break;
#ifdef FULL_MAIN_BUFFER_SUPPORTED
  case JBUF_SAVE_SOURCE:
  case JBUF_CRANK_DEST:
  case JBUF_SAVE_AND_PASS:
    if (mainp->whole_image[0] == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    mainp->pub.process_data = process_data_buffer_main;
    break;
#endif
  default:
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    break;
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq 0x1b8(%rax), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x100(%rax)
je 0xd9bed
jmp 0xd9c55
movq (%rsp), %rax
movl $0x0, 0x10(%rax)
movq (%rsp), %rax
movl $0x0, 0x14(%rax)
movq (%rsp), %rax
movl $0x0, 0x18(%rax)
movl 0xc(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x1c(%rax)
movl 0xc(%rsp), %eax
testl %eax, %eax
jne 0xd9c34
jmp 0xd9c23
movq (%rsp), %rax
leaq 0x32(%rip), %rcx        # 0xd9c60
movq %rcx, 0x8(%rax)
jmp 0xd9c55
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x4, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcmainct.c
// Function: process_data_simple_main
METHODDEF(void)
process_data_simple_main (j_compress_ptr cinfo,
			  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
			  JDIMENSION in_rows_avail)
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;

  while (mainp->cur_iMCU_row < cinfo->total_iMCU_rows) {
    /* Read input data if we haven't filled the main buffer yet */
    if (mainp->rowgroup_ctr < DCTSIZE)
      (*cinfo->prep->pre_process_data) (cinfo,
					input_buf, in_row_ctr, in_rows_avail,
					mainp->buffer, &mainp->rowgroup_ctr,
					(JDIMENSION) DCTSIZE);

    /* If we don't have a full iMCU row buffered, return to application for
     * more data.  Note that preprocessor will always pad to fill the iMCU row
     * at the bottom of the image.
     */
    if (mainp->rowgroup_ctr != DCTSIZE)
      return;

    /* Send the completed row to the compressor */
    if (! (*cinfo->coef->compress_data) (cinfo, mainp->buffer)) {
      /* If compressor did not consume the whole row, then we must need to
       * suspend processing and return to the application.  In this situation
       * we pretend we didn't yet consume the last input row; otherwise, if
       * it happened to be the last row of the image, the application would
       * think we were done.
       */
      if (! mainp->suspended) {
	(*in_row_ctr)--;
	mainp->suspended = TRUE;
      }
      return;
    }
    /* We did finish the row.  Undo our little suspension hack if a previous
     * call suspended; then mark the main buffer empty.
     */
    if (mainp->suspended) {
      (*in_row_ctr)++;
      mainp->suspended = FALSE;
    }
    mainp->rowgroup_ctr = 0;
    mainp->cur_iMCU_row++;
  }
}

// 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 0x1b8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x10(%rax), %eax
movq 0x30(%rsp), %rcx
cmpl 0x140(%rcx), %eax
jae 0xd9d86
movq 0x10(%rsp), %rax
cmpl $0x8, 0x14(%rax)
jae 0xd9cea
movq 0x30(%rsp), %rax
movq 0x1c0(%rax), %rax
movq 0x8(%rax), %rax
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
movl 0x1c(%rsp), %ecx
movq 0x10(%rsp), %r8
addq $0x20, %r8
movq 0x10(%rsp), %r9
addq $0x14, %r9
movl $0x8, (%rsp)
callq *%rax
movq 0x10(%rsp), %rax
cmpl $0x8, 0x14(%rax)
je 0xd9cfa
jmp 0xd9d86
movq 0x30(%rsp), %rax
movq 0x1c8(%rax), %rax
movq 0x8(%rax), %rax
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
callq *%rax
cmpl $0x0, %eax
jne 0xd9d44
movq 0x10(%rsp), %rax
cmpl $0x0, 0x18(%rax)
jne 0xd9d42
movq 0x20(%rsp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movl $0x1, 0x18(%rax)
jmp 0xd9d86
movq 0x10(%rsp), %rax
cmpl $0x0, 0x18(%rax)
je 0xd9d67
movq 0x20(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x18(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x14(%rax)
movq 0x10(%rsp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0xd9c88
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcprepct.c
// Function: jinit_c_prep_controller
GLOBAL(void)
jinit_c_prep_controller (j_compress_ptr cinfo, jboolean need_full_buffer)
{
  my_prep_ptr prep;
  int ci;
  jpeg_component_info * compptr;

  if (need_full_buffer)		/* safety check */
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);

  prep = (my_prep_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_prep_controller));
  cinfo->prep = (struct jpeg_c_prep_controller *) prep;
  prep->pub.start_pass = start_pass_prep;

  /* Allocate the color conversion buffer.
   * We make the buffer wide enough to allow the downsampler to edge-expand
   * horizontally within the buffer, if it so chooses.
   */
  if (cinfo->downsample->need_context_rows) {
    /* Set up to provide context rows */
#ifdef CONTEXT_ROWS_SUPPORTED
    prep->pub.pre_process_data = pre_process_context;
    create_context_buffer(cinfo);
#else
    ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
  } else {
    /* No context, just make it tall enough for one row group */
    prep->pub.pre_process_data = pre_process_data;
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE,
	 (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *
			cinfo->max_h_samp_factor) / compptr->h_samp_factor),
	 (JDIMENSION) cinfo->max_v_samp_factor);
    }
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
je 0xd9dc5
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl $0x4, 0x28(%rax)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rdi
callq *%rax
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rdi
movl $0x1, %esi
movl $0x70, %edx
callq *%rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x1c0(%rax)
movq 0x20(%rsp), %rax
leaq 0x10c(%rip), %rcx       # 0xd9f10
movq %rcx, (%rax)
movq 0x30(%rsp), %rax
movq 0x1e0(%rax), %rax
cmpl $0x0, 0x10(%rax)
je 0xd9e38
movq 0x20(%rsp), %rax
leaq 0x17b(%rip), %rcx       # 0xd9fa0
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rdi
callq 0xda2b0
jmp 0xd9eff
movq 0x20(%rsp), %rax
leaq 0x63c(%rip), %rcx       # 0xda480
movq %rcx, 0x8(%rax)
movl $0x0, 0x1c(%rsp)
movq 0x30(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
movq 0x30(%rsp), %rcx
cmpl 0x4c(%rcx), %eax
jge 0xd9efd
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x1c(%rax), %eax
shlq $0x3, %rax
movq 0x30(%rsp), %rcx
movslq 0x138(%rcx), %rcx
imulq %rcx, %rax
movq 0x10(%rsp), %rcx
movslq 0x8(%rcx), %rcx
cqto
idivq %rcx
movq %rax, %rcx
movq 0x8(%rsp), %rax
movl %ecx, %edx
movq 0x30(%rsp), %rcx
movl 0x13c(%rcx), %ecx
movl $0x1, %esi
callq *%rax
movq %rax, %rdx
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq %rdx, 0x10(%rax,%rcx,8)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x10(%rsp), %rax
addq $0x60, %rax
movq %rax, 0x10(%rsp)
jmp 0xd9e5e
jmp 0xd9eff
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcprepct.c
// Function: start_pass_prep
METHODDEF(void)
start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;

  if (pass_mode != JBUF_PASS_THRU)
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);

  /* Initialize total-height counter for detecting bottom of image */
  prep->rows_to_go = cinfo->image_height;
  /* Mark the conversion buffer empty */
  prep->next_buf_row = 0;
#ifdef CONTEXT_ROWS_SUPPORTED
  /* Preset additional state variables for context mode.
   * These aren't used in non-context mode, so we needn't test which mode.
   */
  prep->this_row_group = 0;
  /* Set next_buf_stop to stop after two row groups have been read in. */
  prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
#endif
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq 0x1c0(%rax), %rax
movq %rax, (%rsp)
cmpl $0x0, 0xc(%rsp)
je 0xd9f55
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x4, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movq 0x10(%rsp), %rax
movl 0x34(%rax), %ecx
movq (%rsp), %rax
movl %ecx, 0x60(%rax)
movq (%rsp), %rax
movl $0x0, 0x64(%rax)
movq (%rsp), %rax
movl $0x0, 0x68(%rax)
movq 0x10(%rsp), %rax
movl 0x13c(%rax), %ecx
shll %ecx
movq (%rsp), %rax
movl %ecx, 0x6c(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcprepct.c
// Function: expand_bottom_edge
LOCAL(void)
expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
		    int input_rows, int output_rows)
{
  register int row;

  for (row = input_rows; row < output_rows; row++) {
    jcopy_sample_rows(image_data, input_rows-1, image_data, row,
		      1, num_cols);
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movl %ecx, 0x4(%rsp)
movl 0x8(%rsp), %eax
movl %eax, (%rsp)
movl (%rsp), %eax
cmpl 0x4(%rsp), %eax
jge 0xda784
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %esi
subl $0x1, %esi
movq 0x10(%rsp), %rdx
movl (%rsp), %ecx
movl 0xc(%rsp), %r9d
movl $0x1, %r8d
callq 0xf9370
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0xda74c
addq $0x18, %rsp
retq
nopl (%rax)