LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNError.cpp
// Function: gaps::RNAbort(char const*, ...)
void RNAbort(const char *fmt, ...)
{
#if (0) && (RN_OS == RN_WINDOWS)
    /* Display error message */
    char outbuf[256];
    outbuf[0] = '\0';
    if (fmt) {
	char buf[256];
        va_list args;
        va_start(args, fmt);
        vsprintf(buf, fmt, args);
	strcat(outbuf, buf);
        va_end(args);
        strcat(outbuf, "\n");
    }
    MessageBox(NULL, outbuf, "GAPS FATAL ERROR -- ABORTING", MB_ICONSTOP | MB_OK);
#endif

    /* Print error message */
    if (RNerror_file) {
        // perror("GAPS FATAL ERROR.  ABORTING:");
	if (fmt) {
	    va_list args;
	    va_start(args, fmt);
	    vfprintf(RNerror_file, fmt, args);
	    va_end(args);
	    fprintf(RNerror_file, "\n");
	}
	fflush(RNerror_file);
    }

    /* Abort */
    fflush(stdout);
    fflush(stderr);
    abort();
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, %r10
testb %al, %al
je 0x68135
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
movq 0x47569b(%rip), %rdi    # 0x4dd7f0
testq %rdi, %rdi
je 0x681a7
testq %r10, %r10
je 0x681a2
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq %r10, %rsi
callq 0xe610
movq 0x47565d(%rip), %rsi    # 0x4dd7f0
pushq $0xa
popq %rdi
callq 0xe5c0
movq 0x47564e(%rip), %rdi    # 0x4dd7f0
callq 0xe540
movq 0x71dd2(%rip), %rax     # 0xd9f80
movq (%rax), %rdi
callq 0xe540
movq 0x71e03(%rip), %rax     # 0xd9fc0
movq (%rax), %rdi
callq 0xe540
callq 0xe280
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNError.cpp
// Function: gaps::RNFail(char const*, ...)
void RNFail(const char *fmt, ...)
{
#if (0) && (RN_OS == RN_WINDOWS)
    /* Display error message */
    char outbuf[256];
    outbuf[0] = '\0';
    if (fmt) {
	char buf[256];
        va_list args;
        va_start(args, fmt);
        vsprintf(buf, fmt, args);
	strcat(outbuf, buf);
        va_end(args);
        strcat(outbuf, "\n");
    }
    MessageBox(NULL, outbuf, "GAPS ERROR", MB_ICONSTOP | MB_OK);
#endif

    /* Print error message */
    if (RNerror_file) {
        // perror("GAPS ERROR");
        if (fmt) {
	    va_list args;
	    va_start(args, fmt);
	    vfprintf(RNerror_file, fmt, args);
	    va_end(args);
	    fprintf(RNerror_file, "\n");
	}
    }
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, %r10
testb %al, %al
je 0x6820f
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
movq 0x4755c1(%rip), %rdi    # 0x4dd7f0
testq %rdi, %rdi
sete %al
testq %r10, %r10
sete %cl
orb %al, %cl
jne 0x6827b
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq %r10, %rsi
callq 0xe610
movq 0x47557d(%rip), %rsi    # 0x4dd7f0
pushq $0xa
popq %rdi
callq 0xe5c0
addq $0xd8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/RNBasics/RNError.cpp
// Function: gaps::RNWarning(char const*, ...)
void RNWarning(const char *fmt, ...)
{
    /* Check error level */
    if (RNerror_level > 0) return;

#if (0) && (RN_OS == RN_WINDOWS)
    /* Display error message */
    char outbuf[256];
    outbuf[0] = '\0';
    if (fmt) {
	char buf[256];
        va_list args;
        va_start(args, fmt);
        vsprintf(buf, fmt, args);
	strcat(outbuf, buf);
        va_end(args);
        strcat(outbuf, "\n");
    }
    MessageBox(NULL, outbuf, "GAPS WARNING", MB_OK);
#endif
    
    /* Print error message */
    if (RNerror_file) {
        // perror("GAPS WARNING");
        if (fmt) {
	    va_list args;
	    va_start(args, fmt);
	    vfprintf(RNerror_file, fmt, args);
	    va_end(args);
	    fprintf(RNerror_file, "\n");
	}
    }
}

// Assembly:
subq $0xd8, %rsp
testb %al, %al
je 0x682c5
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testq %rdi, %rdi
je 0x68337
cmpl $0x0, 0x47550e(%rip)    # 0x4dd7f8
jg 0x68337
movq %rdi, %r10
movq 0x4754fa(%rip), %rdi    # 0x4dd7f0
testq %rdi, %rdi
je 0x68337
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq %r10, %rsi
callq 0xe610
movq 0x4754c1(%rip), %rsi    # 0x4dd7f0
pushq $0xa
popq %rdi
callq 0xe5c0
addq $0xd8, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcapimin.c
// Function: jpeg_CreateCompress
GLOBAL(void)
jpeg_CreateCompress (j_compress_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_compress_struct))
    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, 
	     (int) SIZEOF(struct jpeg_compress_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_compress_struct));
    cinfo->err = err;
    cinfo->client_data = client_data;
  }
  cinfo->is_decompressor = FALSE;

  /* 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->dest = NULL;

  cinfo->comp_info = 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;
  }

  cinfo->script_space = NULL;

  cinfo->input_gamma = 1.0;	/* in case application forgets */

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
andq $0x0, 0x8(%rdi)
cmpl $0x3e, %esi
je 0x68377
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 $0x208, %r14            # imm = 0x208
je 0x683a0
movq (%rbx), %rax
movabsq $0x20800000015, %rcx    # imm = 0x20800000015
movq %rcx, 0x28(%rax)
movq (%rbx), %rax
movl %r14d, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq (%rbx), %r15
movq 0x18(%rbx), %r12
leaq 0x8(%rbx), %rdi
xorl %r14d, %r14d
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0xe270
movq %r15, (%rbx)
movq %r12, 0x18(%rbx)
movq %rbx, %rdi
callq 0x793b4
andq $0x0, 0x10(%rbx)
andq $0x0, 0x28(%rbx)
andq $0x0, 0x58(%rbx)
cmpq $0x4, %r14
je 0x683e9
andq $0x0, 0x60(%rbx,%r14,8)
incq %r14
jmp 0x683d8
pushq $-0x20
popq %rax
testq %rax, %rax
je 0x68409
andq $0x0, 0xa0(%rbx,%rax)
andq $0x0, 0xc0(%rbx,%rax)
addq $0x8, %rax
jmp 0x683ec
andq $0x0, 0x1f8(%rbx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x40(%rbx)
movl $0x64, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcapimin.c
// Function: jpeg_suppress_tables
GLOBAL(void)
jpeg_suppress_tables (j_compress_ptr cinfo, jboolean suppress)
{
  int i;
  JQUANT_TBL * qtbl;
  JHUFF_TBL * htbl;

  for (i = 0; i < NUM_QUANT_TBLS; i++) {
    if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
      qtbl->sent_table = suppress;
  }

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

// Assembly:
xorl %eax, %eax
cmpq $0x4, %rax
je 0x68459
movq 0x60(%rdi,%rax,8), %rcx
testq %rcx, %rcx
je 0x68454
movl %esi, 0x80(%rcx)
incq %rax
jmp 0x6843e
pushq $-0x20
popq %rax
testq %rax, %rax
je 0x6848d
movq 0xa0(%rdi,%rax), %rcx
testq %rcx, %rcx
je 0x68474
movl %esi, 0x114(%rcx)
movq 0xc0(%rdi,%rax), %rcx
testq %rcx, %rcx
je 0x68487
movl %esi, 0x114(%rcx)
addq $0x8, %rax
jmp 0x6845c
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcapimin.c
// Function: jpeg_finish_compress
GLOBAL(void)
jpeg_finish_compress (j_compress_ptr cinfo)
{
  JDIMENSION iMCU_row;

  if (cinfo->global_state == CSTATE_SCANNING ||
      cinfo->global_state == CSTATE_RAW_OK) {
    /* Terminate first pass */
    if (cinfo->next_scanline < cinfo->image_height)
      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
    (*cinfo->master->finish_pass) (cinfo);
  } else if (cinfo->global_state != CSTATE_WRCOEFS)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  /* Perform any remaining passes */
  while (! cinfo->master->is_last_pass) {
    (*cinfo->master->prepare_for_pass) (cinfo);
    for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
      if (cinfo->progress != NULL) {
	cinfo->progress->pass_counter = (long) iMCU_row;
	cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;
	(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
      }
      /* We bypass the main controller and invoke coef controller directly;
       * all work is being done from the coefficient buffer.
       */
      if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))
	ERREXIT(cinfo, JERR_CANT_SUSPEND);
    }
    (*cinfo->master->finish_pass) (cinfo);
  }
  /* Write EOI, do final cleanup */
  (*cinfo->marker->write_file_trailer) (cinfo);
  (*cinfo->dest->term_destination) (cinfo);
  /* We can use jpeg_abort to release memory and reset global_state */
  jpeg_abort((j_common_ptr) cinfo);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x24(%rdi), %eax
leal -0x65(%rax), %ecx
cmpl $0x2, %ecx
jae 0x684c7
movl 0x130(%rbx), %eax
cmpl 0x34(%rbx), %eax
jae 0x684ba
movq (%rbx), %rax
movl $0x43, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x1b0(%rbx), %rax
addq $0x10, %rax
jmp 0x684dc
cmpl $0x67, %eax
je 0x68540
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
jmp 0x68540
movq %rbx, %rdi
callq *(%rax)
xorl %r14d, %r14d
movl 0x140(%rbx), %eax
cmpq %rax, %r14
jae 0x68533
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x6850c
movq %r14, 0x8(%rcx)
movq %rax, 0x10(%rcx)
movq %rbx, %rdi
callq *(%rcx)
movq 0x1c8(%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
callq *0x8(%rax)
testl %eax, %eax
jne 0x6852e
movq (%rbx), %rax
movl $0x18, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
incq %r14
jmp 0x684eb
movq 0x1b0(%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x1b0(%rbx), %rax
cmpl $0x0, 0x1c(%rax)
je 0x684e3
movq 0x1d0(%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x790d0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcapimin.c
// Function: jpeg_write_marker
GLOBAL(void)
jpeg_write_marker (j_compress_ptr cinfo, int marker,
		   const JOCTET *dataptr, unsigned int datalen)
{
  JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));

  if (cinfo->next_scanline != 0 ||
      (cinfo->global_state != CSTATE_SCANNING &&
       cinfo->global_state != CSTATE_RAW_OK &&
       cinfo->global_state != CSTATE_WRCOEFS))
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
  write_marker_byte = cinfo->marker->write_marker_byte;	/* copy for speed */
  while (datalen--) {
    (*write_marker_byte) (cinfo, *dataptr);
    dataptr++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r14
cmpl $0x0, 0x130(%rdi)
sete %cl
movl 0x24(%rdi), %eax
leal -0x65(%rax), %edx
cmpl $0x3, %edx
setb %dl
testb %dl, %cl
jne 0x685b8
movq (%r14), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movq 0x1d0(%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq *0x28(%rax)
movq 0x1d0(%r14), %rax
movq 0x30(%rax), %r15
movl %ebp, %r12d
xorl %r13d, %r13d
cmpl %r13d, %r12d
je 0x685f0
movzbl (%rbx,%r13), %esi
movq %r14, %rdi
callq *%r15
incq %r13
jmp 0x685db
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/jcapimin.c
// Function: jpeg_write_m_header
GLOBAL(void)
jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
{
  if (cinfo->next_scanline != 0 ||
      (cinfo->global_state != CSTATE_SCANNING &&
       cinfo->global_state != CSTATE_RAW_OK &&
       cinfo->global_state != CSTATE_WRCOEFS))
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
cmpl $0x0, 0x130(%rdi)
sete %cl
movl 0x24(%rdi), %eax
leal -0x65(%rax), %edx
cmpl $0x3, %edx
setb %dl
testb %dl, %cl
jne 0x68639
movq (%r14), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movq 0x1d0(%r14), %rax
movq 0x28(%rax), %rax
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcapimin.c
// Function: jpeg_write_tables
GLOBAL(void)
jpeg_write_tables (j_compress_ptr cinfo)
{
  if (cinfo->global_state != CSTATE_START)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  /* (Re)initialize error mgr and destination modules */
  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
  (*cinfo->dest->init_destination) (cinfo);
  /* Initialize the marker writer ... bit of a crock to do it here. */
  jinit_marker_writer(cinfo);
  /* Write them tables! */
  (*cinfo->marker->write_tables_only) (cinfo);
  /* And clean up. */
  (*cinfo->dest->term_destination) (cinfo);
  /*
   * In library releases up through v6a, we called jpeg_abort() here to free
   * any working memory allocated by the destination manager and marker
   * writer.  Some applications had a problem with that: they allocated space
   * of their own from the library memory manager, and didn't want it to go
   * away during write_tables.  So now we do nothing.  This will cause a
   * memory leak if an app calls write_tables repeatedly without doing a full
   * compression cycle or otherwise resetting the JPEG object.  However, that
   * seems less bad than unexpectedly freeing memory in the normal case.
   * An app that prefers the old behavior can call jpeg_abort for itself after
   * each call to jpeg_write_tables().
   */
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0x64, %eax
je 0x6867f
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
callq 0x69e5c
movq 0x1d0(%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x28(%rbx), %rax
movq %rbx, %rdi
popq %rbx
jmpq *0x20(%rax)
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcapistd.c
// Function: jpeg_start_compress
GLOBAL(void)
jpeg_start_compress (j_compress_ptr cinfo, jboolean write_all_tables)
{
  if (cinfo->global_state != CSTATE_START)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  if (write_all_tables)
    jpeg_suppress_tables(cinfo, FALSE);	/* mark all tables to be written */

  /* (Re)initialize error mgr and destination modules */
  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);
  (*cinfo->dest->init_destination) (cinfo);
  /* Perform master selection of active modules */
  jinit_compress_master(cinfo);
  /* Set up for the first pass */
  (*cinfo->master->prepare_for_pass) (cinfo);
  /* Ready for application to drive first pass through jpeg_write_scanlines
   * or jpeg_write_raw_data.
   */
  cinfo->next_scanline = 0;
  cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x24(%rdi), %eax
cmpl $0x64, %eax
je 0x686d9
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
testl %ebp, %ebp
je 0x686e7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6843c
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
callq 0x69208
movq 0x1b0(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
andl $0x0, 0x130(%rbx)
cmpl $0x1, 0x100(%rbx)
pushq $0x66
popq %rax
sbbl $0x0, %eax
movl %eax, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcapistd.c
// Function: jpeg_write_scanlines
GLOBAL(JDIMENSION)
jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,
		      JDIMENSION num_lines)
{
  JDIMENSION row_ctr, rows_left;

  if (cinfo->global_state != CSTATE_SCANNING)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  if (cinfo->next_scanline >= cinfo->image_height)
    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);

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

  /* Give master control module another chance if this is first call to
   * jpeg_write_scanlines.  This lets output of the frame/scan headers be
   * delayed so that application can write COM, etc, markers between
   * jpeg_start_compress and jpeg_write_scanlines.
   */
  if (cinfo->master->call_pass_startup)
    (*cinfo->master->pass_startup) (cinfo);

  /* Ignore any extra scanlines at bottom of image. */
  rows_left = cinfo->image_height - cinfo->next_scanline;
  if (num_lines > rows_left)
    num_lines = rows_left;

  row_ctr = 0;
  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
  cinfo->next_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 $0x65, %eax
je 0x68758
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x130(%rbx), %eax
cmpl 0x34(%rbx), %eax
jb 0x68776
movq (%rbx), %rax
movl $0x7b, 0x28(%rax)
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq *0x8(%rax)
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x68795
movl 0x130(%rbx), %ecx
movq %rcx, 0x8(%rax)
movl 0x34(%rbx), %ecx
movq %rcx, 0x10(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x1b0(%rbx), %rax
cmpl $0x0, 0x18(%rax)
je 0x687a8
movq %rbx, %rdi
callq *0x8(%rax)
movl 0x34(%rbx), %ecx
subl 0x130(%rbx), %ecx
cmpl %ebp, %ecx
cmovael %ebp, %ecx
leaq 0x4(%rsp), %r15
andl $0x0, (%r15)
movq 0x1b8(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x8(%rax)
movl (%r15), %eax
addl %eax, 0x130(%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/jcapistd.c
// Function: jpeg_write_raw_data
GLOBAL(JDIMENSION)
jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
		     JDIMENSION num_lines)
{
  JDIMENSION lines_per_iMCU_row;

  if (cinfo->global_state != CSTATE_RAW_OK)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  if (cinfo->next_scanline >= cinfo->image_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->next_scanline;
    cinfo->progress->pass_limit = (long) cinfo->image_height;
    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);
  }

  /* Give master control module another chance if this is first call to
   * jpeg_write_raw_data.  This lets output of the frame/scan headers be
   * delayed so that application can write COM, etc, markers between
   * jpeg_start_compress and jpeg_write_raw_data.
   */
  if (cinfo->master->call_pass_startup)
    (*cinfo->master->pass_startup) (cinfo);

  /* Verify that at least one iMCU row has been passed. */
  lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
  if (num_lines < lines_per_iMCU_row)
    ERREXIT(cinfo, JERR_BUFFER_SIZE);

  /* Directly compress the row. */
  if (! (*cinfo->coef->compress_data) (cinfo, data)) {
    /* If compressor did not consume the whole row, suspend processing. */
    return 0;
  }

  /* OK, we processed one iMCU row. */
  cinfo->next_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 $0x66, %eax
je 0x68812
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x34(%rbx), %eax
movl 0x130(%rbx), %ecx
cmpl %eax, %ecx
jae 0x68884
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x68835
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
callq *(%rdx)
movq 0x1b0(%rbx), %rax
cmpl $0x0, 0x18(%rax)
je 0x68848
movq %rbx, %rdi
callq *0x8(%rax)
movl 0x13c(%rbx), %r15d
shll $0x3, %r15d
cmpl %ebp, %r15d
jbe 0x68867
movq (%rbx), %rax
movl $0x17, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x1c8(%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x8(%rax)
testl %eax, %eax
je 0x68897
addl %r15d, 0x130(%rbx)
jmp 0x6889a
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/jcparam.c
// Function: jpeg_add_quant_table
GLOBAL(void)
jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
		      const unsigned int *basic_table,
		      int scale_factor, jboolean force_baseline)
/* Define a quantization table equal to the basic_table times
 * a scale factor (given as a percentage).
 * If force_baseline is TRUE, the computed quantization table entries
 * are limited to 1..255 for JPEG baseline compatibility.
 */
{
  JQUANT_TBL ** qtblptr;
  int i;
  long temp;

  /* Safety check to ensure start_compress not called yet. */
  if (cinfo->global_state != CSTATE_START)
    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);

  if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
    ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);

  qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];

  if (*qtblptr == NULL)
    *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);

  for (i = 0; i < DCTSIZE2; i++) {
    temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;
    /* limit the values to the valid range */
    if (temp <= 0L) temp = 1L;
    if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
    if (force_baseline && temp > 255L)
      temp = 255L;		/* limit to baseline range if requested */
    (*qtblptr)->quantval[i] = (UINT16) temp;
  }

  /* Initialize sent_table FALSE so table will be written to JPEG file. */
  (*qtblptr)->sent_table = FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r15
movl 0x24(%rdi), %eax
cmpl $0x64, %eax
je 0x688db
movq (%r15), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%r15), %rax
movq %r15, %rdi
callq *(%rax)
cmpl $0x4, %r12d
jb 0x688f7
movq (%r15), %rax
movl $0x1f, 0x28(%rax)
movl %r12d, 0x2c(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *(%rax)
movslq %r12d, %r12
movq 0x60(%r15,%r12,8), %rcx
testq %rcx, %rcx
jne 0x68914
movq %r15, %rdi
callq 0x79121
movq %rax, %rcx
movq %rax, 0x60(%r15,%r12,8)
movslq %ebp, %rsi
xorl %edi, %edi
pushq $0x64
popq %r8
pushq $0x1
popq %r9
movl $0xff, %r10d
cmpq $0x40, %rdi
je 0x68971
movl (%r14,%rdi,4), %r11d
imulq %rsi, %r11
leaq 0x32(%r11), %rax
cqto
idivq %r8
cmpq $0x2, %rax
jge 0x68947
movq %r9, %rax
movl $0x7fff, %edx           # imm = 0x7FFF
cmpq %rdx, %rax
jl 0x68956
movl $0x7fff, %eax           # imm = 0x7FFF
cmpq $0x63ce, %r11           # imm = 0x63CE
movl %eax, %edx
cmovgel %r10d, %edx
testl %ebx, %ebx
cmovel %eax, %edx
movw %dx, (%rcx,%rdi,2)
incq %rdi
jmp 0x68927
andl $0x0, 0x80(%rcx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcparam.c
// Function: fill_dc_scans
LOCAL(jpeg_scan_info *)
fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)
/* Support routine: generate interleaved DC scan if possible, else N scans */
{
  int ci;

  if (ncomps <= MAX_COMPS_IN_SCAN) {
    /* Single interleaved DC scan */
    scanptr->comps_in_scan = ncomps;
    for (ci = 0; ci < ncomps; ci++)
      scanptr->component_index[ci] = ci;
    scanptr->Ss = scanptr->Se = 0;
    scanptr->Ah = Ah;
    scanptr->Al = Al;
    scanptr++;
  } else {
    /* Noninterleaved DC scan for each component */
    scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);
  }
  return scanptr;
}

// Assembly:
movl %ecx, %r9d
movl %edx, %r8d
cmpl $0x4, %esi
jg 0x68fed
movl %esi, (%rdi)
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
cmpq %rax, %rsi
je 0x68ff3
movl %eax, 0x4(%rdi,%rax,4)
incq %rax
jmp 0x68fdf
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x69008
andq $0x0, 0x14(%rdi)
movl %r8d, 0x1c(%rdi)
movl %r9d, 0x20(%rdi)
addq $0x24, %rdi
movq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcparam.c
// Function: add_huff_table
LOCAL(void)
add_huff_table (j_compress_ptr cinfo,
		JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
/* Define a Huffman table */
{
  int nsymbols, len;

  if (*htblptr == NULL)
    *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);

  /* Copy the number-of-symbols-of-each-code-length counts */
  MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));

  /* Validate the counts.  We do this here mainly so we can copy the right
   * number of symbols from the val[] array, without risking marching off
   * the end of memory.  jchuff.c will do a more thorough test later.
   */
  nsymbols = 0;
  for (len = 1; len <= 16; len++)
    nsymbols += bits[len];
  if (nsymbols < 1 || nsymbols > 256)
    ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);

  MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));

  /* Initialize sent_table FALSE so table will be written to JPEG file. */
  (*htblptr)->sent_table = FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movq (%rsi), %rax
testq %rax, %rax
jne 0x6905e
movq %r15, %rdi
callq 0x79138
movq %rax, (%rbx)
movb 0x10(%r12), %cl
movb %cl, 0x10(%rax)
movups (%r12), %xmm0
movups %xmm0, (%rax)
xorl %eax, %eax
xorl %r13d, %r13d
cmpq $0x10, %rax
je 0x69087
movzbl 0x1(%r12,%rax), %ecx
addl %ecx, %r13d
incq %rax
jmp 0x69073
movl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
leal (%rax,%r13), %ecx
cmpl %eax, %ecx
ja 0x690a3
movq (%r15), %rax
movl $0x8, 0x28(%rax)
movq %r15, %rdi
callq *(%rax)
movq (%rbx), %rdi
addq $0x11, %rdi
movl %r13d, %edx
movq %r14, %rsi
callq 0xe380
movq (%rbx), %rax
andl $0x0, 0x114(%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdatadst.c
// Function: jpeg_stdio_dest
GLOBAL(void)
jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)
{
  my_dest_ptr dest;

  /* The destination object is made permanent so that multiple JPEG images
   * can be written to the same file without re-executing jpeg_stdio_dest.
   * This makes it dangerous to use this manager and a different destination
   * manager serially with the same JPEG object, because their private object
   * sizes may be different.  Caveat programmer.
   */
  if (cinfo->dest == NULL) {	/* first time for this JPEG object? */
    cinfo->dest = (struct jpeg_destination_mgr *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
				  SIZEOF(my_destination_mgr));
  }

  dest = (my_dest_ptr) cinfo->dest;
  dest->pub.init_destination = init_destination;
  dest->pub.empty_output_buffer = empty_output_buffer;
  dest->pub.term_destination = term_destination;
  dest->outfile = outfile;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x28(%rdi), %rax
testq %rax, %rax
jne 0x690ee
movq %rdi, %r14
movq 0x8(%rdi), %rax
pushq $0x38
popq %rdx
xorl %esi, %esi
callq *(%rax)
movq %rax, 0x28(%r14)
leaq 0x26(%rip), %rcx        # 0x6911b
movq %rcx, 0x10(%rax)
leaq 0x3f(%rip), %rcx        # 0x6913f
movq %rcx, 0x18(%rax)
leaq 0x85(%rip), %rcx        # 0x69190
movq %rcx, 0x20(%rax)
movq %rbx, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdatadst.c
// Function: init_destination
METHODDEF(void)
init_destination (j_compress_ptr cinfo)
{
  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;

  /* Allocate the output buffer --- it will be released when done with image */
  dest->buffer = (JOCTET *)
      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				  OUTPUT_BUF_SIZE * SIZEOF(JOCTET));

  dest->pub.next_output_byte = dest->buffer;
  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
}

// Assembly:
pushq %rbx
movq 0x8(%rdi), %rax
movq 0x28(%rdi), %rbx
pushq $0x1
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq *(%rax)
movq %rax, 0x30(%rbx)
movq %rax, (%rbx)
movq $0x1000, 0x8(%rbx)      # imm = 0x1000
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdatadst.c
// Function: empty_output_buffer
METHODDEF(jboolean)
empty_output_buffer (j_compress_ptr cinfo)
{
  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;

  if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=
      (size_t) OUTPUT_BUF_SIZE)
    ERREXIT(cinfo, JERR_FILE_WRITE);

  dest->pub.next_output_byte = dest->buffer;
  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;

  return TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rdi
pushq $0x1
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0xe8e0
cmpq $0x1000, %rax           # imm = 0x1000
je 0x69176
movq (%rbx), %rax
movl $0x25, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x30(%r14), %rax
movq %rax, (%r14)
movq $0x1000, 0x8(%r14)      # imm = 0x1000
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jdatadst.c
// Function: term_destination
METHODDEF(void)
term_destination (j_compress_ptr cinfo)
{
  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;
  size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;

  /* Write any data remaining in the buffer */
  if (datacount > 0) {
    if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
      ERREXIT(cinfo, JERR_FILE_WRITE);
  }
  fflush(dest->outfile);
  /* Make sure we wrote the output file OK */
  if (ferror(dest->outfile))
    ERREXIT(cinfo, JERR_FILE_WRITE);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %r15
movq 0x8(%r15), %rax
cmpq $0x1000, %rax           # imm = 0x1000
je 0x691d8
movl $0x1000, %r14d          # imm = 0x1000
subq %rax, %r14
movq 0x28(%r15), %rcx
movq 0x30(%r15), %rdi
pushq $0x1
popq %rsi
movq %r14, %rdx
callq 0xe8e0
cmpq %r14, %rax
je 0x691d8
movq (%rbx), %rax
movl $0x25, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
movq 0x28(%r15), %rdi
callq 0xe540
movq 0x28(%r15), %rdi
callq 0xe8a0
testl %eax, %eax
je 0x69202
movq (%rbx), %rax
movl $0x25, 0x28(%rax)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcinit.c
// Function: jinit_compress_master
GLOBAL(void)
jinit_compress_master (j_compress_ptr cinfo)
{
  /* Initialize master control (includes parameter checking/processing) */
  jinit_c_master_control(cinfo, FALSE /* full compression */);

  /* Preprocessing */
  if (! cinfo->raw_data_in) {
    jinit_color_converter(cinfo);
    jinit_downsampler(cinfo);
    jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
  }
  /* Forward DCT */
  jinit_forward_dct(cinfo);
  /* Entropy encoding: either Huffman or arithmetic coding. */
  if (cinfo->arith_code) {
    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
  } else {
    if (cinfo->progressive_mode) {
#ifdef C_PROGRESSIVE_SUPPORTED
      jinit_phuff_encoder(cinfo);
#else
      ERREXIT(cinfo, JERR_NOT_COMPILED);
#endif
    } else
      jinit_huff_encoder(cinfo);
  }

  /* Need a full-image coefficient buffer in any multi-pass mode. */
  jinit_c_coef_controller(cinfo,
		(jboolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));
  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);

  jinit_marker_writer(cinfo);

  /* We can now tell the memory manager to allocate virtual arrays. */
  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);

  /* Write the datastream header (SOI) immediately.
   * Frame and scan headers are postponed till later.
   * This lets application insert special markers after the SOI.
   */
  (*cinfo->marker->write_file_header) (cinfo);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x692c0
cmpl $0x0, 0x100(%rbx)
jne 0x69236
movq %rbx, %rdi
callq 0x6b5b4
movq %rbx, %rdi
callq 0x6bb48
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6a824
movq %rbx, %rdi
callq 0x6dd64
cmpl $0x0, 0x104(%rbx)
je 0x69258
movq (%rbx), %rax
movl $0x1, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
jmp 0x69273
cmpl $0x0, 0x134(%rbx)
je 0x6926b
movq %rbx, %rdi
callq 0x6d1c0
jmp 0x69273
movq %rbx, %rdi
callq 0x6c851
cmpl $0x1, 0xf0(%rbx)
jle 0x69281
pushq $0x1
popq %rsi
jmp 0x6928e
xorl %esi, %esi
cmpl $0x0, 0x108(%rbx)
setne %sil
movq %rbx, %rdi
callq 0x6ae18
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6a69c
movq %rbx, %rdi
callq 0x69e5c
movq 0x8(%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq 0x1d0(%rbx), %rax
movq %rbx, %rdi
popq %rbx
jmpq *(%rax)
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmaster.c
// Function: select_scan_parameters
LOCAL(void)
select_scan_parameters (j_compress_ptr cinfo)
/* Set up the scan parameters for the current scan */
{
  int ci;

#ifdef C_MULTISCAN_FILES_SUPPORTED
  if (cinfo->scan_info != NULL) {
    /* Prepare for current scan --- the script is already validated */
    my_master_ptr master = (my_master_ptr) cinfo->master;
    const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;

    cinfo->comps_in_scan = scanptr->comps_in_scan;
    for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
      cinfo->cur_comp_info[ci] =
	&cinfo->comp_info[scanptr->component_index[ci]];
    }
    cinfo->Ss = scanptr->Ss;
    cinfo->Se = scanptr->Se;
    cinfo->Ah = scanptr->Ah;
    cinfo->Al = scanptr->Al;
  }
  else
#endif
  {
    /* Prepare for single sequential-JPEG scan containing all components */
    if (cinfo->num_components > MAX_COMPS_IN_SCAN)
      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
	       MAX_COMPS_IN_SCAN);
    cinfo->comps_in_scan = cinfo->num_components;
    for (ci = 0; ci < cinfo->num_components; ci++) {
      cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
    }
    cinfo->Ss = 0;
    cinfo->Se = DCTSIZE2-1;
    cinfo->Ah = 0;
    cinfo->Al = 0;
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xf8(%rdi), %rcx
testq %rcx, %rcx
je 0x69c5f
movq 0x1b0(%rbx), %rax
movslq 0x2c(%rax), %rax
imulq $0x24, %rax, %rdx
leaq (%rcx,%rdx), %rax
movl (%rcx,%rdx), %ecx
movl %ecx, 0x144(%rbx)
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
cmpq %rdx, %rcx
je 0x69c46
movslq 0x4(%rax,%rdx,4), %rsi
imulq $0x60, %rsi, %rsi
addq 0x58(%rbx), %rsi
movq %rsi, 0x148(%rbx,%rdx,8)
incq %rdx
jmp 0x69c27
movq 0x14(%rax), %rcx
movq %rcx, 0x19c(%rbx)
movl 0x1c(%rax), %ecx
movl %ecx, 0x1a4(%rbx)
movl 0x20(%rax), %eax
jmp 0x69cd4
movl 0x4c(%rbx), %edx
cmpl $0x5, %edx
jl 0x69c89
movq (%rbx), %rax
movl $0x1a, 0x28(%rax)
movl %edx, 0x2c(%rax)
movq (%rbx), %rax
movl $0x4, 0x30(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl 0x4c(%rbx), %edx
movl %edx, 0x144(%rbx)
leaq 0x148(%rbx), %rax
xorl %ecx, %ecx
testl %edx, %edx
cmovlel %ecx, %edx
imulq $0x60, %rdx, %rdx
cmpq %rcx, %rdx
je 0x69cba
movq 0x58(%rbx), %rsi
addq %rcx, %rsi
movq %rsi, (%rax)
addq $0x60, %rcx
addq $0x8, %rax
jmp 0x69ca1
movabsq $0x3f00000000, %rax     # imm = 0x3F00000000
movq %rax, 0x19c(%rbx)
andl $0x0, 0x1a4(%rbx)
xorl %eax, %eax
movl %eax, 0x1a8(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: jinit_marker_writer
GLOBAL(void)
jinit_marker_writer (j_compress_ptr cinfo)
{
  my_marker_ptr marker;

  /* Create the subobject */
  marker = (my_marker_ptr)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				SIZEOF(my_marker_writer));
  cinfo->marker = (struct jpeg_marker_writer *) marker;
  /* Initialize method pointers */
  marker->pub.write_file_header = write_file_header;
  marker->pub.write_frame_header = write_frame_header;
  marker->pub.write_scan_header = write_scan_header;
  marker->pub.write_file_trailer = write_file_trailer;
  marker->pub.write_tables_only = write_tables_only;
  marker->pub.write_marker_header = write_marker_header;
  marker->pub.write_marker_byte = write_marker_byte;
  /* Initialize private state */
  marker->last_restart_interval = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
pushq $0x1
popq %rsi
pushq $0x40
popq %rdx
callq *(%rax)
movq %rax, 0x1d0(%rbx)
leaq 0x4b(%rip), %rcx        # 0x69ec5
movq %rcx, (%rax)
leaq 0x1bc(%rip), %rcx       # 0x6a040
movq %rcx, 0x8(%rax)
leaq 0x2a9(%rip), %rcx       # 0x6a138
movq %rcx, 0x10(%rax)
leaq 0x434(%rip), %rcx       # 0x6a2ce
movq %rcx, 0x18(%rax)
leaq 0x433(%rip), %rcx       # 0x6a2d8
movq %rcx, 0x20(%rax)
leaq 0x4b2(%rip), %rcx       # 0x6a362
movq %rcx, 0x28(%rax)
leaq 0x4e1(%rip), %rcx       # 0x6a39c
movq %rcx, 0x30(%rax)
andl $0x0, 0x38(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: write_file_header
METHODDEF(void)
write_file_header (j_compress_ptr cinfo)
{
  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;

  emit_marker(cinfo, M_SOI);	/* first the SOI */

  /* SOI is defined to reset restart interval to 0 */
  marker->last_restart_interval = 0;

  if (cinfo->write_JFIF_header)	/* next an optional JFIF APP0 */
    emit_jfif_app0(cinfo);
  if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
    emit_adobe_app14(cinfo);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x1d0(%rdi), %r14
movl $0xd8, %esi
callq 0x6a39e
andl $0x0, 0x38(%r14)
cmpl $0x0, 0x120(%rbx)
je 0x69f9d
movq %rbx, %rdi
movl $0xe0, %esi
callq 0x6a39e
pushq $0x10
popq %rsi
movq %rbx, %rdi
callq 0x6a3f3
pushq $0x4a
popq %rsi
movq %rbx, %rdi
callq 0x6a3bf
pushq $0x46
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6a3bf
pushq $0x49
popq %rsi
movq %rbx, %rdi
callq 0x6a3bf
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6a3bf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6a3bf
movzbl 0x124(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3bf
movzbl 0x125(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3bf
movzbl 0x126(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3bf
movzwl 0x128(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3f3
movzwl 0x12a(%rbx), %esi
movq %rbx, %rdi
callq 0x6a3f3
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6a3bf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6a3bf
cmpl $0x0, 0x12c(%rbx)
je 0x6a03b
movq %rbx, %rdi
movl $0xee, %esi
callq 0x6a39e
pushq $0xe
popq %rsi
movq %rbx, %rdi
callq 0x6a3f3
pushq $0x41
popq %rsi
movq %rbx, %rdi
callq 0x6a3bf
pushq $0x64
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6a3bf
pushq $0x6f
popq %rsi
movq %rbx, %rdi
callq 0x6a3bf
pushq $0x62
popq %rsi
movq %rbx, %rdi
callq 0x6a3bf
pushq $0x65
popq %rsi
movq %rbx, %rdi
callq 0x6a3bf
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6a3f3
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6a3f3
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6a3f3
movl 0x50(%rbx), %eax
xorl %ecx, %ecx
cmpl $0x5, %eax
sete %cl
addl %ecx, %ecx
cmpl $0x3, %eax
pushq $0x1
popq %rsi
cmovnel %ecx, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x6a3bf
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: write_frame_header
METHODDEF(void)
write_frame_header (j_compress_ptr cinfo)
{
  int ci, prec;
  jboolean is_baseline;
  jpeg_component_info *compptr;
  
  /* Emit DQT for each quantization table.
   * Note that emit_dqt() suppresses any duplicate tables.
   */
  prec = 0;
  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
       ci++, compptr++) {
    prec += emit_dqt(cinfo, compptr->quant_tbl_no);
  }
  /* now prec is nonzero iff there are any 16-bit quant tables. */

  /* Check for a non-baseline specification.
   * Note we assume that Huffman table numbers won't be changed later.
   */
  if (cinfo->arith_code || cinfo->progressive_mode ||
      cinfo->data_precision != 8) {
    is_baseline = FALSE;
  } else {
    is_baseline = TRUE;
    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
	 ci++, compptr++) {
      if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
	is_baseline = FALSE;
    }
    if (prec && is_baseline) {
      is_baseline = FALSE;
      /* If it's baseline except for quantizer size, warn the user */
      TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
    }
  }

  /* Emit the proper SOF marker */
  if (cinfo->arith_code) {
    emit_sof(cinfo, M_SOF9);	/* SOF code for arithmetic coding */
  } else {
    if (cinfo->progressive_mode)
      emit_sof(cinfo, M_SOF2);	/* SOF code for progressive Huffman */
    else if (is_baseline)
      emit_sof(cinfo, M_SOF0);	/* SOF code for baseline implementation */
    else
      emit_sof(cinfo, M_SOF1);	/* SOF code for non-baseline Huffman file */
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %r15
addq $0x10, %r15
xorl %ebp, %ebp
xorl %r14d, %r14d
movl 0x4c(%rbx), %esi
cmpl %esi, %ebp
jge 0x6a074
movl (%r15), %esi
movq %rbx, %rdi
callq 0x6a418
addl %eax, %r14d
incl %ebp
addq $0x60, %r15
jmp 0x6a057
movl $0xc9, %ebp
cmpl $0x0, 0x104(%rbx)
jne 0x6a124
cmpl $0x0, 0x134(%rbx)
je 0x6a099
movl $0xc2, %ebp
jmp 0x6a124
xorl %eax, %eax
cmpl $0x8, 0x48(%rbx)
jne 0x6a108
movq 0x58(%rbx), %rcx
xorl %edx, %edx
testl %esi, %esi
cmovgl %esi, %edx
addq $0x18, %rcx
pushq $0x1
popq %rax
subl $0x1, %edx
jb 0x6a0cb
cmpl $0x1, -0x4(%rcx)
jg 0x6a0c3
cmpl $0x2, (%rcx)
jl 0x6a0c5
xorl %eax, %eax
addq $0x60, %rcx
jmp 0x6a0b3
testl %r14d, %r14d
setne %cl
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x6a108
movq (%rbx), %rax
movl $0x4b, 0x28(%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq *0x8(%rax)
cmpl $0x0, 0x104(%rbx)
jne 0x6a124
cmpl $0x0, 0x134(%rbx)
movl $0xc2, %ebp
jne 0x6a124
jmp 0x6a11f
cmpl $0x0, 0x134(%rbx)
movl $0xc2, %ebp
jne 0x6a124
movl $0xc0, %ebp
testl %eax, %eax
jne 0x6a124
movl $0xc1, %ebp
movq %rbx, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6a4fd
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: write_tables_only
METHODDEF(void)
write_tables_only (j_compress_ptr cinfo)
{
  int i;

  emit_marker(cinfo, M_SOI);

  for (i = 0; i < NUM_QUANT_TBLS; i++) {
    if (cinfo->quant_tbl_ptrs[i] != NULL)
      (void) emit_dqt(cinfo, i);
  }

  if (! cinfo->arith_code) {
    for (i = 0; i < NUM_HUFF_TBLS; i++) {
      if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
	emit_dht(cinfo, i, FALSE);
      if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
	emit_dht(cinfo, i, TRUE);
    }
  }

  emit_marker(cinfo, M_EOI);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0xd8, %esi
callq 0x6a39e
xorl %r14d, %r14d
cmpq $0x4, %r14
je 0x6a30a
cmpq $0x0, 0x60(%rbx,%r14,8)
je 0x6a305
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6a418
incq %r14
jmp 0x6a2ec
cmpl $0x0, 0x104(%rbx)
je 0x6a321
movq %rbx, %rdi
movl $0xd9, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x6a39e
xorl %r14d, %r14d
pushq $0x1
popq %rbp
cmpq $0x4, %r14
je 0x6a313
cmpq $0x0, 0x80(%rbx,%r14,8)
je 0x6a345
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x6a5b3
cmpq $0x0, 0xa0(%rbx,%r14,8)
je 0x6a35d
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x6a5b3
incq %r14
jmp 0x6a327
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: write_marker_header
METHODDEF(void)
write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)
/* Emit an arbitrary marker header */
{
  if (datalen > (unsigned int) 65533)		/* safety check */
    ERREXIT(cinfo, JERR_BAD_LENGTH);

  emit_marker(cinfo, (JPEG_MARKER) marker);

  emit_2bytes(cinfo, (int) (datalen + 2));	/* total length */
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
cmpl $0xfffe, %edx           # imm = 0xFFFE
jb 0x6a384
movq (%r14), %rax
movl $0xb, 0x28(%rax)
movq %r14, %rdi
callq *(%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x6a39e
addl $0x2, %ebx
movq %r14, %rdi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x6a3f3
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/jpeg/jcmarker.c
// Function: emit_byte
LOCAL(void)
emit_byte (j_compress_ptr cinfo, int val)
/* Emit a byte */
{
  struct jpeg_destination_mgr * dest = cinfo->dest;

  *(dest->next_output_byte)++ = (JOCTET) val;
  if (--dest->free_in_buffer == 0) {
    if (! (*dest->empty_output_buffer) (cinfo))
      ERREXIT(cinfo, JERR_CANT_SUSPEND);
  }
}

// Assembly:
pushq %rbx
movq 0x28(%rdi), %rax
movq (%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rax)
movb %sil, (%rcx)
decq 0x8(%rax)
jne 0x6a3e1
movq %rdi, %rbx
callq *0x18(%rax)
testl %eax, %eax
je 0x6a3e3
popq %rbx
retq
movq (%rbx), %rax
movl $0x18, 0x28(%rax)
movq %rbx, %rdi
popq %rbx
jmpq *(%rax)