LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: getKmerHash
int getKmerHash(char *seq, int startPos, int kmerLen){
  int i;
  int hash = 0;
  for(i = 0; i < kmerLen; i++){
    hash += kmerHash(seq[startPos+i], i);
  }
  return hash;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movslq %esi, %r15
xorl %r14d, %r14d
testl %edx, %edx
cmovlel %r14d, %ebx
addq %rdi, %r15
xorl %ebp, %ebp
cmpq %r14, %rbx
je 0x4dde
movsbl (%r15,%r14), %edi
movl %r14d, %esi
callq 0x4d65
addl %eax, %ebp
incq %r14
jmp 0x4dc5
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: JSHash
unsigned int JSHash(char* str)
{
  unsigned int hash = 1315423911;
  char c;

  while (str != NULL && (c=*str++) != '\0')
  {
    hash ^= ((hash << 5) + c + (hash >> 2));
  }

  return hash;
}

// Assembly:
movl $0x4e67c6a7, %eax       # imm = 0x4E67C6A7
testq %rdi, %rdi
je 0x54de
movsbl (%rdi), %ecx
testl %ecx, %ecx
je 0x54de
incq %rdi
movl %eax, %edx
shll $0x5, %edx
movl %eax, %esi
shrl $0x2, %esi
addl %edx, %esi
addl %ecx, %esi
xorl %esi, %eax
jmp 0x54bd
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: logzNormalizationReadQual
double logzNormalizationReadQual(bam1_t *thisRead, int qOff){

  int i;

  // find the average quality to save computation/precision in combinatorics
  double Qavg = getAverageQualityScoreRead(thisRead, qOff);
  double QmisMatch = (1.0 - Qavg)*Qavg; // assume probability goes mostly to next most likely (and that we hit that base)

  double logQavg = log(Qavg);
  double logQmisMatch = log(QmisMatch);
  int totalLen = thisRead->core.l_qseq;

  // normalize over the maximum value to prevent double precision underflows
  double logMaxExpMatch = 2.0*(totalLen-1)*(logQavg > logQmisMatch ? logQavg : logQmisMatch);

  // find the log expected match score
  double tmpExpMatch = 0.0;
  for(i = 0; i < totalLen; i++){
      double logTmp = 2.0*(i*logQavg + (totalLen-i-1)*logQmisMatch);
      tmpExpMatch += exp( logTmp - logMaxExpMatch );
  }
  double logExpMatch = logMaxExpMatch + log(tmpExpMatch);

  ////printf("logQavg: %lf %lf\n", logQavg, logQmisMatch);
  ////printf("logExpMatch: %lf %lf\n",  logExpMatch, logMaxExpMatch);
  ////printf("expMatch: %e %e\n", exp(logExpMatch), exp(logMaxExpMatch));
  //if (exp(logExpMatch) > expMatch * 1.00001 || exp(logExpMatch) < expMatch * 0.999999)
  //      //printf("expMatch: %e %e %e\n", expMatch - exp(logExpMatch), expMatch, exp(logExpMatch));
  return logExpMatch;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x5e1c
movsd 0x13e5b(%rip), %xmm1    # 0x19a30
subsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
callq 0x3290
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm0
callq 0x3290
movl 0x10(%rbx), %eax
leal -0x1(%rax), %ebx
cvtsi2sd %ebx, %xmm2
addsd %xmm2, %xmm2
movsd 0x10(%rsp), %xmm1
movsd %xmm0, 0x18(%rsp)
maxsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
movsd %xmm1, 0x8(%rsp)
xorl %ebp, %ebp
testl %eax, %eax
cmovgl %eax, %ebp
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
subl $0x1, %ebp
jb 0x5c8a
cvtsi2sd %ebx, %xmm1
mulsd 0x18(%rsp), %xmm1
movsd %xmm0, (%rsp)
movapd %xmm2, %xmm0
mulsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
addsd %xmm0, %xmm0
subsd 0x8(%rsp), %xmm0
movsd %xmm2, 0x20(%rsp)
callq 0x3680
movsd 0x20(%rsp), %xmm2
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
addsd 0x13daa(%rip), %xmm2    # 0x19a30
decl %ebx
jmp 0x5c2e
callq 0x3290
addsd 0x8(%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: binary_search_lower_bound
int binary_search_lower_bound(int *list, int first, int last, int target) {
	int middle = (first+last)/2;;
	while( first <= last ) {
		if ( list[middle] < target ) {
			first = middle + 1;
		} else if ( list[middle] == target ) {
			break;
		} else {
			last = middle - 1;
		}

		middle = (first + last)/2;
	}
	if ( first > last )
		return last;
	else
		return first;
}

// Assembly:
movl %edx, %r8d
leal (%r8,%rsi), %eax
pushq $0x2
popq %r9
cltd
idivl %r9d
cmpl %r8d, %esi
jg 0x5e79
movslq %eax, %rdx
cmpl %ecx, (%rdi,%rdx,4)
jge 0x5e6c
incl %eax
movl %eax, %esi
jmp 0x5e73
je 0x5e79
decl %eax
movl %eax, %r8d
leal (%r8,%rsi), %eax
jmp 0x5e55
cmpl %r8d, %esi
cmovll %esi, %r8d
movl %r8d, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: calcRefPos2SeqPos
int32_t calcRefPos2SeqPos(bam1_t *bam, int32_t targetRefPos) {
	int32_t calcSeqPos = -1, seqPos = 0, refPos = bam->core.pos, i;
	uint32_t *cigar = bam1_cigar(bam);
	assert(targetRefPos >= refPos);
	for(i = 0; i < bam->core.n_cigar; i++) {
		if (refPos > targetRefPos)
			break;
		int op = bam_cigar_op(*(cigar+i));
		int len = bam_cigar_oplen(*(cigar+i));
		int type = bam_cigar_type(op);
		if ((type & 0x02) == 0x02) {
			// consume reference
			if (refPos + len >= targetRefPos) {
				if ((type & 0x01) == 0x01) {
					// consume query
					calcSeqPos = seqPos + (targetRefPos - refPos);
				} else {
					calcSeqPos = seqPos;
				}
				break;
			}
			refPos += len;
		}
		if ((type & 0x01) == 0x01) {
			// consume query;
			seqPos += len;
		}
	}
	return calcSeqPos;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl 0x4(%rdi), %edx
cmpl %esi, %edx
jg 0x5efd
movq 0x8(%rdi), %r8
movl %r8d, %r9d
shrl $0x18, %r9d
addq 0x30(%rdi), %r9
shrq $0x30, %r8
xorl %r10d, %r10d
pushq $-0x1
popq %rax
xorl %edi, %edi
cmpq %r8, %r10
jae 0x5ef6
movl %esi, %ebx
subl %edx, %ebx
jl 0x5ef6
movl (%r9,%r10,4), %ecx
movl %ecx, %ebp
shrl $0x4, %ebp
addl %ecx, %ecx
movl $0x3c1a7, %r11d         # imm = 0x3C1A7
shrl %cl, %r11d
testb $0x2, %r11b
je 0x5ed4
addl %ebp, %edx
cmpl %esi, %edx
jge 0x5ee6
andl $0x1, %r11d
negl %r11d
andl %ebp, %r11d
addl %r11d, %edi
incq %r10
jmp 0x5ea9
andl $0x1, %r11d
negl %r11d
andl %ebx, %r11d
addl %edi, %r11d
movl %r11d, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x183c3(%rip), %rdi     # 0x1e2c7
leaq 0x17e2a(%rip), %rsi     # 0x1dd35
leaq 0x183cc(%rip), %rcx     # 0x1e2de
movl $0x4fd, %edx            # imm = 0x4FD
callq 0x3230
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: recordSNPPhases
void recordSNPPhases(FILE *snpPhaseFile, alignSet_t *aln, assemblyT *theAssembly) {
	if (snpPhaseFile == NULL || aln->likelihood == 0.0)
		return;
	int i,j;

	int printedHeader = -1;

	bam1_t *b = aln->bamOfAlignment1;
	recordSNPPhase(snpPhaseFile, &printedHeader, b, aln, theAssembly);
	b = aln->bamOfAlignment2;
	recordSNPPhase(snpPhaseFile, &printedHeader, b, aln, theAssembly);

}

// Assembly:
testq %rdi, %rdi
je 0x6161
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x611f
jnp 0x6156
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x4(%rsp), %r12
orl $-0x1, (%r12)
movq 0x30(%r14), %rdx
movq %r12, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x5f33
movq 0x38(%r14), %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x5f33
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: savePlacement
void savePlacement(samfile_t *placementBam, alignSet_t *aln) {
	if (placementBam == NULL || aln == NULL || aln->likelihood == 0.0)
		return;
	if (aln->bamOfAlignment1 != NULL)
		bam_write1(placementBam->x.bam, aln->bamOfAlignment1);
	if (aln->bamOfAlignment2 != NULL)
		bam_write1(placementBam->x.bam, aln->bamOfAlignment2);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x6189
movq %rsi, %r14
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6191
jp 0x6191
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x61a6
movq 0x8(%rbx), %rdi
callq 0xe3dc
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0x6189
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe3dc
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: digammaApprox
double digammaApprox(double x){
	double x2 = x*x;
	double x4 = x2*x2;
	double x6 = x4*x2;
    return log(x) - 1.0/(2.0*x) - 1.0/(12.0*x2) + 1.0/(120.0*x4) - 1.0/(252.0*x6);
}

// Assembly:
subq $0x28, %rsp
movapd %xmm0, (%rsp)
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
callq 0x3290
movapd 0x10(%rsp), %xmm3
movapd (%rsp), %xmm1
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd 0x1379c(%rip), %xmm1    # 0x19b00
movapd %xmm1, %xmm4
movapd 0x13740(%rip), %xmm1    # 0x19ab0
movapd %xmm1, %xmm2
divpd %xmm4, %xmm2
subsd %xmm2, %xmm0
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
subsd %xmm2, %xmm0
movapd %xmm3, %xmm2
mulsd %xmm3, %xmm2
mulsd %xmm2, %xmm3
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
mulpd 0x13774(%rip), %xmm2    # 0x19b10
divpd %xmm2, %xmm1
addsd %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
subsd %xmm1, %xmm0
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: negBinom_like
double negBinom_like(double r, double k_avg, float *k, int N){
    double ans = 0.0;
    int i;
    for(i=0; i<N; i++){
        ans += digammaApprox(k[i] + r);
    }
    ans -= N*digammaApprox(r);
    ans += N*log(r/(r + k_avg));
    return ans;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x10(%rsp)
xorl %r15d, %r15d
testl %esi, %esi
movl $0x0, %r12d
cmovgl %esi, %r12d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
cmpq %r15, %r12
je 0x6411
cvtss2sd (%r14,%r15,4), %xmm0
addsd 0x10(%rsp), %xmm0
callq 0x6331
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
incq %r15
jmp 0x63e6
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x6331
mulsd 0x18(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x20(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x3290
mulsd 0x18(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: negBinomPMF
double negBinomPMF(int k, double r, double p){
    double ans = 0.0;
    int i;
    for(i = 1; i <= k; i++){
        ans += log(r - 1 + i) - log(i);
    }
    ans += r*log(1.0 - p);
    ans += (double)k*log(p);
    ////printf("pmf k=%d, r=%lf, p=%lf = %lf\n", k, r, p, ans);
    return ans;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x38, %rsp
movsd %xmm1, 0x18(%rsp)
movl %edi, %ebx
movsd 0x13529(%rip), %xmm1    # 0x19a68
xorl %ebp, %ebp
testl %edi, %edi
cmovgl %edi, %ebp
movsd %xmm0, 0x20(%rsp)
addsd %xmm0, %xmm1
movsd %xmm1, 0x28(%rsp)
movsd 0x134d2(%rip), %xmm1    # 0x19a30
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
subl $0x1, %ebp
jb 0x65bd
movsd 0x28(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm1, 0x10(%rsp)
callq 0x3290
movsd %xmm0, 0x30(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x3290
movsd 0x10(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
subsd %xmm0, %xmm2
movsd 0x8(%rsp), %xmm0
addsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
addsd 0x13475(%rip), %xmm1    # 0x19a30
jmp 0x6568
movsd 0x1346b(%rip), %xmm0    # 0x19a30
subsd 0x18(%rsp), %xmm0
callq 0x3290
mulsd 0x20(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x3290
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: applyExpectedMissingLength
void applyExpectedMissingLength(assemblyT *theAssembly){
    double avgDepth = theAssembly->depthAvgSum/theAssembly->depthAvgNorm;
    if(avgDepth < minAvgDepth){avgDepth = minAvgDepth;}
    double avgDepthScore = theAssembly->depthScoreAvgSum/theAssembly->depthScoreAvgNorm;
    double avgKmerScore = theAssembly->kmerAvgSum/theAssembly->kmerAvgNorm;
    double avgOverlap = theAssembly->overlapAvgSum/theAssembly->overlapAvgNorm;
    double expectedUnmappedBases = (double)theAssembly->totalUnmappedReads*theAssembly->avgReadSize + (double)theAssembly->totalMappedReads*(theAssembly->avgReadSize - avgOverlap);
    double expectedExtraLength = expectedUnmappedBases/avgDepth;
    printf("Expected extra length: %lf\n", expectedExtraLength);

    // apply avg depth and k-mer score to all positions
    // NORMALIZED NOW, so E[avgDepthScore] = 0, E[avgKmerScore] = 0
    //theAssembly->totalScore += expectedExtraLength*avgDepthScore;
    //theAssembly->totalScore += expectedExtraLength*avgKmerScore;
}

// Assembly:
movsd 0x58(%rdi), %xmm0
movsd 0x68(%rdi), %xmm1
divsd 0x60(%rdi), %xmm0
movsd 0x13457(%rip), %xmm2    # 0x19a78
maxsd %xmm0, %xmm2
divsd 0x70(%rdi), %xmm1
cvtsi2sdq 0x80(%rdi), %xmm3
movsd 0x98(%rdi), %xmm0
cvtsi2sdq 0x88(%rdi), %xmm4
mulsd %xmm0, %xmm3
subsd %xmm1, %xmm0
mulsd %xmm4, %xmm0
addsd %xmm3, %xmm0
divsd %xmm2, %xmm0
leaq 0x17e8f(%rip), %rdi     # 0x1e4ee
movb $0x1, %al
jmp 0x3210
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: computeNormaliziedDepthGCParameters
void computeNormaliziedDepthGCParameters(double *depthNormalizer, long *depthNormalizerCount, double *negBinomParam_r, double *negBinomParam_p, double *negBinomParamZnorm_r, double avgDepth) {
	int j;
	for(j = 0; j < 101; j++){ // for each GCpct
        if(depthNormalizerCount[j] > 0){
            depthNormalizer[j] = depthNormalizer[j]/(double)depthNormalizerCount[j]; // now contains the avg depth for that GC
        }else{
            depthNormalizer[j] = avgDepth; // otherwise assume the given avg depth or the min whichever is greater.
        }
        if(depthNormalizer[j] < minAvgDepth){
            depthNormalizer[j] = minAvgDepth;
        }
        // through max likelihood/moment matching
        //negBinomParam_r[j] = negBinom_rFinder(depthNormalizer[j], depthNormalizer[j], depthsAtGC, depthNormalizerCount[j], 1000);
        // through constant r
        negBinomParam_r[j] = depthNormalizer[j];
        negBinomParam_p[j] = negBinom_pFinder(negBinomParam_r[j], depthNormalizer[j]);

        if((int)floor(negBinomParam_r[j]) < 2047){
            negBinomParamZnorm_r[j] = negBinomZ[(int)floor(negBinomParam_r[j])];
        }else{
            // not in lookup table, compute
            negBinomParamZnorm_r[j] = getNegBinomZnorm(negBinomParam_r[j]);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, 0x8(%rsp)
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
xorl %ebp, %ebp
cmpq $0x65, %rbp
je 0x673f
movq (%r12,%rbp,8), %rax
movsd 0x8(%rsp), %xmm0
testq %rax, %rax
jle 0x66b4
movsd (%r13,%rbp,8), %xmm0
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%r13,%rbp,8)
movsd 0x133b5(%rip), %xmm1    # 0x19a78
ucomisd %xmm0, %xmm1
jbe 0x66e0
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, (%r13,%rbp,8)
movsd 0x13398(%rip), %xmm0    # 0x19a78
movsd %xmm0, (%r15,%rbp,8)
movsd (%r13,%rbp,8), %xmm1
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, (%r14,%rbp,8)
movsd (%r15,%rbp,8), %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x3580
cvttsd2si %xmm0, %eax
cmpl $0x7fe, %eax            # imm = 0x7FE
jg 0x6727
cltq
leaq 0x13560(%rip), %rcx     # 0x19c80
movsd (%rcx,%rax,8), %xmm0
jmp 0x6732
movsd 0x10(%rsp), %xmm0
callq 0x3fd2
movsd %xmm0, (%rbx,%rbp,8)
incq %rbp
jmp 0x668b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: guessQualityOffset
int guessQualityOffset(bam1_t *read) {
  int len = read->core.l_qseq;
  if (len <= 0){
    return -1;
  }
  int qualOffset = -1;
  const int maxExpectedQuality = 50;
  char *qualSeq = (char*) bam1_qual(read);
  int i;
  for(i=0; i < len; i++) {
    if (qualSeq[i] > 64 && qualSeq[i] > 33+maxExpectedQuality){
      qualOffset = 64;
    }
    else if (qualSeq[i] > 0 && qualSeq[i] < 33){
      qualOffset = 0;
    }
    else if (qualSeq[i] > 33 && qualSeq[i] < maxExpectedQuality+33 && qualSeq[i] < 64 && qualSeq[i] > maxExpectedQuality+0){
      qualOffset = 33;
    }

    if (qualOffset >= 0) {
      //printf("guessed quality offset is %d\n", qualOffset);
      break;
    }
  }
  return qualOffset;
}

// Assembly:
movl 0x10(%rdi), %ecx
pushq $-0x1
popq %rax
testl %ecx, %ecx
jle 0x6cf5
movq 0x8(%rdi), %rsi
movq %rsi, %rdx
shrq $0x30, %rdx
shrl $0x18, %esi
leaq 0x1(%rcx), %r8
shrq %r8
leaq (%r8,%rdx,4), %rdx
addq %rsi, %rdx
addq 0x30(%rdi), %rdx
xorl %esi, %esi
pushq $0x40
popq %rdi
pushq $0x21
popq %r8
cmpq %rsi, %rcx
je 0x6cf5
movb (%rdx,%rsi), %r9b
cmpb $0x53, %r9b
jg 0x6cf6
leal -0x1(%r9), %r10d
cmpb $0x20, %r10b
jb 0x6cf9
addb $-0x33, %r9b
incq %rsi
cmpb $0xc, %r9b
ja 0x6ccc
movl %r8d, %eax
retq
movl %edi, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: mateTreeCmp
int mateTreeCmp(const void *pa, const void *pb) {
  assert(pa != NULL && pb != NULL);
  bam1_t *a = ((bam1_t*) pa);
  bam1_t *b = ((bam1_t*) pb);
  assert((a->core.flag & (BAM_FREAD1 | BAM_FREAD2)) != 0);
  assert((b->core.flag & (BAM_FREAD1 | BAM_FREAD2)) != 0);
  return strcmp(bam1_qname(a), bam1_qname(b));
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x6d3c
testq %rsi, %rsi
je 0x6d3c
testb $-0x40, 0xc(%rdi)
je 0x6d5b
movabsq $0xc000000000, %rax     # imm = 0xC000000000
testq %rax, 0x8(%rsi)
je 0x6d7a
movq 0x30(%rdi), %rdi
movq 0x30(%rsi), %rsi
popq %rax
jmp 0x3330
leaq 0x178a2(%rip), %rdi     # 0x1e5e5
leaq 0x16feb(%rip), %rsi     # 0x1dd35
leaq 0x178ad(%rip), %rcx     # 0x1e5fe
movl $0x6df, %edx            # imm = 0x6DF
callq 0x3230
leaq 0x178c8(%rip), %rdi     # 0x1e62a
leaq 0x16fcc(%rip), %rsi     # 0x1dd35
leaq 0x1788e(%rip), %rcx     # 0x1e5fe
movl $0x6e2, %edx            # imm = 0x6E2
callq 0x3230
leaq 0x178d9(%rip), %rdi     # 0x1e65a
leaq 0x16fad(%rip), %rsi     # 0x1dd35
leaq 0x1786f(%rip), %rcx     # 0x1e5fe
movl $0x6e3, %edx            # imm = 0x6E3
callq 0x3230
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: mateTreeCmpForceStore
int mateTreeCmpForceStore(const void *pa, const void *pb) {
    int cmp = mateTreeCmp(pa, pb);
    if (cmp == 0) {
        bam1_t *a = ((bam1_t*) pa);
        bam1_t *b = ((bam1_t*) pb);
        cmp = compare(a->core.tid, b->core.tid);
        if (cmp == 0) {
        	cmp = compare(a->core.pos, b->core.pos);
        	if (cmp == 0){
        		//printf("mateTreeCmpForceStore found dup: %s %d %d %d %d %d\n", bam1_qname(a), a->core.tid, a->core.pos, a->core.mtid, a->core.mpos, a->core.isize);
            }
        	return cmp;
        } else
        	return cmp;
    } else
        return cmp;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x6d0d
testl %eax, %eax
jne 0x6dd8
movl (%r14), %ecx
xorl %eax, %eax
cmpl (%rbx), %ecx
setge %cl
jne 0x6dcf
movl 0x4(%r14), %eax
xorl %ecx, %ecx
xorl %edx, %edx
cmpl 0x4(%rbx), %eax
setge %dl
leal -0x1(%rdx,%rdx), %eax
cmovel %ecx, %eax
jmp 0x6dd8
movb %cl, %al
leal -0x1(,%rax,2), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: mateTreeApplyRemainderPlacement
void mateTreeApplyRemainderPlacement(const void *nodep, const VISIT which, const int depth) {
    // TODO do not just ignore stragglers, apply their placement as singles (should not get here on proper BAMs)

    bam1_t *bam;
    switch(which) {
    case preorder:
    case endorder:
        break;
    case postorder:
    case leaf:
        bam = *((bam1_t**) nodep);
        if (printedExampleOrphan == 0) {
        	printf("\t%s %d\n", bam1_qname(bam), bam->core.flag);
        	printedExampleOrphan = 1;
        }
        break;
    default:
        printf("Error %d\n", which);
        exit(1);
    }
}

// Assembly:
pushq %rax
cmpl $0x3, %esi
ja 0x6f7e
movl %esi, %eax
leaq 0x12c3a(%rip), %rcx     # 0x19b84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x0, 0x22afa(%rip)     # 0x29a54
jne 0x6f7c
movq (%rdi), %rax
movq 0x30(%rax), %rsi
movzwl 0xc(%rax), %edx
leaq 0x177ae(%rip), %rdi     # 0x1e71c
xorl %eax, %eax
callq 0x3210
movb $0x1, 0x22ad8(%rip)     # 0x29a54
popq %rax
retq
leaq 0x1779f(%rip), %rdi     # 0x1e724
xorl %eax, %eax
callq 0x3210
pushq $0x1
popq %rdi
callq 0x35c0
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: isValidInsertSize
int isValidInsertSize(bam1_t *thisRead, libraryMateParametersT *mateParameters) {
    // check for > SIGMA_RANGE sigma insert size and fail to chimer
    float range = SIGMA_RANGE * mateParameters->insertStd;
    float mapLen = fabs((float) getFragmentMapLenBAM(thisRead));
    if ((mapLen > mateParameters->insertLength + range)
        || (mapLen < mateParameters->insertLength - range)) {
        return 0;
    } else {
        return 1;
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movsd 0x8(%rsi), %xmm0
mulsd 0x12ac5(%rip), %xmm0    # 0x19a90
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
callq 0x99b8
cvtsi2ss %eax, %xmm0
andps 0x12b3b(%rip), %xmm0    # 0x19b20
cvtss2sd %xmm0, %xmm0
movsd (%rbx), %xmm1
cvtss2sd 0xc(%rsp), %xmm2
movapd %xmm1, %xmm3
addsd %xmm2, %xmm3
subsd %xmm2, %xmm1
cmpnltpd %xmm0, %xmm3
cmpnltpd %xmm1, %xmm0
andpd %xmm3, %xmm0
movd %xmm0, %eax
andl $0x1, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: setAlignmentForMate
void _setAlignmentForMate(alignSet_t *thisAlignment, bam1_t *read1) {
     if ((read1->core.flag & BAM_FPAIRED) != BAM_FPAIRED || (read1->core.flag & BAM_FMUNMAP) == BAM_FMUNMAP ) {
         // not mapped or not paired
         thisAlignment->start2 = -1;
         thisAlignment->end2 = -1; // no information
         thisAlignment->contigId2 = -1;
     } else {
         thisAlignment->start2 = read1->core.mpos;
         thisAlignment->end2 = -1; // no information
         thisAlignment->contigId2 = read1->core.mtid;
     }
     thisAlignment->bamOfAlignment1 = read1;
     thisAlignment->bamOfAlignment2 = NULL;
}

// Assembly:
movabsq $0x900000000, %rax      # imm = 0x900000000
andq 0x8(%rsi), %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %rax
jne 0x73ea
movl 0x14(%rsi), %eax
movl 0x18(%rsi), %ecx
jmp 0x73ef
pushq $-0x1
popq %rcx
movl %ecx, %eax
movl %ecx, 0x14(%rdi)
orl $-0x1, 0x1c(%rdi)
movl %eax, 0x24(%rdi)
movq %rsi, 0x30(%rdi)
andq $0x0, 0x38(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: setAlignment
void _setAlignment(alignSet_t *thisAlignment, bam1_t *read1, bam1_t *read2) {
      assert(read1 != NULL);
      if ((read1->core.flag & BAM_FUNMAP) == BAM_FUNMAP) {
        thisAlignment->start1 = -1;
        thisAlignment->end1   = -1;
        thisAlignment->contigId1 = -1;
      } else {

        thisAlignment->start1 = read1->core.pos;
        thisAlignment->end1   = bam_calend(&read1->core, bam1_cigar(read1));
        assert(thisAlignment->start1 <= thisAlignment->end1);
        thisAlignment->contigId1 = read1->core.tid;
      }

      if (read2 == NULL) {
          _setAlignmentForMate(thisAlignment, read1);
      } else if ((read2->core.flag & BAM_FUNMAP) == BAM_FUNMAP) {
        thisAlignment->start2 = -1;
        thisAlignment->end2   = -1;
        thisAlignment->contigId2 = -1;
      } else {
        thisAlignment->start2 = read2->core.pos;
        thisAlignment->end2   = bam_calend(&read2->core, bam1_cigar(read2));
        assert(thisAlignment->start2 <= thisAlignment->end2);
        thisAlignment->contigId2 = read2->core.tid;
      }

      if (thisAlignment->name != NULL){
          free(thisAlignment->name);
      }
      thisAlignment->name = strdup(bam1_qname(read1));
      thisAlignment->nextAlignment = NULL;
      thisAlignment->likelihood = 1.0;
      thisAlignment->likelihoodInsert = 1.0;
      thisAlignment->bamOfAlignment1 = read1;
      thisAlignment->bamOfAlignment2 = read2;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x74ef
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
testb $0x4, 0xc(%rsi)
jne 0x744c
movl 0x4(%r15), %eax
movl %eax, 0x10(%r14)
movzbl 0xb(%r15), %esi
addq 0x30(%r15), %rsi
movq %r15, %rdi
callq 0xd54c
movl %eax, 0x18(%r14)
cmpl %eax, 0x10(%r14)
jg 0x750e
movl (%r15), %eax
jmp 0x7459
orl $-0x1, 0x10(%r14)
orl $-0x1, 0x18(%r14)
pushq $-0x1
popq %rax
movl %eax, 0x20(%r14)
testq %rbx, %rbx
je 0x749f
movabsq $0x400000000, %rax      # imm = 0x400000000
testq %rax, 0x8(%rbx)
jne 0x74ac
movl 0x4(%rbx), %eax
movl %eax, 0x14(%r14)
movzbl 0xb(%rbx), %esi
addq 0x30(%rbx), %rsi
movq %rbx, %rdi
callq 0xd54c
movl %eax, 0x1c(%r14)
cmpl %eax, 0x14(%r14)
jg 0x752d
movl (%rbx), %eax
movl %eax, 0x24(%r14)
jmp 0x74bb
movq %r14, %rdi
movq %r15, %rsi
callq 0x73c5
jmp 0x74bb
orl $-0x1, 0x14(%r14)
orl $-0x1, 0x1c(%r14)
orl $-0x1, 0x24(%r14)
movq 0x28(%r14), %rdi
callq 0x3070
movq 0x30(%r15), %rdi
callq 0x3630
movq %rax, 0x28(%r14)
andq $0x0, 0x48(%r14)
movaps 0x125d3(%rip), %xmm0    # 0x19ab0
movups %xmm0, (%r14)
movq %r15, 0x30(%r14)
movq %rbx, 0x38(%r14)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x16831(%rip), %rdi     # 0x1dd27
leaq 0x16838(%rip), %rsi     # 0x1dd35
leaq 0x17598(%rip), %rcx     # 0x1ea9c
movl $0x784, %edx            # imm = 0x784
callq 0x3230
leaq 0x1752d(%rip), %rdi     # 0x1ea42
leaq 0x16819(%rip), %rsi     # 0x1dd35
leaq 0x17579(%rip), %rcx     # 0x1ea9c
movl $0x78d, %edx            # imm = 0x78D
callq 0x3230
leaq 0x1753b(%rip), %rdi     # 0x1ea6f
leaq 0x167fa(%rip), %rsi     # 0x1dd35
leaq 0x1755a(%rip), %rcx     # 0x1ea9c
movl $0x79a, %edx            # imm = 0x79A
callq 0x3230
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: getAverageQualityScore
double getAverageQualityScore(char *readQual, int qOff, int offset, int length) {
	double Qavg = 0.0;
	int i, count = 0;
	int minQ = getMinimumQuality() + qOff;
	for(i = offset; i < length; i++){
		// Illumina data below a certain quality (<=2) is *completely* unreliable,
		// so ignore those values for the average calculations
		if (readQual[i] >= minQ) {
			Qavg += getQtoP(readQual[i], qOff);
			count++;
		}
	}
	if (count == 0)
		Qavg = getQtoP(minQ, qOff);
	else
		Qavg = Qavg/(double)count;
	return Qavg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %ebx
movq %rdi, %r14
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x8adc
movl %eax, %ebp
addl %ebx, %ebp
movslq %r12d, %r12
movslq %r15d, %r15
xorpd %xmm1, %xmm1
cmpq %r15, %r12
jge 0x7a9c
movsbl (%r14,%r12), %eax
cmpl %eax, %ebp
jg 0x7a97
movsbl %al, %edi
movl %ebx, %esi
movsd %xmm1, (%rsp)
callq 0x8ae3
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
incl %r13d
incq %r12
jmp 0x7a6e
testl %r13d, %r13d
je 0x7abd
cvtsi2sd %r13d, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl %bpl, %edi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8ae3
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: countPlacements
void countPlacements(int numberMapped, libraryMateParametersT *mateParameters, enum MATE_ORIENTATION orientation)
{
    if (numberMapped > 0) {
        if(orientation <= MAPPED_PAIRED_ORIENTATION){
            if(numberMapped == 2){
                mateParameters->placed += 2;
            }else{
                mateParameters->placed++;
            }
        }
        else{
            mateParameters->placed++;
        }
    }
}

// Assembly:
testl %edi, %edi
jle 0x7af2
cmpl $0x5, %edx
ja 0x7aee
movq 0x30(%rsi), %rax
cmpl $0x2, %edi
jne 0x7af3
addq $0x2, %rax
jmp 0x7af6
incq 0x30(%rsi)
retq
incq %rax
movq %rax, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: buildCigarString
void buildCigarString(char *buf, uint32_t *cigar, uint32_t cigarLen) {
	int l = 0, op = 0;
	while (op < cigarLen) {
		l += sprintf(buf + l, "%d", bam_cigar_oplen(cigar[op]));
		buf[l++] = bam_cigar_opchr(cigar[op]);
		op++;
	}
	buf[l] = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r12d
leaq 0x166b3(%rip), %r13     # 0x1ee51
xorl %ebp, %ebp
xorl %r15d, %r15d
movslq %r15d, %rdi
addq %r14, %rdi
cmpq %rbp, %r12
je 0x87e2
movl (%rbx,%rbp,4), %edx
shrl $0x4, %edx
leaq 0x15c44(%rip), %rsi     # 0x1e3ff
xorl %eax, %eax
callq 0x35b0
leal (%rax,%r15), %ecx
movl (%rbx,%rbp,4), %edx
andl $0xf, %edx
movb (%rdx,%r13), %dl
addl %eax, %r15d
incl %r15d
movslq %ecx, %rax
movb %dl, (%r14,%rax)
incq %rbp
jmp 0x87a3
movb $0x0, (%rdi)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALElike.c
// Function: destroyRefNumForRealign
void destroyRefNumForRealign(assemblyT *theAssembly) {
	if (realignParameters == NULL)
		return;
	free(realignParameters->scoringMatrix);
	realignParameters->scoringMatrix = NULL;

	int i;
	for(i = 0; i < theAssembly->numContigs; i++) {
		contig_t *contig = theAssembly->contigs[i];
		free(contig->seqNum);
		contig->seqNum = NULL;
	}
	realignParameters = NULL;
}

// Assembly:
movq 0x21066(%rip), %rax     # 0x29a48
testq %rax, %rax
je 0x8a38
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rax), %rdi
callq 0x3070
movq 0x2104a(%rip), %rax     # 0x29a48
andq $0x0, (%rax)
xorl %r14d, %r14d
movslq (%rbx), %rax
cmpq %rax, %r14
jge 0x8a2b
movq 0xa0(%rbx), %rax
movq (%rax,%r14,8), %r15
movq 0x18(%r15), %rdi
callq 0x3070
andq $0x0, 0x18(%r15)
incq %r14
jmp 0x8a05
andq $0x0, 0x21015(%rip)     # 0x29a48
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: getQtoP
double getQtoP(char qualChar, int qOff) {
    int idx = qualChar - qOff;
    if (idx < 0 || idx >= 63 ) {
        printf("WARNING: getQtoP called out of range: %c %d %d\n", qualChar, qOff, idx);
        if (idx < 0) idx = 0;
        else idx = 62;
    }
    return QtoP[idx];
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %edx
movl %edi, %ebx
subl %esi, %ebx
cmpl $0x3f, %ebx
jb 0x8b0d
movl %edi, %esi
leaq 0x17106(%rip), %rdi     # 0x1fc00
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
pushq $0x3e
popq %rbx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x166ea(%rip), %rcx     # 0x1f200
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: getQtoLogP
double getQtoLogP(char qualChar, int qOff) {
    int idx = qualChar - qOff;
    if (idx < 0 || idx >= 63 ) {
        printf("WARNING: getQtoLogP called out of range: %c %d %d\n", qualChar, qOff, idx);
        if (idx < 0) idx = 0;
        else idx=62;
    }
    return QtoLogP[idx];
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %edx
movl %edi, %ebx
subl %esi, %ebx
cmpl $0x3f, %ebx
jb 0x8b4c
movl %edi, %esi
leaq 0x170f7(%rip), %rdi     # 0x1fc30
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
pushq $0x3e
popq %rbx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x168ab(%rip), %rcx     # 0x1f400
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: getQtoLogPMiss
double getQtoLogPMiss(char qualChar, int qOff) {
    int idx = qualChar - qOff;
    if (idx < 0 || idx >= 63 ) {
        printf("WARNING: getQtoLogPMiss called out of range: %c %d %d\n", qualChar, qOff, idx);
        if (idx < 0) idx = 0;
        else idx = 62;
    }
    return QtoLogPMiss[idx]; // TODO switch to (1-Q)*Q
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %edx
movl %edi, %ebx
subl %esi, %ebx
cmpl $0x3f, %ebx
jb 0x8b8b
movl %edi, %esi
leaq 0x170eb(%rip), %rdi     # 0x1fc63
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
pushq $0x3e
popq %rbx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x16a6c(%rip), %rcx     # 0x1f600
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: IncreaseAssemblyPartsByOne
void IncreaseAssemblyPartsByOne(assembly_t *theAssembly, int numParts){
  assemblyPart_t *tempPartPointer = malloc(numParts* sizeof(assemblyPart_t));
  int i;
  for(i = 0; i < numParts - 1; i++){
    tempPartPointer[i] = theAssembly->assemblyParts[i];
  }
  //free(theAssembly->assemblyParts);
  theAssembly->assemblyParts = tempPartPointer;
  //return theAssembly;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %r14
movq %r14, %rdi
shlq $0x5, %rdi
callq 0x3420
cmpl $0x2, %r14d
pushq $0x1
popq %rcx
cmovgel %r14d, %ecx
decl %ecx
shlq $0x5, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x8be9
movq (%rbx), %rsi
movups (%rsi,%rdx), %xmm0
movups 0x10(%rsi,%rdx), %xmm1
movups %xmm1, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
addq $0x20, %rdx
jmp 0x8bc9
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: poissonInt
double poissonInt(int k, double lambda){
  int i;
  double answer = 1.0;
  for(i = 1; i < k+1; i++){
    answer = answer*lambda*exp(-lambda/(float)k)/(float)i;
  }
  return answer;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movapd 0x1657d(%rip), %xmm1    # 0x1f180
movapd %xmm0, 0x20(%rsp)
xorpd %xmm0, %xmm1
cvtsi2ss %edi, %xmm0
cvtss2sd %xmm0, %xmm0
xorl %ebx, %ebx
testl %edi, %edi
cmovgl %edi, %ebx
divsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
negl %ebx
movsd 0x10e00(%rip), %xmm0    # 0x19a30
pushq $0x1
popq %r14
leal (%rbx,%r14), %eax
cmpl $0x1, %eax
je 0x8c6c
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movapd 0x10(%rsp), %xmm0
callq 0x3680
mulsd 0x8(%rsp), %xmm0
cvtsi2ss %r14d, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
incl %r14d
jmp 0x8c34
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: makeQual
void makeQual(const char qual[], const unsigned int seqLen, char quality[], int qualityHistogram[]){
  int i;
  for(i = 0; i < seqLen; i++){
    quality[i] = qual[i];
    qualityHistogram[qual[i] - 64]++;
  }
}

// Assembly:
movl %esi, %eax
xorl %esi, %esi
cmpq %rsi, %rax
je 0x8dc8
movsbq (%rdi,%rsi), %r8
movb %r8b, (%rdx,%rsi)
incl -0x100(%rcx,%r8,4)
incq %rsi
jmp 0x8dad
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: makeSeq
void makeSeq(const char seq[], const unsigned int seqLen, unsigned char sequence[]){
    int i;
    // make all multiples of 4 possible
    for(i = 0; i < seqLen/4; i++){
        sequence[i] = seqToChar(seq[i*4], seq[i*4 + 1], seq[i*4 + 2], seq[i*4 + 3]);
    }
    if(seqLen%4 == 3){
        sequence[seqLen/4] = seqToChar(seq[i*4], seq[i*4 + 1], seq[i*4 + 2], 'T');
    }else if(seqLen%4 == 2){
        sequence[seqLen/4] = seqToChar(seq[i*4], seq[i*4 + 1], 'T', 'T');
    }else if(seqLen%4 == 1){
        sequence[seqLen/4] = seqToChar(seq[i*4], 'T', 'T', 'T');
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
movl %esi, %r12d
shrl $0x2, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x8e60
movsbl (%r15,%r13,4), %edi
movsbl 0x1(%r15,%r13,4), %esi
movsbl 0x2(%r15,%r13,4), %edx
movsbl 0x3(%r15,%r13,4), %ecx
callq 0x8d12
movb %al, (%rbx,%r13)
incq %r13
jmp 0x8e36
movl %r14d, %eax
andl $0x3, %eax
leaq 0x16383(%rip), %rcx     # 0x1f1f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
andl $-0x4, %r14d
movb (%r15,%r14), %al
cmpb $0x41, %al
sete %cl
cmpb $0x47, %al
sete %dl
orb %cl, %dl
cmpb $0x43, %al
sete %al
orb %cl, %al
addb %al, %al
orb %dl, %al
jmp 0x8eca
andl $-0x4, %r14d
movsbl (%r15,%r14), %edi
movsbl 0x1(%r15,%r14), %esi
pushq $0x54
popq %rcx
movl %ecx, %edx
jmp 0x8ec5
andl $-0x4, %r14d
movsbl (%r15,%r14), %edi
movsbl 0x1(%r15,%r14), %esi
movsbl 0x2(%r15,%r14), %edx
pushq $0x54
popq %rcx
callq 0x8d12
movb %al, (%rbx,%r12)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: charToSeq
void charToSeq(unsigned char num, char seq[], const int len){
    int i;
    for(i = 0; i < len; i++){
        if(num%2){ // A or G
            num = num >> 1;
            if(num%2){ // A or C match?
                seq[i] = 'A';
            }else{
                seq[i] = 'G';
            }
        }else{
            num = num >> 1;
            if(num%2){ // A or C match?
                seq[i] = 'C';
            }else{
                seq[i] = 'T';
            }
        }
        num = num >> 1;
    }
    for(i = len; i < 4; i++){ // fill in the rest with spaces
        seq[i] = ' ';
    }
}

// Assembly:
pushq %rbp
pushq %rbx
xorl %eax, %eax
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
movl $0x47, %r8d
movl $0x41, %r9d
movl $0x54, %r10d
movl $0x43, %r11d
cmpq %rax, %rcx
je 0x8f57
testb $0x2, %dil
movl %r9d, %ebx
cmovel %r8d, %ebx
movl %r11d, %ebp
cmovel %r10d, %ebp
testb $0x1, %dil
cmovnel %ebx, %ebp
movb %bpl, (%rsi,%rax)
shrb $0x2, %dil
incq %rax
jmp 0x8f2c
movslq %edx, %rax
cmpq $0x3, %rax
jg 0x8f69
movb $0x20, (%rsi,%rax)
incq %rax
jmp 0x8f5a
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: PrintSequence
void PrintSequence(const unsigned char sequence[], const unsigned int seqLen){
    char seqer[4];
    int j;
    for(j = 0; j < seqLen/4; j++){
        charToSeq(sequence[j], seqer, 4);
        //printf("%.4s", seqer);
    }
    if(seqLen%4 != 0){
        charToSeq(sequence[seqLen/4], seqer, seqLen%4);
        //printf("%.4s", seqer);
    }
    //printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r12d
shrl $0x2, %r12d
xorl %r13d, %r13d
leaq 0x4(%rsp), %r15
pushq $0x4
popq %rbp
cmpq %r13, %r12
je 0x8fa9
movzbl (%r14,%r13), %edi
movq %r15, %rsi
movl %ebp, %edx
callq 0x8f06
incq %r13
jmp 0x8f90
andl $0x3, %ebx
je 0x8fbf
movzbl (%r14,%r12), %edi
leaq 0x4(%rsp), %rsi
movl %ebx, %edx
callq 0x8f06
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: copyAlignment
void copyAlignment(alignSet_t *dst, const alignSet_t *src) {
    assert(dst != NULL);
    assert(src != NULL);
    destroyAlignment(dst);

    dst->likelihood = src->likelihood;
    dst->likelihoodInsert = src->likelihoodInsert;
    dst->start1 = src->start1;
    dst->start2 = src->start2;
    dst->end1 = src->end1;
    dst->end2 = src->end2;
    dst->contigId1 = src->contigId1;
    dst->contigId2 = src->contigId2;
    if (src->name != NULL)
        dst->name = strdup(src->name);
    else
        dst->name = NULL;
    dst->orientation = src->orientation;
    dst->nextAlignment = src->nextAlignment;
    dst->bamOfAlignment1 = src->bamOfAlignment1;
    dst->bamOfAlignment2 = src->bamOfAlignment2;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x90d1
movq %rsi, %r14
testq %rsi, %rsi
je 0x90f0
movq %rdi, %rbx
callq 0x903c
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movups 0x10(%r14), %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x90ab
callq 0x3630
jmp 0x90ad
xorl %eax, %eax
movq %rax, 0x28(%rbx)
movl 0x40(%r14), %eax
movl %eax, 0x40(%rbx)
movq 0x48(%r14), %rax
movq %rax, 0x48(%rbx)
movups 0x30(%r14), %xmm0
movups %xmm0, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x16bc2(%rip), %rdi     # 0x1fc9a
leaq 0x16bc7(%rip), %rsi     # 0x1fca6
leaq 0x16bf1(%rip), %rcx     # 0x1fcd7
movl $0x162, %edx            # imm = 0x162
callq 0x3230
leaq 0x16c15(%rip), %rdi     # 0x1fd0c
leaq 0x16ba8(%rip), %rsi     # 0x1fca6
leaq 0x16bd2(%rip), %rcx     # 0x1fcd7
movl $0x163, %edx            # imm = 0x163
callq 0x3230
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: getGCtotal
int getGCtotal(char seq1[], int seq1len){
    int GCtot = 0, i;
    for(i = 0; i < seq1len; i++){
        if(isGC(seq1[i])){
            GCtot++;
        }
    }
    return GCtot;
}

// Assembly:
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
pushq $0x1
popq %rdx
movabsq $0x1000000011, %r8      # imm = 0x1000000011
xorl %eax, %eax
cmpq %rcx, %rsi
je 0x91fb
movzbl (%rdi,%rcx), %r9d
leal -0x43(%r9), %r10d
cmpl $0x24, %r10d
ja 0x91e8
btq %r10, %r8
movl %edx, %r10d
jb 0x91f3
xorl %r10d, %r10d
cmpb $0x63, %r9b
sete %r10b
addl %r10d, %eax
incq %rcx
jmp 0x91cb
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: validateAssemblyIsSameAsAlignment
int validateAssemblyIsSameAsAlignment(bam_header_t *header, assemblyT *theAssembly) {
    int i;
    //printf("Validating assembly and alignment files consisting of %d contigs\n", header->n_targets);
    if (header->n_targets != theAssembly->numContigs) {
        //printf("Different number of contigs in assembly (%d) and alignmentfile (%d)\n", theAssembly->numContigs, header->n_targets);
        return 0;
    }
    for (i = 0; i < header->n_targets; i++) {
        if (header->target_len[i] != theAssembly->contigs[i]->seqLen) {
        	//printf("Different contig length in contig %d: %d vs %d\n", i, header->target_len[i], theAssembly->contigs[i]->seqLen);
        	return 0;
        }
        if (strcmp(header->target_name[i], theAssembly->contigs[i]->name) != 0) {
        	//printf("Warning assembly and alignment files disagree on the name of contig %d: %s vs %s\n", i, header->target_name[i], theAssembly->contigs[i]->name);
        }
    }
    return 1;
}

// Assembly:
movl (%rdi), %ecx
cmpl (%rsi), %ecx
jne 0x95f9
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
pushq $0x1
popq %rax
cmpq %rdx, %rcx
je 0x95fb
movq 0x10(%rdi), %r8
movl (%r8,%rdx,4), %r8d
movq 0xa0(%rsi), %r9
movq (%r9,%rdx,8), %r9
incq %rdx
cmpl 0x8(%r9), %r8d
je 0x95d8
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: getContigAvgDepth
double getContigAvgDepth(contig_t *contig) {
	double depth = 0.0;
	int j;
	for(j=0; j < contig->seqLen; j++)
		depth += contig->depth[j];
	return depth / contig->seqLen;
}

// Assembly:
movl 0x8(%rdi), %eax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
xorpd %xmm0, %xmm0
cmpq %rcx, %rdx
je 0x997d
movq 0x30(%rdi), %rsi
cvtss2sd (%rsi,%rcx,4), %xmm1
addsd %xmm1, %xmm0
incq %rcx
jmp 0x9966
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: getFragmentMapLenBAM
int getFragmentMapLenBAM(bam1_t *read1) {
    assert(read1 != NULL);

    int left = read1->core.pos < read1->core.mpos ? read1->core.pos : read1->core.mpos;
    int readLength = getSeqMapLenBAM(read1);
    int right1 = read1->core.pos + readLength;
    int right2 = read1->core.mpos + readLength;
    int right = right1 > right2 ? right1 : right2;
    assert(right >= left);
    return right - left;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x99eb
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movl 0x18(%rdi), %ebp
cmpl %ebp, %eax
cmovll %eax, %ebp
callq 0x9986
movl 0x4(%rbx), %ecx
addl %eax, %ecx
addl 0x18(%rbx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
subl %ebp, %eax
jl 0x9a0a
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x14335(%rip), %rdi     # 0x1dd27
leaq 0x162ad(%rip), %rsi     # 0x1fca6
leaq 0x163ce(%rip), %rcx     # 0x1fdce
movl $0x240, %edx            # imm = 0x240
callq 0x3230
leaq 0x163e0(%rip), %rdi     # 0x1fdf1
leaq 0x1628e(%rip), %rsi     # 0x1fca6
leaq 0x163af(%rip), %rcx     # 0x1fdce
movl $0x247, %edx            # imm = 0x247
callq 0x3230
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: readNextBAM
enum MATE_ORIENTATION readNextBAM(samfile_t *ins, bam1_t *read1) {
    assert(ins != NULL);
    assert(read1 != NULL);

    while (1) {
      int bytesRead = samread(ins, read1);
      if (bytesRead <= 0) {
        return NO_READS;
      } else if ( ( read1->core.flag & ( BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP | BAM_FSUPPLEMENTARY)) == 0) { // only consider the read if it is primary, passedqc and not duplicated
        enum MATE_ORIENTATION o = getPairedMateOrientation(read1);
        //printf("readNextBam: %s %d %d %s\n", bam1_qname(read1), read1->core.flag, o, MATE_ORIENTATION_LABELS[o]);
        return o;
      }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x9baf
movq %rsi, %rbx
testq %rsi, %rsi
je 0x9bce
movq %rdi, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11323
testl %eax, %eax
jle 0x9ba4
testb $0xf, 0xd(%rbx)
jne 0x9b80
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9a29
pushq $0xd
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x162b0(%rip), %rdi     # 0x1fe66
leaq 0x160e9(%rip), %rsi     # 0x1fca6
leaq 0x162ae(%rip), %rcx     # 0x1fe72
movl $0x296, %edx            # imm = 0x296
callq 0x3230
leaq 0x14152(%rip), %rdi     # 0x1dd27
leaq 0x160ca(%rip), %rsi     # 0x1fca6
leaq 0x1628f(%rip), %rcx     # 0x1fe72
movl $0x297, %edx            # imm = 0x297
callq 0x3230
// File: /workspace/github_c_makefile_star2_O2/sc932[P]ALE/src/ALEhelpers.c
// Function: assemblySanityCheck
int assemblySanityCheck(assemblyT *theAssembly){
    int i, j, num = theAssembly->numContigs;
    int error = 1;
    int countAmbiguous = 0;
    for(j=0; j < num ; j++){
        contig_t *contig = theAssembly->contigs[j];
        for(i = 0; i < contig->seqLen; i++){
            if(contig->seq[i] != 'A' && contig->seq[i] != 'T' && contig->seq[i] != 'C' && contig->seq[i] != 'G' && contig->seq[i] != 'N'){
                //printf("Found an ambiguous base in the assembly, contig %d, position %d = %c\n", j, i, contig->seq[i]);
                //contig->seq[i] = 'N';
                error = 0;
                countAmbiguous++;
                int c = contig->ambiguousBaseCount;
                contig->ambiguousBasePositions = (int32_t*) realloc(contig->ambiguousBasePositions, sizeof(*contig->ambiguousBasePositions) * kroundup32(c));
                contig->ambiguousBasePositions[ contig->ambiguousBaseCount++ ] = i;
            }
        }
    }
    if(error == 0){
      printf("Found %d ambiguous bases (excluding N) in the assembly.\n", countAmbiguous);
    }
    return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movl (%rdi), %eax
xorl %r12d, %r12d
testl %eax, %eax
cmovlel %r12d, %eax
movq %rax, 0x10(%rsp)
pushq $0x1
popq %r14
movl $0x82045, %r13d         # imm = 0x82045
xorl %ebp, %ebp
cmpq 0x10(%rsp), %r12
je 0x9f23
movq 0x8(%rsp), %rax
movq 0xa0(%rax), %rax
movq (%rax,%r12,8), %rbx
xorl %r15d, %r15d
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jge 0x9f1b
movq 0x10(%rbx), %rax
movzbl (%rax,%r15), %eax
addl $-0x41, %eax
cmpl $0x13, %eax
ja 0x9ec7
btl %eax, %r13d
jae 0x9ec7
incq %r15
jmp 0x9ea2
incl %ebp
movl 0x20(%rbx), %eax
movq 0x28(%rbx), %rdi
decl %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x10, %ecx
orl %eax, %ecx
movslq %ecx, %rax
leaq 0x4(,%rax,4), %rsi
callq 0x3480
movq %rax, 0x28(%rbx)
movslq 0x20(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x20(%rbx)
movl %r15d, (%rax,%rcx,4)
xorl %r14d, %r14d
jmp 0x9ec2
incq %r12
jmp 0x9e84
testl %r14d, %r14d
jne 0x9f38
leaq 0x1613d(%rip), %rdi     # 0x2006c
movl %ebp, %esi
xorl %eax, %eax
callq 0x3210
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq