LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jccoefct.c
// Function: start_pass_coef
METHODDEF(void)
start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;

  coef->iMCU_row_num = 0;
  start_iMCU_row(cinfo);

  switch (pass_mode) {
  case JBUF_PASS_THRU:
    if (coef->whole_image[0] != NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    coef->pub.compress_data = compress_data;
    break;
#ifdef FULL_COEF_BUFFER_SUPPORTED
  case JBUF_SAVE_AND_PASS:
    if (coef->whole_image[0] == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    coef->pub.compress_data = compress_first_pass;
    break;
  case JBUF_CRANK_DEST:
    if (coef->whole_image[0] == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    coef->pub.compress_data = compress_output;
    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 0x1c8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x20(%rsp), %rdi
callq 0xdaa80
movl 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0xda98f
jmp 0xda972
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0xdaa10
jmp 0xda981
movl 0xc(%rsp), %eax
subl $0x3, %eax
je 0xda9d1
jmp 0xdaa4f
movq 0x10(%rsp), %rax
cmpq $0x0, 0x70(%rax)
je 0xda9bc
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
movq 0x10(%rsp), %rax
leaq 0x158(%rip), %rcx       # 0xdab20
movq %rcx, 0x8(%rax)
jmp 0xdaa70
movq 0x10(%rsp), %rax
cmpq $0x0, 0x70(%rax)
jne 0xda9fe
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
movq 0x10(%rsp), %rax
leaq 0x496(%rip), %rcx       # 0xdaea0
movq %rcx, 0x8(%rax)
jmp 0xdaa70
movq 0x10(%rsp), %rax
cmpq $0x0, 0x70(%rax)
jne 0xdaa3d
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
movq 0x10(%rsp), %rax
leaq 0x7f7(%rip), %rcx       # 0xdb240
movq %rcx, 0x8(%rax)
jmp 0xdaa70
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/jccoefct.c
// Function: start_iMCU_row
LOCAL(void)
start_iMCU_row (j_compress_ptr cinfo)
/* Reset within-iMCU-row counters for a new row */
{
  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 (coef->iMCU_row_num < (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 0x1c8(%rax), %rax
movq %rax, -0x10(%rsp)
movq -0x8(%rsp), %rax
cmpl $0x1, 0x144(%rax)
jle 0xdaab2
movq -0x10(%rsp), %rax
movl $0x1, 0x1c(%rax)
jmp 0xdaafe
movq -0x10(%rsp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rsp), %rcx
movl 0x140(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0xdaae5
movq -0x8(%rsp), %rax
movq 0x148(%rax), %rax
movl 0xc(%rax), %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0x1c(%rax)
jmp 0xdaafc
movq -0x8(%rsp), %rax
movq 0x148(%rax), %rax
movl 0x48(%rax), %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0x1c(%rax)
jmp 0xdaafe
movq -0x10(%rsp), %rax
movl $0x0, 0x14(%rax)
movq -0x10(%rsp), %rax
movl $0x0, 0x18(%rax)
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: grayscale_convert
METHODDEF(void)
grayscale_convert (j_compress_ptr cinfo,
		   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		   JDIMENSION output_row, int num_rows)
{
  register JSAMPROW inptr;
  register JSAMPROW outptr;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;
  int instride = cinfo->input_components;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr = output_buf[0][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      outptr[col] = inptr[0];	/* don't need GETJSAMPLE() here */
      inptr += instride;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movl %r8d, -0x20(%rsp)
movq -0x8(%rsp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x38(%rsp)
movq -0x8(%rsp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x3c(%rsp)
movl -0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rsp)
cmpl $0x0, %eax
jl 0xdba38
movq -0x10(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rsp)
movq (%rax), %rax
movq %rax, -0x28(%rsp)
movq -0x18(%rsp), %rax
movq (%rax), %rax
movl -0x1c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rsp)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
movl $0x0, -0x34(%rsp)
movl -0x34(%rsp), %eax
cmpl -0x38(%rsp), %eax
jae 0xdba33
movq -0x28(%rsp), %rax
movb (%rax), %dl
movq -0x30(%rsp), %rax
movl -0x34(%rsp), %ecx
movb %dl, (%rax,%rcx)
movl -0x3c(%rsp), %ecx
movq -0x28(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rsp)
movl -0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rsp)
jmp 0xdb9f5
jmp 0xdb9a0
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: rgb_ycc_start
METHODDEF(void)
rgb_ycc_start (j_compress_ptr cinfo)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  INT32 * rgb_ycc_tab;
  INT32 i;

  /* Allocate and fill in the conversion tables. */
  cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				(TABLE_SIZE * SIZEOF(INT32)));

  for (i = 0; i <= MAXJSAMPLE; i++) {
    rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
    rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
    rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i     + ONE_HALF;
    rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
    rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
    /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
     * This ensures that the maximum output will round to MAXJSAMPLE
     * not MAXJSAMPLE+1, and thus that we don't have to range-limit.
     */
    rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
/*  B=>Cb and R=>Cr tables are the same
    rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;
*/
    rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
    rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x1d8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x4000, %edx           # imm = 0x4000
callq *%rax
movq %rax, %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq $0x0, 0x8(%rsp)
cmpq $0xff, 0x8(%rsp)
jg 0xdbba0
imulq $0x4c8b, 0x8(%rsp), %rdx # imm = 0x4C8B
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
imulq $0x9646, 0x8(%rsp), %rdx # imm = 0x9646
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rdx, 0x800(%rax,%rcx,8)
imulq $0x1d2f, 0x8(%rsp), %rdx # imm = 0x1D2F
addq $0x8000, %rdx           # imm = 0x8000
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rdx, 0x1000(%rax,%rcx,8)
imulq $-0x2b33, 0x8(%rsp), %rdx # imm = 0xD4CD
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rdx, 0x1800(%rax,%rcx,8)
imulq $-0x54cd, 0x8(%rsp), %rdx # imm = 0xAB33
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rdx, 0x2000(%rax,%rcx,8)
movq 0x8(%rsp), %rdx
shlq $0xf, %rdx
addq $0x800000, %rdx         # imm = 0x800000
addq $0x8000, %rdx           # imm = 0x8000
subq $0x1, %rdx
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rdx, 0x2800(%rax,%rcx,8)
imulq $-0x6b2f, 0x8(%rsp), %rdx # imm = 0x94D1
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rdx, 0x3000(%rax,%rcx,8)
imulq $-0x14d1, 0x8(%rsp), %rdx # imm = 0xEB2F
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rdx, 0x3800(%rax,%rcx,8)
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0xdba91
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: rgb_gray_convert
METHODDEF(void)
rgb_gray_convert (j_compress_ptr cinfo,
		  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		  JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register INT32 * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr = output_buf[0][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      r = GETJSAMPLE(inptr[RGB_RED]);
      g = GETJSAMPLE(inptr[RGB_GREEN]);
      b = GETJSAMPLE(inptr[RGB_BLUE]);
      inptr += RGB_PIXELSIZE;
      /* Y */
      outptr[col] = (JSAMPLE)
		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
		 >> SCALEBITS);
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movl %r8d, -0x20(%rsp)
movq -0x8(%rsp), %rax
movq 0x1d8(%rax), %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rsp)
movq -0x8(%rsp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x58(%rsp)
movl -0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rsp)
cmpl $0x0, %eax
jl 0xdbcf0
movq -0x10(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rsp)
movq (%rax), %rax
movq %rax, -0x48(%rsp)
movq -0x18(%rsp), %rax
movq (%rax), %rax
movl -0x1c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rsp)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
movl $0x0, -0x54(%rsp)
movl -0x54(%rsp), %eax
cmpl -0x58(%rsp), %eax
jae 0xdbceb
movq -0x48(%rsp), %rax
movzbl (%rax), %eax
movl %eax, -0x2c(%rsp)
movq -0x48(%rsp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x30(%rsp)
movq -0x48(%rsp), %rax
movzbl 0x2(%rax), %eax
movl %eax, -0x34(%rsp)
movq -0x48(%rsp), %rax
addq $0x3, %rax
movq %rax, -0x48(%rsp)
movq -0x40(%rsp), %rax
movl -0x2c(%rsp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rsp), %rcx
movl -0x30(%rsp), %edx
addl $0x100, %edx            # imm = 0x100
movslq %edx, %rdx
addq (%rcx,%rdx,8), %rax
movq -0x40(%rsp), %rcx
movl -0x34(%rsp), %edx
addl $0x200, %edx            # imm = 0x200
movslq %edx, %rdx
addq (%rcx,%rdx,8), %rax
sarq $0x10, %rax
movb %al, %dl
movq -0x50(%rsp), %rax
movl -0x54(%rsp), %ecx
movb %dl, (%rax,%rcx)
movl -0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rsp)
jmp 0xdbc48
jmp 0xdbbf3
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: null_convert
METHODDEF(void)
null_convert (j_compress_ptr cinfo,
	      JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
	      JDIMENSION output_row, int num_rows)
{
  register JSAMPROW inptr;
  register JSAMPROW outptr;
  register JDIMENSION col;
  register int ci;
  int nc = cinfo->num_components;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    /* It seems fastest to make a separate pass for each component. */
    for (ci = 0; ci < nc; ci++) {
      inptr = *input_buf;
      outptr = output_buf[ci][output_row];
      for (col = 0; col < num_cols; col++) {
	outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
	inptr += nc;
      }
    }
    input_buf++;
    output_row++;
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movl %r8d, -0x20(%rsp)
movq -0x8(%rsp), %rax
movl 0x4c(%rax), %eax
movl %eax, -0x3c(%rsp)
movq -0x8(%rsp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x40(%rsp)
movl -0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rsp)
cmpl $0x0, %eax
jl 0xdbdfe
movl $0x0, -0x38(%rsp)
movl -0x38(%rsp), %eax
cmpl -0x3c(%rsp), %eax
jge 0xdbde0
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rsp)
movq -0x18(%rsp), %rax
movslq -0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rsp)
movl $0x0, -0x34(%rsp)
movl -0x34(%rsp), %eax
cmpl -0x40(%rsp), %eax
jae 0xdbdce
movq -0x28(%rsp), %rax
movslq -0x38(%rsp), %rcx
movb (%rax,%rcx), %dl
movq -0x30(%rsp), %rax
movl -0x34(%rsp), %ecx
movb %dl, (%rax,%rcx)
movl -0x3c(%rsp), %ecx
movq -0x28(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rsp)
movl -0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rsp)
jmp 0xdbd8a
jmp 0xdbdd0
movl -0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rsp)
jmp 0xdbd4c
movq -0x10(%rsp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rsp)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0xdbd30
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: sep_downsample
METHODDEF(void)
sep_downsample (j_compress_ptr cinfo,
		JSAMPIMAGE input_buf, JDIMENSION in_row_index,
		JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
{
  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
  int ci;
  jpeg_component_info * compptr;
  JSAMPARRAY in_ptr, out_ptr;

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

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movl %edx, 0x44(%rsp)
movq %rcx, 0x38(%rsp)
movl %r8d, 0x34(%rsp)
movq 0x50(%rsp), %rax
movq 0x1e0(%rax), %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
movq 0x50(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x18(%rsp)
movl 0x24(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0x4c(%rcx), %eax
jge 0xdc64f
movq 0x48(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x44(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x34(%rsp), %ecx
movq 0x18(%rsp), %rdx
imull 0xc(%rdx), %ecx
movl %ecx, %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq 0x50(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
callq *%rax
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movq 0x18(%rsp), %rax
addq $0x60, %rax
movq %rax, 0x18(%rsp)
jmp 0xdc5b3
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: fullsize_downsample
METHODDEF(void)
fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		     JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  /* Copy the data */
  jcopy_sample_rows(input_data, 0, output_data, 0,
		    cinfo->max_v_samp_factor, cinfo->image_width);
  /* Edge-expand */
  expand_right_edge(output_data, cinfo->max_v_samp_factor,
		    cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rdx
movq 0x20(%rsp), %rax
movl 0x13c(%rax), %r8d
movq 0x20(%rsp), %rax
movl 0x30(%rax), %r9d
xorl %ecx, %ecx
movl %ecx, %esi
callq 0xf9370
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x13c(%rax), %esi
movq 0x20(%rsp), %rax
movl 0x30(%rax), %edx
movq 0x18(%rsp), %rax
movl 0x1c(%rax), %ecx
shll $0x3, %ecx
callq 0xdd370
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: h2v1_downsample
METHODDEF(void)
h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int outrow;
  JDIMENSION outcol;
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  register JSAMPROW inptr, outptr;
  register int bias;

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

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

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x38(%rsp), %rax
movl 0x1c(%rax), %eax
shll $0x3, %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rax
movl 0x13c(%rax), %esi
movq 0x40(%rsp), %rax
movl 0x30(%rax), %edx
movl 0x1c(%rsp), %ecx
shll %ecx
callq 0xdd370
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jge 0xdcb3a
movq 0x28(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x4(%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jae 0xdcb28
movq 0x10(%rsp), %rax
movzbl (%rax), %eax
movq 0x10(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
addl 0x4(%rsp), %eax
sarl %eax
movb %al, %cl
movq 0x8(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x8(%rsp)
movb %cl, (%rax)
movl 0x4(%rsp), %eax
xorl $0x1, %eax
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x10(%rsp)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0xdcaca
jmp 0xdcb2a
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0xdca82
addq $0x48, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: h2v2_downsample
METHODDEF(void)
h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int inrow, outrow;
  JDIMENSION outcol;
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  register JSAMPROW inptr0, inptr1, outptr;
  register int bias;

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

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

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x48(%rsp), %rax
movl 0x1c(%rax), %eax
shll $0x3, %eax
movl %eax, 0x28(%rsp)
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rax
movl 0x13c(%rax), %esi
movq 0x50(%rsp), %rax
movl 0x30(%rax), %edx
movl 0x28(%rsp), %ecx
shll %ecx
callq 0xdd370
movl $0x0, 0x34(%rsp)
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
movq 0x48(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jge 0xdd18a
movq 0x38(%rsp), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rax
movl 0x34(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movl $0x1, 0xc(%rsp)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x28(%rsp), %eax
jae 0xdd16f
movq 0x20(%rsp), %rax
movzbl (%rax), %eax
movq 0x20(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
movq 0x18(%rsp), %rcx
movzbl (%rcx), %ecx
addl %ecx, %eax
movq 0x18(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
addl 0xc(%rsp), %eax
sarl $0x2, %eax
movb %al, %cl
movq 0x10(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x10(%rsp)
movb %cl, (%rax)
movl 0xc(%rsp), %eax
xorl $0x3, %eax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x18(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0xdd0ea
movl 0x34(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x34(%rsp)
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0xdd08a
addq $0x58, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: expand_right_edge
LOCAL(void)
expand_right_edge (JSAMPARRAY image_data, int num_rows,
		   JDIMENSION input_cols, JDIMENSION output_cols)
{
  register JSAMPROW ptr;
  register JSAMPLE pixval;
  register int count;
  int row;
  int numcols = (int) (output_cols - input_cols);

  if (numcols > 0) {
    for (row = 0; row < num_rows; row++) {
      ptr = image_data[row] + input_cols;
      pixval = ptr[-1];		/* don't need GETJSAMPLE() here */
      for (count = numcols; count > 0; count--)
	*ptr++ = pixval;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movl %edx, -0x10(%rsp)
movl %ecx, -0x14(%rsp)
movl -0x14(%rsp), %eax
subl -0x10(%rsp), %eax
movl %eax, -0x30(%rsp)
cmpl $0x0, -0x30(%rsp)
jle 0xdd410
movl $0x0, -0x2c(%rsp)
movl -0x2c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jge 0xdd40e
movq -0x8(%rsp), %rax
movslq -0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x10(%rsp), %ecx
addq %rcx, %rax
movq %rax, -0x20(%rsp)
movq -0x20(%rsp), %rax
movb -0x1(%rax), %al
movb %al, -0x21(%rsp)
movl -0x30(%rsp), %eax
movl %eax, -0x28(%rsp)
cmpl $0x0, -0x28(%rsp)
jle 0xdd3ff
movb -0x21(%rsp), %cl
movq -0x20(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rsp)
movb %cl, (%rax)
movl -0x28(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rsp)
jmp 0xdd3d4
jmp 0xdd401
movl -0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rsp)
jmp 0xdd39c
jmp 0xdd410
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: jinit_huff_encoder
GLOBAL(void)
jinit_huff_encoder (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy;
  int i;

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

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

// Assembly:
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 $0xc0, %edx
callq *%rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x1f0(%rax)
movq 0x8(%rsp), %rax
leaq 0x78(%rip), %rcx        # 0xdde20
movq %rcx, (%rax)
movl $0x0, 0x4(%rsp)
cmpl $0x4, 0x4(%rsp)
jge 0xdde19
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)
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq $0x0, 0xa0(%rax,%rcx,8)
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq $0x0, 0x80(%rax,%rcx,8)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xdddb3
addq $0x18, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: encode_mcu_gather
METHODDEF(jboolean)
encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  int blkn, ci;
  jpeg_component_info * compptr;

  /* Take care of restart intervals if needed */
  if (cinfo->restart_interval) {
    if (entropy->restarts_to_go == 0) {
      /* Re-initialize DC predictions to 0 */
      for (ci = 0; ci < cinfo->comps_in_scan; ci++)
	entropy->saved.last_dc_val[ci] = 0;
      /* Update restart state */
      entropy->restarts_to_go = cinfo->restart_interval;
    }
    entropy->restarts_to_go--;
  }

  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
    ci = cinfo->MCU_membership[blkn];
    compptr = cinfo->cur_comp_info[ci];
    htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],
		    entropy->dc_count_ptrs[compptr->dc_tbl_no],
		    entropy->ac_count_ptrs[compptr->ac_tbl_no]);
    entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];
  }

  return TRUE;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x1f0(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x0, 0x118(%rax)
je 0xde171
movq 0x10(%rsp), %rax
cmpl $0x0, 0x38(%rax)
jne 0xde163
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x144(%rcx), %eax
jge 0xde150
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movl $0x0, 0x24(%rax,%rcx,4)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xde120
movq 0x20(%rsp), %rax
movl 0x118(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x38(%rax)
movq 0x10(%rsp), %rax
movl 0x38(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x38(%rax)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x170(%rcx), %eax
jge 0xde238
movq 0x20(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl 0x174(%rax,%rcx,4), %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movslq 0x8(%rsp), %rcx
movq 0x148(%rax,%rcx,8), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movl 0x24(%rax,%rcx,4), %edx
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movslq 0x14(%rcx), %rcx
movq 0x80(%rax,%rcx,8), %rcx
movq 0x10(%rsp), %rax
movq (%rsp), %r8
movslq 0x18(%r8), %r8
movq 0xa0(%rax,%r8,8), %r8
callq 0xde710
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movswl (%rax), %edx
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movl %edx, 0x24(%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xde179
movl $0x1, %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: finish_pass_gather
METHODDEF(void)
finish_pass_gather (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  int ci, dctbl, actbl;
  jpeg_component_info * compptr;
  JHUFF_TBL **htblptr;
  jboolean did_dc[NUM_HUFF_TBLS];
  jboolean did_ac[NUM_HUFF_TBLS];

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

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

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq 0x1f0(%rax), %rax
movq %rax, 0x48(%rsp)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xf280
movq %rsp, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xf280
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0x144(%rcx), %eax
jge 0xde3d8
movq 0x50(%rsp), %rax
movslq 0x44(%rsp), %rcx
movq 0x148(%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, 0x40(%rsp)
movq 0x30(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x3c(%rsp)
movslq 0x40(%rsp), %rax
cmpl $0x0, 0x10(%rsp,%rax,4)
jne 0xde34f
movq 0x50(%rsp), %rax
addq $0x80, %rax
movslq 0x40(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
jne 0xde31e
movq 0x50(%rsp), %rdi
callq 0xf92c0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq 0x48(%rsp), %rax
movslq 0x40(%rsp), %rcx
movq 0x80(%rax,%rcx,8), %rdx
callq 0xdd8a0
movslq 0x40(%rsp), %rax
movl $0x1, 0x10(%rsp,%rax,4)
movslq 0x3c(%rsp), %rax
cmpl $0x0, (%rsp,%rax,4)
jne 0xde3c6
movq 0x50(%rsp), %rax
addq $0xa0, %rax
movslq 0x3c(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
jne 0xde396
movq 0x50(%rsp), %rdi
callq 0xf92c0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq 0x48(%rsp), %rax
movslq 0x3c(%rsp), %rcx
movq 0xa0(%rax,%rcx,8), %rdx
callq 0xdd8a0
movslq 0x3c(%rsp), %rax
movl $0x1, (%rsp,%rax,4)
jmp 0xde3c8
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0xde292
addq $0x58, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: finish_pass_huff
METHODDEF(void)
finish_pass_huff (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  working_state state;

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

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

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

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq 0x1f0(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x20(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x28(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x30(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %rsp, %rdi
callq 0xdece0
cmpl $0x0, %eax
jne 0xde6bd
movq 0x40(%rsp), %rax
movq (%rax), %rax
movl $0x18, 0x28(%rax)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x40(%rsp), %rdi
callq *%rax
movq (%rsp), %rcx
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%rsp), %rcx
movq %rcx, 0x20(%rax)
movq 0x20(%rsp), %rcx
movq %rcx, 0x28(%rax)
movq 0x28(%rsp), %rcx
movq %rcx, 0x30(%rax)
addq $0x48, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: emit_restart
LOCAL(jboolean)
emit_restart (working_state * state, int restart_num)
{
  int ci;

  if (! flush_bits(state))
    return FALSE;

  emit_byte(state, 0xFF, return FALSE);
  emit_byte(state, JPEG_RST0 + restart_num, return FALSE);

  /* Re-initialize DC predictions to 0 */
  for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)
    state->cur.last_dc_val[ci] = 0;

  /* The restart counter is not updated until we successfully write the MCU. */

  return TRUE;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movl %esi, 0x4(%rsp)
movq 0x8(%rsp), %rdi
callq 0xdece0
cmpl $0x0, %eax
jne 0xde909
movl $0x0, 0x14(%rsp)
jmp 0xde9e3
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, (%rcx)
movb $-0x1, (%rax)
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0xde953
movq 0x8(%rsp), %rdi
callq 0xded40
cmpl $0x0, %eax
jne 0xde951
movl $0x0, 0x14(%rsp)
jmp 0xde9e3
jmp 0xde953
movl 0x4(%rsp), %eax
addl $0xd0, %eax
movb %al, %cl
movq 0x8(%rsp), %rdx
movq (%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
movb %cl, (%rax)
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
addq $-0x1, %rax
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0xde9a4
movq 0x8(%rsp), %rdi
callq 0xded40
cmpl $0x0, %eax
jne 0xde9a2
movl $0x0, 0x14(%rsp)
jmp 0xde9e3
jmp 0xde9a4
movl $0x0, (%rsp)
movl (%rsp), %eax
movq 0x8(%rsp), %rcx
movq 0x30(%rcx), %rcx
cmpl 0x144(%rcx), %eax
jge 0xde9db
movq 0x8(%rsp), %rax
movslq (%rsp), %rcx
movl $0x0, 0x1c(%rax,%rcx,4)
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0xde9ab
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: flush_bits
LOCAL(jboolean)
flush_bits (working_state * state)
{
  if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
    return FALSE;
  state->cur.put_buffer = 0;	/* and reset bit-buffer to empty */
  state->cur.put_bits = 0;
  return TRUE;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movl $0x7f, %esi
movl $0x7, %edx
callq 0xdedb0
cmpl $0x0, %eax
jne 0xded0c
movl $0x0, 0x14(%rsp)
jmp 0xded2d
movq 0x8(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x8(%rsp), %rax
movl $0x0, 0x18(%rax)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: dump_buffer
LOCAL(jboolean)
dump_buffer (working_state * state)
/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
{
  struct jpeg_destination_mgr * dest = state->cinfo->dest;

  if (! (*dest->empty_output_buffer) (state->cinfo))
    return FALSE;
  /* After a successful buffer dump, must reset buffer pointers */
  state->next_output_byte = dest->next_output_byte;
  state->free_in_buffer = dest->free_in_buffer;
  return TRUE;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rcx
movq 0x30(%rcx), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xded7c
movl $0x0, 0x14(%rsp)
jmp 0xdeda4
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq (%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: jinit_phuff_encoder
GLOBAL(void)
jinit_phuff_encoder (j_compress_ptr cinfo)
{
  phuff_entropy_ptr entropy;
  int i;

  entropy = (phuff_entropy_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(phuff_entropy_encoder));
  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
  entropy->pub.start_pass = start_pass_phuff;

  /* Mark tables unallocated */
  for (i = 0; i < NUM_HUFF_TBLS; i++) {
    entropy->derived_tbls[i] = NULL;
    entropy->count_ptrs[i] = NULL;
  }
  entropy->bit_buffer = NULL;	/* needed only in AC refinement scan */
}

// 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 $0xb8, %edx
callq *%rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x1f0(%rax)
movq 0x8(%rsp), %rax
leaq 0x68(%rip), %rcx        # 0xdf020
movq %rcx, (%rax)
movl $0x0, 0x4(%rsp)
cmpl $0x4, 0x4(%rsp)
jge 0xdf000
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq $0x0, 0x78(%rax,%rcx,8)
movq 0x8(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq $0x0, 0x98(%rax,%rcx,8)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xdefc3
movq 0x8(%rsp), %rax
movq $0x0, 0x68(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: encode_mcu_DC_refine
METHODDEF(jboolean)
encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  register int temp;
  int blkn;
  int Al = cinfo->Al;
  JBLOCKROW block;

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

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

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

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

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

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

  return TRUE;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x1f0(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movl 0x1a8(%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x30(%rsp), %rax
cmpl $0x0, 0x118(%rax)
je 0xdf8d6
movq 0x20(%rsp), %rax
cmpl $0x0, 0x70(%rax)
jne 0xdf8d4
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rax
movl 0x74(%rax), %esi
callq 0xe00e0
jmp 0xdf8d6
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movq 0x30(%rsp), %rcx
cmpl 0x170(%rcx), %eax
jge 0xdf934
movq 0x28(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movswl (%rax), %eax
movl %eax, 0x1c(%rsp)
movq 0x20(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x14(%rsp), %ecx
sarl %cl, %esi
movl $0x1, %edx
callq 0xe0280
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xdf8de
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x30(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rax
cmpl $0x0, 0x118(%rax)
je 0xdf9b5
movq 0x20(%rsp), %rax
cmpl $0x0, 0x70(%rax)
jne 0xdf9a7
movq 0x30(%rsp), %rax
movl 0x118(%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x70(%rax)
movq 0x20(%rsp), %rax
movl 0x74(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x74(%rax)
movq 0x20(%rsp), %rax
movl 0x74(%rax), %ecx
andl $0x7, %ecx
movl %ecx, 0x74(%rax)
movq 0x20(%rsp), %rax
movl 0x70(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x70(%rax)
movl $0x1, %eax
addq $0x38, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: finish_pass_gather_phuff
METHODDEF(void)
finish_pass_gather_phuff (j_compress_ptr cinfo)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  jboolean is_DC_band;
  int ci, tbl;
  jpeg_component_info * compptr;
  JHUFF_TBL **htblptr;
  jboolean did[NUM_HUFF_TBLS];

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

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

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

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

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq 0x1f0(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0xe0420
movq 0x40(%rsp), %rax
cmpl $0x0, 0x19c(%rax)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x34(%rsp)
movq %rsp, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xf280
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl 0x144(%rcx), %eax
jge 0xe0045
movq 0x40(%rsp), %rax
movslq 0x30(%rsp), %rcx
movq 0x148(%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0xdff87
movq 0x40(%rsp), %rax
cmpl $0x0, 0x1a4(%rax)
je 0xdff79
jmp 0xe0035
movq 0x20(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, 0x2c(%rsp)
jmp 0xdff93
movq 0x20(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x2c(%rsp)
movslq 0x2c(%rsp), %rax
cmpl $0x0, (%rsp,%rax,4)
jne 0xe0033
cmpl $0x0, 0x34(%rsp)
je 0xdffc7
movq 0x40(%rsp), %rax
addq $0x80, %rax
movslq 0x2c(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
jmp 0xdffe3
movq 0x40(%rsp), %rax
addq $0xa0, %rax
movslq 0x2c(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0xe0003
movq 0x40(%rsp), %rdi
callq 0xf92c0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movq 0x38(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movq 0x98(%rax,%rcx,8), %rdx
callq 0xdd8a0
movslq 0x2c(%rsp), %rax
movl $0x1, (%rsp,%rax,4)
jmp 0xe0035
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0xdff33
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: finish_pass_phuff
METHODDEF(void)
finish_pass_phuff (j_compress_ptr cinfo)
{   
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;

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

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

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

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x1f0(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rdi
callq 0xe0420
movq 0x8(%rsp), %rdi
callq 0xe0510
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x8(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: emit_restart
LOCAL(void)
emit_restart (phuff_entropy_ptr entropy, int restart_num)
{
  int ci;

  emit_eobrun(entropy);

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

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

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rdi
callq 0xe0420
movq 0x10(%rsp), %rax
cmpl $0x0, 0x18(%rax)
jne 0xe018c
movq 0x10(%rsp), %rdi
callq 0xe0510
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x20(%rcx)
movb $-0x1, (%rax)
movq 0x10(%rsp), %rcx
movq 0x28(%rcx), %rax
addq $-0x1, %rax
movq %rax, 0x28(%rcx)
cmpq $0x0, %rax
jne 0xe0148
movq 0x10(%rsp), %rdi
callq 0xe0550
movl 0xc(%rsp), %eax
addl $0xd0, %eax
movb %al, %cl
movq 0x10(%rsp), %rdx
movq 0x20(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x20(%rdx)
movb %cl, (%rax)
movq 0x10(%rsp), %rcx
movq 0x28(%rcx), %rax
addq $-0x1, %rax
movq %rax, 0x28(%rcx)
cmpq $0x0, %rax
jne 0xe018a
movq 0x10(%rsp), %rdi
callq 0xe0550
jmp 0xe018c
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
cmpl $0x0, 0x19c(%rax)
jne 0xe01dc
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rcx
cmpl 0x144(%rcx), %eax
jge 0xe01da
movq 0x10(%rsp), %rax
movslq 0x8(%rsp), %rcx
movl $0x0, 0x48(%rax,%rcx,4)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xe01a6
jmp 0xe01f4
movq 0x10(%rsp), %rax
movl $0x0, 0x5c(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x60(%rax)
addq $0x18, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: emit_eobrun
LOCAL(void)
emit_eobrun (phuff_entropy_ptr entropy)
{
  register int temp, nbits;

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

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

    entropy->EOBRUN = 0;

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

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x5c(%rax)
jbe 0xe0505
movq 0x10(%rsp), %rax
movl 0x5c(%rax), %eax
movl %eax, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0xc(%rsp), %eax
sarl %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, %eax
je 0xe0468
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xe044c
cmpl $0xe, 0x8(%rsp)
jle 0xe049c
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movl $0x28, 0x28(%rax)
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rdi
callq *%rax
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x58(%rax), %esi
movl 0x8(%rsp), %edx
shll $0x4, %edx
callq 0xe0200
cmpl $0x0, 0x8(%rsp)
je 0xe04d2
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movl 0x5c(%rax), %esi
movl 0x8(%rsp), %edx
callq 0xe0280
movq 0x10(%rsp), %rax
movl $0x0, 0x5c(%rax)
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x68(%rax), %rsi
movq 0x10(%rsp), %rax
movl 0x60(%rax), %edx
callq 0xe05e0
movq 0x10(%rsp), %rax
movl $0x0, 0x60(%rax)
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: dump_buffer
LOCAL(void)
dump_buffer (phuff_entropy_ptr entropy)
/* Empty the output buffer; we do not support suspension in this module. */
{
  struct jpeg_destination_mgr * dest = entropy->cinfo->dest;

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

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rdi
callq *%rax
cmpl $0x0, %eax
jne 0xe05b1
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movl $0x18, 0x28(%rax)
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x40(%rcx), %rdi
callq *%rax
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
addq $0x18, %rsp
retq
nopl (%rax)