LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::clr_top_supdiag_elt(double*, int, int, double*, int, int, int)
void clr_top_supdiag_elt(RNScalar * b,int p,int z,RNScalar * u,int m,int n,int min)
{
    int i;
    RNScalar r, x, hypot, cos, sin;

    for (i=p+1; i<=z; i++) {
	r = REF2D(b,m,n,p,i);
	x = REF2D(b,m,n,i,i);
	if (r==0) break;
	hypot = ((RNScalar) sqrt (r*r + x*x)); //hypot = pythag(r,x);
	cos = x/hypot;
	sin = r/hypot;
	/* update the diagonal and superdiagonal elements */
	REF2D(b,m,n,p,i) = 0;
	REF2D(b,m,n,i,i) = hypot;
	/* Rotate the remainder of rows p and i (only need to
	** rotate one more element, since the rest are zero) */
	if (i != z) rotate_rows(p,i,cos,sin,b,i+1,1,m,n);
	/* accumulate the rotation into u */
	rotate_cols(i,p,cos,sin,u,0,m,m,min);
    }
}

// Assembly:
cmpl %edx, %esi
jge 0x7131e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r8d, %ebp
movl %r9d, %eax
imull %esi, %eax
cltq
movslq 0xa0(%rsp), %r12
movslq %esi, %rbx
movl %r8d, %esi
movq %rsi, 0x40(%rsp)
movslq %r9d, %rsi
movq %rsi, 0x20(%rsp)
incl %r9d
movslq %edx, %rsi
movq %rax, 0x28(%rsp)
leaq (%rdi,%rax,8), %r10
leaq 0x10(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq (%rcx,%rbx,8), %rax
movq %rax, 0x38(%rsp)
shlq $0x3, %r12
movl $0x8, %r15d
xorpd %xmm5, %xmm5
movl %r9d, 0x4(%rsp)
movq %rdi, 0x30(%rsp)
movq %rsi, 0x18(%rsp)
movq %r10, 0x10(%rsp)
movsd 0x8(%r10,%rbx,8), %xmm6
ucomisd %xmm5, %xmm6
jne 0x711db
jnp 0x71310
leaq 0x1(%rbx), %r13
movl %r9d, %eax
imull %r13d, %eax
movslq %eax, %r14
movsd (%rdi,%r14,8), %xmm7
movapd %xmm7, %xmm1
mulsd %xmm7, %xmm1
movapd %xmm6, %xmm0
mulsd %xmm6, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm5, %xmm0
jb 0x7120f
sqrtsd %xmm0, %xmm0
jmp 0x71244
movapd %xmm6, 0x50(%rsp)
movsd %xmm7, 0x48(%rsp)
callq 0xe340
movsd 0x48(%rsp), %xmm7
movapd 0x50(%rsp), %xmm6
xorpd %xmm5, %xmm5
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rdi
movl 0x4(%rsp), %r9d
divsd %xmm0, %xmm7
divsd %xmm0, %xmm6
movq $0x0, (%r10,%r13,8)
movsd %xmm0, (%rdi,%r14,8)
cmpq %rsi, %r13
je 0x712aa
movq %r13, %rax
imulq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rbx,8), %rcx
movq 0x28(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movsd (%rcx,%rax,8), %xmm1
movapd %xmm6, %xmm2
mulsd %xmm1, %xmm2
movapd %xmm7, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%rcx,%rdx,8)
mulsd %xmm7, %xmm1
mulsd %xmm6, %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%rcx,%rax,8)
testl %ebp, %ebp
jle 0x71300
movapd %xmm6, %xmm0
xorpd 0x30d66(%rip), %xmm0    # 0xa2020
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
movsd (%rax,%r15), %xmm1
movsd (%rax), %xmm2
movapd %xmm6, %xmm3
mulsd %xmm2, %xmm3
movapd %xmm7, %xmm4
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rax,%r15)
mulsd %xmm7, %xmm2
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, (%rax)
addq %r12, %rax
decq %rcx
jne 0x712c4
addq $0x8, %r15
movq %r13, %rbx
cmpq %rsi, %r13
jne 0x711c8
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::clr_bot_supdiag_elt(double*, int, int, double*, int, int, int)
void clr_bot_supdiag_elt(RNScalar * b,int p,int z,RNScalar * v,int m,int n,int min)
{
    int i;
    RNScalar r, x, hypot, cos, sin;

    for (i=z-1; i>=p; i--) {
	r = REF2D(b,m,n,i,z);
	x = REF2D(b,m,n,i,i);
	if (r==0) break;
	hypot = ((RNScalar) sqrt (r*r + x*x)); //hypot = pythag(r,x);
	cos = x/hypot;
	sin = r/hypot;
	/* update the diagonal and superdiagonal elements */
	REF2D(b,m,n,i,z) = 0;
	REF2D(b,m,n,i,i) = hypot;
	/* Rotate the remainder of cols z and i (only need to
	** rotate one more element, since the rest are zero) */
	if (i != p) rotate_cols(i,z,cos,sin,b,i-1,1,m,n);
	/* accumulate the rotation into v */
	rotate_rows(i,z,cos,sin,v,0,n,min,n);
    }
}

// Assembly:
cmpl %esi, %edx
jle 0x71500
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movslq %r9d, %r8
movslq %edx, %rbx
imull %r9d, %edx
movslq %edx, %rax
movl %r8d, %r13d
movslq %esi, %rdx
leaq (%rdi,%rbx,8), %rsi
leaq (%rcx,%rax,8), %r14
leaq -0x1(%rbx), %rax
imulq %r8, %rax
leaq (%rcx,%rax,8), %r15
leaq (,%r8,8), %r10
negq %r10
xorpd %xmm5, %xmm5
movq %rbx, 0x20(%rsp)
movl %r9d, 0x4(%rsp)
movq %rdi, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %r10, 0x8(%rsp)
leaq -0x1(%rbx), %r12
movq %r12, %rbp
imulq %r8, %rbp
movsd (%rsi,%rbp,8), %xmm6
ucomisd %xmm5, %xmm6
jne 0x713aa
jnp 0x714f2
movl %r12d, %eax
imull %r9d, %eax
cltq
leaq (%rdi,%r12,8), %rcx
movsd (%rcx,%rax,8), %xmm7
movapd %xmm7, %xmm1
mulsd %xmm7, %xmm1
movapd %xmm6, %xmm0
mulsd %xmm6, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm5, %xmm0
jb 0x713dc
sqrtsd %xmm0, %xmm0
jmp 0x7142f
movapd %xmm6, 0x50(%rsp)
movsd %xmm7, 0x48(%rsp)
movq %rax, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
callq 0xe340
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rax
movsd 0x48(%rsp), %xmm7
movapd 0x50(%rsp), %xmm6
xorpd %xmm5, %xmm5
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %rdi
movl 0x4(%rsp), %r9d
divsd %xmm0, %xmm7
divsd %xmm0, %xmm6
movq $0x0, (%rsi,%rbp,8)
movsd %xmm0, (%rcx,%rax,8)
cmpq %rdx, %r12
je 0x71490
addq $-0x2, %rbx
imulq %r8, %rbx
leaq (%rdi,%rbx,8), %rax
movsd (%rax,%r12,8), %xmm0
movq 0x20(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movapd %xmm6, %xmm2
mulsd %xmm1, %xmm2
movapd %xmm7, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%rax,%r12,8)
mulsd %xmm7, %xmm1
mulsd %xmm6, %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%rax,%rcx,8)
testl %r9d, %r9d
jle 0x714e3
movapd %xmm6, %xmm0
xorpd 0x30b7f(%rip), %xmm0    # 0xa2020
xorl %eax, %eax
movsd (%r15,%rax,8), %xmm1
movsd (%r14,%rax,8), %xmm2
movapd %xmm6, %xmm3
mulsd %xmm2, %xmm3
movapd %xmm7, %xmm4
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%r15,%rax,8)
mulsd %xmm7, %xmm2
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, (%r14,%rax,8)
incq %rax
cmpq %rax, %r13
jne 0x714a3
addq %r10, %r15
movq %r12, %rbx
cmpq %rdx, %r12
jg 0x7138e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::RNSvdBacksubstitute(int, int, double const*, double const*, double const*, double const*, double*, double)
void RNSvdBacksubstitute(int m, int n, 
    const RNScalar *u, const RNScalar *w, const RNScalar *vt, const RNScalar *b, 
    RNScalar *x, RNScalar eps)
{
    const int min = MIN(m,n);
    const RNScalar thresh = eps * w[0];	/* singular vals are sorted, w[0] is max */
    RNScalar *tmp = ALLOC1D(min);
    int i,j,k;

    for (j=0; j<min; j++) {
	RNScalar s = 0;
	if (w[j] >= thresh) {
	    for (i=0; i<m; i++) s += REF2D(u,m,min,i,j) * b[i];
	    s /= w[j];
	}
	tmp[j] = s;
    }
    for (k=0; k<n; k++) {
	RNScalar s=0;
	for (j=0; j<min; j++) s += REF2D(vt,min,n,j,k) * tmp[j];
	x[k] = s;
    }
    FREE(tmp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r13
movl %edi, %ebp
cmpl %esi, %edi
movl %esi, 0x4(%rsp)
movl %esi, %r14d
cmovll %edi, %r14d
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
mulsd (%rcx), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq (,%r14,8), %rdi
callq 0xe5e0
movsd 0x8(%rsp), %xmm3
movl %r14d, %ecx
testl %r14d, %r14d
jle 0x723f4
movl %ebp, %edx
leaq (,%rcx,8), %rsi
xorl %edi, %edi
movsd (%r12,%rdi,8), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm3, %xmm1
jb 0x723e3
movq %r13, %r8
xorl %r9d, %r9d
movsd (%r8), %xmm2
mulsd (%r15,%r9,8), %xmm2
addsd %xmm2, %xmm0
incq %r9
addq %rsi, %r8
cmpq %r9, %rdx
jne 0x723c5
divsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rdi,8)
incq %rdi
addq $0x8, %r13
cmpq %rcx, %rdi
jne 0x723af
movl 0x4(%rsp), %edx
testl %edx, %edx
movq 0x10(%rsp), %r10
jle 0x72447
movl %edx, %edx
leaq (,%rdx,8), %rsi
xorl %edi, %edi
xorpd %xmm0, %xmm0
testl %ebp, %ebp
jle 0x72435
movq %rbx, %r8
xorl %r9d, %r9d
movsd (%r8), %xmm1
mulsd (%rax,%r9,8), %xmm1
addsd %xmm1, %xmm0
incq %r9
addq %rsi, %r8
cmpq %r9, %rcx
jne 0x7241b
movsd %xmm0, (%r10,%rdi,8)
incq %rdi
addq $0x8, %rbx
cmpq %rdx, %rdi
jne 0x7240d
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe540
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNSvd.cpp
// Function: gaps::RNSvdSolve(int, int, double const*, double const*, double*, double)
void RNSvdSolve(int m, int n, 
    const RNScalar *a, const RNScalar *b,
    RNScalar *x, RNScalar eps)
{
  // Allocate memory
  int min = (m < n) ? m : n;
  RNScalar *u = new RNScalar [ m * min ];
  RNScalar *w = new RNScalar [ min ];
  RNScalar *vt = new RNScalar [ min * n ];
  assert(u && w && vt);

  // Decompose matrix
  RNSvdDecompose(m, n, a, u, w, vt);

  // Backsubstitute
  RNSvdBacksubstitute(m, n, u, w, vt, b, x, eps);

  // Delete memory
  delete [] u;
  delete [] w;
  delete [] vt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movsd %xmm0, 0x20(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movl %esi, %ebp
movl %edi, %r15d
cmpl %esi, %edi
movl %esi, %ebx
cmovll %edi, %ebx
movl %ebx, %eax
imull %edi, %eax
cltq
leaq (,%rax,8), %rdi
testl %eax, %eax
movq $-0x1, %r14
cmovsq %r14, %rdi
callq 0xe030
movq %rax, %r13
movslq %ebx, %r12
leaq (,%r12,8), %rdi
testl %r12d, %r12d
cmovsq %r14, %rdi
callq 0xe030
movq %rax, %rbx
imull %ebp, %r12d
movslq %r12d, %rax
leaq (,%rax,8), %rdi
testl %eax, %eax
cmovsq %r14, %rdi
callq 0xe030
movq %rax, %r14
movl %r15d, %edi
movl %ebp, %esi
movq 0x8(%rsp), %rdx
movq %r13, %rcx
movq %rbx, %r8
movq %rax, %r9
callq 0x720bd
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl %r15d, %edi
movl %ebp, %esi
movq %r13, %rdx
movq %rbx, %rcx
movq %r14, %r8
movq 0x18(%rsp), %r9
movsd 0x20(%rsp), %xmm0
callq 0x7234b
movq %r13, %rdi
callq 0xe5b0
movq %rbx, %rdi
callq 0xe5b0
movq %r14, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe5b0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNScalar.cpp
// Function: gaps::RNSeedRandomScalar(double)
void 
RNSeedRandomScalar(RNScalar seed)
{
#if (RN_OS == RN_WINDOWS)
  if (seed == 0.0) srand(GetTickCount());
  else srand((int) (1.0E6 * seed));
#elif (RN_CC_VER == RN_C11)
#else
  if (seed == 0.0) { 
    struct timeval timevalue;
    gettimeofday(&timevalue, NULL);
    srand48(timevalue.tv_usec);
  }
  else {
    srand48((long) (1.0E6 * seed));
  }
#endif
  random_seeded = TRUE;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x72611
jp 0x72611
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe760
movq 0x8(%rbx), %rdi
jmp 0x7261e
mulsd 0x37937(%rip), %xmm0    # 0xa9f50
cvttsd2si %xmm0, %rdi
callq 0xe7b0
movb $0x1, 0x476196(%rip)    # 0x4e87c0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNType.cpp
// Function: gaps::RNClassType::RNClassType(int, char const*)
RNClassType::
RNClassType(RNClassID id, const char *name)
{
    // Initialize class type
    this->id = id;
    if (!name) this->name = NULL;
    else {
	this->name = new char[strlen(name) + 1];
	assert(this->name);
	strcpy(this->name, name);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl %esi, (%rdi)
testq %rdx, %rdx
je 0x72714
movq %rdx, %rbx
movq %rdx, %rdi
callq 0xe1e0
leaq 0x1(%rax), %rdi
callq 0xe030
movq %rax, 0x8(%r14)
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe3d0
movq $0x0, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNType.cpp
// Function: gaps::RNClassType::RNClassType(char const*)
RNClassType::
RNClassType(const char *name)
{
    // Initialize class type
    id = ++RNnclass_ids;
    if (!name) this->name = NULL;
    else {
	this->name = new char[strlen(name) + 1];
	assert(this->name);
	strcpy(this->name, name);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x4760a7(%rip), %eax    # 0x4e87d8
incl %eax
movl %eax, 0x47609f(%rip)    # 0x4e87d8
movl %eax, (%rdi)
testq %rsi, %rsi
je 0x7276a
movq %rsi, %rbx
movq %rsi, %rdi
callq 0xe1e0
leaq 0x1(%rax), %rdi
callq 0xe030
movq %rax, 0x8(%r14)
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe3d0
movq $0x0, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNMem.cpp
// Function: gaps::RNSwap(void*, void*, void*, int)
void RNSwap(void *node1, void *node2, void *buffer, int size)
{
    // Check arguments
    assert(node1);
    assert(node2);
    assert(size > 0);

    // Find suitable swap buffer 
    void *swap = buffer;
    char swap_buffer[RN_SWAP_BUFFER_SIZE];
    if (buffer == NULL) {
	swap = (void *) swap_buffer;
	if (size > RN_SWAP_BUFFER_SIZE) {
	    swap = (void *) malloc(size);
            if (!swap) {
		RNFail("Unable to allocate swap buffer");
                return;
	    }
	}
    }

    // Swap two buffers 
    RNCopy(node1, swap, size);
    RNCopy(node2, node1, size);
    RNCopy(swap, node2, size);

    // Free swap buffer 
    if (buffer == NULL) {
	if (size > RN_SWAP_BUFFER_SIZE) {
	    free(swap);
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %ecx, %ebx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r12
movq %rdx, %r15
testq %rdx, %rdx
jne 0x727fc
cmpl $0x401, %ebx            # imm = 0x401
jl 0x727f9
movl %ebx, %edi
callq 0xe5e0
movq %rax, %r15
testq %rax, %rax
jne 0x727fc
leaq 0x37807(%rip), %rdi     # 0xa9fe8
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x72a1e
movq %rsp, %r15
testq %r13, %r13
setne %bpl
movslq %ebx, %r13
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xe370
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xe370
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xe370
cmpl $0x401, %ebx            # imm = 0x401
setl %al
orb %bpl, %al
jne 0x72846
movq %r15, %rdi
callq 0xe540
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNMem.cpp
// Function: gaps::RNStrdup(char const*)
char *RNStrdup(const char *str)
{
  // Copy a string (RNStrdup is not part of standard)
  size_t len = strlen(str) + 1;
  void *output = malloc(len);
  if (output == NULL) return NULL;
  return (char *) memcpy (output, str, len);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xe1e0
movq %rax, %r14
incq %r14
movq %r14, %rdi
callq 0xe5e0
testq %rax, %rax
je 0x728af
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe370
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/RNBasics/RNMem.cpp
// Function: gaps::RNStrncpy(char*, char const*, int)
char *RNStrncpy(char *dst, const char *src, int max_length)
{
  // Check arguments
  if (!dst) return NULL;
  if (!src) return NULL;
  if (max_length < 0) return NULL;

  // Copy characters
  int count = 0;
  char *dstp = dst;
  const char *srcp = src;
  while (count < max_length) {
    if (count++ >= max_length) break;
    if (!*srcp) { *dstp = '\0'; break; }
    *dstp++ = *srcp++;
  }

  // Return destination address
  return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdi, %rdi
sete %cl
testq %rsi, %rsi
sete %dil
orb %cl, %dil
testl %edx, %edx
sets %cl
orb %dil, %cl
je 0x728d9
xorl %eax, %eax
retq
testl %edx, %edx
jle 0x728f5
movl %edx, %ecx
xorl %edx, %edx
movb (%rsi,%rdx), %dil
testb %dil, %dil
je 0x728f6
movb %dil, (%rax,%rdx)
incq %rdx
cmpl %edx, %ecx
jne 0x728e1
retq
movb $0x0, (%rax,%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x72987
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 0x475e39(%rip), %rdi    # 0x4e87e0
testq %rdi, %rdi
je 0x729fb
testq %r10, %r10
je 0x729ef
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 0xe5f0
movq 0x475dfb(%rip), %rsi    # 0x4e87e0
movl $0xa, %edi
callq 0xe5a0
movq 0x475dea(%rip), %rdi    # 0x4e87e0
callq 0xe520
movq 0x7256e(%rip), %rax     # 0xe4f70
movq (%rax), %rdi
callq 0xe520
movq 0x725a7(%rip), %rax     # 0xe4fb8
movq (%rax), %rdi
callq 0xe520
callq 0xe270
// File: /workspace/github_cpp_makefile_star2_O1/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 0x72a63
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 0x475d5d(%rip), %rdi    # 0x4e87e0
testq %rdi, %rdi
sete %al
testq %r10, %r10
sete %cl
orb %al, %cl
jne 0x72ad1
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 0xe5f0
movq 0x475d19(%rip), %rsi    # 0x4e87e0
movl $0xa, %edi
callq 0xe5a0
addq $0xd8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x72b1b
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 0x72b8f
cmpl $0x0, 0x475ca8(%rip)    # 0x4e87e8
jg 0x72b8f
movq %rdi, %r10
movq 0x475c94(%rip), %rdi    # 0x4e87e0
testq %rdi, %rdi
je 0x72b8f
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 0xe5f0
movq 0x475c5b(%rip), %rsi    # 0x4e87e0
movl $0xa, %edi
callq 0xe5a0
addq $0xd8, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq $0x0, 0x8(%rdi)
cmpl $0x3e, %esi
je 0x72bd2
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 0x72bfb
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), %r14
movq 0x18(%rbx), %r15
xorl %r12d, %r12d
movl $0x208, %edx            # imm = 0x208
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe260
movq %r14, (%rbx)
movq %r15, 0x18(%rbx)
movl $0x0, 0x20(%rbx)
movq %rbx, %rdi
callq 0x86cd0
movq %r12, 0x10(%rbx)
movq %r12, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movq %r12, 0x78(%rbx)
movups %xmm0, 0x80(%rbx)
movups %xmm0, 0x90(%rbx)
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0xb0(%rbx)
movq %r12, 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_O1/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
movq 0x60(%rdi,%rax,8), %rcx
testq %rcx, %rcx
je 0x72ca1
movl %esi, 0x80(%rcx)
incq %rax
cmpq $0x4, %rax
jne 0x72c91
movq $-0x4, %rax
movq 0xa0(%rdi,%rax,8), %rcx
testq %rcx, %rcx
je 0x72cc4
movl %esi, 0x114(%rcx)
movq 0xc0(%rdi,%rax,8), %rcx
testq %rcx, %rcx
je 0x72cd7
movl %esi, 0x114(%rcx)
incq %rax
jne 0x72cb1
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x72d0b
movl 0x130(%rbx), %eax
cmpl 0x34(%rbx), %eax
jae 0x72d27
movq (%rbx), %rax
movl $0x43, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
jmp 0x72d27
cmpl $0x67, %eax
je 0x72d34
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
jmp 0x72d34
movq 0x1b0(%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x1b0(%rbx), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x72d9d
movq %rbx, %rdi
callq *(%rax)
movl 0x140(%rbx), %eax
testl %eax, %eax
je 0x72d27
xorl %r14d, %r14d
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x72d6b
movq %r14, 0x8(%rcx)
movl %eax, %eax
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 0x72d8d
movq (%rbx), %rax
movl $0x18, 0x28(%rax)
movq %rbx, %rdi
callq *(%rax)
incq %r14
movl 0x140(%rbx), %eax
cmpq %rax, %r14
jb 0x72d53
jmp 0x72d27
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 0x86a0c
// File: /workspace/github_cpp_makefile_star2_O1/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)
jne 0x72dee
movl 0x24(%r14), %eax
addl $-0x65, %eax
cmpl $0x3, %eax
jb 0x72e07
movq (%r14), %rax
movl $0x14, 0x28(%rax)
movl 0x24(%r14), %ecx
movl %ecx, 0x2c(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
movq 0x1d0(%r14), %rax
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq *0x28(%rax)
testl %ebp, %ebp
je 0x72e41
movq 0x1d0(%r14), %rax
movq 0x30(%rax), %r15
movl %ebp, %r12d
xorl %r13d, %r13d
movzbl (%rbx,%r13), %esi
movq %r14, %rdi
callq *%r15
incq %r13
cmpl %r13d, %r12d
jne 0x72e2e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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)
jne 0x72e70
movl 0x24(%r14), %eax
addl $-0x65, %eax
cmpl $0x3, %eax
jb 0x72e89
movq (%r14), %rax
movl $0x14, 0x28(%rax)
movl 0x24(%r14), %ecx
movl %ecx, 0x2c(%rax)
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_O1/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 0x72ecf
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 0x749dc
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_O1/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 0x72f29
movq (%rbx), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
testl %ebp, %ebp
je 0x72f37
movq %rbx, %rdi
xorl %esi, %esi
callq 0x72c8f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x28(%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %rbx, %rdi
callq 0x73d04
movq 0x1b0(%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movl $0x0, 0x130(%rbx)
cmpl $0x1, 0x100(%rbx)
movl $0x66, %eax
sbbl $0x0, %eax
movl %eax, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x72fad
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 0x72fcd
movq (%rbx), %rax
movl $0x7b, 0x28(%rax)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq *0x8(%rax)
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x72fec
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 0x72fff
movq %rbx, %rdi
callq *0x8(%rax)
movl 0x34(%rbx), %ecx
subl 0x130(%rbx), %ecx
cmpl %ebp, %ecx
cmovael %ebp, %ecx
leaq 0x4(%rsp), %r15
movl $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_O1/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 0x7306c
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 0x730de
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0x7308f
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movq %rbx, %rdi
callq *(%rdx)
movq 0x1b0(%rbx), %rax
cmpl $0x0, 0x18(%rax)
je 0x730a2
movq %rbx, %rdi
callq *0x8(%rax)
movl 0x13c(%rbx), %r15d
shll $0x3, %r15d
cmpl %ebp, %r15d
jbe 0x730c1
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 0x730f3
addl %r15d, 0x130(%rbx)
jmp 0x730f6
movq (%rbx), %rax
movl $0x7b, 0x28(%rax)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
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_O1/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 0x73137
movq (%r15), %rcx
movl $0x14, 0x28(%rcx)
movl %eax, 0x2c(%rcx)
movq (%r15), %rax
movq %r15, %rdi
callq *(%rax)
cmpl $0x4, %r12d
jb 0x73153
movq (%r15), %rax
movl $0x1f, 0x28(%rax)
movl %r12d, 0x2c(%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *(%rax)
movslq %r12d, %r12
cmpq $0x0, 0x60(%r15,%r12,8)
jne 0x7316b
movq %r15, %rdi
callq 0x86a68
movq %rax, 0x60(%r15,%r12,8)
movslq %ebp, %rcx
movq 0x60(%r15,%r12,8), %rsi
xorl %edi, %edi
movabsq $-0x5c28f5c28f5c28f5, %r8 # imm = 0xA3D70A3D70A3D70B
movl $0xff, %r9d
movl (%r14,%rdi,4), %r10d
imulq %rcx, %r10
leaq 0x32(%r10), %rax
imulq %r8
leaq (%rdx,%r10), %rax
addq $0x32, %rax
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x6, %rax
addq %rdx, %rax
cmpq $0x2, %rax
jge 0x731b5
movl $0x1, %eax
movl $0x7fff, %edx           # imm = 0x7FFF
cmpq %rdx, %rax
jl 0x731c4
movl $0x7fff, %eax           # imm = 0x7FFF
cmpq $0x63ce, %r10           # imm = 0x63CE
movl %eax, %edx
cmovgel %r9d, %edx
testl %ebx, %ebx
cmovel %eax, %edx
movw %dx, (%rsi,%rdi,2)
incq %rdi
cmpq $0x40, %rdi
jne 0x73185
movq 0x60(%r15,%r12,8), %rax
movl $0x0, 0x80(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/jpeg/jcparam.c
// Function: jpeg_set_quality
GLOBAL(void)
jpeg_set_quality (j_compress_ptr cinfo, int quality, jboolean force_baseline)
/* Set or change the 'quality' (quantization) setting, using default tables.
 * This is the standard quality-adjusting entry point for typical user
 * interfaces; only those who want detailed control over quantization tables
 * would use the preceding three routines directly.
 */
{
  /* Convert user 0-100 rating to percentage scaling */
  quality = jpeg_quality_scaling(quality);

  /* Set up standard quality tables */
  jpeg_set_linear_quality(cinfo, quality, force_baseline);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rdi, %r14
cmpl $0x2, %esi
movl $0x1, %eax
cmovgel %esi, %eax
cmpl $0x64, %eax
movl $0x64, %ecx
cmovll %eax, %ecx
cmpl $0x31, %esi
jg 0x73296
movl $0x1388, %eax           # imm = 0x1388
xorl %edx, %edx
divl %ecx
movl %eax, %ebp
jmp 0x7329f
addl %ecx, %ecx
movl $0xc8, %ebp
subl %ecx, %ebp
leaq 0x36e3a(%rip), %rdx     # 0xaa0e0
movq %r14, %rdi
xorl %esi, %esi
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x73104
leaq 0x36f24(%rip), %rdx     # 0xaa1e0
movq %r14, %rdi
movl $0x1, %esi
movl %ebp, %ecx
movl %ebx, %r8d
popq %rbx
popq %r14
popq %rbp
jmp 0x73104
// File: /workspace/github_cpp_makefile_star2_O1/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:
movq %rdi, %rax
cmpl $0x5, %esi
jge 0x73ad3
movl %esi, (%rax)
testl %esi, %esi
jle 0x73ac0
movl %esi, %edi
incl %esi
andl $-0x2, %esi
decq %rdi
movq %rdi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x2e838(%rip), %xmm1    # 0xa2280
xorl %edi, %edi
movdqa 0x2e83e(%rip), %xmm2    # 0xa2290
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x2e83e(%rip), %xmm4    # 0xa22a0
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %r8d
notl %r8d
testb $0x1, %r8b
je 0x73a9a
movl %edi, 0x4(%rax,%rdi,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %r8d
testb $0x1, %r8b
je 0x73ab3
leal 0x1(%rdi), %r8d
movl %r8d, 0x8(%rax,%rdi,4)
addq $0x2, %rdi
paddq %xmm4, %xmm1
cmpq %rdi, %rsi
jne 0x73a62
movq $0x0, 0x14(%rax)
movl %edx, 0x1c(%rax)
movl %ecx, 0x20(%rax)
addq $0x24, %rax
retq
xorl %edi, %edi
movl $0x1, (%rax)
movl %edi, 0x4(%rax)
movq $0x0, 0x14(%rax)
movl %edx, 0x1c(%rax)
movl %ecx, 0x20(%rax)
addq $0x24, %rax
incl %edi
cmpl %edi, %esi
jne 0x73ad5
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
cmpq $0x0, (%rsi)
jne 0x73b1c
movq %r15, %rdi
callq 0x86a82
movq %rax, (%rbx)
movq (%rbx), %rax
movb 0x10(%r12), %cl
movb %cl, 0x10(%rax)
movdqu (%r12), %xmm0
movdqu %xmm0, (%rax)
pxor %xmm0, %xmm0
xorl %eax, %eax
pxor %xmm1, %xmm1
movd 0x1(%r12,%rax), %xmm2
punpcklbw %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
paddd %xmm2, %xmm1
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x73b3b
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
paddd %xmm1, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
paddd %xmm0, %xmm1
movd %xmm1, %r12d
movl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
leal (%r12,%rax), %ecx
cmpl %eax, %ecx
ja 0x73b8b
movq (%r15), %rax
movl $0x8, 0x28(%rax)
movq %r15, %rdi
callq *(%rax)
movq (%rbx), %rdi
addq $0x11, %rdi
movl %r12d, %edx
movq %r14, %rsi
callq 0xe370
movq (%rbx), %rax
movl $0x0, 0x114(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 %rdi, %r14
cmpq $0x0, 0x28(%rdi)
jne 0x73bdd
movq 0x8(%r14), %rax
movl $0x38, %edx
movq %r14, %rdi
xorl %esi, %esi
callq *(%rax)
movq %rax, 0x28(%r14)
movq 0x28(%r14), %rax
leaq 0x26(%rip), %rcx        # 0x73c0e
movq %rcx, 0x10(%rax)
leaq 0x41(%rip), %rcx        # 0x73c34
movq %rcx, 0x18(%rax)
leaq 0x8b(%rip), %rcx        # 0x73c89
movq %rcx, 0x20(%rax)
movq %rbx, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq