LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcphuff.c
// Function: jinit_phuff_encoder
GLOBAL(void)
jinit_phuff_encoder (j_compress_ptr cinfo)
{
  phuff_entropy_ptr entropy;
  int i;

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

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
pushq $0x1
popq %rsi
movl $0xb8, %edx
callq *(%rax)
movq %rax, 0x1f0(%rbx)
leaq 0x2a(%rip), %rcx        # 0x6d20a
movq %rcx, (%rax)
pushq $-0x20
popq %rcx
testq %rcx, %rcx
je 0x6d203
andq $0x0, 0x98(%rax,%rcx)
andq $0x0, 0xb8(%rax,%rcx)
addq $0x8, %rcx
jmp 0x6d1e6
andq $0x0, 0x68(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
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 0x6d70e
cmpl $0x0, 0x70(%rbx)
jne 0x6d70e
movl 0x74(%rbx), %esi
movq %rbx, %rdi
callq 0x6dae4
xorl %r13d, %r13d
pushq $0x1
popq %r12
movslq 0x170(%r14), %rax
cmpq %rax, %r13
jge 0x6d73c
movq (%r15,%r13,8), %rax
movswl (%rax), %esi
movl %ebp, %ecx
sarl %cl, %esi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x6db99
incq %r13
jmp 0x6d715
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 0x6d773
movl 0x70(%rbx), %ecx
testl %ecx, %ecx
jne 0x6d76e
movl 0x74(%rbx), %ecx
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x74(%rbx)
movl %eax, %ecx
decl %ecx
movl %ecx, 0x70(%rbx)
pushq $0x1
popq %rax
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/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 $0x28, %rsp
movq %rdi, %rbx
movq 0x1f0(%rdi), %rdi
movq %rdi, 0x8(%rsp)
callq 0x6dc57
movl 0x19c(%rbx), %ebp
xorl %eax, %eax
testl %ebp, %ebp
setne %al
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
shll $0x5, %eax
leaq (%rbx,%rax), %r15
addq $0x80, %r15
xorl %r12d, %r12d
pushq $0x18
popq %r13
movslq 0x144(%rbx), %rax
cmpq %rax, %r12
jge 0x6da89
movq 0x148(%rbx,%r12,8), %rax
movq %r13, %rcx
testl %ebp, %ebp
je 0x6da78
movslq (%rax,%rcx), %r14
cmpl $0x0, 0x10(%rsp,%r14,4)
jne 0x6da84
movq (%r15,%r14,8), %rsi
testq %rsi, %rsi
jne 0x6da58
movq %rbx, %rdi
callq 0x79138
movq %rax, %rsi
movq %rax, (%r15,%r14,8)
movq 0x8(%rsp), %rax
movq 0x98(%rax,%r14,8), %rdx
movq %rbx, %rdi
callq 0x6c62b
movl $0x1, 0x10(%rsp,%r14,4)
jmp 0x6da84
cmpl $0x0, 0x1a4(%rbx)
pushq $0x14
popq %rcx
je 0x6da34
incq %r12
jmp 0x6da19
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/jcphuff.c
// Function: finish_pass_phuff
METHODDEF(void)
finish_pass_phuff (j_compress_ptr cinfo)
{   
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;

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

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

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rax
movq 0x1f0(%rdi), %r14
movq (%rax), %rcx
movq %rcx, 0x20(%r14)
movq 0x8(%rax), %rax
movq %rax, 0x28(%r14)
movq %r14, %rdi
callq 0x6dc57
movq %r14, %rdi
callq 0x6dcc9
movq 0x20(%r14), %rax
movq 0x28(%rbx), %rcx
movq %rax, (%rcx)
movq 0x28(%r14), %rax
movq %rax, 0x8(%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6dc57
cmpl $0x0, 0x18(%rbx)
jne 0x6db3d
movq %rbx, %rdi
callq 0x6dcc9
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb $-0x1, (%rax)
decq 0x28(%rbx)
jne 0x6db1c
movq %rbx, %rdi
callq 0x6dce3
addb $-0x30, %bpl
movq 0x20(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rbx)
movb %bpl, (%rax)
decq 0x28(%rbx)
jne 0x6db3d
movq %rbx, %rdi
callq 0x6dce3
movq 0x40(%rbx), %rax
cmpl $0x0, 0x19c(%rax)
je 0x6db56
andq $0x0, 0x5c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %ecx, %ecx
movslq 0x144(%rax), %rdx
cmpq %rdx, %rcx
jge 0x6db4f
andl $0x0, 0x48(%rbx,%rcx,4)
incq %rcx
jmp 0x6db58
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6dcc8
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
cmpl $0x2, %eax
jb 0x6dc79
sarl %eax
incl %ebp
addl $0x10, %r14d
jmp 0x6dc6a
cmpl $0xf, %ebp
jb 0x6dc8e
movq 0x40(%rbx), %rdi
movq (%rdi), %rax
movl $0x28, 0x28(%rax)
callq *(%rax)
movl 0x58(%rbx), %esi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x6db6e
testl %ebp, %ebp
je 0x6dcad
movl 0x5c(%rbx), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x6db99
andl $0x0, 0x5c(%rbx)
movq 0x68(%rbx), %rsi
movl 0x60(%rbx), %edx
movq %rbx, %rdi
callq 0x6dd21
andl $0x0, 0x60(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6dd61
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
cmpl $0x0, 0x18(%rdi)
jne 0x6dd59
movq %rsi, %rbx
movl %edx, %r15d
xorl %r12d, %r12d
pushq $0x1
popq %rbp
movsbl (%rbx,%r12), %esi
movq %r14, %rdi
movl %ebp, %edx
callq 0x6db99
incq %r12
cmpl %r12d, %r15d
jne 0x6dd42
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcdctmgr.c
// Function: jinit_forward_dct
GLOBAL(void)
jinit_forward_dct (j_compress_ptr cinfo)
{
  my_fdct_ptr fdct;
  int i;

  fdct = (my_fdct_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_fdct_controller));
  cinfo->fdct = (struct jpeg_forward_dct *) fdct;
  fdct->pub.start_pass = start_pass_fdctmgr;

  switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
  case JDCT_ISLOW:
    fdct->pub.forward_DCT = forward_DCT;
    fdct->do_dct = jpeg_fdct_islow;
    break;
#endif
#ifdef DCT_IFAST_SUPPORTED
  case JDCT_IFAST:
    fdct->pub.forward_DCT = forward_DCT;
    fdct->do_dct = jpeg_fdct_ifast;
    break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
  case JDCT_FLOAT:
    fdct->pub.forward_DCT = forward_DCT_float;
    fdct->do_float_dct = jpeg_fdct_float;
    break;
#endif
  default:
    ERREXIT(cinfo, JERR_NOT_COMPILED);
    break;
  }

  /* Mark divisor tables unallocated */
  for (i = 0; i < NUM_QUANT_TBLS; i++) {
    fdct->divisors[i] = NULL;
#ifdef DCT_FLOAT_SUPPORTED
    fdct->float_divisors[i] = NULL;
#endif
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rax
pushq $0x1
popq %rsi
pushq $0x60
popq %rdx
callq *(%rax)
movq %rax, %rbx
movq %rax, 0x1e8(%r14)
leaq 0x8c(%rip), %rax        # 0x6de14
movq %rax, (%rbx)
movl 0x114(%r14), %eax
cmpl $0x2, %eax
je 0x6ddcc
cmpl $0x1, %eax
je 0x6ddb4
testl %eax, %eax
jne 0x6dde4
leaq 0x286(%rip), %rax       # 0x6e02d
movq %rax, 0x8(%rbx)
leaq 0x992(%rip), %rax       # 0x6e744
jmp 0x6ddc6
leaq 0x272(%rip), %rax       # 0x6e02d
movq %rax, 0x8(%rbx)
leaq 0x4ce(%rip), %rax       # 0x6e294
movq %rax, 0x10(%rbx)
jmp 0x6ddf3
leaq 0x377(%rip), %rax       # 0x6e14a
movq %rax, 0x8(%rbx)
leaq 0x6be(%rip), %rax       # 0x6e49c
movq %rax, 0x38(%rbx)
jmp 0x6ddf3
movq (%r14), %rax
movl $0x30, 0x28(%rax)
movq %r14, %rdi
callq *(%rax)
xorl %eax, %eax
cmpq $0x4, %rax
je 0x6de0c
andq $0x0, 0x18(%rbx,%rax,8)
andq $0x0, 0x40(%rbx,%rax,8)
incq %rax
jmp 0x6ddf5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapimin.c
// Function: jpeg_CreateDecompress
GLOBAL(void)
jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)
{
  int i;

  /* Guard against version mismatches between library and caller. */
  cinfo->mem = NULL;		/* so jpeg_destroy knows mem mgr not called */
  if (version != JPEG_LIB_VERSION)
    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
  if (structsize != SIZEOF(struct jpeg_decompress_struct))
    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, 
	     (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);

  /* For debugging purposes, we zero the whole master structure.
   * But the application has already set the err pointer, and may have set
   * client_data, so we have to save and restore those fields.
   * Note: if application hasn't set client_data, tools like Purify may
   * complain here.
   */
  {
    struct jpeg_error_mgr * err = cinfo->err;
    void * client_data = cinfo->client_data; /* ignore Purify complaint here */
    MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));
    cinfo->err = err;
    cinfo->client_data = client_data;
  }
  cinfo->is_decompressor = TRUE;

  /* Initialize a memory manager instance for this object */
  jinit_memory_mgr((j_common_ptr) cinfo);

  /* Zero out pointers to permanent structures. */
  cinfo->progress = NULL;
  cinfo->src = NULL;

  for (i = 0; i < NUM_QUANT_TBLS; i++)
    cinfo->quant_tbl_ptrs[i] = NULL;

  for (i = 0; i < NUM_HUFF_TBLS; i++) {
    cinfo->dc_huff_tbl_ptrs[i] = NULL;
    cinfo->ac_huff_tbl_ptrs[i] = NULL;
  }

  /* Initialize marker processor so application can override methods
   * for COM, APPn markers before calling jpeg_read_header.
   */
  cinfo->marker_list = NULL;
  jinit_marker_reader(cinfo);

  /* And initialize the overall input controller. */
  jinit_input_controller(cinfo);

  /* OK, I'm ready */
  cinfo->global_state = DSTATE_START;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
andq $0x0, 0x8(%rdi)
cmpl $0x3e, %esi
je 0x6eaa0
movq (%rbx), %rax
movabsq $0x3e0000000c, %rcx     # imm = 0x3E0000000C
movq %rcx, 0x28(%rax)
movq (%rbx), %rax
movl %esi, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpq $0x278, %r14            # imm = 0x278
je 0x6eac9
movq (%rbx), %rax
movabsq $0x27800000015, %rcx    # imm = 0x27800000015
movq %rcx, 0x28(%rax)
movq (%rbx), %rax
movl %r14d, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq (%rbx), %r14
movq 0x18(%rbx), %r15
leaq 0x8(%rbx), %rdi
movl $0x270, %edx            # imm = 0x270
xorl %esi, %esi
callq 0xe270
movq %r14, (%rbx)
movq %r15, 0x18(%rbx)
movl $0x1, 0x20(%rbx)
movq %rbx, %rdi
callq 0x793b4
andq $0x0, 0x10(%rbx)
andq $0x0, 0x28(%rbx)
pushq $0x19
popq %rax
cmpq $0x1d, %rax
je 0x6eb13
andq $0x0, (%rbx,%rax,8)
incq %rax
jmp 0x6eb03
pushq $0x21
popq %rax
cmpq $0x25, %rax
je 0x6eb2c
andq $0x0, -0x20(%rbx,%rax,8)
andq $0x0, (%rbx,%rax,8)
incq %rax
jmp 0x6eb16
andq $0x0, 0x190(%rbx)
movq %rbx, %rdi
callq 0x702f6
movq %rbx, %rdi
callq 0x6fb70
movl $0xc8, 0x24(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapimin.c
// Function: jpeg_read_header
GLOBAL(int)
jpeg_read_header (j_decompress_ptr cinfo, jboolean require_image)
{
  int retcode;

  if (cinfo->global_state != DSTATE_START &&
      cinfo->global_state != DSTATE_INHEADER)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  retcode = jpeg_consume_input(cinfo);

  switch (retcode) {
  case JPEG_REACHED_SOS:
    retcode = JPEG_HEADER_OK;
    break;
  case JPEG_REACHED_EOI:
    if (require_image)		/* Complain if application wanted an image */
      ERREXIT(cinfo, JERR_NO_IMAGE);
    /* Reset to start state; it would be safer to require the application to
     * call jpeg_abort, but we can't change it now for compatibility reasons.
     * A side effect is to free any temporary memory (there shouldn't be any).
     */
    jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */
    retcode = JPEG_HEADER_TABLES_ONLY;
    break;
  case JPEG_SUSPENDED:
    /* no work */
    break;
  }

  return retcode;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl 0x24(%rdi), %eax
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0xc8, %ecx
je 0x6eb89
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x6ebbc
movl %eax, %r14d
cmpl $0x2, %eax
jne 0x6ebb4
testl %ebp, %ebp
je 0x6ebac
movq (%rbx), %rax
movl $0x33, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0x790d0
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapimin.c
// Function: jpeg_finish_decompress
GLOBAL(jboolean)
jpeg_finish_decompress (j_decompress_ptr cinfo)
{
  if ((cinfo->global_state == DSTATE_SCANNING ||
       cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {
    /* Terminate final pass of non-buffered mode */
    if (cinfo->output_scanline < cinfo->output_height)
      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
    (*cinfo->master->finish_output_pass) (cinfo);
    cinfo->global_state = DSTATE_STOPPING;
  } else if (cinfo->global_state == DSTATE_BUFIMAGE) {
    /* Finishing after a buffered-image operation */
    cinfo->global_state = DSTATE_STOPPING;
  } else if (cinfo->global_state != DSTATE_STOPPING) {
    /* STOPPING = repeat call after a suspension, anything else is error */
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  }
  /* Read until EOI */
  while (! cinfo->inputctl->eoi_reached) {
    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
      return FALSE;		/* Suspend, come back later */
  }
  /* Do final cleanup */
  (*cinfo->src->term_source) (cinfo);
  /* We can use jpeg_abort to release memory and reset global_state */
  jpeg_abort((j_common_ptr) cinfo);
  return TRUE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %eax
leal -0xcd(%rax), %ecx
cmpl $0x1, %ecx
ja 0x6ee54
cmpl $0x0, 0x58(%rbx)
je 0x6ee79
cmpl $0xd2, %eax
je 0x6eeaa
cmpl $0xcf, %eax
je 0x6eea3
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
jmp 0x6eeaa
movl 0xa8(%rbx), %eax
cmpl 0x8c(%rbx), %eax
jae 0x6ee96
movq (%rbx), %rax
movl $0x43, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl $0xd2, 0x24(%rbx)
movq 0x240(%rbx), %rax
cmpl $0x0, 0x24(%rax)
jne 0x6eec4
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
jne 0x6eeaa
xorl %eax, %eax
jmp 0x6eed9
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq %rbx, %rdi
callq 0x790d0
pushq $0x1
popq %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_start_decompress
GLOBAL(jboolean)
jpeg_start_decompress (j_decompress_ptr cinfo)
{
  if (cinfo->global_state == DSTATE_READY) {
    /* First call: initialize master control, select active modules */
    jinit_master_decompress(cinfo);
    if (cinfo->buffered_image) {
      /* No more work here; expecting jpeg_start_output next */
      cinfo->global_state = DSTATE_BUFIMAGE;
      return TRUE;
    }
    cinfo->global_state = DSTATE_PRELOAD;
  }
  if (cinfo->global_state == DSTATE_PRELOAD) {
    /* If file has multiple scans, absorb them all into the coef buffer */
    if (cinfo->inputctl->has_multiple_scans) {
#ifdef D_MULTISCAN_FILES_SUPPORTED
      for (;;) {
	int retcode;
	/* Call progress monitor hook if present */
	if (cinfo->progress != NULL)
	  (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
	/* Absorb some more input */
	retcode = (*cinfo->inputctl->consume_input) (cinfo);
	if (retcode == JPEG_SUSPENDED)
	  return FALSE;
	if (retcode == JPEG_REACHED_EOI)
	  break;
	/* Advance progress counter if appropriate */
	if (cinfo->progress != NULL &&
	    (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
	  if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
	    /* jdmaster underestimated number of scans; ratchet up one scan */
	    cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;
	  }
	}
      }
#else
      ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif /* D_MULTISCAN_FILES_SUPPORTED */
    }
    cinfo->output_scan_number = cinfo->input_scan_number;
  } else if (cinfo->global_state != DSTATE_PRESCAN)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  /* Perform any dummy output passes, and set up for the final pass */
  return output_pass_setup(cinfo);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0xcc, %eax
je 0x6efaa
cmpl $0xcb, %eax
je 0x6ef34
cmpl $0xca, %eax
jne 0x6ef16
movq %rbx, %rdi
callq 0x6f6db
cmpl $0x0, 0x58(%rbx)
je 0x6ef2d
movl $0xcf, 0x24(%rbx)
pushq $0x1
popq %rax
popq %rbx
retq
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
jmp 0x6efaa
movl $0xcb, 0x24(%rbx)
movq 0x240(%rbx), %rax
cmpl $0x0, 0x20(%rax)
je 0x6ef9e
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x6ef4f
movq %rbx, %rdi
callq *(%rcx)
movq 0x240(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
je 0x6ef14
cmpl $0x2, %eax
je 0x6ef9e
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
sete %dl
andl $-0x3, %eax
cmpl $0x1, %eax
setne %al
orb %dl, %al
jne 0x6ef45
movq 0x8(%rcx), %rdx
movq 0x10(%rcx), %rax
incq %rdx
movq %rdx, 0x8(%rcx)
cmpq %rax, %rdx
jl 0x6ef45
movl 0x1a4(%rbx), %edx
addq %rdx, %rax
movq %rax, 0x10(%rcx)
jmp 0x6ef45
movl 0xac(%rbx), %eax
movl %eax, 0xb4(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x6efb0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: output_pass_setup
LOCAL(jboolean)
output_pass_setup (j_decompress_ptr cinfo)
{
  if (cinfo->global_state != DSTATE_PRESCAN) {
    /* First call: do pass setup */
    (*cinfo->master->prepare_for_output_pass) (cinfo);
    cinfo->output_scanline = 0;
    cinfo->global_state = DSTATE_PRESCAN;
  }
  /* Loop over any required dummy passes */
  while (cinfo->master->is_dummy_pass) {
#ifdef QUANT_2PASS_SUPPORTED
    /* Crank through the dummy pass */
    while (cinfo->output_scanline < cinfo->output_height) {
      JDIMENSION last_scanline;
      /* Call progress monitor hook if present */
      if (cinfo->progress != NULL) {
	cinfo->progress->pass_counter = (long) cinfo->output_scanline;
	cinfo->progress->pass_limit = (long) cinfo->output_height;
	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
      }
      /* Process some data */
      last_scanline = cinfo->output_scanline;
      (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,
				    &cinfo->output_scanline, (JDIMENSION) 0);
      if (cinfo->output_scanline == last_scanline)
	return FALSE;		/* No progress made, must suspend */
    }
    /* Finish up dummy pass, and set up for another one */
    (*cinfo->master->finish_output_pass) (cinfo);
    (*cinfo->master->prepare_for_output_pass) (cinfo);
    cinfo->output_scanline = 0;
#else
    ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif /* QUANT_2PASS_SUPPORTED */
  }
  /* Ready for application to drive output pass through
   * jpeg_read_scanlines or jpeg_read_raw_data.
   */
  cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0xcc, 0x24(%rdi)
je 0x6efdd
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
andl $0x0, 0xa8(%rbx)
movl $0xcc, 0x24(%rbx)
leaq 0xa8(%rbx), %r14
movq 0x220(%rbx), %rax
cmpl $0x0, 0x10(%rax)
je 0x6f063
movl (%r14), %ebp
movl 0x8c(%rbx), %eax
cmpl %eax, %ebp
jae 0x6f041
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x6f01c
movl %ebp, %edx
movq %rdx, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq %rbx, %rdi
callq *(%rcx)
movl 0xa8(%rbx), %ebp
movq 0x228(%rbx), %rax
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq *0x8(%rax)
movl 0xa8(%rbx), %eax
cmpl %ebp, %eax
movl %eax, %ebp
jne 0x6eff4
jmp 0x6f076
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
andl $0x0, 0xa8(%rbx)
jmp 0x6efe4
cmpl $0x1, 0x5c(%rbx)
movl $0xce, %eax
sbbl $0x0, %eax
movl %eax, 0x24(%rbx)
pushq $0x1
popq %r15
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_read_scanlines
GLOBAL(JDIMENSION)
jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,
		     JDIMENSION max_lines)
{
  JDIMENSION row_ctr;

  if (cinfo->global_state != DSTATE_SCANNING)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  if (cinfo->output_scanline >= cinfo->output_height) {
    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
    return 0;
  }

  /* Call progress monitor hook if present */
  if (cinfo->progress != NULL) {
    cinfo->progress->pass_counter = (long) cinfo->output_scanline;
    cinfo->progress->pass_limit = (long) cinfo->output_height;
    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  }

  /* Process some data */
  row_ctr = 0;
  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
  cinfo->output_scanline += row_ctr;
  return row_ctr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0xcd, %eax
je 0x6f0b2
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x8c(%rbx), %eax
movl 0xa8(%rbx), %ecx
cmpl %eax, %ecx
jae 0x6f101
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x6f0d8
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
callq *(%rdx)
leaq 0x4(%rsp), %r15
andl $0x0, (%r15)
movq 0x228(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq *0x8(%rax)
movl (%r15), %eax
addl %eax, 0xa8(%rbx)
jmp 0x6f116
movq (%rbx), %rax
movl $0x7b, 0x28(%rax)
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_read_raw_data
GLOBAL(JDIMENSION)
jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
		    JDIMENSION max_lines)
{
  JDIMENSION lines_per_iMCU_row;

  if (cinfo->global_state != DSTATE_RAW_OK)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  if (cinfo->output_scanline >= cinfo->output_height) {
    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
    return 0;
  }

  /* Call progress monitor hook if present */
  if (cinfo->progress != NULL) {
    cinfo->progress->pass_counter = (long) cinfo->output_scanline;
    cinfo->progress->pass_limit = (long) cinfo->output_height;
    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  }

  /* Verify that at least one iMCU row can be returned. */
  lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size;
  if (max_lines < lines_per_iMCU_row)
    ERREXIT(cinfo, JERR_BUFFER_SIZE);

  /* Decompress directly into user's buffer. */
  if (! (*cinfo->coef->decompress_data) (cinfo, data))
    return 0;			/* suspension forced, can do nothing more */

  /* OK, we processed one iMCU row. */
  cinfo->output_scanline += lines_per_iMCU_row;
  return lines_per_iMCU_row;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0xce, %eax
je 0x6f14f
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x8c(%rbx), %eax
movl 0xa8(%rbx), %ecx
cmpl %eax, %ecx
jae 0x6f1b5
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x6f175
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
callq *(%rdx)
movl 0x1a0(%rbx), %r15d
imull 0x19c(%rbx), %r15d
cmpl %ebp, %r15d
jbe 0x6f198
movq (%rbx), %rax
movl $0x17, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x230(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x18(%rax)
testl %eax, %eax
je 0x6f1c8
addl %r15d, 0xa8(%rbx)
jmp 0x6f1cb
movq (%rbx), %rax
movl $0x7b, 0x28(%rax)
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq *0x8(%rax)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_start_output
GLOBAL(jboolean)
jpeg_start_output (j_decompress_ptr cinfo, int scan_number)
{
  if (cinfo->global_state != DSTATE_BUFIMAGE &&
      cinfo->global_state != DSTATE_PRESCAN)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  /* Limit scan number to valid range */
  if (scan_number <= 0)
    scan_number = 1;
  if (cinfo->inputctl->eoi_reached &&
      scan_number > cinfo->input_scan_number)
    scan_number = cinfo->input_scan_number;
  cinfo->output_scan_number = scan_number;
  /* Perform any dummy output passes, and set up for the real pass */
  return output_pass_setup(cinfo);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0xcc, %eax
je 0x6f207
cmpl $0xcf, %eax
je 0x6f207
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl $0x2, %ebp
pushq $0x1
popq %rax
cmovgel %ebp, %eax
movq 0x240(%rbx), %rcx
cmpl $0x0, 0x24(%rcx)
je 0x6f228
movl 0xac(%rbx), %ecx
cmpl %ecx, %eax
cmovgel %ecx, %eax
movl %eax, 0xb4(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6efb0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdapistd.c
// Function: jpeg_finish_output
GLOBAL(jboolean)
jpeg_finish_output (j_decompress_ptr cinfo)
{
  if ((cinfo->global_state == DSTATE_SCANNING ||
       cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
    /* Terminate this pass. */
    /* We do not require the whole pass to have been completed. */
    (*cinfo->master->finish_output_pass) (cinfo);
    cinfo->global_state = DSTATE_BUFPOST;
  } else if (cinfo->global_state != DSTATE_BUFPOST) {
    /* BUFPOST = repeat call after a suspension, anything else is error */
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  }
  /* Read markers looking for SOS or EOI */
  while (cinfo->input_scan_number <= cinfo->output_scan_number &&
	 ! cinfo->inputctl->eoi_reached) {
    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
      return FALSE;		/* Suspend, come back later */
  }
  cinfo->global_state = DSTATE_BUFIMAGE;
  return TRUE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %eax
leal -0xcd(%rax), %ecx
cmpl $0x1, %ecx
ja 0x6f26a
cmpl $0x0, 0x58(%rbx)
je 0x6f271
movq 0x220(%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movl $0xd0, 0x24(%rbx)
jmp 0x6f286
cmpl $0xd0, %eax
je 0x6f286
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0xac(%rbx), %eax
cmpl 0xb4(%rbx), %eax
jg 0x6f2ae
movq 0x240(%rbx), %rax
cmpl $0x0, 0x24(%rax)
jne 0x6f2ae
movq %rbx, %rdi
callq *(%rax)
testl %eax, %eax
jne 0x6f286
xorl %eax, %eax
jmp 0x6f2b8
movl $0xcf, 0x24(%rbx)
pushq $0x1
popq %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdatasrc.c
// Function: jpeg_stdio_src
GLOBAL(void)
jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
{
  my_src_ptr src;

  /* The source object and input buffer are made permanent so that a series
   * of JPEG images can be read from the same file by calling jpeg_stdio_src
   * only before the first one.  (If we discarded the buffer at the end of
   * one image, we'd likely lose the start of the next one.)
   * This makes it unsafe to use this manager and a different source
   * manager serially with the same JPEG object.  Caveat programmer.
   */
  if (cinfo->src == NULL) {	/* first time for this JPEG object? */
    cinfo->src = (struct jpeg_source_mgr *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
				  SIZEOF(my_source_mgr));
    src = (my_src_ptr) cinfo->src;
    src->buffer = (JOCTET *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
				  INPUT_BUF_SIZE * SIZEOF(JOCTET));
  }

  src = (my_src_ptr) cinfo->src;
  src->pub.init_source = init_source;
  src->pub.fill_input_buffer = fill_input_buffer;
  src->pub.skip_input_data = skip_input_data;
  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
  src->pub.term_source = term_source;
  src->infile = infile;
  src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
  src->pub.next_input_byte = NULL; /* until buffer loaded */
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq 0x28(%rdi), %rax
testq %rax, %rax
jne 0x6f2fa
movq %rdi, %r14
movq 0x8(%rdi), %rax
pushq $0x50
popq %rdx
xorl %esi, %esi
callq *(%rax)
movq %rax, %r15
movq %rax, 0x28(%r14)
movq 0x8(%r14), %rax
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movq %rax, 0x40(%r15)
movq 0x28(%r14), %rax
leaq 0x40(%rip), %rcx        # 0x6f341
movq %rcx, 0x10(%rax)
leaq 0x41(%rip), %rcx        # 0x6f34d
movq %rcx, 0x18(%rax)
leaq 0xb1(%rip), %rcx        # 0x6f3c8
movq %rcx, 0x20(%rax)
leaq 0xdd6(%rip), %rcx       # 0x700f8
movq %rcx, 0x28(%rax)
leaq 0xd5(%rip), %rcx        # 0x6f402
movq %rcx, 0x30(%rax)
movq %rbx, 0x38(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdatasrc.c
// Function: fill_input_buffer
METHODDEF(jboolean)
fill_input_buffer (j_decompress_ptr cinfo)
{
  my_src_ptr src = (my_src_ptr) cinfo->src;
  size_t nbytes;

  nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);

  if (nbytes <= 0) {
    if (src->start_of_file)	/* Treat empty input file as fatal error */
      ERREXIT(cinfo, JERR_INPUT_EMPTY);
    WARNMS(cinfo, JWRN_JPEG_EOF);
    /* Insert a fake EOI marker */
    src->buffer[0] = (JOCTET) 0xFF;
    src->buffer[1] = (JOCTET) JPEG_EOI;
    nbytes = 2;
  }

  src->pub.next_input_byte = src->buffer;
  src->pub.bytes_in_buffer = nbytes;
  src->start_of_file = FALSE;

  return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movq 0x38(%r14), %rcx
movq 0x40(%r14), %rdi
pushq $0x1
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0xe6f0
testq %rax, %rax
jne 0x6f3ad
cmpl $0x0, 0x48(%r14)
je 0x6f388
movq (%rbx), %rax
movl $0x2a, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq (%rbx), %rax
movl $0x78, 0x28(%rax)
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x40(%r14), %rax
movb $-0x1, (%rax)
movq 0x40(%r14), %rax
movb $-0x27, 0x1(%rax)
pushq $0x2
popq %rax
movq 0x40(%r14), %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
andl $0x0, 0x48(%r14)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdatasrc.c
// Function: skip_input_data
METHODDEF(void)
skip_input_data (j_decompress_ptr cinfo, long num_bytes)
{
  my_src_ptr src = (my_src_ptr) cinfo->src;

  /* Just a dumb implementation for now.  Could use fseek() except
   * it doesn't work on pipes.  Not clear that being smart is worth
   * any trouble anyway --- large skips are infrequent.
   */
  if (num_bytes > 0) {
    while (num_bytes > (long) src->pub.bytes_in_buffer) {
      num_bytes -= (long) src->pub.bytes_in_buffer;
      (void) fill_input_buffer(cinfo);
      /* note we assume that fill_input_buffer will never return FALSE,
       * so suspension need not be handled.
       */
    }
    src->pub.next_input_byte += (size_t) num_bytes;
    src->pub.bytes_in_buffer -= (size_t) num_bytes;
  }
}

// Assembly:
testq %rsi, %rsi
jle 0x6f401
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movq %rsi, %r15
movq 0x8(%r14), %rax
subq %rax, %r15
jle 0x6f3f2
movq %rbx, %rdi
callq 0x6f34d
movq %r15, %rsi
jmp 0x6f3dc
addq %rsi, (%r14)
subq %rsi, %rax
movq %rax, 0x8(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmaster.c
// Function: use_merged_upsample
LOCAL(jboolean)
use_merged_upsample (j_decompress_ptr cinfo)
{
#ifdef UPSAMPLE_MERGING_SUPPORTED
  /* Merging is the equivalent of plain box-filter upsampling */
  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
    return FALSE;
  /* jdmerge.c only supports YCC=>RGB color conversion */
  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
      cinfo->out_color_space != JCS_RGB ||
      cinfo->out_color_components != RGB_PIXELSIZE)
    return FALSE;
  /* and it only handles 2h1v or 2h2v sampling ratios */
  if (cinfo->comp_info[0].h_samp_factor != 2 ||
      cinfo->comp_info[1].h_samp_factor != 1 ||
      cinfo->comp_info[2].h_samp_factor != 1 ||
      cinfo->comp_info[0].v_samp_factor >  2 ||
      cinfo->comp_info[1].v_samp_factor != 1 ||
      cinfo->comp_info[2].v_samp_factor != 1)
    return FALSE;
  /* furthermore, it doesn't work if we've scaled the IDCTs differently */
  if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
      cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size ||
      cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size)
    return FALSE;
  /* ??? also need to test for upsample-time rescaling, when & if supported */
  return TRUE;			/* by golly, it'll work... */
#else
  return FALSE;
#endif
}

// Assembly:
xorl %eax, %eax
cmpl $0x0, 0x64(%rdi)
je 0x6f5ed
retq
cmpl $0x0, 0x188(%rdi)
jne 0x6f5ec
cmpl $0x3, 0x3c(%rdi)
jne 0x6f5ec
cmpl $0x3, 0x38(%rdi)
jne 0x6f5ec
cmpl $0x2, 0x40(%rdi)
jne 0x6f5ec
cmpl $0x3, 0x90(%rdi)
jne 0x6f5ec
movq 0x130(%rdi), %rcx
cmpl $0x2, 0x8(%rcx)
jne 0x6f5ec
cmpl $0x1, 0x68(%rcx)
jne 0x6f5ec
cmpl $0x1, 0xc8(%rcx)
jne 0x6f5ec
cmpl $0x2, 0xc(%rcx)
jg 0x6f5ec
cmpl $0x1, 0x6c(%rcx)
jne 0x6f5ec
cmpl $0x1, 0xcc(%rcx)
jne 0x6f5ec
movl 0x24(%rcx), %edx
cmpl 0x1a0(%rdi), %edx
jne 0x6f5ec
cmpl %edx, 0x84(%rcx)
jne 0x6f5ec
xorl %eax, %eax
cmpl %edx, 0xe4(%rcx)
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmaster.c
// Function: jpeg_new_colormap
GLOBAL(void)
jpeg_new_colormap (j_decompress_ptr cinfo)
{
  my_master_ptr master = (my_master_ptr) cinfo->master;

  /* Prevent application from calling me at wrong times */
  if (cinfo->global_state != DSTATE_BUFIMAGE)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  if (cinfo->quantize_colors && cinfo->enable_external_quant &&
      cinfo->colormap != NULL) {
    /* Select 2-pass quantizer for external colormap use */
    cinfo->cquantize = master->quantizer_2pass;
    /* Notify quantizer of colormap change */
    (*cinfo->cquantize->new_color_map) (cinfo);
    master->pub.is_dummy_pass = FALSE; /* just in case */
  } else
    ERREXIT(cinfo, JERR_MODE_CHANGE);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x220(%rdi), %r14
movl 0x24(%rdi), %eax
cmpl $0xcf, %eax
je 0x6f68e
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
cmpl $0x0, 0x6c(%rbx)
je 0x6f6c5
cmpl $0x0, 0x80(%rbx)
je 0x6f6c5
cmpq $0x0, 0xa0(%rbx)
je 0x6f6c5
movq 0x28(%r14), %rax
movq %rax, 0x270(%rbx)
movq %rbx, %rdi
callq *0x18(%rax)
andl $0x0, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq (%rbx), %rax
movl $0x2e, 0x28(%rax)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmaster.c
// Function: finish_output_pass
METHODDEF(void)
finish_output_pass (j_decompress_ptr cinfo)
{
  my_master_ptr master = (my_master_ptr) cinfo->master;

  if (cinfo->quantize_colors)
    (*cinfo->cquantize->finish_pass) (cinfo);
  master->pass_number++;
}

// Assembly:
pushq %rbx
movq 0x220(%rdi), %rbx
cmpl $0x0, 0x6c(%rdi)
je 0x6fb6b
movq 0x270(%rdi), %rax
callq *0x10(%rax)
incl 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdinput.c
// Function: reset_input_controller
METHODDEF(void)
reset_input_controller (j_decompress_ptr cinfo)
{
  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;

  inputctl->pub.consume_input = consume_markers;
  inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
  inputctl->pub.eoi_reached = FALSE;
  inputctl->inheaders = TRUE;
  /* Reset other modules */
  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
  (*cinfo->marker->reset_marker_reader) (cinfo);
  /* Reset progression state -- would be cleaner if entropy decoder did this */
  cinfo->coef_bits = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x240(%rdi), %rax
leaq -0x2d2(%rip), %rcx      # 0x6fbbf
movq %rcx, (%rax)
andq $0x0, 0x20(%rax)
movl $0x1, 0x28(%rax)
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x248(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
andq $0x0, 0xc0(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdinput.c
// Function: start_input_pass
METHODDEF(void)
start_input_pass (j_decompress_ptr cinfo)
{
  per_scan_setup(cinfo);
  latch_quant_tables(cinfo);
  (*cinfo->entropy->start_pass) (cinfo);
  (*cinfo->coef->start_input_pass) (cinfo);
  cinfo->inputctl->consume_input = cinfo->coef->consume_data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x1b0(%rdi), %eax
cmpl $0x1, %eax
jne 0x6ffea
pushq $0x1
popq %rcx
movq 0x1b8(%rbx), %rsi
movl 0x1c(%rsi), %eax
movl %eax, 0x1d8(%rbx)
movl 0x20(%rsi), %eax
movl %eax, 0x1dc(%rbx)
movabsq $0x100000001, %rdx      # imm = 0x100000001
movq %rdx, 0x34(%rsi)
movl %ecx, 0x3c(%rsi)
movl 0xc(%rsi), %edi
movl 0x24(%rsi), %edx
movl %edx, 0x40(%rsi)
movl %ecx, 0x44(%rsi)
xorl %edx, %edx
divl %edi
testl %edx, %edx
cmovel %edi, %edx
movl %edx, 0x48(%rsi)
movq $0x1, 0x1e0(%rbx)
xorl %r15d, %r15d
pushq $0x1
popq %rbp
movslq %ecx, %rax
cmpq %rax, %r15
jge 0x6ffae
movq 0x1b8(%rbx,%r15,8), %r12
cmpq $0x0, 0x50(%r12)
jne 0x6ffa9
movl 0x10(%r12), %r14d
cmpq $0x3, %r14
ja 0x6ff5d
cmpq $0x0, 0xc8(%rbx,%r14,8)
jne 0x6ff73
movq (%rbx), %rax
movl $0x34, 0x28(%rax)
movl %r14d, 0x2c(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movslq %r14d, %r13
movq 0x8(%rbx), %rax
movl $0x84, %edx
movq %rbx, %rdi
movl %ebp, %esi
callq *(%rax)
movq %rax, %r14
movq 0xc8(%rbx,%r13,8), %rsi
movl $0x84, %edx
movq %rax, %rdi
callq 0xe380
movq %r14, 0x50(%r12)
movl 0x1b0(%rbx), %ecx
incq %r15
jmp 0x6ff2f
movq 0x250(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq 0x230(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq 0x230(%rbx), %rax
movq 0x240(%rbx), %rcx
movq 0x8(%rax), %rax
movq %rax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal -0x5(%rax), %ecx
cmpl $-0x5, %ecx
ja 0x70011
movq (%rbx), %rcx
movl $0x1a, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movl $0x4, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x30(%rbx), %edi
movslq 0x198(%rbx), %rsi
shlq $0x3, %rsi
callq 0x79150
movl %eax, 0x1d8(%rbx)
movl 0x34(%rbx), %edi
movslq 0x19c(%rbx), %rsi
shlq $0x3, %rsi
callq 0x79150
movl %eax, 0x1dc(%rbx)
andl $0x0, 0x1e0(%rbx)
xorl %r14d, %r14d
movslq 0x1b0(%rbx), %rcx
cmpq %rcx, %r14
jge 0x6ff29
movq 0x1b8(%rbx,%r14,8), %rcx
movl 0x8(%rcx), %esi
movl 0xc(%rcx), %edi
movl %esi, 0x34(%rcx)
movl %edi, 0x38(%rcx)
movl %edi, %ebp
imull %esi, %ebp
movl %ebp, 0x3c(%rcx)
movl 0x24(%rcx), %eax
imull %esi, %eax
movl %eax, 0x40(%rcx)
movl 0x1c(%rcx), %eax
xorl %edx, %edx
divl %esi
testl %edx, %edx
cmovel %esi, %edx
movl %edx, 0x44(%rcx)
movl 0x20(%rcx), %eax
xorl %edx, %edx
divl %edi
testl %edx, %edx
cmovel %edi, %edx
movl %edx, 0x48(%rcx)
movl 0x1e0(%rbx), %eax
addl %ebp, %eax
cmpl $0xb, %eax
jl 0x700d8
movq (%rbx), %rax
movl $0xd, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
jmp 0x700d8
decl %ebp
movslq 0x1e0(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x1e0(%rbx)
movl %r14d, 0x1e4(%rbx,%rax,4)
testl %ebp, %ebp
jg 0x700be
incq %r14
jmp 0x7004d
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: jpeg_resync_to_restart
GLOBAL(jboolean)
jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)
{
  int marker = cinfo->unread_marker;
  int action = 1;
  
  /* Always put up a warning. */
  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
  
  /* Outer loop handles repeated decision after scanning forward. */
  for (;;) {
    if (marker < (int) M_SOF0)
      action = 2;		/* invalid marker */
    else if (marker < (int) M_RST0 || marker > (int) M_RST7)
      action = 3;		/* valid non-restart marker */
    else {
      if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||
	  marker == ((int) M_RST0 + ((desired+2) & 7)))
	action = 3;		/* one of the next two expected restarts */
      else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||
	       marker == ((int) M_RST0 + ((desired-2) & 7)))
	action = 2;		/* a prior restart, so advance */
      else
	action = 1;		/* desired restart or too far away */
    }
    TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
    switch (action) {
    case 1:
      /* Discard marker and let entropy decoder resume processing. */
      cinfo->unread_marker = 0;
      return TRUE;
    case 2:
      /* Scan to the next marker, and repeat the decision loop. */
      if (! next_marker(cinfo))
	return FALSE;
      marker = cinfo->unread_marker;
      break;
    case 3:
      /* Return without advancing past this marker. */
      /* Entropy decoder will be forced to process an empty segment. */
      return TRUE;
    }
  } /* end loop */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl 0x21c(%rdi), %ebp
movq (%rdi), %rax
movl $0x79, 0x28(%rax)
movl %ebp, 0x2c(%rax)
movq (%rdi), %rax
movl %esi, 0x30(%rax)
movq (%rdi), %rax
pushq $-0x1
popq %rsi
callq *0x8(%rax)
leal 0x1(%r14), %r12d
andl $0x7, %r12d
movl $0xd0, %eax
orl %eax, %r12d
leal 0x2(%r14), %ecx
andl $0x7, %ecx
orl %eax, %ecx
movl %ecx, 0x4(%rsp)
leal -0x1(%r14), %ecx
andl $0x7, %ecx
orl %eax, %ecx
movl %ecx, (%rsp)
addl $0x6, %r14d
andl $0x7, %r14d
orl %eax, %r14d
pushq $0x3
popq %r13
pushq $0x2
popq %r15
cmpl $0xc0, %ebp
jge 0x701a9
movq (%rbx), %rax
movl $0x61, 0x28(%rax)
movl %ebp, 0x2c(%rax)
movq (%rbx), %rax
movl %r15d, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
pushq $0x4
popq %rsi
callq *0x8(%rax)
cmpl $0x2, %r15d
jne 0x701e0
movq %rbx, %rdi
callq 0x70203
testl %eax, %eax
je 0x701f2
movl 0x21c(%rbx), %ebp
jmp 0x70163
leal -0xd8(%rbp), %eax
movl %r13d, %r15d
cmpl $-0x8, %eax
jb 0x7016f
movl %r13d, %r15d
cmpl %r12d, %ebp
je 0x7016f
movl %r13d, %r15d
cmpl 0x4(%rsp), %ebp
je 0x7016f
pushq $0x2
popq %r15
cmpl (%rsp), %ebp
je 0x7016f
xorl %r15d, %r15d
cmpl %r14d, %ebp
sete %r15b
incl %r15d
jmp 0x7016f
cmpl $0x3, %r15d
je 0x701ed
andl $0x0, 0x21c(%rbx)
pushq $0x1
popq %rax
jmp 0x701f4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq