LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_dqt
LOCAL(int)
emit_dqt (j_compress_ptr cinfo, int index)
/* Emit a DQT marker */
/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
{
  JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];
  int prec;
  int i;

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

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

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

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

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

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

    qtbl->sent_table = TRUE;
  }

  return prec;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movslq %esi, %rax
movq 0x60(%rdi,%rax,8), %r15
testq %r15, %r15
jne 0x6a44c
movq (%rbx), %rax
movl $0x34, 0x28(%rax)
movl %r14d, 0x2c(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
xorl %eax, %eax
pushq $0x1
popq %rcx
xorl %ebp, %ebp
cmpq $0x40, %rax
je 0x6a468
cmpw $0x100, (%r15,%rax,2)   # imm = 0x100
cmovael %ecx, %ebp
incq %rax
jmp 0x6a453
cmpl $0x0, 0x80(%r15)
jne 0x6a4ec
movq %rbx, %rdi
movl $0xdb, %esi
callq 0x6a39e
xorl %esi, %esi
testl %ebp, %ebp
setne %sil
shll $0x6, %esi
addl $0x43, %esi
movq %rbx, %rdi
callq 0x6a3f3
movl %ebp, %esi
shll $0x4, %esi
addl %r14d, %esi
movq %rbx, %rdi
callq 0x6a3bf
xorl %r14d, %r14d
leaq 0x31531(%rip), %r12     # 0x9b9e0
cmpq $0x40, %r14
je 0x6a4e1
movslq (%r12,%r14,4), %rax
movzwl (%r15,%rax,2), %r13d
testl %ebp, %ebp
je 0x6a4d0
movl %r13d, %esi
shrl $0x8, %esi
movq %rbx, %rdi
callq 0x6a3bf
movzbl %r13b, %esi
movq %rbx, %rdi
callq 0x6a3bf
incq %r14
jmp 0x6a4af
movl $0x1, 0x80(%r15)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_sof
LOCAL(void)
emit_sof (j_compress_ptr cinfo, JPEG_MARKER code)
/* Emit a SOF marker */
{
  int ci;
  jpeg_component_info *compptr;
  
  emit_marker(cinfo, code);
  
  emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */

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

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

  emit_byte(cinfo, cinfo->num_components);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x6a39e
movl 0x4c(%rbx), %eax
leal (%rax,%rax,2), %esi
addl $0x8, %esi
movq %rbx, %rdi
callq 0x6a3f3
cmpl $0xffff, 0x34(%rbx)     # imm = 0xFFFF
ja 0x6a52c
cmpl $0x10000, 0x30(%rbx)    # imm = 0x10000
jb 0x6a545
movq (%rbx), %rax
movabsq $0xffff00000029, %rcx   # imm = 0xFFFF00000029
movq %rcx, 0x28(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x48(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3bf
movl 0x34(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3f3
movl 0x30(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3f3
movl 0x4c(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3bf
movq 0x58(%rbx), %r14
xorl %ebp, %ebp
cmpl 0x4c(%rbx), %ebp
jge 0x6a5ae
movl (%r14), %esi
movq %rbx, %rdi
callq 0x6a3bf
movl 0x8(%r14), %esi
shll $0x4, %esi
addl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x6a3bf
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x6a3bf
incl %ebp
addq $0x60, %r14
jmp 0x6a577
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
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 0x6a5fc
movq (%rbx), %rax
movl $0x32, 0x28(%rax)
movl %r14d, 0x2c(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl $0x0, 0x114(%r15)
jne 0x6a68d
movq %rbx, %rdi
movl $0xc4, %esi
callq 0x6a39e
xorl %eax, %eax
xorl %r12d, %r12d
cmpq $0x10, %rax
je 0x6a630
movzbl 0x1(%r15,%rax), %ecx
addl %ecx, %r12d
incq %rax
jmp 0x6a61c
leal 0x13(%r12), %esi
movq %rbx, %rdi
callq 0x6a3f3
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6a3bf
xorl %r14d, %r14d
cmpq $0x10, %r14
je 0x6a664
movzbl 0x1(%r15,%r14), %esi
movq %rbx, %rdi
callq 0x6a3bf
incq %r14
jmp 0x6a64b
movl %r12d, %r14d
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x6a682
movzbl 0x11(%r15,%r12), %esi
movq %rbx, %rdi
callq 0x6a3bf
incq %r12
jmp 0x6a66a
movl $0x1, 0x114(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x1
popq %rsi
pushq $0x70
popq %rdx
callq *(%rax)
movq %rax, %r14
movq %rax, 0x1b8(%rbx)
leaq 0x6e(%rip), %rax        # 0x6a734
movq %rax, (%r14)
cmpl $0x0, 0x100(%rbx)
je 0x6a6db
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
je 0x6a6f6
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *(%rax)
movq 0x58(%rbx), %r15
addq $0x1c, %r15
xorl %r12d, %r12d
pushq $0x1
popq %rbp
movslq 0x4c(%rbx), %rax
cmpq %rax, %r12
jge 0x6a6d2
movq 0x8(%rbx), %rax
movl -0x10(%r15), %ecx
movl (%r15), %edx
shll $0x3, %edx
shll $0x3, %ecx
movq %rbx, %rdi
movl %ebp, %esi
callq *0x10(%rax)
movq %rax, 0x20(%r14,%r12,8)
incq %r12
addq $0x60, %r15
jmp 0x6a704
// File: /workspace/github_cpp_makefile_star2_O2/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 %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x1b8(%rdi), %rbp
leaq 0x14(%rbp), %r12
leaq 0x20(%rbp), %r13
movl 0x10(%rbp), %eax
cmpl 0x140(%r15), %eax
jae 0x6a815
movl (%r12), %eax
cmpl $0x7, %eax
ja 0x6a7d4
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 0x6a815
movq 0x1c8(%r15), %rax
movq %r15, %rdi
movq %r13, %rsi
callq *0x8(%rax)
movl 0x18(%rbp), %ecx
testl %eax, %eax
je 0x6a808
testl %ecx, %ecx
je 0x6a7fa
incl (%rbx)
andl $0x0, 0x18(%rbp)
andl $0x0, 0x14(%rbp)
movl 0x10(%rbp), %eax
incl %eax
movl %eax, 0x10(%rbp)
jmp 0x6a79a
testl %ecx, %ecx
jne 0x6a815
decl (%rbx)
movl $0x1, 0x18(%rbp)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6aa64
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movl 0x34(%rbx), %eax
movl %eax, 0x60(%r14)
andq $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_O2/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
pushq $0x1
popq %rsi
movl $0xc0, %edx
callq *(%rax)
movq %rax, %rbx
movq %rax, 0x1c8(%r14)
leaq 0xa2(%rip), %rax        # 0x6aee9
movq %rax, (%rbx)
testl %ebp, %ebp
je 0x6aead
movq 0x58(%r14), %r12
addq $0x8, %r12
xorl %r13d, %r13d
movslq 0x4c(%r14), %rax
cmpq %rax, %r13
jge 0x6aeda
movq 0x8(%r14), %rax
movq 0x28(%rax), %rbp
movl 0x14(%r12), %edi
movslq (%r12), %rsi
callq 0x7915d
movq %rax, %r15
movl 0x18(%r12), %edi
movslq 0x4(%r12), %rsi
callq 0x7915d
movl 0x4(%r12), %r9d
movq %r14, %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
movl %r15d, %ecx
movl %eax, %r8d
callq *%rbp
movq %rax, 0x70(%rbx,%r13,8)
incq %r13
addq $0x60, %r12
jmp 0x6ae59
movq 0x8(%r14), %rax
pushq $0x1
popq %rsi
movl $0x500, %edx            # imm = 0x500
movq %r14, %rdi
callq *0x8(%rax)
pushq $0x4
popq %rcx
cmpq $0xe, %rcx
je 0x6aed5
movq %rax, (%rbx,%rcx,8)
incq %rcx
subq $-0x80, %rax
jmp 0x6aec2
andq $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_O2/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
andl $0x0, 0x10(%r14)
callq 0x6af88
cmpl $0x3, %ebp
je 0x6af4f
cmpl $0x2, %ebp
je 0x6af30
testl %ebp, %ebp
jne 0x6af75
cmpq $0x0, 0x70(%r14)
je 0x6af27
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
leaq 0x98(%rip), %rax        # 0x6afc6
jmp 0x6af6c
cmpq $0x0, 0x70(%r14)
jne 0x6af46
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
leaq 0x4fd(%rip), %rax       # 0x6b44a
jmp 0x6af6c
cmpq $0x0, 0x70(%r14)
jne 0x6af65
movq (%rbx), %rax
movl $0x4, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
leaq 0x299(%rip), %rax       # 0x6b205
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_O2/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:
pushq %rbx
movl 0x30(%rdi), %eax
movslq 0x38(%rdi), %rdi
testl %r8d, %r8d
jle 0x6b7e1
decl %r8d
movq (%rsi), %r9
movq (%rdx), %r10
movl %ecx, %r11d
movq (%r10,%r11,8), %r10
xorl %r11d, %r11d
cmpq %r11, %rax
je 0x6b7d9
movb (%r9), %bl
movb %bl, (%r10,%r11)
addq %rdi, %r9
incq %r11
jmp 0x6b7c5
addq $0x8, %rsi
incl %ecx
jmp 0x6b7ad
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jccolor.c
// Function: rgb_ycc_start
METHODDEF(void)
rgb_ycc_start (j_compress_ptr cinfo)
{
  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
  INT32 * rgb_ycc_tab;
  INT32 i;

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

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

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rax
movq 0x1d8(%rdi), %rbx
pushq $0x1
popq %rsi
movl $0x4000, %edx           # imm = 0x4000
callq *(%rax)
movq %rax, 0x10(%rbx)
addq $0x3800, %rax           # imm = 0x3800
movl $0x807fff, %ecx         # imm = 0x807FFF
movl $0x8000, %edx           # imm = 0x8000
xorl %esi, %esi
xorl %edi, %edi
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %r11d, %r11d
cmpq $0x1007fff, %rcx        # imm = 0x1007FFF
je 0x6b898
movq %r11, -0x3800(%rax)
movq %r10, -0x3000(%rax)
movq %rdx, -0x2800(%rax)
movq %r9, -0x2000(%rax)
movq %r8, -0x1800(%rax)
movq %rcx, -0x1000(%rax)
movq %rdi, -0x800(%rax)
movq %rsi, (%rax)
addq $0x8000, %rcx           # imm = 0x8000
addq $0x8, %rax
addq $0x4c8b, %r11           # imm = 0x4C8B
addq $0x9646, %r10           # imm = 0x9646
addq $0x1d2f, %rdx           # imm = 0x1D2F
addq $-0x2b33, %r9           # imm = 0xD4CD
addq $-0x54cd, %r8           # imm = 0xAB33
addq $-0x6b2f, %rdi          # imm = 0x94D1
addq $-0x14d1, %rsi          # imm = 0xEB2F
jmp 0x6b81d
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x1d8(%rdi), %rax
movq 0x10(%rax), %rax
movl 0x30(%rdi), %edi
testl %r8d, %r8d
jle 0x6b904
decl %r8d
movq (%rsi), %r9
movq (%rdx), %r10
movl %ecx, %r11d
movq (%r10,%r11,8), %r10
xorl %r11d, %r11d
cmpq %r11, %rdi
je 0x6b8fc
movzbl (%r9), %ebx
movzbl 0x1(%r9), %r14d
movzbl 0x2(%r9), %r15d
movl 0x800(%rax,%r14,8), %ebp
addl (%rax,%rbx,8), %ebp
addl 0x1000(%rax,%r15,8), %ebp
shrl $0x10, %ebp
movb %bpl, (%r10,%r11)
incq %r11
addq $0x3, %r9
jmp 0x6b8c6
addq $0x8, %rsi
incl %ecx
jmp 0x6b8ae
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movslq 0x4c(%rdi), %rax
movl 0x30(%rdi), %edi
xorl %r9d, %r9d
testl %eax, %eax
cmovgl %eax, %r9d
testl %r8d, %r8d
jle 0x6b966
decl %r8d
movl %ecx, %r10d
xorl %r11d, %r11d
cmpq %r9, %r11
je 0x6b95e
movq (%rdx,%r11,8), %rbx
movq (%rbx,%r10,8), %rbx
movq (%rsi), %r14
addq %r11, %r14
xorl %r15d, %r15d
cmpq %r15, %rdi
je 0x6b959
movb (%r14), %bpl
movb %bpl, (%rbx,%r15)
incq %r15
addq %rax, %r14
jmp 0x6b945
incq %r11
jmp 0x6b92f
addq $0x8, %rsi
incl %ecx
jmp 0x6b921
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x1d8(%rdi), %rax
movq 0x10(%rax), %rax
movl 0x30(%rdi), %edi
testl %r8d, %r8d
jle 0x6ba30
decl %r8d
movq (%rsi), %r9
movl %ecx, %ebx
movq (%rdx), %r10
movq 0x8(%rdx), %r11
movq (%r10,%rbx,8), %r10
movq (%r11,%rbx,8), %r11
movq 0x10(%rdx), %r14
movq (%r14,%rbx,8), %rbx
xorl %r14d, %r14d
cmpq %r14, %rdi
je 0x6ba25
movzbl (%r9), %r15d
movzbl 0x1(%r9), %r12d
movzbl 0x2(%r9), %r13d
movl 0x800(%rax,%r12,8), %ebp
addl (%rax,%r15,8), %ebp
addl 0x1000(%rax,%r13,8), %ebp
shrl $0x10, %ebp
movb %bpl, (%r10,%r14)
movl 0x2000(%rax,%r12,8), %ebp
addl 0x1800(%rax,%r15,8), %ebp
addl 0x2800(%rax,%r13,8), %ebp
shrl $0x10, %ebp
movb %bpl, (%r11,%r14)
movl 0x3000(%rax,%r12,8), %ebp
addl 0x2800(%rax,%r15,8), %ebp
addl 0x3800(%rax,%r13,8), %ebp
shrl $0x10, %ebp
movb %bpl, (%rbx,%r14)
incq %r14
addq $0x3, %r9
jmp 0x6b9b0
addq $0x8, %rsi
incl %ecx
jmp 0x6b985
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdx, -0x8(%rsp)
movq 0x1d8(%rdi), %rax
movq 0x10(%rax), %rax
movl 0x30(%rdi), %edx
movl $0xff, %r9d
testl %r8d, %r8d
jle 0x6bb3a
decl %r8d
movl %r8d, -0xc(%rsp)
movq %rsi, %r8
movq (%rsi), %r10
movl %ecx, -0x10(%rsp)
movl %ecx, %r15d
movq -0x8(%rsp), %rcx
movq (%rcx), %r11
movq 0x8(%rcx), %rbx
movq (%r11,%r15,8), %r11
movq (%rbx,%r15,8), %rbx
movq 0x10(%rcx), %r14
movq (%r14,%r15,8), %r14
movq 0x18(%rcx), %r12
movq (%r12,%r15,8), %r15
xorl %r12d, %r12d
cmpq %r12, %rdx
je 0x6bb23
movzbl (%r10,%r12,4), %r13d
xorl %r9d, %r13d
movzbl 0x1(%r10,%r12,4), %ebp
xorl %r9d, %ebp
movzbl 0x2(%r10,%r12,4), %edi
xorl %r9d, %edi
movb 0x3(%r10,%r12,4), %cl
movb %cl, (%r15,%r12)
movl 0x800(%rax,%rbp,8), %ecx
addl (%rax,%r13,8), %ecx
addl 0x1000(%rax,%rdi,8), %ecx
shrl $0x10, %ecx
movb %cl, (%r11,%r12)
movl 0x2000(%rax,%rbp,8), %ecx
addl 0x1800(%rax,%r13,8), %ecx
addl 0x2800(%rax,%rdi,8), %ecx
shrl $0x10, %ecx
movb %cl, (%rbx,%r12)
movl 0x3000(%rax,%rbp,8), %ecx
addl 0x2800(%rax,%r13,8), %ecx
addl 0x3800(%rax,%rdi,8), %ecx
shrl $0x10, %ecx
movb %cl, (%r14,%r12)
incq %r12
jmp 0x6baa3
movq %r8, %rsi
addq $0x8, %rsi
movl -0x10(%rsp), %ecx
incl %ecx
movl -0xc(%rsp), %r8d
jmp 0x6ba5e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %r12
movq 0x58(%rdi), %r13
movq 0x1e0(%rdi), %rbp
movl %edx, %ebx
xorl %r14d, %r14d
shlq $0x3, %rbx
movslq 0x4c(%r12), %rax
cmpq %rax, %r14
jge 0x6bd34
movq (%r15,%r14,8), %rdx
addq %rbx, %rdx
movl 0xc(%r13), %ecx
imull 0xc(%rsp), %ecx
shlq $0x3, %rcx
movq 0x10(%rsp), %rax
addq (%rax,%r14,8), %rcx
movq %r12, %rdi
movq %r13, %rsi
callq *0x18(%rbp,%r14,8)
incq %r14
addq $0x60, %r13
jmp 0x6bcf9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %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 0x79173
movl 0x30(%r15), %edx
movl 0x13c(%r15), %esi
movl 0x1c(%r14), %ecx
shll $0x3, %ecx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x6c3d0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl 0x1c(%rsi), %ecx
leal (,%rcx,8), %r12d
movl 0x30(%rdi), %edx
movl 0x13c(%rdi), %esi
shll $0x4, %ecx
movq %r14, %rdi
callq 0x6c3d0
xorl %eax, %eax
movslq 0xc(%r15), %rcx
cmpq %rcx, %rax
jge 0x6bf69
movq (%rbx,%rax,8), %rcx
movq (%r14,%rax,8), %rdx
xorl %esi, %esi
xorl %edi, %edi
cmpl %esi, %r12d
je 0x6bf64
movzbl (%rdx,%rsi,2), %r8d
movzbl 0x1(%rdx,%rsi,2), %r9d
addl %edi, %r8d
addl %r9d, %r8d
shrl %r8d
movb %r8b, (%rcx,%rsi)
xorl $0x1, %edi
incq %rsi
jmp 0x6bf3f
incq %rax
jmp 0x6bf2a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl 0x1c(%rsi), %ecx
leal (,%rcx,8), %r12d
movl 0x30(%rdi), %edx
movl 0x13c(%rdi), %esi
shll $0x4, %ecx
movq %r14, %rdi
callq 0x6c3d0
xorl %eax, %eax
pushq $0x1
popq %rcx
xorl %edx, %edx
movslq 0xc(%r15), %rsi
cmpq %rsi, %rdx
jge 0x6c286
movq (%rbx,%rdx,8), %rsi
movq (%r14,%rax,8), %rdi
movq 0x8(%r14,%rax,8), %r8
xorl %r9d, %r9d
movl %ecx, %r10d
cmpl %r9d, %r12d
je 0x6c27d
movzbl (%rdi,%r9,2), %r11d
movzbl 0x1(%rdi,%r9,2), %ebp
movzbl (%r8,%r9,2), %r13d
addl %ebp, %r13d
movzbl 0x1(%r8,%r9,2), %ebp
addl %r10d, %r11d
addl %r13d, %r11d
addl %ebp, %r11d
shrl $0x2, %r11d
movb %r11b, (%rsi,%r9)
xorl $0x3, %r10d
incq %r9
jmp 0x6c245
addq $0x2, %rax
incq %rdx
jmp 0x6c229
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: int_downsample
METHODDEF(void)
int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
		JSAMPARRAY input_data, JSAMPARRAY output_data)
{
  int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
  JDIMENSION outcol, outcol_h;	/* outcol_h == outcol*h_expand */
  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
  JSAMPROW inptr, outptr;
  INT32 outvalue;

  h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
  v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
  numpix = h_expand * v_expand;
  numpix2 = numpix/2;

  /* 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 * h_expand);

  inrow = 0;
  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
    outptr = output_data[outrow];
    for (outcol = 0, outcol_h = 0; outcol < output_cols;
	 outcol++, outcol_h += h_expand) {
      outvalue = 0;
      for (v = 0; v < v_expand; v++) {
	inptr = input_data[inrow+v] + outcol_h;
	for (h = 0; h < h_expand; h++) {
	  outvalue += (INT32) GETJSAMPLE(*inptr++);
	}
      }
      *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);
    }
    inrow += v_expand;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, %r9
movl 0x1c(%rsi), %r12d
shll $0x3, %r12d
movl 0x30(%rdi), %r8d
movl 0x138(%rdi), %eax
cltd
idivl 0x8(%rsi)
movl %eax, %ebp
movl 0x13c(%rdi), %r10d
movl %r10d, %eax
cltd
movq %rsi, 0x20(%rsp)
idivl 0xc(%rsi)
movl %eax, %ebx
movl %eax, %r13d
imull %ebp, %r13d
pushq $0x2
popq %rcx
movl %r13d, %eax
cltd
idivl %ecx
movl %eax, %r14d
movl %ebp, %ecx
imull %r12d, %ecx
movq %r9, 0x10(%rsp)
movq %r9, %rdi
movl %r10d, %esi
movl %r8d, %edx
callq 0x6c3d0
movslq %r14d, %rcx
movslq %r13d, %rsi
xorl %edx, %edx
testl %ebp, %ebp
movl $0x0, %r8d
cmovgl %ebp, %r8d
testl %ebx, %ebx
movl $0x0, %r9d
cmovgl %ebx, %r9d
movslq %ebx, %rax
movq %rax, 0x8(%rsp)
xorl %edi, %edi
movq 0x20(%rsp), %rax
movslq 0xc(%rax), %rax
cmpq %rax, %rdi
jge 0x6c3c1
movq 0x18(%rsp), %rax
movq %rdi, 0x28(%rsp)
movq (%rax,%rdi,8), %r13
movq 0x10(%rsp), %rax
movq %rdx, 0x30(%rsp)
leaq (%rax,%rdx,8), %rbx
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpl %r12d, %r14d
je 0x6c3aa
movl %r15d, %r15d
xorl %edx, %edx
xorl %eax, %eax
cmpq %r9, %rdx
je 0x6c393
movq (%rbx,%rdx,8), %r10
addq %r15, %r10
xorl %edi, %edi
cmpl %edi, %r8d
je 0x6c38e
movzbl (%r10,%rdi), %r11d
addq %r11, %rax
incq %rdi
jmp 0x6c37c
incq %rdx
jmp 0x6c36e
addq %rcx, %rax
cqto
idivq %rsi
movb %al, (%r13)
incq %r13
incl %r14d
addl %ebp, %r15d
jmp 0x6c362
movq 0x30(%rsp), %rdx
addq 0x8(%rsp), %rdx
movq 0x28(%rsp), %rdi
incq %rdi
jmp 0x6c32e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcsample.c
// Function: expand_right_edge
LOCAL(void)
expand_right_edge (JSAMPARRAY image_data, int num_rows,
		   JDIMENSION input_cols, JDIMENSION output_cols)
{
  register JSAMPROW ptr;
  register JSAMPLE pixval;
  register int count;
  int row;
  int numcols = (int) (output_cols - input_cols);

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

// Assembly:
subl %edx, %ecx
testl %ecx, %ecx
jle 0x6c408
movl %edx, %eax
xorl %edx, %edx
testl %esi, %esi
cmovlel %edx, %esi
cmpq %rsi, %rdx
je 0x6c408
movq (%rdi,%rdx,8), %r8
movb -0x1(%r8,%rax), %r9b
addq %rax, %r8
movl %ecx, %r10d
testl %r10d, %r10d
jle 0x6c403
movb %r9b, (%r8)
incq %r8
decl %r10d
jmp 0x6c3f3
incq %rdx
jmp 0x6c3df
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x1
popq %rsi
movl $0xc0, %edx
callq *(%rax)
movq %rax, 0x1f0(%rbx)
leaq 0x34(%rip), %rcx        # 0x6c8a5
movq %rcx, (%rax)
pushq $-0x20
popq %rcx
testq %rcx, %rcx
je 0x6c8a3
andq $0x0, 0x80(%rax,%rcx)
andq $0x0, 0x60(%rax,%rcx)
andq $0x0, 0xc0(%rax,%rcx)
andq $0x0, 0xa0(%rax,%rcx)
addq $0x8, %rcx
jmp 0x6c877
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: encode_mcu_gather
METHODDEF(jboolean)
encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  int blkn, ci;
  jpeg_component_info * compptr;

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

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

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x1f0(%rdi), %rdx
cmpl $0x0, 0x118(%rdi)
je 0x6ca8a
movl 0x38(%rdx), %eax
testl %eax, %eax
jne 0x6ca85
xorl %eax, %eax
movslq 0x144(%r14), %rcx
cmpq %rcx, %rax
jge 0x6ca7e
andl $0x0, 0x24(%rdx,%rax,4)
incq %rax
jmp 0x6ca68
movl 0x118(%r14), %eax
decl %eax
movl %eax, 0x38(%rdx)
xorl %ecx, %ecx
leaq 0x2ef4d(%rip), %rbp     # 0x9b9e0
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movslq 0x170(%r14), %rax
cmpq %rax, %rcx
jge 0x6cbc5
movslq 0x174(%r14,%rcx,4), %rdi
movq 0x148(%r14,%rdi,8), %rax
movq %rcx, 0x20(%rsp)
movq (%rsi,%rcx,8), %rbx
movslq 0x14(%rax), %rcx
movq 0x80(%rdx,%rcx,8), %r12
movslq 0x18(%rax), %rax
movq 0xa0(%rdx,%rax,8), %r15
movswl (%rbx), %ecx
movq %rdi, 0x18(%rsp)
subl 0x24(%rdx,%rdi,4), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
xorl %r13d, %r13d
testl %eax, %eax
je 0x6caff
shrl %eax
incq %r13
jmp 0x6caf4
cmpl $0xc, %r13d
jb 0x6cb14
movq (%r14), %rax
movl $0x6, 0x28(%rax)
movq %r14, %rdi
callq *(%rax)
incq (%r12,%r13,8)
xorl %eax, %eax
pushq $0x1
popq %r12
cmpq $0x40, %r12
je 0x6cb97
movslq (%rbp,%r12,4), %rcx
movzwl (%rbx,%rcx,2), %ecx
testw %cx, %cx
je 0x6cb90
movl %eax, %r13d
shll $0x4, %r13d
incl %r13d
cmpl $0x10, %eax
jl 0x6cb54
incq 0x780(%r15)
addl $-0x10, %eax
addl $0xffffff00, %r13d      # imm = 0xFFFFFF00
jmp 0x6cb3c
movl %ecx, %eax
negw %ax
cmovsw %cx, %ax
movzwl %ax, %eax
pushq $0x1
popq %rcx
cmpl $0x2, %eax
jb 0x6cb71
shrl %eax
incl %ecx
incl %r13d
jmp 0x6cb63
cmpl $0xb, %ecx
jb 0x6cb85
movq (%r14), %rax
movl $0x6, 0x28(%rax)
movq %r14, %rdi
callq *(%rax)
movslq %r13d, %rax
incq (%r15,%rax,8)
xorl %eax, %eax
jmp 0x6cb92
incl %eax
incq %r12
jmp 0x6cb1e
testl %eax, %eax
jle 0x6cb9e
incq (%r15)
movq 0x10(%rsp), %rsi
movq 0x20(%rsp), %rcx
movq (%rsi,%rcx,8), %rax
movswl (%rax), %eax
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rdi
movl %eax, 0x24(%rdx,%rdi,4)
incq %rcx
jmp 0x6ca9d
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %rdi, %rbx
movq 0x1f0(%rdi), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
xorl %r15d, %r15d
movslq 0x144(%rbx), %rax
cmpq %rax, %r15
jge 0x6cca5
movq 0x148(%rbx,%r15,8), %rax
movslq 0x14(%rax), %r13
movslq 0x18(%rax), %r12
cmpl $0x0, 0x10(%rsp,%r13,4)
jne 0x6cc5e
movq 0x80(%rbx,%r13,8), %rsi
testq %rsi, %rsi
jne 0x6cc45
movq %rbx, %rdi
callq 0x79138
movq %rax, %rsi
movq %rax, 0x80(%rbx,%r13,8)
movq 0x80(%r14,%r13,8), %rdx
movq %rbx, %rdi
callq 0x6c62b
movl $0x1, 0x10(%rsp,%r13,4)
cmpl $0x0, (%rsp,%r12,4)
jne 0x6cc9d
movq 0xa0(%rbx,%r12,8), %rsi
testq %rsi, %rsi
jne 0x6cc85
movq %rbx, %rdi
callq 0x79138
movq %rax, %rsi
movq %rax, 0xa0(%rbx,%r12,8)
movq 0xa0(%r14,%r12,8), %rdx
movq %rbx, %rdi
callq 0x6c62b
movl $0x1, (%rsp,%r12,4)
incq %r15
jmp 0x6cbfd
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: finish_pass_huff
METHODDEF(void)
finish_pass_huff (j_compress_ptr cinfo)
{
  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
  working_state state;

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq 0x1f0(%rdi), %rax
movq 0x28(%rdi), %rcx
movq (%rcx), %rdx
leaq 0x18(%rsp), %r14
movq %rdx, -0x10(%r14)
movq 0x8(%rcx), %rcx
movq %rcx, -0x8(%r14)
leaq 0x18(%rax), %r15
movups 0x18(%rax), %xmm0
movups 0x28(%rax), %xmm1
movups %xmm0, (%r14)
movups %xmm1, 0x10(%r14)
movq %rdi, 0x20(%r14)
leaq 0x8(%rsp), %rdi
callq 0x6d0a8
testl %eax, %eax
jne 0x6d077
movq (%rbx), %rax
movl $0x18, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x8(%rsp), %rax
movq 0x28(%rbx), %rcx
movq %rax, (%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rcx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jchuff.c
// Function: dump_buffer
LOCAL(jboolean)
dump_buffer (working_state * state)
/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
{
  struct jpeg_destination_mgr * dest = state->cinfo->dest;

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
movq 0x28(%rdi), %r14
callq *0x18(%r14)
testl %eax, %eax
je 0x6d0f7
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
pushq $0x1
popq %rax
jmp 0x6d0f9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq