LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_dht
LOCAL(void)
emit_dht (j_compress_ptr cinfo, int index, jboolean is_ac)
/* Emit a DHT marker */
{
  JHUFF_TBL * htbl;
  int length, i;
  
  if (is_ac) {
    htbl = cinfo->ac_huff_tbl_ptrs[index];
    index += 0x10;		/* output index has AC bit set */
  } else {
    htbl = cinfo->dc_huff_tbl_ptrs[index];
  }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leal 0x10(%rsi), %eax
testl %edx, %edx
movslq %esi, %r14
leaq 0xa0(%rdi,%r14,8), %rcx
leaq 0x80(%rdi,%r14,8), %rdx
cmovnel %eax, %r14d
cmovneq %rcx, %rdx
movq (%rdx), %r15
testq %r15, %r15
jne 0x743e8
movq (%rbx), %rax
movl $0x32, 0x28(%rax)
movl %r14d, 0x2c(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl $0x0, 0x114(%r15)
jne 0x744c7
movq %rbx, %rdi
movl $0xff, %esi
callq 0x74115
movq %rbx, %rdi
movl $0xc4, %esi
callq 0x74115
pxor %xmm0, %xmm0
xorl %eax, %eax
pxor %xmm1, %xmm1
movd 0x1(%r15,%rax), %xmm2
punpcklbw %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
paddd %xmm2, %xmm1
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x7441a
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
paddd %xmm1, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
paddd %xmm0, %xmm1
movd %xmm1, %r12d
leal 0x13(%r12), %ebp
movl %ebp, %esi
shrl $0x8, %esi
movl $0xff, %r13d
andl %r13d, %esi
movq %rbx, %rdi
callq 0x74115
andl %r13d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x74115
movq %rbx, %rdi
movl %r14d, %esi
callq 0x74115
xorl %r14d, %r14d
movzbl 0x1(%r15,%r14), %esi
movq %rbx, %rdi
callq 0x74115
incq %r14
cmpq $0x10, %r14
jne 0x74484
testl %r12d, %r12d
je 0x744bc
movl %r12d, %r14d
xorl %r12d, %r12d
movzbl 0x11(%r15,%r12), %esi
movq %rbx, %rdi
callq 0x74115
incq %r12
cmpq %r12, %r14
jne 0x744a6
movl $0x1, 0x114(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcmainct.c
// Function: jinit_c_main_controller
GLOBAL(void)
jinit_c_main_controller (j_compress_ptr cinfo, jboolean need_full_buffer)
{
  my_main_ptr mainp;
  int ci;
  jpeg_component_info *compptr;

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0x70, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, %r14
movq %rax, 0x1b8(%rbx)
leaq 0x74(%rip), %rax        # 0x7457a
movq %rax, (%r14)
cmpl $0x0, 0x100(%rbx)
je 0x7451b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
je 0x74536
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *(%rax)
cmpl $0x0, 0x4c(%rbx)
jle 0x74512
movq 0x58(%rbx), %r15
addq $0x1c, %r15
xorl %r12d, %r12d
movq 0x8(%rbx), %rax
movl -0x10(%r15), %ecx
movl (%r15), %edx
shll $0x3, %edx
shll $0x3, %ecx
movq %rbx, %rdi
movl $0x1, %esi
callq *0x10(%rax)
movq %rax, 0x20(%r14,%r12,8)
incq %r12
movslq 0x4c(%rbx), %rax
addq $0x60, %r15
cmpq %rax, %r12
jl 0x74547
jmp 0x74512
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcmainct.c
// Function: process_data_simple_main
METHODDEF(void)
process_data_simple_main (j_compress_ptr cinfo,
			  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,
			  JDIMENSION in_rows_avail)
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0x14(%rsp)
movq 0x1b8(%rdi), %rbp
movl 0x10(%rbp), %eax
cmpl 0x140(%rdi), %eax
jae 0x74674
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x14(%rbp), %r12
leaq 0x20(%rbp), %r13
movl 0x14(%rbp), %eax
cmpl $0x7, %eax
ja 0x74622
movq 0x1c0(%r15), %rax
movl $0x8, (%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl 0x14(%rsp), %ecx
movq %r13, %r8
movq %r12, %r9
callq *0x8(%rax)
movl (%r12), %eax
cmpl $0x8, %eax
jne 0x74674
movq 0x1c8(%r15), %rax
movq %r15, %rdi
movq %r13, %rsi
callq *0x8(%rax)
movl 0x18(%rbp), %ecx
testl %eax, %eax
je 0x74667
testl %ecx, %ecx
je 0x7464b
incl (%rbx)
movl $0x0, 0x18(%rbp)
movl $0x0, 0x14(%rbp)
movl 0x10(%rbp), %ecx
incl %ecx
movl %ecx, 0x10(%rbp)
xorl %eax, %eax
cmpl 0x140(%r15), %ecx
jb 0x745f5
jmp 0x74674
testl %ecx, %ecx
jne 0x74674
decl (%rbx)
movl $0x1, 0x18(%rbp)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcprepct.c
// Function: start_pass_prep
METHODDEF(void)
start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;

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

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1c0(%rdi), %r14
testl %esi, %esi
je 0x748cf
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movl 0x34(%rbx), %eax
movl %eax, 0x60(%r14)
movq $0x0, 0x64(%r14)
movl 0x13c(%rbx), %eax
addl %eax, %eax
movl %eax, 0x6c(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jccoefct.c
// Function: jinit_c_coef_controller
GLOBAL(void)
jinit_c_coef_controller (j_compress_ptr cinfo, jboolean need_full_buffer)
{
  my_coef_ptr coef;

  coef = (my_coef_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_coef_controller));
  cinfo->coef = (struct jpeg_c_coef_controller *) coef;
  coef->pub.start_pass = start_pass_coef;

  /* Create the coefficient buffer. */
  if (need_full_buffer) {
#ifdef FULL_COEF_BUFFER_SUPPORTED
    /* Allocate a full-image virtual array for each component, */
    /* padded to a multiple of samp_factor DCT blocks in each direction. */
    int ci;
    jpeg_component_info *compptr;

    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
	((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,
	 (JDIMENSION) jround_up((long) compptr->width_in_blocks,
				(long) compptr->h_samp_factor),
	 (JDIMENSION) jround_up((long) compptr->height_in_blocks,
				(long) compptr->v_samp_factor),
	 (JDIMENSION) compptr->v_samp_factor);
    }
#else
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
#endif
  } else {
    /* We only need a single-MCU buffer. */
    JBLOCKROW buffer;
    int i;

    buffer = (JBLOCKROW)
      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
    for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
      coef->MCU_buffer[i] = buffer + i;
    }
    coef->whole_image[0] = NULL; /* flag for no virtual arrays */
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
movq 0x8(%rdi), %rax
movl $0xc0, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, %rbx
movq %rax, 0x1c8(%r14)
leaq 0xdd(%rip), %rax        # 0x74eba
movq %rax, (%rbx)
testl %ebp, %ebp
je 0x74e50
cmpl $0x0, 0x4c(%r14)
jle 0x74eab
movq 0x58(%r14), %r12
addq $0x8, %r12
xorl %r13d, %r13d
movq 0x8(%r14), %rax
movq 0x28(%rax), %rbp
movl 0x14(%r12), %edi
movslq (%r12), %rsi
callq 0x85ca1
movq %rax, %r15
movl 0x18(%r12), %edi
movslq 0x4(%r12), %rsi
callq 0x85ca1
movl 0x4(%r12), %r9d
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
movl %r15d, %ecx
movl %eax, %r8d
callq *%rbp
movq %rax, 0x70(%rbx,%r13,8)
incq %r13
movslq 0x4c(%r14), %rax
addq $0x60, %r12
cmpq %rax, %r13
jl 0x74dfa
jmp 0x74eab
movq 0x8(%r14), %rax
movl $0x500, %edx            # imm = 0x500
movq %r14, %rdi
movl $0x1, %esi
callq *0x8(%rax)
movdqa 0x2d414(%rip), %xmm0    # 0xa2280
movl $0x4, %ecx
movq %rax, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa 0x2d41d(%rip), %xmm2    # 0xa22a0
movdqa %xmm0, %xmm3
psllq $0x7, %xmm3
paddq %xmm1, %xmm3
movdqu %xmm3, (%rbx,%rcx,8)
paddq %xmm2, %xmm0
addq $0x2, %rcx
cmpq $0xe, %rcx
jne 0x74e83
movq $0x0, 0x70(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jccoefct.c
// Function: start_pass_coef
METHODDEF(void)
start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;

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

  switch (pass_mode) {
  case JBUF_PASS_THRU:
    if (coef->whole_image[0] != NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    coef->pub.compress_data = compress_data;
    break;
#ifdef FULL_COEF_BUFFER_SUPPORTED
  case JBUF_SAVE_AND_PASS:
    if (coef->whole_image[0] == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    coef->pub.compress_data = compress_first_pass;
    break;
  case JBUF_CRANK_DEST:
    if (coef->whole_image[0] == NULL)
      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    coef->pub.compress_data = compress_output;
    break;
#endif
  default:
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    break;
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x1c8(%rdi), %r14
movl $0x0, 0x10(%r14)
callq 0x74f5c
cmpl $0x3, %ebp
je 0x74f23
cmpl $0x2, %ebp
je 0x74f04
testl %ebp, %ebp
jne 0x74f49
cmpq $0x0, 0x70(%r14)
je 0x74efb
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
leaq 0x9b(%rip), %rax        # 0x74f9d
jmp 0x74f40
cmpq $0x0, 0x70(%r14)
jne 0x74f1a
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
leaq 0xaa6(%rip), %rax       # 0x759c7
jmp 0x74f40
cmpq $0x0, 0x70(%r14)
jne 0x74f39
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
leaq 0x2e4(%rip), %rax       # 0x75224
movq %rax, 0x8(%r14)
popq %rbx
popq %r14
popq %rbp
retq
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *(%rax)
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: grayscale_convert
METHODDEF(void)
grayscale_convert (j_compress_ptr cinfo,
		   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		   JDIMENSION output_row, int num_rows)
{
  register JSAMPROW inptr;
  register JSAMPROW outptr;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;
  int instride = cinfo->input_components;

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

// Assembly:
testl %r8d, %r8d
jle 0x75d8d
pushq %rbx
movl 0x30(%rdi), %eax
movslq 0x38(%rdi), %rdi
testq %rax, %rax
je 0x75d79
movq (%rdx), %r9
movl %ecx, %r10d
movq (%r9,%r10,8), %r9
movq (%rsi), %r10
xorl %r11d, %r11d
movb (%r10), %bl
movb %bl, (%r9,%r11)
addq %rdi, %r10
incq %r11
cmpq %r11, %rax
jne 0x75d67
leal -0x1(%r8), %r9d
addq $0x8, %rsi
incl %ecx
cmpl $0x2, %r8d
movl %r9d, %r8d
jge 0x75d52
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: rgb_gray_convert
METHODDEF(void)
rgb_gray_convert (j_compress_ptr cinfo,
		  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		  JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register INT32 * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

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

// Assembly:
testl %r8d, %r8d
jle 0x75ebb
pushq %rbp
pushq %r14
pushq %rbx
movq 0x1d8(%rdi), %rax
movq 0x10(%rax), %rax
movl 0x30(%rdi), %edi
testq %rdi, %rdi
je 0x75ea4
movq (%rdx), %r9
movl %ecx, %r10d
movq (%r9,%r10,8), %r9
movq (%rsi), %r10
xorl %r11d, %r11d
movzbl (%r10), %ebx
movzbl 0x1(%r10), %r14d
movl 0x800(%rax,%r14,8), %ebp
addl (%rax,%rbx,8), %ebp
movzbl 0x2(%r10), %ebx
addl 0x1000(%rax,%rbx,8), %ebp
shrl $0x10, %ebp
movb %bpl, (%r9,%r11)
incq %r11
addq $0x3, %r10
cmpq %r11, %rdi
jne 0x75e71
leal -0x1(%r8), %r9d
addq $0x8, %rsi
incl %ecx
cmpl $0x2, %r8d
movl %r9d, %r8d
jge 0x75e5c
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: null_convert
METHODDEF(void)
null_convert (j_compress_ptr cinfo,
	      JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
	      JDIMENSION output_row, int num_rows)
{
  register JSAMPROW inptr;
  register JSAMPROW outptr;
  register JDIMENSION col;
  register int ci;
  int nc = cinfo->num_components;
  JDIMENSION num_cols = cinfo->image_width;

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

// Assembly:
testl %r8d, %r8d
jle 0x75f23
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl 0x30(%rdi), %eax
movl 0x4c(%rdi), %edi
movslq %edi, %r9
testl %edi, %edi
jle 0x75f0a
movl %ecx, %r10d
xorl %r11d, %r11d
testq %rax, %rax
je 0x75f02
movq (%rdx,%r11,8), %rbx
movq (%rbx,%r10,8), %rbx
movq (%rsi), %r14
addq %r11, %r14
xorl %r15d, %r15d
movb (%r14), %bpl
movb %bpl, (%rbx,%r15)
incq %r15
addq %r9, %r14
cmpq %r15, %rax
jne 0x75ef0
incq %r11
cmpq %rdi, %r11
jne 0x75eda
leal -0x1(%r8), %r10d
addq $0x8, %rsi
incl %ecx
cmpl $0x1, %r8d
movl %r10d, %r8d
jg 0x75ed0
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: rgb_ycc_convert
METHODDEF(void)
rgb_ycc_convert (j_compress_ptr cinfo,
		 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		 JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register INT32 * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr0, outptr1, outptr2;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr0 = output_buf[0][output_row];
    outptr1 = output_buf[1][output_row];
    outptr2 = output_buf[2][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      r = GETJSAMPLE(inptr[RGB_RED]);
      g = GETJSAMPLE(inptr[RGB_GREEN]);
      b = GETJSAMPLE(inptr[RGB_BLUE]);
      inptr += RGB_PIXELSIZE;
      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
       * must be too; we do not need an explicit range-limiting operation.
       * Hence the value being shifted is never negative, and we don't
       * need the general RIGHT_SHIFT macro.
       */
      /* Y */
      outptr0[col] = (JSAMPLE)
		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
		 >> SCALEBITS);
      /* Cb */
      outptr1[col] = (JSAMPLE)
		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
		 >> SCALEBITS);
      /* Cr */
      outptr2[col] = (JSAMPLE)
		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
		 >> SCALEBITS);
    }
  }
}

// Assembly:
testl %r8d, %r8d
jle 0x76002
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x1d8(%rdi), %rax
movq 0x10(%rax), %rax
movl 0x30(%rdi), %edi
testq %rdi, %rdi
je 0x75fe1
movl %ecx, %r11d
movq (%rdx), %r9
movq 0x8(%rdx), %r10
movq (%r9,%r11,8), %r9
movq (%r10,%r11,8), %r10
movq 0x10(%rdx), %rbx
movq (%rbx,%r11,8), %r11
movq (%rsi), %rbx
xorl %r14d, %r14d
movzbl (%rbx), %r15d
movzbl 0x1(%rbx), %r12d
movl 0x800(%rax,%r12,8), %ebp
addl (%rax,%r15,8), %ebp
movzbl 0x2(%rbx), %r13d
addl 0x1000(%rax,%r13,8), %ebp
shrl $0x10, %ebp
movb %bpl, (%r9,%r14)
movl 0x2000(%rax,%r12,8), %ebp
addl 0x1800(%rax,%r15,8), %ebp
addl 0x2800(%rax,%r13,8), %ebp
shrl $0x10, %ebp
movb %bpl, (%r10,%r14)
movl 0x3000(%rax,%r12,8), %ebp
addl 0x2800(%rax,%r15,8), %ebp
addl 0x3800(%rax,%r13,8), %ebp
shrl $0x10, %ebp
movb %bpl, (%r11,%r14)
incq %r14
addq $0x3, %rbx
cmpq %r14, %rdi
jne 0x75f6e
leal -0x1(%r8), %r9d
addq $0x8, %rsi
incl %ecx
cmpl $0x2, %r8d
movl %r9d, %r8d
jge 0x75f45
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: cmyk_ycck_convert
METHODDEF(void)
cmyk_ycck_convert (j_compress_ptr cinfo,
		   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
		   JDIMENSION output_row, int num_rows)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  register int r, g, b;
  register INT32 * ctab = cconvert->rgb_ycc_tab;
  register JSAMPROW inptr;
  register JSAMPROW outptr0, outptr1, outptr2, outptr3;
  register JDIMENSION col;
  JDIMENSION num_cols = cinfo->image_width;

  while (--num_rows >= 0) {
    inptr = *input_buf++;
    outptr0 = output_buf[0][output_row];
    outptr1 = output_buf[1][output_row];
    outptr2 = output_buf[2][output_row];
    outptr3 = output_buf[3][output_row];
    output_row++;
    for (col = 0; col < num_cols; col++) {
      r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
      g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
      b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
      /* K passes through as-is */
      outptr3[col] = inptr[3];	/* don't need GETJSAMPLE here */
      inptr += 4;
      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
       * must be too; we do not need an explicit range-limiting operation.
       * Hence the value being shifted is never negative, and we don't
       * need the general RIGHT_SHIFT macro.
       */
      /* Y */
      outptr0[col] = (JSAMPLE)
		((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
		 >> SCALEBITS);
      /* Cb */
      outptr1[col] = (JSAMPLE)
		((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])
		 >> SCALEBITS);
      /* Cr */
      outptr2[col] = (JSAMPLE)
		((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])
		 >> SCALEBITS);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, -0xc(%rsp)
movq %rdx, -0x8(%rsp)
testl %r8d, %r8d
jle 0x76102
movq 0x1d8(%rdi), %rax
movq 0x10(%rax), %rax
movl 0x30(%rdi), %ecx
movl $0xff, %r9d
testq %rcx, %rcx
je 0x760e9
movl -0xc(%rsp), %r14d
movq -0x8(%rsp), %rdx
movq (%rdx), %r10
movq 0x8(%rdx), %r11
movq (%r10,%r14,8), %r10
movq (%r11,%r14,8), %r11
movq 0x10(%rdx), %rbx
movq (%rbx,%r14,8), %rbx
movq 0x18(%rdx), %r15
movq (%r15,%r14,8), %r14
movq (%rsi), %r15
xorl %r12d, %r12d
movzbl (%r15,%r12,4), %r13d
xorl %r9d, %r13d
movzbl 0x1(%r15,%r12,4), %ebp
xorl %r9d, %ebp
movzbl 0x2(%r15,%r12,4), %edi
xorl %r9d, %edi
movb 0x3(%r15,%r12,4), %dl
movb %dl, (%r14,%r12)
movl 0x800(%rax,%rbp,8), %edx
addl (%rax,%r13,8), %edx
addl 0x1000(%rax,%rdi,8), %edx
shrl $0x10, %edx
movb %dl, (%r10,%r12)
movl 0x2000(%rax,%rbp,8), %edx
addl 0x1800(%rax,%r13,8), %edx
addl 0x2800(%rax,%rdi,8), %edx
shrl $0x10, %edx
movb %dl, (%r11,%r12)
movl 0x3000(%rax,%rbp,8), %edx
addl 0x2800(%rax,%r13,8), %edx
addl 0x3800(%rax,%rdi,8), %edx
shrl $0x10, %edx
movb %dl, (%rbx,%r12)
incq %r12
cmpq %r12, %rcx
jne 0x7606b
leal -0x1(%r8), %r10d
addq $0x8, %rsi
incl -0xc(%rsp)
cmpl $0x2, %r8d
movl %r10d, %r8d
jge 0x76033
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: sep_downsample
METHODDEF(void)
sep_downsample (j_compress_ptr cinfo,
		JSAMPIMAGE input_buf, JDIMENSION in_row_index,
		JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)
{
  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;
  int ci;
  jpeg_component_info * compptr;
  JSAMPARRAY in_ptr, out_ptr;

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

// Assembly:
cmpl $0x0, 0x4c(%rdi)
jle 0x7632c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r15d
movq %rcx, %rbp
movq %rsi, %rbx
movq %rdi, %r12
movq 0x58(%rdi), %r13
movq 0x1e0(%rdi), %rcx
movq %rcx, 0x10(%rsp)
movl %edx, %ecx
xorl %r14d, %r14d
shlq $0x3, %rcx
movq %rcx, 0x8(%rsp)
movq (%rbx,%r14,8), %rdx
addq 0x8(%rsp), %rdx
movl 0xc(%r13), %ecx
imull %r15d, %ecx
shlq $0x3, %rcx
addq (%rbp,%r14,8), %rcx
movq %r12, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rax
callq *0x18(%rax,%r14,8)
incq %r14
addq $0x60, %r13
movslq 0x4c(%r12), %rax
cmpq %rax, %r14
jl 0x762e3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: fullsize_downsample
METHODDEF(void)
fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		     JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  /* Copy the data */
  jcopy_sample_rows(input_data, 0, output_data, 0,
		    cinfo->max_v_samp_factor, cinfo->image_width);
  /* Edge-expand */
  expand_right_edge(output_data, cinfo->max_v_samp_factor,
		    cinfo->image_width, compptr->width_in_blocks * DCTSIZE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x30(%rdi), %r9d
movl 0x13c(%rdi), %r8d
movq %rdx, %rdi
xorl %esi, %esi
movq %rcx, %rdx
xorl %ecx, %ecx
callq 0x85cb7
movslq 0x13c(%r15), %r12
testq %r12, %r12
setle %al
movl 0x30(%r15), %r15d
movl 0x1c(%r14), %r14d
shll $0x3, %r14d
movl %r14d, %ecx
subl %r15d, %ecx
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x7654e
movl %r15d, %eax
notl %eax
addl %eax, %r14d
incq %r14
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rdi
movzbl -0x1(%rdi,%r15), %esi
addq %r15, %rdi
movq %r14, %rdx
callq 0xe260
incq %r13
cmpq %r13, %r12
jne 0x76531
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: h2v1_downsample
METHODDEF(void)
h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int outrow;
  JDIMENSION outcol;
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  register JSAMPROW inptr, outptr;
  register int bias;

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movl 0x1c(%rsi), %ebp
movslq 0x13c(%rdi), %r13
testq %r13, %r13
setle %al
movl 0x30(%rdi), %ebx
movl %ebp, %r12d
shll $0x4, %r12d
movl %r12d, %ecx
subl %ebx, %ecx
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x765c4
movl %ebx, %eax
notl %eax
addl %eax, %r12d
incq %r12
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
movzbl -0x1(%rdi,%rbx), %esi
addq %rbx, %rdi
movq %r12, %rdx
callq 0xe260
incq %r15
cmpq %r15, %r13
jne 0x765a8
movq 0x8(%rsp), %rbx
movl 0xc(%rbx), %edx
testl %edx, %edx
movq 0x10(%rsp), %r11
jle 0x7661e
shll $0x3, %ebp
movl %ebp, %eax
xorl %ecx, %ecx
testl %ebp, %ebp
je 0x76613
movq (%r14,%rcx,8), %rdx
movq (%r11,%rcx,8), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movzbl (%rdx,%rdi,2), %r9d
movzbl 0x1(%rdx,%rdi,2), %r10d
addl %r8d, %r9d
addl %r10d, %r9d
shrl %r9d
movb %r9b, (%rsi,%rdi)
xorl $0x1, %r8d
incq %rdi
cmpl %edi, %eax
jne 0x765ed
movl 0xc(%rbx), %edx
incq %rcx
movslq %edx, %rsi
cmpq %rsi, %rcx
jl 0x765dc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: h2v2_downsample
METHODDEF(void)
h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		 JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int inrow, outrow;
  JDIMENSION outcol;
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  register JSAMPROW inptr0, inptr1, outptr;
  register int bias;

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movl 0x1c(%rsi), %ebp
movslq 0x13c(%rdi), %r13
testq %r13, %r13
setle %al
movl 0x30(%rdi), %ebx
movl %ebp, %r12d
shll $0x4, %r12d
movl %r12d, %ecx
subl %ebx, %ecx
testl %ecx, %ecx
setle %cl
orb %al, %cl
jne 0x7695d
movl %ebx, %eax
notl %eax
addl %eax, %r12d
incq %r12
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
movzbl -0x1(%rdi,%rbx), %esi
addq %rbx, %rdi
movq %r12, %rdx
callq 0xe260
incq %r15
cmpq %r15, %r13
jne 0x76941
movq 0x8(%rsp), %r13
movl 0xc(%r13), %esi
testl %esi, %esi
movq 0x10(%rsp), %r12
jle 0x769db
shll $0x3, %ebp
movl %ebp, %eax
xorl %ecx, %ecx
xorl %edx, %edx
testl %ebp, %ebp
je 0x769cc
movq (%r14,%rdx,8), %rsi
movq 0x8(%r14,%rdx,8), %rdi
movq (%r12,%rcx,8), %r8
movl $0x1, %r9d
xorl %r10d, %r10d
movzbl (%rsi,%r10,2), %r11d
movzbl 0x1(%rsi,%r10,2), %ebx
movzbl (%rdi,%r10,2), %r15d
addl %ebx, %r15d
movzbl 0x1(%rdi,%r10,2), %ebx
addl %r9d, %r11d
addl %r15d, %r11d
addl %ebx, %r11d
shrl $0x2, %r11d
movb %r11b, (%r8,%r10)
xorl $0x3, %r9d
incq %r10
cmpl %r10d, %eax
jne 0x76992
movl 0xc(%r13), %esi
addq $0x2, %rdx
incq %rcx
movslq %esi, %rdi
cmpq %rdi, %rcx
jl 0x76978
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: jinit_huff_encoder
GLOBAL(void)
jinit_huff_encoder (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy;
  int i;

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

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0xc0, %edx
movl $0x1, %esi
callq *(%rax)
movq %rax, 0x1f0(%rbx)
leaq 0x35(%rip), %rcx        # 0x76ff3
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movq $-0x4, %rcx
movups %xmm0, 0x80(%rax,%rcx,8)
movups %xmm0, 0xc0(%rax,%rcx,8)
movups %xmm0, 0xa0(%rax,%rcx,8)
addq $0x2, %rcx
jne 0x76fd3
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: finish_pass_gather
METHODDEF(void)
finish_pass_gather (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  int ci, dctbl, actbl;
  jpeg_component_info * compptr;
  JHUFF_TBL **htblptr;
  jboolean did_dc[NUM_HUFF_TBLS];
  jboolean did_ac[NUM_HUFF_TBLS];

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq 0x1f0(%rdi), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
cmpl $0x0, 0x144(%rdi)
jle 0x77481
movq %rdi, %rbx
xorl %r15d, %r15d
movq 0x148(%rbx,%r15,8), %rax
movslq 0x14(%rax), %r13
movslq 0x18(%rax), %r12
cmpl $0x0, 0x10(%rsp,%r13,4)
jne 0x7742f
movq 0x80(%rbx,%r13,8), %rsi
testq %rsi, %rsi
jne 0x77416
movq %rbx, %rdi
callq 0x85c7a
movq %rax, %rsi
movq %rax, 0x80(%rbx,%r13,8)
movq 0x80(%r14,%r13,8), %rdx
movq %rbx, %rdi
callq 0x76d5f
movl $0x1, 0x10(%rsp,%r13,4)
cmpl $0x0, (%rsp,%r12,4)
jne 0x7746e
movq 0xa0(%rbx,%r12,8), %rsi
testq %rsi, %rsi
jne 0x77456
movq %rbx, %rdi
callq 0x85c7a
movq %rax, %rsi
movq %rax, 0xa0(%rbx,%r12,8)
movq 0xa0(%r14,%r12,8), %rdx
movq %rbx, %rdi
callq 0x76d5f
movl $0x1, (%rsp,%r12,4)
incq %r15
movslq 0x144(%rbx), %rax
cmpq %rax, %r15
jl 0x773de
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: flush_bits
LOCAL(jboolean)
flush_bits (working_state * state)
{
  if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
    return FALSE;
  state->cur.put_buffer = 0;	/* and reset bit-buffer to empty */
  state->cur.put_bits = 0;
  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x18(%rdi), %ebp
testl %ebp, %ebp
jle 0x77f48
movb $0x11, %cl
subb %bpl, %cl
movl $0x7f, %r14d
shlq %cl, %r14
orq 0x10(%rbx), %r14
addl $0xf, %ebp
movl %r14d, %eax
shrl $0x10, %eax
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movb %al, (%rcx)
decq 0x8(%rbx)
jne 0x77eff
movq 0x30(%rbx), %rdi
movq 0x28(%rdi), %r15
callq *0x18(%r15)
testl %eax, %eax
je 0x77f5e
movq (%r15), %rax
movq %rax, (%rbx)
movq 0x8(%r15), %rax
movq %rax, 0x8(%rbx)
movl %r14d, %eax
notl %eax
testl $0xff0000, %eax         # imm = 0xFF0000
jne 0x77f3c
movq (%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%rbx)
movb $0x0, (%rax)
decq 0x8(%rbx)
jne 0x77f3c
movq 0x30(%rbx), %rdi
movq 0x28(%rdi), %r15
callq *0x18(%r15)
testl %eax, %eax
je 0x77f5e
movq (%r15), %rax
movq %rax, (%rbx)
movq 0x8(%r15), %rax
movq %rax, 0x8(%rbx)
shlq $0x8, %r14
addl $-0x8, %ebp
cmpl $0xf, %ebp
jg 0x77ec9
movq $0x0, 0x10(%rbx)
movl $0x0, 0x18(%rbx)
movl $0x1, %eax
jmp 0x77f60
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: encode_mcu_DC_refine
METHODDEF(jboolean)
encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  register int temp;
  int blkn;
  int Al = cinfo->Al;
  JBLOCKROW block;

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

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

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

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

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

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

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %r14
movq 0x1f0(%rdi), %rbx
movl 0x1a8(%rdi), %ebp
movq 0x28(%rdi), %rax
movq (%rax), %rcx
movq %rcx, 0x20(%rbx)
movq 0x8(%rax), %rax
movq %rax, 0x28(%rbx)
cmpl $0x0, 0x118(%rdi)
je 0x786f7
cmpl $0x0, 0x70(%rbx)
jne 0x786f7
movl 0x74(%rbx), %esi
movq %rbx, %rdi
callq 0x78d3a
movl 0x170(%r14), %eax
testl %eax, %eax
jle 0x787c2
xorl %r12d, %r12d
cmpl $0x0, 0x18(%rbx)
jne 0x787b3
movl 0x38(%rbx), %r13d
movq (%rsp), %rcx
movq (%rcx,%r12,8), %rcx
movswl (%rcx), %ecx
xorl %r15d, %r15d
btl %ebp, %ecx
setb %r15b
movb $0x17, %cl
subb %r13b, %cl
shlq %cl, %r15
orq 0x30(%rbx), %r15
cmpl $0x7, %r13d
jl 0x787a8
addl $0x9, %r13d
movl %r15d, %eax
shrl $0x10, %eax
movq 0x20(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rbx)
movb %al, (%rcx)
decq 0x28(%rbx)
jne 0x78764
movq %rbx, %rdi
callq 0x7907c
movl %r15d, %eax
notl %eax
testl $0xff0000, %eax         # imm = 0xFF0000
jne 0x7878d
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $0x0, (%rax)
decq 0x28(%rbx)
jne 0x7878d
movq %rbx, %rdi
callq 0x7907c
shlq $0x8, %r15
addl $-0x8, %r13d
cmpl $0xf, %r13d
jg 0x78742
movl 0x170(%r14), %eax
addl $-0x8, %r13d
jmp 0x787ab
incl %r13d
movq %r15, 0x30(%rbx)
movl %r13d, 0x38(%rbx)
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x78709
movq 0x20(%rbx), %rax
movq 0x28(%r14), %rcx
movq %rax, (%rcx)
movq 0x28(%rbx), %rax
movq %rax, 0x8(%rcx)
movl 0x118(%r14), %eax
testl %eax, %eax
je 0x787f9
movl 0x70(%rbx), %ecx
testl %ecx, %ecx
jne 0x787f4
movl 0x74(%rbx), %ecx
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x74(%rbx)
movl %eax, %ecx
decl %ecx
movl %ecx, 0x70(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: finish_pass_gather_phuff
METHODDEF(void)
finish_pass_gather_phuff (j_compress_ptr cinfo)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  jboolean is_DC_band;
  int ci, tbl;
  jpeg_component_info * compptr;
  JHUFF_TBL **htblptr;
  jboolean did[NUM_HUFF_TBLS];

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x1f0(%rdi), %r14
movq %r14, %rdi
callq 0x78ecc
movl 0x19c(%rbx), %ebp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movl 0x144(%rbx), %eax
testl %eax, %eax
jle 0x78cdf
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
shll $0x5, %ecx
leaq (%rbx,%rcx), %r15
addq $0x80, %r15
xorl %r12d, %r12d
movq 0x148(%rbx,%r12,8), %rcx
movl $0x18, %edx
testl %ebp, %ebp
je 0x78cc2
movslq (%rcx,%rdx), %r13
cmpl $0x0, (%rsp,%r13,4)
jne 0x78ccb
movq (%r15,%r13,8), %rsi
testq %rsi, %rsi
jne 0x78ca2
movq %rbx, %rdi
callq 0x85c7a
movq %rax, %rsi
movq %rax, (%r15,%r13,8)
movq 0x98(%r14,%r13,8), %rdx
movq %rbx, %rdi
callq 0x76d5f
movl $0x1, (%rsp,%r13,4)
movl 0x144(%rbx), %eax
jmp 0x78ccb
cmpl $0x0, 0x1a4(%rbx)
je 0x78cd8
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x78c6e
jmp 0x78cdf
movl $0x14, %edx
jmp 0x78c7f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: emit_restart
LOCAL(void)
emit_restart (phuff_entropy_ptr entropy, int restart_num)
{
  int ci;

  emit_eobrun(entropy);

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

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x78ecc
cmpl $0x0, 0x18(%rbx)
jne 0x78d93
movq %rbx, %rdi
callq 0x78fe8
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $-0x1, (%rax)
decq 0x28(%rbx)
jne 0x78d72
movq %rbx, %rdi
callq 0x7907c
addb $-0x30, %bpl
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb %bpl, (%rax)
decq 0x28(%rbx)
jne 0x78d93
movq %rbx, %rdi
callq 0x7907c
movq 0x40(%rbx), %rax
cmpl $0x0, 0x19c(%rax)
je 0x78daa
movq $0x0, 0x5c(%rbx)
jmp 0x78dcc
cmpl $0x0, 0x144(%rax)
jle 0x78dcc
xorl %ecx, %ecx
movl $0x0, 0x48(%rbx,%rcx,4)
incq %rcx
movslq 0x144(%rax), %rdx
cmpq %rdx, %rcx
jl 0x78db5
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: emit_eobrun
LOCAL(void)
emit_eobrun (phuff_entropy_ptr entropy)
{
  register int temp, nbits;

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

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

    entropy->EOBRUN = 0;

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

// Assembly:
movl 0x5c(%rdi), %eax
testl %eax, %eax
je 0x78fe7
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
cmpl $0x1, %eax
je 0x78f10
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
sarl %eax
incl %ecx
cmpl $0x1, %eax
ja 0x78eee
leal 0x1(%rcx), %r14d
cmpl $0xe, %ecx
jb 0x78f10
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
movl $0x28, 0x28(%rax)
callq *(%rax)
movl 0x58(%rbx), %esi
movl %r14d, %edx
shll $0x4, %edx
movq %rbx, %rdi
callq 0x78dd3
testl %r14d, %r14d
je 0x78fc6
cmpl $0x0, 0x18(%rbx)
jne 0x78fc6
movq $-0x1, %r15
movl %r14d, %ecx
shlq %cl, %r15
notl %r15d
andl 0x5c(%rbx), %r15d
addl 0x38(%rbx), %r14d
movb $0x18, %cl
subb %r14b, %cl
shlq %cl, %r15
orq 0x30(%rbx), %r15
cmpl $0x8, %r14d
jl 0x78fbc
movl %r15d, %eax
shrl $0x10, %eax
movq 0x20(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%rbx)
movb %al, (%rcx)
decq 0x28(%rbx)
jne 0x78f80
movq %rbx, %rdi
callq 0x7907c
movl %r15d, %eax
notl %eax
testl $0xff0000, %eax         # imm = 0xFF0000
jne 0x78fa9
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $0x0, (%rax)
decq 0x28(%rbx)
jne 0x78fa9
movq %rbx, %rdi
callq 0x7907c
shlq $0x8, %r15
leal -0x8(%r14), %eax
cmpl $0xf, %r14d
movl %eax, %r14d
jg 0x78f5e
jmp 0x78fbf
movl %r14d, %eax
movq %r15, 0x30(%rbx)
movl %eax, 0x38(%rbx)
xorl %ebp, %ebp
movl %ebp, 0x5c(%rbx)
movq 0x68(%rbx), %rsi
movl 0x60(%rbx), %edx
movq %rbx, %rdi
callq 0x790ba
movl %ebp, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: dump_buffer
LOCAL(void)
dump_buffer (phuff_entropy_ptr entropy)
/* Empty the output buffer; we do not support suspension in this module. */
{
  struct jpeg_destination_mgr * dest = entropy->cinfo->dest;

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
movq 0x28(%rdi), %r14
callq *0x18(%r14)
testl %eax, %eax
jne 0x790a3
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
movl $0x18, 0x28(%rax)
callq *(%rax)
movq (%r14), %rax
movq %rax, 0x20(%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: emit_buffered_bits
LOCAL(void)
emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,
		    unsigned int nbits)
{
  if (entropy->gather_statistics)
    return;			/* no real work */

  while (nbits > 0) {
    emit_bits(entropy, (unsigned int) (*bufstart), 1);
    bufstart++;
    nbits--;
  }
}

// Assembly:
testl %edx, %edx
je 0x79180
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r15
cmpl $0x0, 0x18(%rdi)
jne 0x79178
movl %edx, %ebx
movq %rsi, %r14
cmpl $0x0, 0x18(%r15)
jne 0x7916d
movl 0x38(%r15), %ebp
movzbl (%r14), %r12d
andl $0x1, %r12d
movb $0x17, %cl
subb %bpl, %cl
shlq %cl, %r12
orq 0x30(%r15), %r12
cmpl $0x7, %ebp
jl 0x79163
addl $0x9, %ebp
movl %r12d, %eax
shrl $0x10, %eax
movq 0x20(%r15), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x20(%r15)
movb %al, (%rcx)
decq 0x28(%r15)
jne 0x79129
movq %r15, %rdi
callq 0x7907c
movl %r12d, %eax
notl %eax
testl $0xff0000, %eax         # imm = 0xFF0000
jne 0x79152
movq 0x20(%r15), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%r15)
movb $0x0, (%rax)
decq 0x28(%r15)
jne 0x79152
movq %r15, %rdi
callq 0x7907c
shlq $0x8, %r12
addl $-0x8, %ebp
cmpl $0xf, %ebp
jg 0x79107
addl $-0x8, %ebp
jmp 0x79165
incl %ebp
movq %r12, 0x30(%r15)
movl %ebp, 0x38(%r15)
incq %r14
decl %ebx
jne 0x790dc
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)