LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdcoefct.c
// Function: start_output_pass
METHODDEF(void)
start_output_pass (j_decompress_ptr cinfo)
{
#ifdef BLOCK_SMOOTHING_SUPPORTED
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x230(%rdi), %r14
cmpq $0x0, 0x20(%r14)
je 0x80e51
cmpl $0x0, 0x68(%rbx)
je 0x80e46
cmpl $0x0, 0x138(%rbx)
je 0x80e46
cmpq $0x0, 0xc0(%rbx)
je 0x80e46
cmpq $0x0, 0xd8(%r14)
jne 0x80d7b
movq 0x8(%rbx), %rax
movslq 0x38(%rbx), %rcx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0xd8(%r14)
cmpl $0x0, 0x38(%rbx)
jle 0x80e46
movq 0x130(%rbx), %rcx
movq 0xd8(%r14), %rdx
xorl %esi, %esi
movl $0x1, %edi
xorl %r8d, %r8d
xorl %eax, %eax
movq 0x50(%rcx), %r9
testq %r9, %r9
je 0x80e37
cmpw $0x0, (%r9)
je 0x80e37
cmpw $0x0, 0x2(%r9)
je 0x80e37
cmpw $0x0, 0x10(%r9)
je 0x80e37
cmpw $0x0, 0x20(%r9)
je 0x80e37
cmpw $0x0, 0x12(%r9)
je 0x80e37
cmpw $0x0, 0x4(%r9)
je 0x80e37
movq 0xc0(%rbx), %r9
movq %r8, %r10
shlq $0x8, %r10
cmpl $0x0, (%r9,%r10)
js 0x80e37
addq %rsi, %r9
movl $0x1, %r10d
movl (%r9,%r10,4), %r11d
movl %r11d, (%rdx,%r10,4)
cmpl $0x0, (%r9,%r10,4)
cmovnel %edi, %eax
incq %r10
cmpq $0x6, %r10
jne 0x80dfd
addq $0x18, %rdx
incq %r8
addq $0x60, %rcx
movslq 0x38(%rbx), %r9
addq $0x100, %rsi            # imm = 0x100
cmpq %r9, %r8
jl 0x80d9f
jmp 0x80e39
xorl %eax, %eax
testl %eax, %eax
je 0x80e46
leaq 0x66c(%rip), %rax       # 0x814b0
jmp 0x80e4d
leaq 0x1c8(%rip), %rax       # 0x81015
movq %rax, 0x18(%r14)
movl $0x0, 0xb8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: jinit_d_post_controller
GLOBAL(void)
jinit_d_post_controller (j_decompress_ptr cinfo, jboolean need_full_buffer)
{
  my_post_ptr post;

  post = (my_post_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_post_controller));
  cinfo->post = (struct jpeg_d_post_controller *) post;
  post->pub.start_pass = start_pass_dpost;
  post->whole_image = NULL;	/* flag for no virtual arrays */
  post->buffer = NULL;		/* flag for no strip buffer */

  /* Create the quantization buffer, if needed */
  if (cinfo->quantize_colors) {
    /* The buffer strip height is max_v_samp_factor, which is typically
     * an efficient number of rows for upsampling to return.
     * (In the presence of output rescaling, we might want to be smarter?)
     */
    post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;
    if (need_full_buffer) {
      /* Two-pass color quantization: need full-image storage. */
      /* We round up the number of rows to a multiple of the strip height. */
#ifdef QUANT_2PASS_SUPPORTED
      post->whole_image = (*cinfo->mem->request_virt_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
	 cinfo->output_width * cinfo->out_color_components,
	 (JDIMENSION) jround_up((long) cinfo->output_height,
				(long) post->strip_height),
	 post->strip_height);
#else
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif /* QUANT_2PASS_SUPPORTED */
    } else {
      /* One-pass color quantization: just make a strip buffer. */
      post->buffer = (*cinfo->mem->alloc_sarray)
	((j_common_ptr) cinfo, JPOOL_IMAGE,
	 cinfo->output_width * cinfo->out_color_components,
	 post->strip_height);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rdi), %rax
movl $0x30, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, %rbx
movq %rax, 0x238(%r14)
leaq 0x7d(%rip), %rax        # 0x81cc7
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
cmpl $0x0, 0x6c(%r14)
je 0x81cbe
movl 0x19c(%r14), %ecx
movl %ecx, 0x20(%rbx)
movl 0x90(%r14), %r15d
imull 0x88(%r14), %r15d
movq 0x8(%r14), %rax
testl %ebp, %ebp
je 0x81cac
movq 0x20(%rax), %r12
movl 0x8c(%r14), %edi
movq %rcx, %rsi
callq 0x86aa9
movl 0x20(%rbx), %r9d
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
movl %r15d, %ecx
movl %eax, %r8d
callq *%r12
movq %rax, 0x10(%rbx)
jmp 0x81cbe
movq %r14, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq *0x10(%rax)
movq %rax, 0x18(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: start_pass_dpost
METHODDEF(void)
start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;

  switch (pass_mode) {
  case JBUF_PASS_THRU:
    if (cinfo->quantize_colors) {
      /* Single-pass processing with color quantization. */
      post->pub.post_process_data = post_process_1pass;
      /* We could be doing buffered-image output before starting a 2-pass
       * color quantization; in that case, jinit_d_post_controller did not
       * allocate a strip buffer.  Use the virtual-array buffer as workspace.
       */
      if (post->buffer == NULL) {
	post->buffer = (*cinfo->mem->access_virt_sarray)
	  ((j_common_ptr) cinfo, post->whole_image,
	   (JDIMENSION) 0, post->strip_height, TRUE);
      }
    } else {
      /* For single-pass processing without color quantization,
       * I have no work to do; just call the upsampler directly.
       */
      post->pub.post_process_data = cinfo->upsample->upsample;
    }
    break;
#ifdef QUANT_2PASS_SUPPORTED
  case JBUF_SAVE_AND_PASS:
    /* First pass of 2-pass quantization */
    if (post->whole_image == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    post->pub.post_process_data = post_process_prepass;
    break;
  case JBUF_CRANK_DEST:
    /* Second pass of 2-pass quantization */
    if (post->whole_image == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    post->pub.post_process_data = post_process_2pass;
    break;
#endif /* QUANT_2PASS_SUPPORTED */
  default:
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    break;
  }
  post->starting_row = post->next_row = 0;
}

// Assembly:
pushq %rbx
movq 0x238(%rdi), %rbx
cmpl $0x3, %esi
je 0x81d2d
cmpl $0x2, %esi
je 0x81d11
testl %esi, %esi
jne 0x81d49
cmpl $0x0, 0x6c(%rdi)
je 0x81d57
leaq 0x86(%rip), %rax        # 0x81d70
movq %rax, 0x8(%rbx)
cmpq $0x0, 0x18(%rbx)
jne 0x81d66
movq 0x8(%rdi), %rax
movq 0x10(%rbx), %rsi
movl 0x20(%rbx), %ecx
xorl %edx, %edx
movl $0x1, %r8d
callq *0x38(%rax)
movq %rax, 0x18(%rbx)
jmp 0x81d66
cmpq $0x0, 0x10(%rbx)
jne 0x81d24
movq (%rdi), %rax
movl $0x4, 0x28(%rax)
callq *(%rax)
leaq 0x190(%rip), %rax       # 0x81ebb
jmp 0x81d62
cmpq $0x0, 0x10(%rbx)
jne 0x81d40
movq (%rdi), %rax
movl $0x4, 0x28(%rax)
callq *(%rax)
leaq 0xaa(%rip), %rax        # 0x81df1
jmp 0x81d62
movq (%rdi), %rax
movl $0x4, 0x28(%rax)
callq *(%rax)
jmp 0x81d66
movq 0x260(%rdi), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
movq $0x0, 0x24(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: post_process_1pass
METHODDEF(void)
post_process_1pass (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION num_rows, max_rows;

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rdi, %r15
movl 0x40(%rsp), %eax
movq 0x238(%rdi), %r13
subl (%r9), %eax
movl 0x20(%r13), %edi
cmpl %edi, %eax
cmovael %edi, %eax
leaq 0xc(%rsp), %r12
movl $0x0, (%r12)
movq 0x260(%r15), %r10
movq 0x18(%r13), %r8
movl %eax, (%rsp)
movq %r15, %rdi
movq %r12, %r9
callq *0x8(%r10)
movq 0x270(%r15), %rax
movq 0x18(%r13), %rsi
movl (%rbx), %ecx
leaq (%r14,%rcx,8), %rdx
movl (%r12), %ecx
movq %r15, %rdi
callq *0x8(%rax)
movl (%r12), %eax
addl %eax, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: post_process_prepass
METHODDEF(void)
post_process_prepass (j_decompress_ptr cinfo,
		      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		      JDIMENSION in_row_groups_avail,
		      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		      JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION old_next_row, num_rows;

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movl %ecx, %r9d
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x238(%rdi), %rbp
leaq 0x28(%rbp), %r12
cmpl $0x0, 0x28(%rbp)
jne 0x81e45
movq 0x8(%r14), %rax
movq 0x10(%rbp), %rsi
movl 0x24(%rbp), %edx
movl 0x20(%rbp), %ecx
movq %r14, %rdi
movl $0x1, %r8d
movl %r9d, %r13d
callq *0x38(%rax)
movl %r13d, %r9d
movq %rax, 0x18(%rbp)
movl 0x28(%rbp), %r13d
movq 0x260(%r14), %rax
movq 0x18(%rbp), %r8
movl 0x20(%rbp), %ecx
movl %ecx, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %r9d, %ecx
movq %r12, %r9
callq *0x8(%rax)
movl 0x28(%rbp), %ebx
cmpl %r13d, %ebx
jbe 0x81e9a
subl %r13d, %ebx
movq 0x270(%r14), %rax
shlq $0x3, %r13
addq 0x18(%rbp), %r13
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movl %ebx, %ecx
callq *0x8(%rax)
movq 0x10(%rsp), %rax
addl %ebx, (%rax)
movl 0x20(%rbp), %eax
cmpl %eax, 0x28(%rbp)
jb 0x81eac
addl %eax, 0x24(%rbp)
movl $0x0, 0x28(%rbp)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: post_process_2pass
METHODDEF(void)
post_process_2pass (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION num_rows, max_rows;

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

  /* Determine number of rows to emit. */
  num_rows = post->strip_height - post->next_row; /* available in strip */
  max_rows = out_rows_avail - *out_row_ctr; /* available in output area */
  if (num_rows > max_rows)
    num_rows = max_rows;
  /* We have to check bottom of image here, can't depend on upsampler. */
  max_rows = cinfo->output_height - post->starting_row;
  if (num_rows > max_rows)
    num_rows = max_rows;

  /* Quantize and emit data. */
  (*cinfo->cquantize->color_quantize) (cinfo,
		post->buffer + post->next_row, output_buf + *out_row_ctr,
		(int) num_rows);
  *out_row_ctr += num_rows;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r15
movq %rdi, %r14
movl 0x40(%rsp), %r13d
movq 0x238(%rdi), %r12
cmpl $0x0, 0x28(%r12)
jne 0x81f04
movq 0x8(%r14), %rax
movq 0x10(%r12), %rsi
movl 0x24(%r12), %edx
movl 0x20(%r12), %ecx
movq %r14, %rdi
xorl %r8d, %r8d
callq *0x38(%rax)
movq %rax, 0x18(%r12)
movl 0x20(%r12), %eax
movl 0x28(%r12), %esi
subl %esi, %eax
movl (%rbx), %ecx
subl %ecx, %r13d
cmpl %r13d, %eax
cmovbl %eax, %r13d
movl 0x8c(%r14), %ebp
subl 0x24(%r12), %ebp
cmpl %ebp, %r13d
cmovbl %r13d, %ebp
movq 0x270(%r14), %rax
shlq $0x3, %rsi
addq 0x18(%r12), %rsi
leaq (%r15,%rcx,8), %rdx
movq %r14, %rdi
movl %ebp, %ecx
callq *0x8(%rax)
addl %ebp, (%rbx)
addl 0x28(%r12), %ebp
movl %ebp, 0x28(%r12)
movl 0x20(%r12), %eax
cmpl %eax, %ebp
jb 0x81f6e
addl %eax, 0x24(%r12)
movl $0x0, 0x28(%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jddctmgr.c
// Function: jinit_inverse_dct
GLOBAL(void)
jinit_inverse_dct (j_decompress_ptr cinfo)
{
  my_idct_ptr idct;
  int ci;
  jpeg_component_info *compptr;

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0x80, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, %r14
movq %rax, 0x258(%rbx)
leaq 0x61(%rip), %rax        # 0x8200d
movq %rax, (%r14)
cmpl $0x0, 0x38(%rbx)
jle 0x82001
movq 0x130(%rbx), %r15
addq $0x58, %r15
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, (%r15)
movl $0x100, %edx            # imm = 0x100
movq %rax, %rdi
xorl %esi, %esi
callq 0xe260
movl $0xffffffff, 0x58(%r14,%r12,4) # imm = 0xFFFFFFFF
incq %r12
movslq 0x38(%rbx), %rax
addq $0x60, %r15
cmpq %rax, %r12
jl 0x81fc3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdsample.c
// Function: h2v1_fancy_upsample
METHODDEF(void)
h2v1_fancy_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 int invalue;
  register JDIMENSION colctr;
  int inrow;

  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {
    inptr = input_data[inrow];
    outptr = output_data[inrow];
    /* Special case for first column */
    invalue = GETJSAMPLE(*inptr++);
    *outptr++ = (JSAMPLE) invalue;
    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);

    for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {
      /* General case: 3/4 * nearer pixel + 1/4 * further pixel */
      invalue = GETJSAMPLE(*inptr++) * 3;
      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);
      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2);
    }

    /* Special case for last column */
    invalue = GETJSAMPLE(*inptr);
    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);
    *outptr++ = (JSAMPLE) invalue;
  }
}

// Assembly:
cmpl $0x0, 0x19c(%rdi)
jle 0x839cc
pushq %rbx
movq (%rcx), %rax
xorl %ecx, %ecx
movq (%rdx,%rcx,8), %r8
movq (%rax,%rcx,8), %r10
leaq 0x1(%r8), %r9
movzbl (%r8), %r11d
movb %r11b, (%r10)
leal (%r11,%r11,2), %r11d
movzbl 0x1(%r8), %r8d
addl %r11d, %r8d
addl $0x2, %r8d
shrl $0x2, %r8d
movb %r8b, 0x1(%r10)
movl 0x28(%rsi), %r11d
leaq 0x2(%r10), %r8
addl $-0x2, %r11d
je 0x8399a
movzbl (%r9), %r10d
leal (%r10,%r10,2), %r10d
movzbl -0x1(%r9), %ebx
addl %r10d, %ebx
incl %ebx
shrl $0x2, %ebx
movb %bl, (%r8)
movzbl 0x1(%r9), %ebx
incq %r9
addl %ebx, %r10d
addl $0x2, %r10d
shrl $0x2, %r10d
movb %r10b, 0x1(%r8)
addq $0x2, %r8
decl %r11d
jne 0x8395e
leaq -0x2(%r8), %r10
movzbl (%r9), %r11d
leal (%r11,%r11,2), %ebx
movzbl -0x1(%r9), %r9d
addl %ebx, %r9d
incl %r9d
shrl $0x2, %r9d
movb %r9b, (%r8)
movb %r11b, 0x3(%r10)
incq %rcx
movslq 0x19c(%rdi), %r8
cmpq %r8, %rcx
jl 0x83925
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdsample.c
// Function: h2v1_upsample
METHODDEF(void)
h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  JSAMPARRAY output_data = *output_data_ptr;
  register JSAMPROW inptr, outptr;
  register JSAMPLE invalue;
  JSAMPROW outend;
  int inrow;

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

// Assembly:
cmpl $0x0, 0x19c(%rdi)
jle 0x83a21
pushq %rbx
movq (%rcx), %rax
xorl %ecx, %ecx
movl 0x88(%rdi), %esi
testq %rsi, %rsi
je 0x83a11
movq (%rax,%rcx,8), %r8
addq %r8, %rsi
movq (%rdx,%rcx,8), %r9
xorl %r10d, %r10d
movb (%r9,%r10), %r11b
leaq (%r8,%r10,2), %rbx
addq $0x2, %rbx
movb %r11b, -0x2(%rbx)
movb %r11b, -0x1(%rbx)
incq %r10
cmpq %rsi, %rbx
jb 0x839f5
incq %rcx
movslq 0x19c(%rdi), %rsi
cmpq %rsi, %rcx
jl 0x839dc
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x19c(%rdi)
jle 0x83bf4
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq (%rcx), %r15
xorl %r13d, %r13d
xorl %r12d, %r12d
movl 0x88(%r14), %eax
testq %rax, %rax
je 0x83bba
movq (%r15,%r12,8), %rcx
addq %rcx, %rax
movq (%rbx,%r13,8), %rdx
xorl %esi, %esi
movb (%rdx,%rsi), %dil
leaq (%rcx,%rsi,2), %r8
addq $0x2, %r8
movb %dil, -0x2(%r8)
movb %dil, -0x1(%r8)
incq %rsi
cmpq %rax, %r8
jb 0x83b9e
movl %r12d, %ecx
orl $0x1, %ecx
movl 0x88(%r14), %r9d
movq %r15, %rdi
movl %r12d, %esi
movq %r15, %rdx
movl $0x1, %r8d
callq 0x86abf
incq %r13
addq $0x2, %r12
cmpl %r12d, 0x19c(%r14)
jg 0x83b85
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x20(%rsp)
cmpl $0x0, 0x19c(%rdi)
jle 0x83ced
movq %rdi, %rbx
movq (%rcx), %rax
movq %rax, 0x10(%rsp)
movq 0x260(%rdi), %rax
movslq 0x4(%rsi), %rcx
movzbl 0xf2(%rax,%rcx), %r14d
movzbl 0xe8(%rax,%rcx), %r12d
leal -0x1(%r14), %eax
movl %eax, 0xc(%rsp)
movl %r12d, %r15d
decl %r15d
incq %r15
movq $0x0, 0x18(%rsp)
xorl %r13d, %r13d
movq %rdi, 0x30(%rsp)
movq %r14, 0x28(%rsp)
movl 0x88(%rbx), %r14d
testq %r14, %r14
je 0x83ca8
movq 0x10(%rsp), %rax
movq (%rax,%r13,8), %rbp
addq %rbp, %r14
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rbx
testq %r12, %r12
je 0x83ca0
movzbl (%rbx), %esi
movq %rbp, %rdi
movq %r12, %rdx
callq 0xe260
addq %r15, %rbp
incq %rbx
cmpq %r14, %rbp
jb 0x83c8a
movq 0x28(%rsp), %r14
cmpb $0x2, %r14b
movq 0x30(%rsp), %rbx
jb 0x83cd8
leal 0x1(%r13), %ecx
movl 0x88(%rbx), %r9d
movq 0x10(%rsp), %rdi
movl %r13d, %esi
movq %rdi, %rdx
movl 0xc(%rsp), %r8d
callq 0x86abf
incq 0x18(%rsp)
addq %r14, %r13
cmpl %r13d, 0x19c(%rbx)
jg 0x83c64
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdcolor.c
// Function: ycc_rgb_convert
METHODDEF(void)
ycc_rgb_convert (j_decompress_ptr cinfo,
		 JSAMPIMAGE input_buf, JDIMENSION input_row,
		 JSAMPARRAY output_buf, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int y, cb, cr;
  register JSAMPROW outptr;
  register JSAMPROW inptr0, inptr1, inptr2;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->output_width;
  /* copy these pointers into registers if possible */
  register JSAMPLE * range_limit = cinfo->sample_range_limit;
  register int * Crrtab = cconvert->Cr_r_tab;
  register int * Cbbtab = cconvert->Cb_b_tab;
  register INT32 * Crgtab = cconvert->Cr_g_tab;
  register INT32 * Cbgtab = cconvert->Cb_g_tab;
  SHIFT_TEMPS

  while (--num_rows >= 0) {
    inptr0 = input_buf[0][input_row];
    inptr1 = input_buf[1][input_row];
    inptr2 = input_buf[2][input_row];
    input_row++;
    outptr = *output_buf++;
    for (col = 0; col < num_cols; col++) {
      y  = GETJSAMPLE(inptr0[col]);
      cb = GETJSAMPLE(inptr1[col]);
      cr = GETJSAMPLE(inptr2[col]);
      /* Range-limiting is essential due to noise introduced by DCT losses. */
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
      outptr[RGB_GREEN] = range_limit[y +
			      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
						 SCALEBITS))];
      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];
      outptr += RGB_PIXELSIZE;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, -0x18(%rsp)
movl %edx, -0x1c(%rsp)
movq %rsi, -0x10(%rsp)
testl %r8d, %r8d
jle 0x8408a
movq 0x268(%rdi), %rbx
movl 0x88(%rdi), %eax
movq 0x1a8(%rdi), %rdi
movq 0x10(%rbx), %rdx
movq 0x18(%rbx), %r10
movq 0x20(%rbx), %r11
movq 0x28(%rbx), %rbx
movq %r8, -0x8(%rsp)
testq %rax, %rax
je 0x8406c
movl -0x1c(%rsp), %r12d
movq -0x10(%rsp), %rcx
movq (%rcx), %r14
movq 0x8(%rcx), %r15
movq (%r14,%r12,8), %r14
movq (%r15,%r12,8), %r15
movq 0x10(%rcx), %r13
movq (%r13,%r12,8), %r12
movq -0x18(%rsp), %rcx
movq (%rcx), %r13
xorl %ebp, %ebp
movzbl (%r14,%rbp), %r9d
movzbl (%r15,%rbp), %esi
movzbl (%r12,%rbp), %r8d
movslq (%rdx,%r8,4), %rcx
addq %r9, %rcx
movb (%rdi,%rcx), %cl
movb %cl, (%r13)
movq (%r11,%r8,8), %rcx
addq (%rbx,%rsi,8), %rcx
shrq $0x10, %rcx
movslq %ecx, %rcx
addq %r9, %rcx
movb (%rdi,%rcx), %cl
movb %cl, 0x1(%r13)
movslq (%r10,%rsi,4), %rcx
addq %r9, %rcx
movb (%rdi,%rcx), %cl
movb %cl, 0x2(%r13)
addq $0x3, %r13
incq %rbp
cmpq %rbp, %rax
jne 0x8401c
movq -0x8(%rsp), %rcx
leal -0x1(%rcx), %ebp
incl -0x1c(%rsp)
addq $0x8, -0x18(%rsp)
cmpl $0x2, %ecx
movl %ebp, %r8d
jge 0x83fe6
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jdcolor.c
// Function: build_ycc_rgb_table
LOCAL(void)
build_ycc_rgb_table (j_decompress_ptr cinfo)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  int i;
  INT32 x;
  SHIFT_TEMPS

  cconvert->Cr_r_tab = (int *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				(MAXJSAMPLE+1) * SIZEOF(int));
  cconvert->Cb_b_tab = (int *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				(MAXJSAMPLE+1) * SIZEOF(int));
  cconvert->Cr_g_tab = (INT32 *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				(MAXJSAMPLE+1) * SIZEOF(INT32));
  cconvert->Cb_g_tab = (INT32 *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				(MAXJSAMPLE+1) * SIZEOF(INT32));

  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
    /* Cr=>R value is nearest int to 1.40200 * x */
    cconvert->Cr_r_tab[i] = (int)
		    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
    /* Cb=>B value is nearest int to 1.77200 * x */
    cconvert->Cb_b_tab[i] = (int)
		    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
    /* Cr=>G value is scaled-up -0.71414 * x */
    cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
    /* Cb=>G value is scaled-up -0.34414 * x */
    /* We also add in ONE_HALF so that need not do it in inner loop */
    cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x268(%rdi), %r14
movq 0x8(%rdi), %rax
movl $0x400, %edx            # imm = 0x400
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x10(%r14)
movq 0x8(%rbx), %rax
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x18(%r14)
movq 0x8(%rbx), %rax
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x20(%r14)
movq 0x8(%rbx), %rax
movl $0x800, %edx            # imm = 0x800
movq %rbx, %rdi
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x28(%r14)
movq 0x10(%r14), %rcx
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rsi
movq $-0xb2f480, %rdi        # imm = 0xFF4D0B80
movq $-0xe25100, %r8         # imm = 0xFF1DAF00
movl $0x5b6900, %r9d         # imm = 0x5B6900
movl $0x2c8d00, %r10d        # imm = 0x2C8D00
xorl %r11d, %r11d
movq %rdi, %rbx
shrq $0x10, %rbx
movl %ebx, (%rcx,%r11)
movq %r8, %rbx
shrq $0x10, %rbx
movl %ebx, (%rdx,%r11)
movq %r9, (%rsi,%r11,2)
movq %r10, (%rax,%r11,2)
addq $0x4, %r11
addq $0x166e9, %rdi          # imm = 0x166E9
addq $0x1c5a2, %r8           # imm = 0x1C5A2
addq $-0xb6d2, %r9           # imm = 0xFFFF492E
addq $-0x581a, %r10          # imm = 0xA7E6
cmpq $0x400, %r11            # imm = 0x400
jne 0x84125
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testl %r8d, %r8d
jle 0x841c6
movl 0x88(%rdi), %eax
testq %rax, %rax
je 0x841b3
movq (%rsi), %rdi
movl %edx, %r9d
movq (%rdi,%r9,8), %rdi
movq (%rcx), %r9
addq $0x2, %r9
xorl %r10d, %r10d
movb (%rdi,%r10), %r11b
movb %r11b, (%r9)
movb %r11b, -0x1(%r9)
movb %r11b, -0x2(%r9)
incq %r10
addq $0x3, %r9
cmpq %r10, %rax
jne 0x84198
leal -0x1(%r8), %edi
incl %edx
addq $0x8, %rcx
cmpl $0x2, %r8d
movl %edi, %r8d
jge 0x8417f
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testl %r8d, %r8d
jle 0x8422b
pushq %rbp
pushq %r14
pushq %rbx
movslq 0x38(%rdi), %rax
movl 0x88(%rdi), %edi
testl %eax, %eax
jle 0x84214
movl %edx, %r9d
xorl %r10d, %r10d
testq %rdi, %rdi
je 0x8420c
movq (%rcx), %r11
addq %r10, %r11
movq (%rsi,%r10,8), %rbx
movq (%rbx,%r9,8), %rbx
xorl %r14d, %r14d
movb (%rbx,%r14), %bpl
movb %bpl, (%r11)
addq %rax, %r11
incq %r14
cmpl %r14d, %edi
jne 0x841fa
incq %r10
cmpq %rax, %r10
jne 0x841e4
leal -0x1(%r8), %r9d
incl %edx
addq $0x8, %rcx
cmpl $0x1, %r8d
movl %r9d, %r8d
jg 0x841da
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpl $0x0, 0x90(%rdi)
jle 0x84b4a
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x88(%rdi), %r14d
addl $0x2, %r14d
addq %r14, %r14
movq 0x270(%rdi), %r15
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq *0x8(%rax)
movq %rax, 0x70(%r15,%r12,8)
incq %r12
movslq 0x90(%rbx), %rax
cmpq %rax, %r12
jl 0x84b19
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testl %ecx, %ecx
jle 0x84bc2
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x270(%rdi), %rax
movq 0x30(%rax), %r9
movq (%r9), %rax
movq 0x8(%r9), %r8
movq 0x10(%r9), %r9
movl 0x88(%rdi), %edi
movl %ecx, %ecx
xorl %r10d, %r10d
testq %rdi, %rdi
je 0x84bb2
movq (%rdx,%r10,8), %r11
movq (%rsi,%r10,8), %rbx
xorl %r14d, %r14d
movzbl (%rbx), %r15d
movzbl 0x1(%rbx), %r12d
movb (%r8,%r12), %bpl
addb (%rax,%r15), %bpl
movzbl 0x2(%rbx), %r15d
addb (%r9,%r15), %bpl
movb %bpl, (%r11,%r14)
incq %r14
addq $0x3, %rbx
cmpl %r14d, %edi
jne 0x84b88
incq %r10
cmpq %rcx, %r10
jne 0x84b78
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testl %ecx, %ecx
jle 0x84c4b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x270(%rdi), %rax
movq 0x30(%rax), %rax
movl 0x88(%rdi), %r8d
movl 0x90(%rdi), %edi
leal -0x1(%rdi), %r9d
incq %r9
movl %ecx, %ecx
xorl %r10d, %r10d
testl %r8d, %r8d
je 0x84c39
movq (%rdx,%r10,8), %r11
movq (%rsi,%r10,8), %rbx
movl %r8d, %ebp
xorl %r14d, %r14d
testl %edi, %edi
jle 0x84c2f
xorl %r15d, %r15d
movq (%rax,%r15,8), %r12
movzbl (%rbx,%r15), %r13d
movzbl (%r12,%r13), %r12d
addl %r12d, %r14d
incq %r15
cmpq %r15, %rdi
jne 0x84c13
addq %r9, %rbx
movb %r14b, (%r11)
incq %r11
decl %ebp
jne 0x84c09
incq %r10
cmpq %rcx, %r10
jne 0x84bf9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: quantize3_ord_dither
METHODDEF(void)
quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		      JSAMPARRAY output_buf, int num_rows)
/* Fast path for out_color_components==3, with ordered dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register int pixcode;
  register JSAMPROW input_ptr;
  register JSAMPROW output_ptr;
  JSAMPROW colorindex0 = cquantize->colorindex[0];
  JSAMPROW colorindex1 = cquantize->colorindex[1];
  JSAMPROW colorindex2 = cquantize->colorindex[2];
  int * dither0;		/* points to active row of dither matrix */
  int * dither1;
  int * dither2;
  int row_index, col_index;	/* current indexes into dither matrix */
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    row_index = cquantize->row_index;
    input_ptr = input_buf[row];
    output_ptr = output_buf[row];
    dither0 = cquantize->odither[0][row_index];
    dither1 = cquantize->odither[1][row_index];
    dither2 = cquantize->odither[2][row_index];
    col_index = 0;

    for (col = width; col > 0; col--) {
      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +
					dither0[col_index]]);
      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +
					dither1[col_index]]);
      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +
					dither2[col_index]]);
      *output_ptr++ = (JSAMPLE) pixcode;
      col_index = (col_index + 1) & ODITHER_MASK;
    }
    row_index = (row_index + 1) & ODITHER_MASK;
    cquantize->row_index = row_index;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
testl %ecx, %ecx
jle 0x84d55
movq 0x270(%rdi), %rax
movq 0x30(%rax), %rdx
movq (%rdx), %r8
movq 0x8(%rdx), %r9
movq 0x10(%rdx), %r10
movl 0x88(%rdi), %edi
movl %ecx, %ecx
movq %rcx, -0x8(%rsp)
movq $0x0, -0x30(%rsp)
movq %rax, -0x28(%rsp)
movslq 0x4c(%rax), %rax
movq %rax, -0x20(%rsp)
testq %rdi, %rdi
je 0x84d2b
movq -0x20(%rsp), %r14
shlq $0x6, %r14
movq -0x28(%rsp), %rax
movq 0x50(%rax), %r15
addq %r14, %r15
movq 0x58(%rax), %r12
addq %r14, %r12
addq 0x60(%rax), %r14
movq -0x10(%rsp), %rax
movq -0x30(%rsp), %rcx
movq (%rax,%rcx,8), %r13
movq -0x18(%rsp), %rax
movq (%rax,%rcx,8), %rbp
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rbp), %esi
movl %edx, %eax
movslq (%r15,%rax,4), %rbx
addq %rsi, %rbx
movzbl 0x1(%rbp), %esi
movslq (%r12,%rax,4), %r11
addq %rsi, %r11
movb (%r9,%r11), %sil
addb (%r8,%rbx), %sil
movzbl 0x2(%rbp), %r11d
movslq (%r14,%rax,4), %rax
addq %r11, %rax
addb (%r10,%rax), %sil
movb %sil, (%r13,%rcx)
incl %edx
andl $0xf, %edx
incq %rcx
addq $0x3, %rbp
cmpl %ecx, %edi
jne 0x84ce6
movq -0x20(%rsp), %rcx
incl %ecx
andl $0xf, %ecx
movq -0x28(%rsp), %rax
movl %ecx, 0x4c(%rax)
movq -0x30(%rsp), %rdx
incq %rdx
movq %rdx, -0x30(%rsp)
cmpq -0x8(%rsp), %rdx
jne 0x84c99
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jquant1.c
// Function: quantize_ord_dither
METHODDEF(void)
quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
		     JSAMPARRAY output_buf, int num_rows)
/* General case, with ordered dithering */
{
  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
  register JSAMPROW input_ptr;
  register JSAMPROW output_ptr;
  JSAMPROW colorindex_ci;
  int * dither;			/* points to active row of dither matrix */
  int row_index, col_index;	/* current indexes into dither matrix */
  int nc = cinfo->out_color_components;
  int ci;
  int row;
  JDIMENSION col;
  JDIMENSION width = cinfo->output_width;

  for (row = 0; row < num_rows; row++) {
    /* Initialize output values to 0 so can process components separately */
    jzero_far((void FAR *) output_buf[row],
	      (size_t) (width * SIZEOF(JSAMPLE)));
    row_index = cquantize->row_index;
    for (ci = 0; ci < nc; ci++) {
      input_ptr = input_buf[row] + ci;
      output_ptr = output_buf[row];
      colorindex_ci = cquantize->colorindex[ci];
      dither = cquantize->odither[ci][row_index];
      col_index = 0;

      for (col = width; col > 0; col--) {
	/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,
	 * select output value, accumulate into output code for this pixel.
	 * Range-limiting need not be done explicitly, as we have extended
	 * the colorindex table to produce the right answers for out-of-range
	 * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the
	 * required amount of padding.
	 */
	*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];
	input_ptr += nc;
	output_ptr++;
	col_index = (col_index + 1) & ODITHER_MASK;
      }
    }
    /* Advance row index for next row */
    row_index = (row_index + 1) & ODITHER_MASK;
    cquantize->row_index = row_index;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
testl %ecx, %ecx
jle 0x84e35
movq %rdx, %rbx
movslq 0x90(%rdi), %r12
movl 0x88(%rdi), %r15d
movq 0x270(%rdi), %r13
movl %ecx, %eax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
movq (%rbx,%rbp,8), %rdi
movq %r15, %rsi
callq 0x86b1f
movslq 0x4c(%r13), %rax
movq %rax, (%rsp)
testl %r12d, %r12d
jle 0x84e1a
movq (%rsp), %rcx
shlq $0x6, %rcx
xorl %edx, %edx
testq %r15, %r15
je 0x84e12
movq 0x50(%r13,%rdx,8), %rsi
addq %rcx, %rsi
movq 0x30(%r13), %rdi
movq (%rdi,%rdx,8), %rdi
movq (%rbx,%rbp,8), %r8
movq 0x10(%rsp), %rax
movq (%rax,%rbp,8), %r9
addq %rdx, %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
movzbl (%r9), %eax
movl %r11d, %r14d
movslq (%rsi,%r14,4), %r14
addq %rax, %r14
movb (%rdi,%r14), %al
addb %al, (%r8,%r10)
addq %r12, %r9
incl %r11d
andl $0xf, %r11d
incq %r10
cmpl %r10d, %r15d
jne 0x84dea
incq %rdx
cmpq %r12, %rdx
jne 0x84dbf
movq (%rsp), %rax
incl %eax
andl $0xf, %eax
movl %eax, 0x4c(%r13)
incq %rbp
cmpq 0x8(%rsp), %rbp
jne 0x84d9c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq 0x270(%rdi), %rbx
movq 0x8(%rdi), %rax
movl $0x7fc, %edx            # imm = 0x7FC
movl $0x1, %esi
callq *(%rax)
leaq 0x3fc(%rax), %rcx
movq %rcx, 0x50(%rbx)
xorl %edx, %edx
xorl %esi, %esi
movl %esi, (%rcx,%rsi,4)
movl %edx, (%rcx,%rdx,4)
incq %rsi
decq %rdx
cmpq $0x10, %rsi
jne 0x852f3
movl $0x10, %ecx
movl $0x10f, %edx            # imm = 0x10F
movl $0xef, %esi
movl %ecx, (%rax,%rdx,4)
movl %ecx, %edi
negl %edi
movl %edi, (%rax,%rsi,4)
leal -0x1(%rdx), %edi
andl $0x1, %edi
addl %edi, %ecx
incq %rdx
decq %rsi
cmpq $0xcf, %rsi
jne 0x85314
movq %rax, %rcx
addq $0x4bc, %rcx            # imm = 0x4BC
movl $0xcf, %edx
movl $0x20, (%rcx)
movl $0xffffffe0, (%rax,%rdx,4) # imm = 0xFFFFFFE0
addq $0x4, %rcx
addq $-0x1, %rdx
jb 0x85344
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
testl %ecx, %ecx
jle 0x853cb
pushq %rbp
pushq %rbx
movq 0x270(%rdi), %rax
movq 0x30(%rax), %rax
movl 0x88(%rdi), %edx
movl %ecx, %ecx
xorl %edi, %edi
testl %edx, %edx
je 0x853c1
movq (%rsi,%rdi,8), %r8
movl %edx, %r9d
movzbl (%r8), %r10d
andl $-0x8, %r10d
movzbl 0x1(%r8), %r11d
movzbl 0x2(%r8), %ebx
shll $0x4, %r11d
andl $-0x40, %r11d
addq (%rax,%r10), %r11
shrl $0x3, %ebx
movzwl (%r11,%rbx,2), %r10d
movl %r10d, %ebp
incw %bp
cmovel %r10d, %ebp
movw %bp, (%r11,%rbx,2)
addq $0x3, %r8
decl %r9d
jne 0x85383
incq %rdi
cmpq %rcx, %rdi
jne 0x85378
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
testl %ecx, %ecx
jle 0x85c08
movq 0x10(%rsp), %rdx
movq 0x270(%rdx), %rax
movq 0x30(%rax), %rsi
movl 0x88(%rdx), %r14d
movl %ecx, %eax
movq %rax, 0x28(%rsp)
movq $0x0, 0x8(%rsp)
movq %rsi, 0x30(%rsp)
testq %r14, %r14
je 0x85bf0
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %r13
movq 0x18(%rsp), %rax
movq (%rax,%rcx,8), %rbp
xorl %r15d, %r15d
movzbl (%rbp), %eax
movzbl 0x1(%rbp), %edx
shrl $0x2, %edx
movzbl 0x2(%rbp), %ebx
shrl $0x3, %ebx
movl %eax, %ecx
andl $-0x8, %ecx
movl %edx, %r12d
shll $0x6, %r12d
addq (%rsi,%rcx), %r12
cmpw $0x0, (%r12,%rbx,2)
jne 0x85bd7
shrl $0x3, %eax
movzbl %bl, %ecx
movzbl %dl, %edx
movzbl %al, %esi
movq 0x10(%rsp), %rdi
callq 0x86044
movq 0x30(%rsp), %rsi
leaq (%r12,%rbx,2), %rax
movb (%rax), %al
decb %al
movb %al, (%r13,%r15)
incq %r15
addq $0x3, %rbp
cmpl %r15d, %r14d
jne 0x85b92
movq 0x8(%rsp), %rcx
incq %rcx
movq %rcx, 0x8(%rsp)
cmpq 0x28(%rsp), %rcx
jne 0x85b73
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq