LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: next_marker
LOCAL(jboolean)
next_marker (j_decompress_ptr cinfo)
{
  int c;
  INPUT_VARS(cinfo);

  for (;;) {
    INPUT_BYTE(cinfo, c, return FALSE);
    /* Skip any non-FF bytes.
     * This may look a bit inefficient, but it will not occur in a valid file.
     * We sync after each discarded byte so that a suspending data source
     * can discard the byte from its buffer.
     */
    while (c != 0xFF) {
      cinfo->marker->discarded_bytes++;
      INPUT_SYNC(cinfo);
      INPUT_BYTE(cinfo, c, return FALSE);
    }
    /* This loop swallows any duplicate FF bytes.  Extra FFs are legal as
     * pad bytes, so don't count them in discarded_bytes.  We assume there
     * will not be so many consecutive FF bytes as to overflow a suspending
     * data source's input buffer.
     */
    do {
      INPUT_BYTE(cinfo, c, return FALSE);
    } while (c == 0xFF);
    if (c != 0)
      break;			/* found a valid marker, exit loop */
    /* Reach here if we found a stuffed-zero data sequence (FF/00).
     * Discard it and loop back to try again.
     */
    cinfo->marker->discarded_bytes += 2;
    INPUT_SYNC(cinfo);
  }

  if (cinfo->marker->discarded_bytes != 0) {
    WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
    cinfo->marker->discarded_bytes = 0;
  }

  cinfo->unread_marker = c;

  INPUT_SYNC(cinfo);
  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movq (%r14), %r15
movq 0x8(%r14), %r12
testq %r12, %r12
jne 0x70234
movq %rbx, %rdi
callq *0x18(%r14)
testl %eax, %eax
je 0x702eb
movq (%r14), %r15
movq 0x8(%r14), %r12
incq %r15
decq %r12
cmpb $-0x1, -0x1(%r15)
je 0x7025d
movq 0x248(%rbx), %rax
incl 0x24(%rax)
movq %r15, (%r14)
movq %r12, 0x8(%r14)
incq %r15
addq $-0x1, %r12
jb 0x7023a
jmp 0x7021e
testq %r12, %r12
jne 0x70274
movq %rbx, %rdi
callq *0x18(%r14)
testl %eax, %eax
je 0x702eb
movq (%r14), %r15
movq 0x8(%r14), %r12
decq %r12
movzbl (%r15), %ebp
incq %r15
cmpl $0xff, %ebp
je 0x7025d
testl %ebp, %ebp
jne 0x702a1
movq 0x248(%rbx), %rax
addl $0x2, 0x24(%rax)
movq %r15, (%r14)
movq %r12, 0x8(%r14)
jmp 0x70219
movq 0x248(%rbx), %rax
movl 0x24(%rax), %eax
testl %eax, %eax
je 0x702d9
movq (%rbx), %rcx
movl $0x74, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movl %ebp, 0x30(%rax)
movq (%rbx), %rax
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x248(%rbx), %rax
andl $0x0, 0x24(%rax)
movl %ebp, 0x21c(%rbx)
movq %r15, (%r14)
movq %r12, 0x8(%r14)
pushq $0x1
popq %rax
jmp 0x702ed
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: jinit_marker_reader
GLOBAL(void)
jinit_marker_reader (j_decompress_ptr cinfo)
{
  my_marker_ptr marker;
  int i;

  /* Create subobject in permanent pool */
  marker = (my_marker_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
				SIZEOF(my_marker_reader));
  cinfo->marker = (struct jpeg_marker_reader *) marker;
  /* Initialize public method pointers */
  marker->pub.reset_marker_reader = reset_marker_reader;
  marker->pub.read_markers = read_markers;
  marker->pub.read_restart_marker = read_restart_marker;
  /* Initialize COM/APPn processing.
   * By default, we examine and then discard APP0 and APP14,
   * but simply discard COM and all other APPn.
   */
  marker->process_COM = skip_variable;
  marker->length_limit_COM = 0;
  for (i = 0; i < 16; i++) {
    marker->process_APPn[i] = skip_variable;
    marker->length_limit_APPn[i] = 0;
  }
  marker->process_APPn[0] = get_interesting_appn;
  marker->process_APPn[14] = get_interesting_appn;
  /* Reset marker processing state */
  reset_marker_reader(cinfo);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl $0x108, %edx            # imm = 0x108
xorl %esi, %esi
callq *(%rax)
movq %rax, 0x248(%rbx)
leaq 0x61(%rip), %rcx        # 0x70376
movq %rcx, (%rax)
leaq 0x86(%rip), %rcx        # 0x703a5
movq %rcx, 0x8(%rax)
leaq 0xc26(%rip), %rcx       # 0x70f50
movq %rcx, 0x10(%rax)
leaq 0xc9a(%rip), %rcx       # 0x70fcf
movq %rcx, 0x28(%rax)
andl $0x0, 0xb0(%rax)
pushq $-0x40
popq %rdx
testq %rdx, %rdx
je 0x7035e
movq %rcx, 0xb0(%rax,%rdx,2)
andl $0x0, 0xf4(%rax,%rdx)
addq $0x4, %rdx
jmp 0x70343
leaq 0xd33(%rip), %rcx       # 0x71098
movq %rcx, 0x30(%rax)
movq %rcx, 0xa0(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x70376
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: read_restart_marker
METHODDEF(jboolean)
read_restart_marker (j_decompress_ptr cinfo)
{
  /* Obtain a marker unless we already did. */
  /* Note that next_marker will complain if it skips any data. */
  if (cinfo->unread_marker == 0) {
    if (! next_marker(cinfo))
      return FALSE;
  }

  if (cinfo->unread_marker ==
      ((int) M_RST0 + cinfo->marker->next_restart_num)) {
    /* Normal case --- swallow the marker and let entropy decoder continue */
    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);
    cinfo->unread_marker = 0;
  } else {
    /* Uh-oh, the restart markers have been messed up. */
    /* Let the data source manager determine how to resync. */
    if (! (*cinfo->src->resync_to_restart) (cinfo,
					    cinfo->marker->next_restart_num))
      return FALSE;
  }

  /* Update next-restart state */
  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;

  return TRUE;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x21c(%rdi), %eax
testl %eax, %eax
jne 0x70f70
movq %rbx, %rdi
callq 0x70203
testl %eax, %eax
je 0x70fcb
movl 0x21c(%rbx), %eax
movq 0x248(%rbx), %rcx
movl 0x20(%rcx), %esi
leal 0xd0(%rsi), %ecx
cmpl %ecx, %eax
jne 0x70fa6
movq (%rbx), %rax
movl $0x62, 0x28(%rax)
movl %esi, 0x2c(%rax)
movq (%rbx), %rax
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq *0x8(%rax)
andl $0x0, 0x21c(%rbx)
jmp 0x70fb4
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
testl %eax, %eax
je 0x70fcb
movq 0x248(%rbx), %rax
movl 0x20(%rax), %ecx
incl %ecx
andl $0x7, %ecx
movl %ecx, 0x20(%rax)
pushq $0x1
popq %rax
jmp 0x70fcd
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: skip_variable
METHODDEF(jboolean)
skip_variable (j_decompress_ptr cinfo)
/* Skip over an unknown or uninteresting variable-length marker */
{
  INT32 length;
  INPUT_VARS(cinfo);

  INPUT_2BYTES(cinfo, length, return FALSE);
  length -= 2;
  
  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);

  INPUT_SYNC(cinfo);		/* do before skip_input_data */
  if (length > 0)
    (*cinfo->src->skip_input_data) (cinfo, (long) length);

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movq 0x8(%r15), %r12
testq %r12, %r12
jne 0x70ffd
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x71085
movq 0x8(%r15), %r12
movq (%r15), %r13
movzbl (%r13), %ebp
decq %r12
je 0x7100f
incq %r13
jmp 0x71021
movq %rbx, %rdi
callq *0x18(%r15)
testl %eax, %eax
je 0x71085
movq (%r15), %r13
movq 0x8(%r15), %r12
shll $0x8, %ebp
decq %r12
movzbl (%r13), %eax
incq %r13
movq %rbp, %r14
orq %rax, %r14
leaq (%rax,%rbp), %rdx
addq $-0x2, %rdx
movq (%rbx), %rax
movl $0x5b, 0x28(%rax)
movl 0x21c(%rbx), %ecx
movl %ecx, 0x2c(%rax)
movq (%rbx), %rax
movq %rdx, (%rsp)
movl %edx, 0x30(%rax)
movq (%rbx), %rax
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq *0x8(%rax)
movq %r13, (%r15)
movq %r12, 0x8(%r15)
cmpq $0x3, %r14
jb 0x71087
movq 0x28(%rbx), %rax
movq %rbx, %rdi
movq (%rsp), %rsi
callq *0x20(%rax)
jmp 0x71087
xorl %ebp, %ebp
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/jdmarker.c
// Function: get_interesting_appn
METHODDEF(jboolean)
get_interesting_appn (j_decompress_ptr cinfo)
/* Process an APP0 or APP14 marker without saving it */
{
  INT32 length;
  JOCTET b[APPN_DATA_LEN];
  unsigned int i, numtoread;
  INPUT_VARS(cinfo);

  INPUT_2BYTES(cinfo, length, return FALSE);
  length -= 2;

  /* get the interesting part of the marker data */
  if (length >= APPN_DATA_LEN)
    numtoread = APPN_DATA_LEN;
  else if (length > 0)
    numtoread = (unsigned int) length;
  else
    numtoread = 0;
  for (i = 0; i < numtoread; i++)
    INPUT_BYTE(cinfo, b[i], return FALSE);
  length -= numtoread;

  /* process it */
  switch (cinfo->unread_marker) {
  case M_APP0:
    examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);
    break;
  case M_APP14:
    examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);
    break;
  default:
    /* can't get here unless jpeg_save_markers chooses wrong processor */
    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
    break;
  }

  /* skip any remaining data -- could be lots */
  INPUT_SYNC(cinfo);
  if (length > 0)
    (*cinfo->src->skip_input_data) (cinfo, (long) length);

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x28(%rdi), %r12
movq 0x8(%r12), %r13
testq %r13, %r13
jne 0x710cc
movq %rbx, %rdi
callq *0x18(%r12)
testl %eax, %eax
je 0x7118a
movq 0x8(%r12), %r13
movq (%r12), %rbp
movzbl (%rbp), %r14d
decq %r13
je 0x710df
incq %rbp
jmp 0x710f8
movq %rbx, %rdi
callq *0x18(%r12)
testl %eax, %eax
je 0x7118a
movq (%r12), %rbp
movq 0x8(%r12), %r13
shll $0x8, %r14d
movzbl (%rbp), %eax
movq %r14, %rcx
orq %rax, %rcx
addq %r14, %rax
addq $-0x2, %rax
xorl %r14d, %r14d
cmpq $0x3, %rcx
movq %rax, (%rsp)
cmovbl %r14d, %eax
cmpq $0x10, %rcx
pushq $0xe
popq %r15
cmovbl %eax, %r15d
incq %rbp
decq %r13
cmpq %r14, %r15
je 0x7115a
testq %r13, %r13
jne 0x7114d
movq %rbx, %rdi
callq *0x18(%r12)
testl %eax, %eax
je 0x7118a
movq (%r12), %rbp
movq 0x8(%r12), %r13
movb (%rbp), %al
movb %al, 0xa(%rsp,%r14)
incq %r14
jmp 0x71128
movq (%rsp), %r14
subq %r15, %r14
movl 0x21c(%rbx), %eax
cmpl $0xee, %eax
je 0x7118e
cmpl $0xe0, %eax
jne 0x711a3
leaq 0xa(%rsp), %rsi
movq %rbx, %rdi
movl %r15d, %edx
movq %r14, %rcx
callq 0x718b3
jmp 0x711b8
xorl %ebp, %ebp
jmp 0x711d6
leaq 0xa(%rsp), %rsi
movq %rbx, %rdi
movl %r15d, %edx
movq %r14, %rcx
callq 0x71ae3
jmp 0x711b8
movq (%rbx), %rcx
movl $0x44, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %rbp, (%r12)
movq %r13, 0x8(%r12)
pushq $0x1
popq %rbp
testq %r14, %r14
jle 0x711d6
movq 0x28(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x20(%rax)
movl %ebp, %eax
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/jdmarker.c
// Function: jpeg_save_markers
GLOBAL(void)
jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
		   unsigned int length_limit)
{
  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;
  long maxlength;
  jpeg_marker_parser_method processor;

  /* Length limit mustn't be larger than what we can allocate
   * (should only be a concern in a 16-bit environment).
   */
  maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);
  if (((long) length_limit) > maxlength)
    length_limit = (unsigned int) maxlength;

  /* Choose processor routine to use.
   * APP0/APP14 have special requirements.
   */
  if (length_limit) {
    processor = save_marker;
    /* If saving APP0/APP14, save at least enough for our internal use. */
    if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)
      length_limit = APP0_DATA_LEN;
    else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)
      length_limit = APP14_DATA_LEN;
  } else {
    processor = skip_variable;
    /* If discarding APP0/APP14, use our regular on-the-fly processor. */
    if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)
      processor = get_interesting_appn;
  }

  if (marker_code == (int) M_COM) {
    marker->process_COM = processor;
    marker->length_limit_COM = length_limit;
  } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {
    marker->process_APPn[marker_code - (int) M_APP0] = processor;
    marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;
  } else
    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
}

// Assembly:
movq 0x248(%rdi), %rax
movq 0x8(%rdi), %rcx
movq 0x60(%rcx), %r8
addq $-0x20, %r8
movl %edx, %ecx
cmpq %rcx, %r8
cmovgel %edx, %r8d
testl %r8d, %r8d
je 0x71222
cmpl $0xe0, %esi
jne 0x71248
cmpl $0xe, %r8d
jae 0x71248
leaq 0x8f(%rip), %rdx        # 0x712ac
pushq $0xe
popq %rcx
jmp 0x71287
cmpl $0xee, %esi
leaq -0x197(%rip), %rcx      # 0x71098
leaq -0x267(%rip), %rdx      # 0x70fcf
cmoveq %rcx, %rdx
cmpl $0xe0, %esi
cmoveq %rcx, %rdx
xorl %ecx, %ecx
jmp 0x71264
cmpl $0xd, %r8d
pushq $0xc
popq %rcx
cmovael %r8d, %ecx
cmpl $0xee, %esi
cmovnel %r8d, %ecx
leaq 0x48(%rip), %rdx        # 0x712ac
cmpl $0xfe, %esi
jne 0x71277
movq %rdx, 0x28(%rax)
movl %ecx, 0xb0(%rax)
retq
movl %esi, %r8d
andl $-0x10, %r8d
cmpl $0xe0, %r8d
jne 0x7129a
addl $0xffffff20, %esi       # imm = 0xFFFFFF20
movq %rdx, 0x30(%rax,%rsi,8)
movl %ecx, 0xb4(%rax,%rsi,4)
retq
movq (%rdi), %rax
movl $0x44, 0x28(%rax)
movl %esi, 0x2c(%rax)
movq (%rdi), %rax
jmpq *(%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: jpeg_set_marker_processor
GLOBAL(void)
jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,
			   jpeg_marker_parser_method routine)
{
  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;

  if (marker_code == (int) M_COM)
    marker->process_COM = routine;
  else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)
    marker->process_APPn[marker_code - (int) M_APP0] = routine;
  else
    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);
}

// Assembly:
movq 0x248(%rdi), %rax
cmpl $0xfe, %esi
jne 0x71569
movq %rdx, 0x28(%rax)
retq
movl %esi, %ecx
andl $-0x10, %ecx
cmpl $0xe0, %ecx
jne 0x71582
addl $0xffffff20, %esi       # imm = 0xFFFFFF20
movq %rdx, 0x30(%rax,%rsi,8)
retq
movq (%rdi), %rax
movl $0x44, 0x28(%rax)
movl %esi, 0x2c(%rax)
movq (%rdi), %rax
jmpq *(%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmarker.c
// Function: examine_app14
LOCAL(void)
examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,
	       unsigned int datalen, INT32 remaining)
/* Examine first few bytes from an APP14.
 * Take appropriate action if it is an Adobe marker.
 * datalen is # of bytes at data[], remaining is length of rest of marker data.
 */
{
  unsigned int version, flags0, flags1, transform;

  if (datalen >= APP14_DATA_LEN &&
      GETJOCTET(data[0]) == 0x41 &&
      GETJOCTET(data[1]) == 0x64 &&
      GETJOCTET(data[2]) == 0x6F &&
      GETJOCTET(data[3]) == 0x62 &&
      GETJOCTET(data[4]) == 0x65) {
    /* Found Adobe APP14 marker */
    version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
    flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
    flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
    transform = GETJOCTET(data[11]);
    TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
    cinfo->saw_Adobe_marker = TRUE;
    cinfo->Adobe_transform = (UINT8) transform;
  } else {
    /* Start of APP14 does not match "Adobe", or too short */
    TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0xc, %edx
jb 0x71b6d
cmpb $0x41, (%rsi)
jne 0x71b6d
cmpb $0x64, 0x1(%rsi)
jne 0x71b6d
cmpb $0x6f, 0x2(%rsi)
jne 0x71b6d
cmpb $0x62, 0x3(%rsi)
jne 0x71b6d
cmpb $0x65, 0x4(%rsi)
jne 0x71b6d
movzwl 0x5(%rsi), %eax
rolw $0x8, %ax
movzwl 0x7(%rsi), %ecx
movzwl %ax, %eax
rolw $0x8, %cx
movzwl %cx, %ecx
movzwl 0x9(%rsi), %edx
rolw $0x8, %dx
movzwl %dx, %edx
movzbl 0xb(%rsi), %ebp
movq (%rbx), %r8
movl %eax, 0x2c(%r8)
movl %ecx, 0x30(%r8)
movl %edx, 0x34(%r8)
movl %ebp, 0x38(%r8)
movl $0x4c, 0x28(%r8)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq *0x8(%r8)
movl $0x1, 0x180(%rbx)
movb %bpl, 0x184(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq (%rbx), %rax
movl $0x4e, 0x28(%rax)
addl %edx, %ecx
movl %ecx, 0x2c(%rax)
movq (%rbx), %rax
movq 0x8(%rax), %rax
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdhuff.c
// Function: jpeg_huff_decode
GLOBAL(int)
jpeg_huff_decode (bitread_working_state * state,
		  register bit_buf_type get_buffer, register int bits_left,
		  d_derived_tbl * htbl, int min_bits)
{
  register int l = min_bits;
  register INT32 code;

  /* HUFF_DECODE has determined that the code is at least min_bits */
  /* bits long, so fetch that many bits in one swoop. */

  CHECK_BIT_BUFFER(*state, l, return -1);
  code = GET_BITS(l);

  /* Collect the rest of the Huffman code one bit at a time. */
  /* This is per Figure F.16 in the JPEG spec. */

  while (code > htbl->maxcode[l]) {
    code <<= 1;
    CHECK_BIT_BUFFER(*state, 1, return -1);
    code |= GET_BITS(1);
    l++;
  }

  /* Unload the local registers */
  state->get_buffer = get_buffer;
  state->bits_left = bits_left;

  /* With garbage input we may reach the sentinel value l = 17. */

  if (l > 16) {
    WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
    return 0;			/* fake a zero as the safest result */
  }

  return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r15d
movq %rcx, %rbx
movq %rdi, %r14
pushq $-0x1
popq %rbp
cmpl %r8d, %edx
jge 0x71f96
movq %r14, %rdi
movl %r15d, %ecx
callq 0x71e39
testl %eax, %eax
je 0x7202b
movq 0x10(%r14), %rsi
movl 0x18(%r14), %edx
subl %r15d, %edx
movq %rsi, %rax
movl %edx, %ecx
sarq %cl, %rax
movl %ebp, %r12d
movl %r15d, %ecx
shll %cl, %r12d
notl %r12d
andl %eax, %r12d
movslq %r15d, %r13
pushq $0x1
popq %r15
cmpq (%rbx,%r13,8), %r12
jle 0x71fee
testl %edx, %edx
jg 0x71fd8
movq %r14, %rdi
movl %r15d, %ecx
callq 0x71e39
testl %eax, %eax
je 0x7202b
movq 0x10(%r14), %rsi
movl 0x18(%r14), %edx
addq %r12, %r12
decl %edx
xorl %eax, %eax
btq %rdx, %rsi
setb %al
orq %rax, %r12
incq %r13
jmp 0x71fb7
movq %rsi, 0x10(%r14)
movl %edx, 0x18(%r14)
cmpq $0x11, %r13
jl 0x72014
movq 0x20(%r14), %rdi
movq (%rdi), %rax
movl $0x76, 0x28(%rax)
pushq $-0x1
popq %rsi
callq *0x8(%rax)
xorl %ebp, %ebp
jmp 0x7202b
movq 0x118(%rbx), %rax
addl 0x90(%rbx,%r13,8), %r12d
movslq %r12d, %rcx
movzbl 0x11(%rax,%rcx), %ebp
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/jdhuff.c
// Function: jinit_huff_decoder
GLOBAL(void)
jinit_huff_decoder (j_decompress_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_decoder));
  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
  entropy->pub.start_pass = start_pass_huff_decoder;
  entropy->pub.decode_mcu = decode_mcu;

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
pushq $0x1
popq %rsi
movl $0x170, %edx            # imm = 0x170
callq *(%rax)
movq %rax, 0x250(%rbx)
leaq 0x2d(%rip), %rcx        # 0x72089
movq %rcx, (%rax)
leaq 0x16c(%rip), %rcx       # 0x721d2
movq %rcx, 0x8(%rax)
pushq $-0x20
popq %rcx
testq %rcx, %rcx
je 0x72087
andq $0x0, 0x80(%rax,%rcx)
andq $0x0, 0x60(%rax,%rcx)
addq $0x8, %rcx
jmp 0x7206d
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdphuff.c
// Function: jinit_phuff_decoder
GLOBAL(void)
jinit_phuff_decoder (j_decompress_ptr cinfo)
{
  phuff_entropy_ptr entropy;
  int *coef_bit_ptr;
  int ci, i;

  entropy = (phuff_entropy_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(phuff_entropy_decoder));
  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
  entropy->pub.start_pass = start_pass_phuff_decoder;

  /* Mark derived tables unallocated */
  for (i = 0; i < NUM_HUFF_TBLS; i++) {
    entropy->derived_tbls[i] = NULL;
  }

  /* Create progression status table */
  cinfo->coef_bits = (int (*)[DCTSIZE2])
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				cinfo->num_components*DCTSIZE2*SIZEOF(int));
  coef_bit_ptr = & cinfo->coef_bits[0][0];
  for (ci = 0; ci < cinfo->num_components; ci++) 
    for (i = 0; i < DCTSIZE2; i++)
      *coef_bit_ptr++ = -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
pushq $0x1
popq %rsi
pushq $0x68
popq %rdx
callq *(%rax)
movq %rax, 0x250(%rbx)
leaq 0x55(%rip), %rcx        # 0x72687
movq %rcx, (%rax)
xorl %ecx, %ecx
cmpq $0x4, %rcx
je 0x72648
andq $0x0, 0x40(%rax,%rcx,8)
incq %rcx
jmp 0x72637
movq 0x8(%rbx), %rax
movslq 0x38(%rbx), %rdx
shlq $0x8, %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq *(%rax)
movq %rax, 0xc0(%rbx)
xorl %ecx, %ecx
cmpl 0x38(%rbx), %ecx
jge 0x72685
xorl %edx, %edx
cmpl $0x100, %edx            # imm = 0x100
je 0x7267e
orl $-0x1, (%rax,%rdx)
addq $0x4, %rdx
jmp 0x7266c
incl %ecx
addq %rdx, %rax
jmp 0x72665
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdphuff.c
// Function: decode_mcu_DC_refine
METHODDEF(jboolean)
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
{   
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  int p1 = 1 << cinfo->Al;	/* 1 in the bit position being coded */
  int blkn;
  JBLOCKROW block;
  BITREAD_STATE_VARS;

  /* Process restart marker if needed; may have to suspend */
  if (cinfo->restart_interval) {
    if (entropy->restarts_to_go == 0)
      if (! process_restart(cinfo))
	return FALSE;
  }

  /* Not worth the cycles to check insufficient_data here,
   * since we will not change the data anyway if we read zeroes.
   */

  /* Load up working state */
  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);

  /* Outer loop handles each block in the MCU */

  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
    block = MCU_data[blkn];

    /* Encoded data is simply the next bit of the two's-complement DC value */
    CHECK_BIT_BUFFER(br_state, 1, return FALSE);
    if (GET_BITS(1))
      (*block)[0] |= p1;
    /* Note: since we use |=, repeating the assignment later is safe */
  }

  /* Completed MCU, so update state */
  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);

  /* Account for restart interval (no-op if not using restarts) */
  entropy->restarts_to_go--;

  return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movb 0x218(%rdi), %cl
pushq $0x1
popq %r13
shll %cl, %r13d
movq %rsi, %r14
movq 0x250(%rdi), %r15
cmpl $0x0, 0x170(%rdi)
je 0x72d80
cmpl $0x0, 0x3c(%r15)
jne 0x72d80
movq %rbx, %rdi
callq 0x73255
testl %eax, %eax
je 0x72e12
leaq 0x10(%rsp), %rdx
movq %rbx, 0x20(%rdx)
movq 0x28(%rbx), %rax
movq (%rax), %rcx
movq %rcx, (%rdx)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rdx)
movq 0x18(%r15), %rsi
movq %r15, 0x8(%rsp)
movl 0x20(%r15), %edx
xorl %r12d, %r12d
pushq $0x1
popq %rbp
movslq 0x1e0(%rbx), %rax
cmpq %rax, %r12
jge 0x72dec
movq (%r14,%r12,8), %r15
testl %edx, %edx
jg 0x72ddb
leaq 0x10(%rsp), %rdi
movl %ebp, %ecx
callq 0x71e39
testl %eax, %eax
je 0x72e12
movq 0x20(%rsp), %rsi
movl 0x28(%rsp), %edx
decl %edx
btq %rdx, %rsi
jae 0x72de7
orw %r13w, (%r15)
incq %r12
jmp 0x72dae
movq 0x10(%rsp), %rax
movq 0x28(%rbx), %rcx
movq %rax, (%rcx)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rcx)
movq 0x8(%rsp), %rax
movq %rsi, 0x18(%rax)
movl %edx, 0x20(%rax)
decl 0x3c(%rax)
jmp 0x72e14
xorl %ebp, %ebp
movl %ebp, %eax
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/jdphuff.c
// Function: process_restart
LOCAL(jboolean)
process_restart (j_decompress_ptr cinfo)
{
  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
  int ci;

  /* Throw away any unused bits remaining in bit buffer; */
  /* include any full bytes in next_marker's count of discarded bytes */
  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
  entropy->bitstate.bits_left = 0;

  /* Advance past the RSTn marker */
  if (! (*cinfo->marker->read_restart_marker) (cinfo))
    return FALSE;

  /* Re-initialize DC predictions to 0 */
  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
    entropy->saved.last_dc_val[ci] = 0;
  /* Re-init EOB run count, too */
  entropy->saved.EOBRUN = 0;

  /* Reset restart counter */
  entropy->restarts_to_go = cinfo->restart_interval;

  /* Reset out-of-data flag, unless read_restart_marker left us smack up
   * against a marker.  In that case we will end up treating the next data
   * segment as empty, and we can avoid producing bogus output pixels by
   * leaving the flag set.
   */
  if (cinfo->unread_marker == 0)
    entropy->pub.insufficient_data = FALSE;

  return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x248(%rdi), %rcx
movq 0x250(%rdi), %r14
movl 0x20(%r14), %eax
pushq $0x8
popq %rsi
cltd
idivl %esi
addl %eax, 0x24(%rcx)
andl $0x0, 0x20(%r14)
callq *0x10(%rcx)
testl %eax, %eax
je 0x732be
xorl %eax, %eax
movslq 0x1b0(%rbx), %rcx
cmpq %rcx, %rax
jge 0x7329c
andl $0x0, 0x2c(%r14,%rax,4)
incq %rax
jmp 0x73285
andl $0x0, 0x28(%r14)
movl 0x170(%rbx), %eax
movl %eax, 0x3c(%r14)
pushq $0x1
popq %rax
cmpl $0x0, 0x21c(%rbx)
jne 0x732c0
andl $0x0, 0x10(%r14)
jmp 0x732c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdmainct.c
// Function: start_pass_main
METHODDEF(void)
start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;

  switch (pass_mode) {
  case JBUF_PASS_THRU:
    if (cinfo->upsample->need_context_rows) {
      mainp->pub.process_data = process_data_context_main;
      make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
      mainp->whichptr = 0;	/* Read first iMCU row into xbuffer[0] */
      mainp->context_state = CTX_PREPARE_FOR_IMCU;
      mainp->iMCU_row_ctr = 0;
    } else {
      /* Simple case with no context needed */
      mainp->pub.process_data = process_data_simple_main;
    }
    mainp->buffer_full = FALSE;	/* Mark buffer empty */
    mainp->rowgroup_ctr = 0;
    break;
#ifdef QUANT_2PASS_SUPPORTED
  case JBUF_CRANK_DEST:
    /* For last pass of 2-pass quantization, just crank the postprocessor */
    mainp->pub.process_data = process_data_crank_post;
    break;
#endif
  default:
    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
    break;
  }
}

// Assembly:
movq 0x228(%rdi), %rcx
cmpl $0x2, %esi
je 0x7359f
testl %esi, %esi
jne 0x735ab
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x260(%rdi), %rax
cmpl $0x0, 0x10(%rax)
je 0x735c5
leaq 0x142(%rip), %rax       # 0x735e0
movq %rax, 0x8(%rcx)
movl 0x1a0(%rdi), %esi
movq 0x130(%rdi), %r8
movl 0x38(%rdi), %edi
leal 0x2(%rsi), %eax
movl %eax, -0x4(%rsp)
leal -0x2(%rsi), %eax
movl %eax, -0x8(%rsp)
xorl %r11d, %r11d
testl %edi, %edi
cmovlel %r11d, %edi
xorl %ebx, %ebx
cmpq %rdi, %rbx
je 0x735b7
movl 0x24(%r8), %eax
imull 0xc(%r8), %eax
cltd
idivl %esi
movq 0x68(%rcx), %rdx
movq 0x70(%rcx), %r9
movq (%rdx,%rbx,8), %rdx
movq (%r9,%rbx,8), %r14
movq 0x10(%rcx,%rbx,8), %r15
movl %eax, %r12d
imull -0x4(%rsp), %r12d
testl %r12d, %r12d
cmovlel %r11d, %r12d
xorl %r9d, %r9d
cmpq %r9, %r12
je 0x7351e
movq (%r15,%r9,8), %r13
movq %r13, (%r14,%r9,8)
movq %r13, (%rdx,%r9,8)
incq %r9
jmp 0x73508
leal (%rax,%rax), %r12d
movl %eax, %r9d
imull %esi, %r9d
movl %eax, %ebp
imull -0x8(%rsp), %ebp
movslq %ebp, %rbp
movslq %r9d, %r9
testl %r12d, %r12d
cmovlel %r11d, %r12d
leaq (%r15,%rbp,8), %r13
leaq (%r14,%rbp,8), %rbp
leaq (%r14,%r9,8), %r14
leaq (%r15,%r9,8), %r15
xorl %r9d, %r9d
cmpq %r9, %r12
je 0x7356c
movq (%r15,%r9,8), %r10
movq %r10, (%rbp,%r9,8)
movq (%r13,%r9,8), %r10
movq %r10, (%r14,%r9,8)
incq %r9
jmp 0x73550
movslq %eax, %r9
testl %eax, %eax
cmovlel %r11d, %eax
shlq $0x3, %r9
movq %rdx, %r14
subq %r9, %r14
xorl %r9d, %r9d
cmpq %r9, %rax
je 0x73593
movq (%rdx), %r10
movq %r10, (%r14,%r9,8)
incq %r9
jmp 0x73582
incq %rbx
addq $0x60, %r8
jmp 0x734cb
leaq 0x3c3(%rip), %rax       # 0x73969
movq %rax, 0x8(%rcx)
retq
movq (%rdi), %rax
movl $0x4, 0x28(%rax)
jmpq *(%rax)
andq $0x0, 0x78(%rcx)
andl $0x0, 0x84(%rcx)
jmp 0x735d0
leaq 0x31a(%rip), %rax       # 0x738e6
movq %rax, 0x8(%rcx)
andq $0x0, 0x60(%rcx)
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/jdmainct.c
// Function: process_data_simple_main
METHODDEF(void)
process_data_simple_main (j_decompress_ptr cinfo,
			  JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
			  JDIMENSION out_rows_avail)
{
  my_main_ptr mainp = (my_main_ptr) cinfo->main;
  JDIMENSION rowgroups_avail;

  /* Read input data if we haven't filled the main buffer yet */
  if (! mainp->buffer_full) {
    if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))
      return;			/* suspension forced, can do nothing more */
    mainp->buffer_full = TRUE;	/* OK, we have an iMCU row to work with */
  }

  /* There are always min_DCT_scaled_size row groups in an iMCU row. */
  rowgroups_avail = (JDIMENSION) cinfo->min_DCT_scaled_size;
  /* Note: at the bottom of the image, we may pass extra garbage row groups
   * to the postprocessor.  The postprocessor has to check for bottom
   * of image anyway (at row resolution), so no point in us doing it too.
   */

  /* Feed the postprocessor */
  (*cinfo->post->post_process_data) (cinfo, mainp->buffer,
				     &mainp->rowgroup_ctr, rowgroups_avail,
				     output_buf, out_row_ctr, out_rows_avail);

  /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
  if (mainp->rowgroup_ctr >= rowgroups_avail) {
    mainp->buffer_full = FALSE;
    mainp->rowgroup_ctr = 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x228(%rdi), %r13
cmpl $0x0, 0x60(%r13)
jne 0x73927
movq 0x230(%r15), %rax
leaq 0x10(%r13), %rsi
movq %r15, %rdi
callq *0x18(%rax)
testl %eax, %eax
je 0x7395a
movl $0x1, 0x60(%r13)
movl 0x1a0(%r15), %r12d
movq 0x238(%r15), %rax
leaq 0x10(%r13), %rsi
leaq 0x64(%r13), %rdx
movl %ebp, (%rsp)
movq %r15, %rdi
movl %r12d, %ecx
movq %r14, %r8
movq %rbx, %r9
callq *0x8(%rax)
cmpl %r12d, 0x64(%r13)
jb 0x7395a
andq $0x0, 0x60(%r13)
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/jdcoefct.c
// Function: start_output_pass
METHODDEF(void)
start_output_pass (j_decompress_ptr cinfo)
{
#ifdef BLOCK_SMOOTHING_SUPPORTED
  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x230(%rdi), %r14
cmpq $0x0, 0x20(%r14)
je 0x73c03
cmpl $0x0, 0x68(%rbx)
je 0x73bf8
cmpl $0x0, 0x138(%rbx)
je 0x73bf8
cmpq $0x0, 0xc0(%rbx)
je 0x73bf8
movq 0xd8(%r14), %rax
testq %rax, %rax
jne 0x73b3d
movq 0x8(%rbx), %rax
movslq 0x38(%rbx), %rcx
imulq $0x18, %rcx, %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq *(%rax)
movq %rax, 0xd8(%r14)
movq 0x130(%rbx), %rcx
xorl %edx, %edx
pushq $0x1
popq %rsi
pushq $0x1
popq %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
movslq 0x38(%rbx), %r10
cmpq %r10, %r8
jge 0x73bea
movq 0x50(%rcx), %r10
testq %r10, %r10
je 0x73bf8
cmpw $0x0, (%r10)
je 0x73bf8
cmpw $0x0, 0x2(%r10)
je 0x73bf8
cmpw $0x0, 0x10(%r10)
je 0x73bf8
cmpw $0x0, 0x20(%r10)
je 0x73bf8
cmpw $0x0, 0x12(%r10)
je 0x73bf8
cmpw $0x0, 0x4(%r10)
je 0x73bf8
movq 0xc0(%rbx), %r10
movq %r8, %r11
shlq $0x8, %r11
cmpl $0x0, (%r10,%r11)
js 0x73bf8
addq %rdx, %r10
movq %rsi, %r11
cmpq $0x6, %r11
je 0x73bd3
movl (%r10,%r11,4), %ebp
movl %ebp, (%rax,%r11,4)
testl %ebp, %ebp
cmovnel %edi, %r9d
incq %r11
jmp 0x73bba
addq $0x18, %rax
incq %r8
addq $0x60, %rcx
addq $0x100, %rdx            # imm = 0x100
jmp 0x73b52
testl %r9d, %r9d
je 0x73bf8
leaq 0x5cc(%rip), %rax       # 0x741c2
jmp 0x73bff
leaq 0x1a2(%rip), %rax       # 0x73da1
movq %rax, 0x18(%r14)
andl $0x0, 0xb8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: jinit_d_post_controller
GLOBAL(void)
jinit_d_post_controller (j_decompress_ptr cinfo, jboolean need_full_buffer)
{
  my_post_ptr post;

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

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

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

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

// Assembly:
pushq %rbx
movq 0x238(%rdi), %rbx
cmpl $0x3, %esi
je 0x749f8
cmpl $0x2, %esi
je 0x749dc
testl %esi, %esi
jne 0x74a14
cmpl $0x0, 0x6c(%rdi)
je 0x74a22
leaq 0x81(%rip), %rax        # 0x74a38
movq %rax, 0x8(%rbx)
cmpq $0x0, 0x18(%rbx)
jne 0x74a31
movq 0x8(%rdi), %rax
movq 0x10(%rbx), %rsi
movl 0x20(%rbx), %ecx
pushq $0x1
popq %r8
xorl %edx, %edx
callq *0x38(%rax)
movq %rax, 0x18(%rbx)
jmp 0x74a31
cmpq $0x0, 0x10(%rbx)
jne 0x749ef
movq (%rdi), %rax
movl $0x4, 0x28(%rax)
callq *(%rax)
leaq 0x18e(%rip), %rax       # 0x74b84
jmp 0x74a2d
cmpq $0x0, 0x10(%rbx)
jne 0x74a0b
movq (%rdi), %rax
movl $0x4, 0x28(%rax)
callq *(%rax)
leaq 0xa4(%rip), %rax        # 0x74ab6
jmp 0x74a2d
movq (%rdi), %rax
movl $0x4, 0x28(%rax)
callq *(%rax)
jmp 0x74a31
movq 0x260(%rdi), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rbx)
andq $0x0, 0x24(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdpostct.c
// Function: post_process_prepass
METHODDEF(void)
post_process_prepass (j_decompress_ptr cinfo,
		      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		      JDIMENSION in_row_groups_avail,
		      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		      JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION old_next_row, num_rows;

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movl %ecx, %r9d
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %r14
movq 0x238(%rdi), %rbx
leaq 0x28(%rbx), %r12
movl 0x28(%rbx), %r15d
testl %r15d, %r15d
je 0x74aef
movq 0x18(%rbx), %r8
jmp 0x74b18
movq 0x8(%r14), %rax
movq 0x10(%rbx), %rsi
movl 0x24(%rbx), %edx
movl 0x20(%rbx), %ecx
pushq $0x1
popq %r8
movq %r14, %rdi
movl %r9d, %r15d
callq *0x38(%rax)
movl %r15d, %r9d
movq %rax, %r8
movq %rax, 0x18(%rbx)
movl 0x28(%rbx), %r15d
movq 0x260(%r14), %rax
movl 0x20(%rbx), %ecx
movl %ecx, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movl %r9d, %ecx
movq %r12, %r9
callq *0x8(%rax)
movl 0x28(%rbx), %eax
movl %eax, %ebp
subl %r15d, %ebp
jbe 0x74b67
movq 0x270(%r14), %rax
movl %r15d, %esi
shlq $0x3, %rsi
addq 0x18(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
movl %ebp, %ecx
callq *0x8(%rax)
movq 0x10(%rsp), %rax
addl %ebp, (%rax)
movl 0x28(%rbx), %eax
movl 0x20(%rbx), %ecx
cmpl %ecx, %eax
jb 0x74b75
addl %ecx, 0x24(%rbx)
andl $0x0, 0x28(%rbx)
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/jdpostct.c
// Function: post_process_2pass
METHODDEF(void)
post_process_2pass (j_decompress_ptr cinfo,
		    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,
		    JDIMENSION in_row_groups_avail,
		    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
		    JDIMENSION out_rows_avail)
{
  my_post_ptr post = (my_post_ptr) cinfo->post;
  JDIMENSION num_rows, max_rows;

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

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

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

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

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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
pushq $0x1
popq %rbp
movl $0x80, %edx
movl %ebp, %esi
callq *(%rax)
movq %rax, %r14
movq %rax, 0x258(%rbx)
leaq 0x54(%rip), %rax        # 0x74ccc
movq %rax, (%r14)
movq 0x130(%rbx), %r15
addq $0x58, %r15
xorl %r12d, %r12d
movslq 0x38(%rbx), %rax
cmpq %rax, %r12
jge 0x74cc3
movq 0x8(%rbx), %rax
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movl %ebp, %esi
callq *(%rax)
movq %rax, (%r15)
movl $0x100, %edx            # imm = 0x100
movq %rax, %rdi
xorl %esi, %esi
callq 0xe270
orl $-0x1, 0x58(%r14,%r12,4)
incq %r12
addq $0x60, %r15
jmp 0x74c89
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdsample.c
// Function: h2v1_fancy_upsample
METHODDEF(void)
h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
		     JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  JSAMPARRAY output_data = *output_data_ptr;
  register JSAMPROW inptr, outptr;
  register int invalue;
  register JDIMENSION colctr;
  int inrow;

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

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

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq (%rcx), %rax
xorl %ecx, %ecx
movslq 0x19c(%rdi), %r8
cmpq %r8, %rcx
jge 0x765af
movq (%rdx,%rcx,8), %r9
movq (%rax,%rcx,8), %r8
movzbl (%r9), %r10d
movb %r10b, (%r8)
leal (%r10,%r10,2), %r10d
movzbl 0x1(%r9), %r11d
addl %r11d, %r10d
addl $0x2, %r10d
shrl $0x2, %r10d
movb %r10b, 0x1(%r8)
movl 0x28(%rsi), %r11d
addl $-0x2, %r11d
xorl %r10d, %r10d
cmpl %r10d, %r11d
je 0x76584
movzbl 0x1(%r9,%r10), %ebx
leal (%rbx,%rbx,2), %ebx
movzbl (%r9,%r10), %r14d
leal (%r14,%rbx), %ebp
incl %ebp
shrl $0x2, %ebp
movb %bpl, 0x2(%r8,%r10,2)
movzbl 0x2(%r9,%r10), %r14d
addl %r14d, %ebx
addl $0x2, %ebx
shrl $0x2, %ebx
movb %bl, 0x3(%r8,%r10,2)
incq %r10
jmp 0x7654a
movzbl 0x1(%r9,%r10), %r11d
leal (%r11,%r11,2), %ebx
movzbl (%r9,%r10), %r9d
addl %ebx, %r9d
incl %r9d
shrl $0x2, %r9d
movb %r9b, 0x2(%r8,%r10,2)
movb %r11b, 0x3(%r8,%r10,2)
incq %rcx
jmp 0x76508
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdsample.c
// Function: h2v1_upsample
METHODDEF(void)
h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
	       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
{
  JSAMPARRAY output_data = *output_data_ptr;
  register JSAMPROW inptr, outptr;
  register JSAMPLE invalue;
  JSAMPROW outend;
  int inrow;

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

// Assembly:
movq (%rcx), %rax
xorl %ecx, %ecx
movslq 0x19c(%rdi), %rsi
cmpq %rsi, %rcx
jge 0x765f4
movq (%rdx,%rcx,8), %rsi
movq (%rax,%rcx,8), %r8
movl 0x88(%rdi), %r9d
addq %r8, %r9
cmpq %r9, %r8
jae 0x765ef
movb (%rsi), %r10b
incq %rsi
movb %r10b, (%r8)
movb %r10b, 0x1(%r8)
addq $0x2, %r8
jmp 0x765d7
incq %rcx
jmp 0x765b9
retq