LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdsample.c
// Function: h2v2_upsample
METHODDEF(void)
h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  JSAMPARRAY output_data = *output_data_ptr;
  register JSAMPROW inptr, outptr;
  register JSAMPLE invalue;
  JSAMPROW outend;
  int inrow, outrow;

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

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
movl 0x8(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0x19c(%rcx), %eax
jge 0xf3582
movq 0x40(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x50(%rsp), %rcx
movl 0x88(%rcx), %ecx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x10(%rsp), %rax
jae 0xf353b
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rsp)
movb (%rax), %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %cl
movq 0x20(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x20(%rsp)
movb %cl, (%rax)
movb 0x1f(%rsp), %cl
movq 0x20(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x20(%rsp)
movb %cl, (%rax)
jmp 0xf34e8
movq 0x30(%rsp), %rdi
movl 0x8(%rsp), %esi
movq 0x30(%rsp), %rdx
movl 0x8(%rsp), %ecx
addl $0x1, %ecx
movq 0x50(%rsp), %rax
movl 0x88(%rax), %r9d
movl $0x1, %r8d
callq 0xf9370
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x8(%rsp)
jmp 0xf3495
addq $0x58, %rsp
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdsample.c
// Function: int_upsample
METHODDEF(void)
int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	      JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
  JSAMPARRAY output_data = *output_data_ptr;
  register JSAMPROW inptr, outptr;
  register JSAMPLE invalue;
  register int h;
  JSAMPROW outend;
  int h_expand, v_expand;
  int inrow, outrow;

  h_expand = upsample->h_expand[compptr->component_index];
  v_expand = upsample->v_expand[compptr->component_index];

  inrow = outrow = 0;
  while (outrow < cinfo->max_v_samp_factor) {
    /* Generate one output row with proper horizontal expansion */
    inptr = input_data[inrow];
    outptr = output_data[outrow];
    outend = outptr + cinfo->output_width;
    while (outptr < outend) {
      invalue = *inptr++;	/* don't need GETJSAMPLE() here */
      for (h = h_expand; h > 0; h--) {
	*outptr++ = invalue;
      }
    }
    /* Generate any additional output rows by duplicating the first one */
    if (v_expand > 1) {
      jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
			v_expand-1, cinfo->output_width);
    }
    inrow++;
    outrow += v_expand;
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq 0x260(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq 0x58(%rsp), %rcx
movslq 0x4(%rcx), %rcx
movzbl 0xe8(%rax,%rcx), %eax
movl %eax, 0x14(%rsp)
movq 0x40(%rsp), %rax
movq 0x58(%rsp), %rcx
movslq 0x4(%rcx), %rcx
movzbl 0xf2(%rax,%rcx), %eax
movl %eax, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
movl 0x8(%rsp), %eax
movq 0x60(%rsp), %rcx
cmpl 0x19c(%rcx), %eax
jge 0xf3707
movq 0x50(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movq 0x38(%rsp), %rax
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x60(%rsp), %rcx
movl 0x88(%rcx), %ecx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0xf36b5
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movb (%rax), %al
movb %al, 0x27(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x20(%rsp)
jle 0xf36b3
movb 0x27(%rsp), %cl
movq 0x28(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x28(%rsp)
movb %cl, (%rax)
movl 0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0xf3688
jmp 0xf365d
cmpl $0x1, 0x10(%rsp)
jle 0xf36eb
movq 0x38(%rsp), %rdi
movl 0x8(%rsp), %esi
movq 0x38(%rsp), %rdx
movl 0x8(%rsp), %ecx
addl $0x1, %ecx
movl 0x10(%rsp), %r8d
subl $0x1, %r8d
movq 0x60(%rsp), %rax
movl 0x88(%rax), %r9d
callq 0xf9370
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
addl 0x8(%rsp), %eax
movl %eax, 0x8(%rsp)
jmp 0xf360a
addq $0x68, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdcolor.c
// Function: gray_rgb_convert
METHODDEF(void)
gray_rgb_convert (j_decompress_ptr cinfo,
		  JSAMPIMAGE input_buf, JDIMENSION input_row,
		  JSAMPARRAY output_buf, int num_rows)
{
  register JSAMPROW inptr, outptr;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->output_width;

  while (--num_rows >= 0) {
    inptr = input_buf[0][input_row++];
    outptr = *output_buf++;
    for (col = 0; col < num_cols; col++) {
      /* We can dispense with GETJSAMPLE() here */
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
      outptr += RGB_PIXELSIZE;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movl %edx, -0x14(%rsp)
movq %rcx, -0x20(%rsp)
movl %r8d, -0x24(%rsp)
movq -0x8(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, -0x40(%rsp)
movl -0x24(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rsp)
cmpl $0x0, %eax
jl 0xf3f69
movq -0x10(%rsp), %rax
movq (%rax), %rax
movl -0x14(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x14(%rsp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rsp)
movq -0x20(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x20(%rsp)
movq (%rax), %rax
movq %rax, -0x38(%rsp)
movl $0x0, -0x3c(%rsp)
movl -0x3c(%rsp), %eax
cmpl -0x40(%rsp), %eax
jae 0xf3f64
movq -0x30(%rsp), %rax
movl -0x3c(%rsp), %ecx
movb (%rax,%rcx), %cl
movq -0x38(%rsp), %rax
movb %cl, 0x2(%rax)
movq -0x38(%rsp), %rax
movb %cl, 0x1(%rax)
movq -0x38(%rsp), %rax
movb %cl, (%rax)
movq -0x38(%rsp), %rax
addq $0x3, %rax
movq %rax, -0x38(%rsp)
movl -0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rsp)
jmp 0xf3f1c
jmp 0xf3ec7
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdcolor.c
// Function: null_convert
METHODDEF(void)
null_convert (j_decompress_ptr cinfo,
	      JSAMPIMAGE input_buf, JDIMENSION input_row,
	      JSAMPARRAY output_buf, int num_rows)
{
  register JSAMPROW inptr, outptr;
  register JDIMENSION count;
  register int num_components = cinfo->num_components;
  JDIMENSION num_cols = cinfo->output_width;
  int ci;

  while (--num_rows >= 0) {
    for (ci = 0; ci < num_components; ci++) {
      inptr = input_buf[ci][input_row];
      outptr = output_buf[0] + ci;
      for (count = num_cols; count > 0; count--) {
	*outptr = *inptr++;	/* needn't bother with GETJSAMPLE() here */
	outptr += num_components;
      }
    }
    input_row++;
    output_buf++;
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movl %edx, -0x14(%rsp)
movq %rcx, -0x20(%rsp)
movl %r8d, -0x24(%rsp)
movq -0x8(%rsp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x40(%rsp)
movq -0x8(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, -0x44(%rsp)
movl -0x24(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rsp)
cmpl $0x0, %eax
jl 0xf4077
movl $0x0, -0x48(%rsp)
movl -0x48(%rsp), %eax
cmpl -0x40(%rsp), %eax
jge 0xf4059
movq -0x10(%rsp), %rax
movslq -0x48(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rsp)
movq -0x20(%rsp), %rax
movq (%rax), %rax
movslq -0x48(%rsp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rsp)
movl -0x44(%rsp), %eax
movl %eax, -0x3c(%rsp)
cmpl $0x0, -0x3c(%rsp)
jbe 0xf4047
movq -0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rsp)
movb (%rax), %cl
movq -0x38(%rsp), %rax
movb %cl, (%rax)
movl -0x40(%rsp), %ecx
movq -0x38(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rsp)
movl -0x3c(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rsp)
jmp 0xf4005
jmp 0xf4049
movl -0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rsp)
jmp 0xf3fbf
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
movq -0x20(%rsp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rsp)
jmp 0xf3fa3
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: jinit_1pass_quantizer
GLOBAL(void)
jinit_1pass_quantizer (j_decompress_ptr cinfo)
{
  my_cquantize_ptr cquantize;

  cquantize = (my_cquantize_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_cquantizer));
  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
  cquantize->pub.start_pass = start_pass_1_quant;
  cquantize->pub.finish_pass = finish_pass_1_quant;
  cquantize->pub.new_color_map = new_color_map_1_quant;
  cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */
  cquantize->odither[0] = NULL;	/* Also flag odither arrays not allocated */

  /* Make sure my internal arrays won't overflow */
  if (cinfo->out_color_components > MAX_Q_COMPS)
    ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS);
  /* Make sure colormap indexes can be represented by JSAMPLEs */
  if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1))
    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1);

  /* Create the colormap and color index table. */
  create_colormap(cinfo);
  create_colorindex(cinfo);

  /* Allocate Floyd-Steinberg workspace now if requested.
   * We do this now since it is FAR storage and may affect the memory
   * manager's space calculations.  If the user changes to FS dither
   * mode in a later pass, we will allocate the space then, and will
   * possibly overrun the max_memory_to_use setting.
   */
  if (cinfo->dither_mode == JDITHER_FS)
    alloc_fs_workspace(cinfo);
}

// 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 $0x98, %edx
callq *%rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x270(%rax)
movq 0x8(%rsp), %rax
leaq 0xe8(%rip), %rcx        # 0xf43e0
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
leaq 0x2a9(%rip), %rcx       # 0xf45b0
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rax
leaq 0x2a9(%rip), %rcx       # 0xf45c0
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x70(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x50(%rax)
movq 0x10(%rsp), %rax
cmpl $0x4, 0x90(%rax)
jle 0xf4373
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x37, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x4, 0x2c(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movq 0x10(%rsp), %rax
cmpl $0x100, 0x78(%rax)      # imm = 0x100
jle 0xf43b1
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x39, 0x28(%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl $0x100, 0x2c(%rax)      # imm = 0x100
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movq 0x10(%rsp), %rdi
callq 0xf45f0
movq 0x10(%rsp), %rdi
callq 0xf4830
movq 0x10(%rsp), %rax
cmpl $0x2, 0x70(%rax)
jne 0xf43da
movq 0x10(%rsp), %rdi
callq 0xf4a40
addq $0x18, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: alloc_fs_workspace
LOCAL(void)
alloc_fs_workspace (j_decompress_ptr cinfo)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  size_t arraysize;
  int i;

  arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
  for (i = 0; i < cinfo->out_color_components; i++) {
    cquantize->fserrors[i] = (FSERRPTR)
      (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x270(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movl 0x88(%rax), %eax
addl $0x2, %eax
movl %eax, %eax
shlq %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x90(%rcx), %eax
jge 0xf4ac8
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl $0x1, %esi
callq *%rax
movq %rax, %rdx
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq %rdx, 0x70(%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xf4a7a
addq $0x28, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: color_quantize3
METHODDEF(void)
color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		 JSAMPARRAY output_buf, int num_rows)
/* Fast path for out_color_components==3, no dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register int pixcode;
  register JSAMPROW ptrin, ptrout;
  JSAMPROW colorindex0 = cquantize->colorindex[0];
  JSAMPROW colorindex1 = cquantize->colorindex[1];
  JSAMPROW colorindex2 = cquantize->colorindex[2];
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    ptrin = input_buf[row];
    ptrout = output_buf[row];
    for (col = width; col > 0; col--) {
      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);
      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);
      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);
      *ptrout++ = (JSAMPLE) pixcode;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movq 0x270(%rax), %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq (%rax), %rax
movq %rax, -0x48(%rsp)
movq -0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rsp)
movq -0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rsp)
movq -0x8(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, -0x64(%rsp)
movl $0x0, -0x5c(%rsp)
movl -0x5c(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jge 0xf4c36
movq -0x10(%rsp), %rax
movslq -0x5c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rsp)
movq -0x18(%rsp), %rax
movslq -0x5c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rsp)
movl -0x64(%rsp), %eax
movl %eax, -0x60(%rsp)
cmpl $0x0, -0x60(%rsp)
jbe 0xf4c24
movq -0x48(%rsp), %rax
movq -0x38(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rsp)
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rsp)
movq -0x50(%rsp), %rax
movq -0x38(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rsp)
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
addl -0x2c(%rsp), %eax
movl %eax, -0x2c(%rsp)
movq -0x58(%rsp), %rax
movq -0x38(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rsp)
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
addl -0x2c(%rsp), %eax
movl %eax, -0x2c(%rsp)
movl -0x2c(%rsp), %eax
movb %al, %cl
movq -0x40(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rsp)
movb %cl, (%rax)
movl -0x60(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x60(%rsp)
jmp 0xf4b7c
jmp 0xf4c26
movl -0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rsp)
jmp 0xf4b40
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: color_quantize
METHODDEF(void)
color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		JSAMPARRAY output_buf, int num_rows)
/* General case, no dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  JSAMPARRAY colorindex = cquantize->colorindex;
  register int pixcode, ci;
  register JSAMPROW ptrin, ptrout;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;
  register int nc = cinfo->out_color_components;

  for (row = 0; row < num_rows; row++) {
    ptrin = input_buf[row];
    ptrout = output_buf[row];
    for (col = width; col > 0; col--) {
      pixcode = 0;
      for (ci = 0; ci < nc; ci++) {
	pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);
      }
      *ptrout++ = (JSAMPLE) pixcode;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movq 0x270(%rax), %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rsp)
movq -0x8(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, -0x54(%rsp)
movq -0x8(%rsp), %rax
movl 0x90(%rax), %eax
movl %eax, -0x58(%rsp)
movl $0x0, -0x4c(%rsp)
movl -0x4c(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jge 0xf4d72
movq -0x10(%rsp), %rax
movslq -0x4c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rsp)
movq -0x18(%rsp), %rax
movslq -0x4c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rsp)
movl -0x54(%rsp), %eax
movl %eax, -0x50(%rsp)
cmpl $0x0, -0x50(%rsp)
jbe 0xf4d60
movl $0x0, -0x34(%rsp)
movl $0x0, -0x38(%rsp)
movl -0x38(%rsp), %eax
cmpl -0x58(%rsp), %eax
jge 0xf4d37
movq -0x30(%rsp), %rax
movslq -0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rsp)
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
addl -0x34(%rsp), %eax
movl %eax, -0x34(%rsp)
movl -0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rsp)
jmp 0xf4cef
movl -0x34(%rsp), %eax
movb %al, %cl
movq -0x48(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rsp)
movb %cl, (%rax)
movl -0x50(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x50(%rsp)
jmp 0xf4cd4
jmp 0xf4d62
movl -0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rsp)
jmp 0xf4c98
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: create_odither_tables
LOCAL(void)
create_odither_tables (j_decompress_ptr cinfo)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  ODITHER_MATRIX_PTR odither;
  int i, j, nci;

  for (i = 0; i < cinfo->out_color_components; i++) {
    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */
    odither = NULL;		/* search for matching prior component */
    for (j = 0; j < i; j++) {
      if (nci == cquantize->Ncolors[j]) {
	odither = cquantize->odither[j];
	break;
      }
    }
    if (odither == NULL)	/* need a new table? */
      odither = make_odither_array(cinfo, nci);
    cquantize->odither[i] = odither;
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x270(%rax), %rax
movq %rax, 0x18(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0x90(%rcx), %eax
jge 0xf524c
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl 0x3c(%rax,%rcx,4), %eax
movl %eax, 0x4(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0xf520d
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
movslq 0x8(%rsp), %rdx
cmpl 0x3c(%rcx,%rdx,4), %eax
jne 0xf51fe
movq 0x18(%rsp), %rax
movslq 0x8(%rsp), %rcx
movq 0x50(%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
jmp 0xf520d
jmp 0xf5200
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xf51ca
cmpq $0x0, 0x10(%rsp)
jne 0xf5228
movq 0x20(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0xf55d0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
movq %rdx, 0x50(%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xf5192
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: make_odither_array
LOCAL(ODITHER_MATRIX_PTR)
make_odither_array (j_decompress_ptr cinfo, int ncolors)
{
  ODITHER_MATRIX_PTR odither;
  int j,k;
  INT32 num,den;

  odither = (ODITHER_MATRIX_PTR)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(ODITHER_MATRIX));
  /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).
   * Hence the dither value for the matrix cell with fill order f
   * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).
   * On 16-bit-int machine, be careful to avoid overflow.
   */
  den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1));
  for (j = 0; j < ODITHER_SIZE; j++) {
    for (k = 0; k < ODITHER_SIZE; k++) {
      num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))
	    * MAXJSAMPLE;
      /* Ensure round towards zero despite C's lack of consistency
       * about rounding negative values in integer division...
       */
      odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);
    }
  }
  return odither;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x30(%rsp), %rdi
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
callq *%rax
movq %rax, 0x20(%rsp)
movl 0x2c(%rsp), %eax
subl $0x1, %eax
cltq
shlq $0x9, %rax
movq %rax, 0x8(%rsp)
movl $0x0, 0x1c(%rsp)
cmpl $0x10, 0x1c(%rsp)
jge 0xf56df
movl $0x0, 0x18(%rsp)
cmpl $0x10, 0x18(%rsp)
jge 0xf56cd
movslq 0x1c(%rsp), %rcx
leaq 0x41e0d(%rip), %rax     # 0x137450
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x18(%rsp), %rcx
movzbl (%rax,%rcx), %ecx
shll %ecx
movl $0xff, %eax
subl %ecx, %eax
cltq
imulq $0xff, %rax, %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jge 0xf568e
xorl %eax, %eax
subq 0x10(%rsp), %rax
cqto
idivq 0x8(%rsp)
movq %rax, %rcx
xorl %eax, %eax
subq %rcx, %rax
movq %rax, (%rsp)
jmp 0xf569e
movq 0x10(%rsp), %rax
cqto
idivq 0x8(%rsp)
movq %rax, (%rsp)
movq (%rsp), %rax
movl %eax, %edx
movq 0x20(%rsp), %rax
movslq 0x1c(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movslq 0x18(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0xf562c
jmp 0xf56cf
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0xf5619
movq 0x20(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: init_error_limit
LOCAL(void)
init_error_limit (j_decompress_ptr cinfo)
/* Allocate and fill in the error_limiter table */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  int * table;
  int in, out;

  table = (int *) (*cinfo->mem->alloc_small)
    ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int));
  table += MAXJSAMPLE;		/* so can index -MAXJSAMPLE .. +MAXJSAMPLE */
  cquantize->error_limiter = table;

#define STEPSIZE ((MAXJSAMPLE+1)/16)
  /* Map errors 1:1 up to +- MAXJSAMPLE/16 */
  out = 0;
  for (in = 0; in < STEPSIZE; in++, out++) {
    table[in] = out; table[-in] = -out;
  }
  /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */
  for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) {
    table[in] = out; table[-in] = -out;
  }
  /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */
  for (; in <= MAXJSAMPLE; in++) {
    table[in] = out; table[-in] = -out;
  }
#undef STEPSIZE
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x270(%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 $0x7fc, %edx            # imm = 0x7FC
callq *%rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq $0x3fc, %rax            # imm = 0x3FC
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x50(%rax)
movl $0x0, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x10, 0xc(%rsp)
jge 0xf5ef1
movl 0x8(%rsp), %edx
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
xorl %edx, %edx
subl 0x8(%rsp), %edx
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
subl 0xc(%rsp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xf5eaa
jmp 0xf5ef3
cmpl $0x30, 0xc(%rsp)
jge 0xf5f4b
movl 0x8(%rsp), %edx
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
xorl %edx, %edx
subl 0x8(%rsp), %edx
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
subl 0xc(%rsp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %edx
andl $0x1, %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
addl 0x8(%rsp), %eax
movl %eax, 0x8(%rsp)
jmp 0xf5ef3
jmp 0xf5f4d
cmpl $0xff, 0xc(%rsp)
jg 0xf5f8c
movl 0x8(%rsp), %edx
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
xorl %edx, %edx
subl 0x8(%rsp), %edx
movq 0x10(%rsp), %rax
xorl %ecx, %ecx
subl 0xc(%rsp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xf5f4d
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: prescan_quantize
METHODDEF(void)
prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		  JSAMPARRAY output_buf, int num_rows)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register JSAMPROW ptr;
  register histptr histp;
  register hist3d histogram = cquantize->histogram;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    ptr = input_buf[row];
    for (col = width; col > 0; col--) {
      /* get pixel value and index into the histogram */
      histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]
			 [GETJSAMPLE(ptr[1]) >> C1_SHIFT]
			 [GETJSAMPLE(ptr[2]) >> C2_SHIFT];
      /* increment, check for overflow and undo increment if so. */
      if (++(*histp) <= 0)
	(*histp)--;
      ptr += 3;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movq 0x270(%rax), %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x40(%rsp)
movq -0x8(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, -0x4c(%rsp)
movl $0x0, -0x44(%rsp)
movl -0x44(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jge 0xf60ba
movq -0x10(%rsp), %rax
movslq -0x44(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rsp)
movl -0x4c(%rsp), %eax
movl %eax, -0x48(%rsp)
cmpl $0x0, -0x48(%rsp)
jbe 0xf60a8
movq -0x40(%rsp), %rax
movq -0x30(%rsp), %rcx
movzbl (%rcx), %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq -0x30(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
sarl $0x2, %ecx
movslq %ecx, %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq -0x30(%rsp), %rcx
movzbl 0x2(%rcx), %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x38(%rsp)
movq -0x38(%rsp), %rcx
movw (%rcx), %ax
addw $0x1, %ax
movw %ax, (%rcx)
movzwl %ax, %eax
cmpl $0x0, %eax
jg 0xf608a
movq -0x38(%rsp), %rax
movw (%rax), %cx
addw $-0x1, %cx
movw %cx, (%rax)
movq -0x30(%rsp), %rax
addq $0x3, %rax
movq %rax, -0x30(%rsp)
movl -0x48(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rsp)
jmp 0xf6012
jmp 0xf60aa
movl -0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rsp)
jmp 0xf5fe9
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: finish_pass1
METHODDEF(void)
finish_pass1 (j_decompress_ptr cinfo)
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;

  /* Select the representative colors and fill in cinfo->colormap */
  cinfo->colormap = cquantize->sv_colormap;
  select_colors(cinfo, cquantize->desired);
  /* Force next pass to zero the color index table */
  cquantize->needs_zeroed = TRUE;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x270(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0xa0(%rax)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movl 0x28(%rax), %esi
callq 0xf6940
movq 0x8(%rsp), %rax
movl $0x1, 0x38(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: pass2_no_dither
METHODDEF(void)
pass2_no_dither (j_decompress_ptr cinfo,
		 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
/* This version performs no dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  hist3d histogram = cquantize->histogram;
  register JSAMPROW inptr, outptr;
  register histptr cachep;
  register int c0, c1, c2;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    inptr = input_buf[row];
    outptr = output_buf[row];
    for (col = width; col > 0; col--) {
      /* get pixel value and index into the cache */
      c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;
      c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;
      c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;
      cachep = & histogram[c0][c1][c2];
      /* If we have not seen this color before, find nearest colormap entry */
      /* and update the cache */
      if (*cachep == 0)
	fill_inverse_cmap(cinfo, c0,c1,c2);
      /* Now emit the colormap index for this cell */
      *outptr++ = (JSAMPLE) (*cachep - 1);
    }
  }
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movl %ecx, 0x4c(%rsp)
movq 0x60(%rsp), %rax
movq 0x270(%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x60(%rsp), %rax
movl 0x88(%rax), %eax
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jge 0xf6924
movq 0x58(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jbe 0xf6912
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movzbl (%rax), %eax
sarl $0x3, %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movzbl (%rax), %eax
sarl $0x2, %eax
movl %eax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rsp)
movzbl (%rax), %eax
sarl $0x3, %eax
movl %eax, 0x14(%rsp)
movq 0x38(%rsp), %rax
movslq 0x1c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x18(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movslq 0x14(%rsp), %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movzwl (%rax), %eax
cmpl $0x0, %eax
jne 0xf68e2
movq 0x60(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl 0x18(%rsp), %edx
movl 0x14(%rsp), %ecx
callq 0xf7730
movq 0x20(%rsp), %rax
movzwl (%rax), %eax
subl $0x1, %eax
movb %al, %cl
movq 0x28(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x28(%rsp)
movb %cl, (%rax)
movl 0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xf6839
jmp 0xf6914
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xf67fd
addq $0x68, %rsp
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: select_colors
LOCAL(void)
select_colors (j_decompress_ptr cinfo, int desired_colors)
/* Master routine for color selection */
{
  boxptr boxlist;
  int numboxes;
  int i;

  /* Allocate workspace for box list */
  boxlist = (boxptr) (*cinfo->mem->alloc_small)
    ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box));
  /* Initialize one box containing whole space */
  numboxes = 1;
  boxlist[0].c0min = 0;
  boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT;
  boxlist[0].c1min = 0;
  boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT;
  boxlist[0].c2min = 0;
  boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT;
  /* Shrink it to actually-used volume and set its statistics */
  update_box(cinfo, & boxlist[0]);
  /* Perform median-cut to produce final box list */
  numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);
  /* Compute the representative color for each box, fill colormap */
  for (i = 0; i < numboxes; i++)
    compute_color(cinfo, & boxlist[i], i);
  cinfo->actual_number_of_colors = numboxes;
  TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);
}

// 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
movslq 0x1c(%rsp), %rcx
imulq $0x28, %rcx, %rdx
movl $0x1, %esi
callq *%rax
movq %rax, 0x10(%rsp)
movl $0x1, 0xc(%rsp)
movq 0x10(%rsp), %rax
movl $0x0, (%rax)
movq 0x10(%rsp), %rax
movl $0x1f, 0x4(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x10(%rsp), %rax
movl $0x3f, 0xc(%rax)
movq 0x10(%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x10(%rsp), %rax
movl $0x1f, 0x14(%rax)
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0xf6a80
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl 0xc(%rsp), %edx
movl 0x1c(%rsp), %ecx
callq 0xf7150
movl %eax, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0xc(%rsp), %eax
jge 0xf6a2a
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
movslq 0x8(%rsp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
movl 0x8(%rsp), %edx
callq 0xf73c0
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xf69f4
movl 0xc(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x9c(%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl $0x60, 0x28(%rax)
movl 0xc(%rsp), %ecx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl %ecx, 0x2c(%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x20(%rsp), %rdi
movl $0x1, %esi
callq *%rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: find_biggest_color_pop
LOCAL(boxptr)
find_biggest_color_pop (boxptr boxlist, int numboxes)
/* Find the splittable box with the largest color population */
/* Returns NULL if no splittable boxes remain */
{
  register boxptr boxp;
  register int i;
  register long maxc = 0;
  boxptr which = NULL;
  
  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
    if (boxp->colorcount > maxc && boxp->volume > 0) {
      which = boxp;
      maxc = boxp->colorcount;
    }
  }
  return which;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq $0x0, -0x28(%rsp)
movq $0x0, -0x30(%rsp)
movl $0x0, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jge 0xf7698
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
cmpq -0x28(%rsp), %rax
jle 0xf767b
movq -0x18(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jle 0xf767b
movq -0x18(%rsp), %rax
movq %rax, -0x30(%rsp)
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rsp)
jmp 0xf767d
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
movq -0x18(%rsp), %rax
addq $0x28, %rax
movq %rax, -0x18(%rsp)
jmp 0xf763d
movq -0x30(%rsp), %rax
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jquant2.c
// Function: find_biggest_volume
LOCAL(boxptr)
find_biggest_volume (boxptr boxlist, int numboxes)
/* Find the splittable box with the largest (scaled) volume */
/* Returns NULL if no splittable boxes remain */
{
  register boxptr boxp;
  register int i;
  register INT32 maxv = 0;
  boxptr which = NULL;
  
  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
    if (boxp->volume > maxv) {
      which = boxp;
      maxv = boxp->volume;
    }
  }
  return which;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq $0x0, -0x28(%rsp)
movq $0x0, -0x30(%rsp)
movl $0x0, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0xc(%rsp), %eax
jge 0xf771c
movq -0x18(%rsp), %rax
movq 0x18(%rax), %rax
cmpq -0x28(%rsp), %rax
jle 0xf76ff
movq -0x18(%rsp), %rax
movq %rax, -0x30(%rsp)
movq -0x18(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rsp)
jmp 0xf7701
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
movq -0x18(%rsp), %rax
addq $0x28, %rax
movq %rax, -0x18(%rsp)
jmp 0xf76cd
movq -0x30(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdmerge.c
// Function: jinit_merged_upsampler
GLOBAL(void)
jinit_merged_upsampler (j_decompress_ptr cinfo)
{
  my_upsample_ptr upsample;

  upsample = (my_upsample_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_upsampler));
  cinfo->upsample = (struct jpeg_upsampler *) upsample;
  upsample->pub.start_pass = start_pass_merged_upsample;
  upsample->pub.need_context_rows = FALSE;

  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;

  if (cinfo->max_v_samp_factor == 2) {
    upsample->pub.upsample = merged_2v_upsample;
    upsample->upmethod = h2v2_merged_upsample;
    /* Allocate a spare row buffer */
    upsample->spare_row = (JSAMPROW)
      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
		(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));
  } else {
    upsample->pub.upsample = merged_1v_upsample;
    upsample->upmethod = h2v1_merged_upsample;
    /* No spare row needed */
    upsample->spare_row = NULL;
  }

  build_ycc_rgb_table(cinfo);
}

// 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 $0x58, %edx
callq *%rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x260(%rax)
movq 0x8(%rsp), %rax
leaq 0xd8(%rip), %rcx        # 0xf8600
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x10(%rsp), %rax
movl 0x88(%rax), %ecx
movq 0x10(%rsp), %rax
imull 0x90(%rax), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x4c(%rax)
movq 0x10(%rsp), %rax
cmpl $0x2, 0x19c(%rax)
jne 0xf85b9
movq 0x8(%rsp), %rax
leaq 0xd0(%rip), %rcx        # 0xf8640
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rax
leaq 0x240(%rip), %rcx       # 0xf87c0
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rcx
movl 0x4c(%rcx), %ecx
movl %ecx, %edx
shlq $0x0, %rdx
movl $0x1, %esi
callq *%rax
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x40(%rax)
jmp 0xf85e6
movq 0x8(%rsp), %rax
leaq 0x69b(%rip), %rcx       # 0xf8c60
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rax
leaq 0x71b(%rip), %rcx       # 0xf8cf0
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x40(%rax)
movq 0x10(%rsp), %rdi
callq 0xf9010
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jdmerge.c
// Function: merged_1v_upsample
METHODDEF(void)
merged_1v_upsample (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
/* 1:1 vertical sampling case: much easier, never need a spare row. */
{
  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;

  /* Just do the upsampling. */
  (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
			 output_buf + *out_row_ctr);
  /* Adjust counts */
  (*out_row_ctr)++;
  (*in_row_group_ctr)++;
}

// Assembly:
subq $0x38, %rsp
movl 0x40(%rsp), %eax
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movl %ecx, 0x1c(%rsp)
movq %r8, 0x10(%rsp)
movq %r9, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq 0x260(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rcx
movl (%rcx), %edx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
movl (%r8), %r8d
shlq $0x3, %r8
addq %r8, %rcx
callq *%rax
movq 0x8(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x20(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcomapi.c
// Function: jpeg_abort
GLOBAL(void)
jpeg_abort (j_common_ptr cinfo)
{
  int pool;

  /* Do nothing if called on a not-initialized or destroyed JPEG object. */
  if (cinfo->mem == NULL)
    return;

  /* Releasing pools in reverse order might help avoid fragmentation
   * with some (brain-damaged) malloc libraries.
   */
  for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {
    (*cinfo->mem->free_pool) (cinfo, pool);
  }

  /* Reset overall state for possible reuse of object */
  if (cinfo->is_decompressor) {
    cinfo->global_state = DSTATE_START;
    /* Try to keep application from accessing now-deleted marker list.
     * A bit kludgy to do it here, but this is the most central place.
     */
    ((j_decompress_ptr) cinfo)->marker_list = NULL;
  } else {
    cinfo->global_state = CSTATE_START;
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xf91b7
jmp 0xf9220
movl $0x1, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jle 0xf91eb
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x48(%rax), %rax
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq *%rax
movl 0xc(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xf91bf
movq 0x10(%rsp), %rax
cmpl $0x0, 0x20(%rax)
je 0xf9214
movq 0x10(%rsp), %rax
movl $0xc8, 0x24(%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x190(%rax)
jmp 0xf9220
movq 0x10(%rsp), %rax
movl $0x64, 0x24(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcomapi.c
// Function: jpeg_destroy
GLOBAL(void)
jpeg_destroy (j_common_ptr cinfo)
{
  /* We need only tell the memory manager to release everything. */
  /* NB: mem pointer is NULL if memory mgr failed to initialize. */
  if (cinfo->mem != NULL)
    (*cinfo->mem->self_destruct) (cinfo);
  cinfo->mem = NULL;		/* be safe if jpeg_destroy is called twice */
  cinfo->global_state = 0;	/* mark it destroyed */
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0xf9252
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq 0x50(%rax), %rax
movq (%rsp), %rdi
callq *%rax
movq (%rsp), %rax
movq $0x0, 0x8(%rax)
movq (%rsp), %rax
movl $0x0, 0x24(%rax)
popq %rax
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcomapi.c
// Function: jpeg_alloc_quant_table
GLOBAL(JQUANT_TBL *)
jpeg_alloc_quant_table (j_common_ptr cinfo)
{
  JQUANT_TBL *tbl;

  tbl = (JQUANT_TBL *)
    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));
  tbl->sent_table = FALSE;	/* make sure this is false in any new table */
  return tbl;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x84, %edx
callq *%rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl $0x0, 0x80(%rax)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jcomapi.c
// Function: jpeg_alloc_huff_table
GLOBAL(JHUFF_TBL *)
jpeg_alloc_huff_table (j_common_ptr cinfo)
{
  JHUFF_TBL *tbl;

  tbl = (JHUFF_TBL *)
    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));
  tbl->sent_table = FALSE;	/* make sure this is false in any new table */
  return tbl;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rdi
xorl %esi, %esi
movl $0x118, %edx            # imm = 0x118
callq *%rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl $0x0, 0x114(%rax)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jutils.c
// Function: jcopy_sample_rows
GLOBAL(void)
jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
		   JSAMPARRAY output_array, int dest_row,
		   int num_rows, JDIMENSION num_cols)
/* Copy some rows of samples from one place to another.
 * num_rows rows are copied from input_array[source_row++]
 * to output_array[dest_row++]; these areas may overlap for duplication.
 * The source and destination arrays must be at least as wide as num_cols.
 */
{
  register JSAMPROW inptr, outptr;
#ifdef FMEMCOPY
  register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
#else
  register JDIMENSION count;
#endif
  register int row;

  input_array += source_row;
  output_array += dest_row;

  for (row = num_rows; row > 0; row--) {
    inptr = *input_array++;
    outptr = *output_array++;
#ifdef FMEMCOPY
    FMEMCOPY(outptr, inptr, count);
#else
    for (count = num_cols; count > 0; count--)
      *outptr++ = *inptr++;	/* needn't bother with GETJSAMPLE() here */
#endif
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
movl %r8d, 0x28(%rsp)
movl %r9d, 0x24(%rsp)
movl 0x24(%rsp), %eax
shlq $0x0, %rax
movq %rax, 0x8(%rsp)
movl 0x3c(%rsp), %ecx
movq 0x40(%rsp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movl 0x2c(%rsp), %ecx
movq 0x30(%rsp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movl 0x28(%rsp), %eax
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
jle 0xf942f
movq 0x40(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x40(%rsp)
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x30(%rsp)
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0xf3d0
movl 0x4(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xf93d5
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jerror.c
// Function: jpeg_std_error
GLOBAL(struct jpeg_error_mgr *)
jpeg_std_error (struct jpeg_error_mgr * err)
{
  err->error_exit = error_exit;
  err->emit_message = emit_message;
  err->output_message = output_message;
  err->format_message = format_message;
  err->reset_error_mgr = reset_error_mgr;

  err->trace_level = 0;		/* default = no tracing */
  err->num_warnings = 0;	/* no warnings emitted yet */
  err->msg_code = 0;		/* may be useful as a flag for "no error" */

  /* Initialize message table pointers */
  err->jpeg_message_table = jpeg_std_message_table;
  err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;

  err->addon_message_table = NULL;
  err->first_addon_message = 0;	/* for safety */
  err->last_addon_message = 0;

  return err;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
leaq 0xcf(%rip), %rcx        # 0xf9580
movq %rcx, (%rax)
movq -0x8(%rsp), %rax
leaq 0xf0(%rip), %rcx        # 0xf95b0
movq %rcx, 0x8(%rax)
movq -0x8(%rsp), %rax
leaq 0x170(%rip), %rcx       # 0xf9640
movq %rcx, 0x10(%rax)
movq -0x8(%rsp), %rax
leaq 0x1b0(%rip), %rcx       # 0xf9690
movq %rcx, 0x18(%rax)
movq -0x8(%rsp), %rax
leaq 0x370(%rip), %rcx       # 0xf9860
movq %rcx, 0x20(%rax)
movq -0x8(%rsp), %rax
movl $0x0, 0x7c(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x80(%rax)
movq -0x8(%rsp), %rax
movl $0x0, 0x28(%rax)
movq -0x8(%rsp), %rax
leaq 0x75338(%rip), %rcx     # 0x16e860
movq %rcx, 0x88(%rax)
movq -0x8(%rsp), %rax
movl $0x7b, 0x90(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x98(%rax)
movq -0x8(%rsp), %rax
movl $0x0, 0xa0(%rax)
movq -0x8(%rsp), %rax
movl $0x0, 0xa4(%rax)
movq -0x8(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/jpeg/jerror.c
// Function: emit_message
METHODDEF(void)
emit_message (j_common_ptr cinfo, int msg_level)
{
  struct jpeg_error_mgr * err = cinfo->err;

  if (msg_level < 0) {
    /* It's a warning message.  Since corrupt files may generate many warnings,
     * the policy implemented here is to show only the first warning,
     * unless trace_level >= 3.
     */
    if (err->num_warnings == 0 || err->trace_level >= 3)
      (*err->output_message) (cinfo);
    /* Always count warnings in num_warnings. */
    err->num_warnings++;
  } else {
    /* It's a trace message.  Show it if trace_level >= msg_level. */
    if (err->trace_level >= msg_level)
      (*err->output_message) (cinfo);
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
cmpl $0x0, 0xc(%rsp)
jge 0xf960f
movq (%rsp), %rax
cmpq $0x0, 0x80(%rax)
je 0xf95e8
movq (%rsp), %rax
cmpl $0x3, 0x7c(%rax)
jl 0xf95f7
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
movq (%rsp), %rax
movq 0x80(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x80(%rax)
jmp 0xf962d
movq (%rsp), %rax
movl 0x7c(%rax), %eax
cmpl 0xc(%rsp), %eax
jl 0xf962b
movq (%rsp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rsp), %rdi
callq *%rax
jmp 0xf962d
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)