LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/sc932[P]ALE/src/ALElike.c
// Function: kmerHash
int kmerHash(char c1, int place){
  int hash = 0;
  switch(c1) {
  case 'A': case 'a': break;
  case 'T': case 't': hash = 0x1 << (place*2); break;
  case 'C': case 'c': hash = 0x2 << (place*2); break;
  case 'G': case 'g': hash = 0x3 << (place*2); break;
  default: hash = -16777216;
  }
  return hash;
}

// Assembly:
xorl %eax, %eax
cmpl $0x60, %edi
jg 0x6909
cmpl $0x46, %edi
jg 0x6921
cmpl $0x41, %edi
je 0x6930
cmpl $0x43, %edi
je 0x6918
jmp 0x692b
cmpl $0x66, %edi
jg 0x6931
cmpl $0x61, %edi
je 0x6930
cmpl $0x63, %edi
jne 0x692b
addl %esi, %esi
movl $0x2, %eax
jmp 0x694b
cmpl $0x47, %edi
je 0x6944
cmpl $0x54, %edi
je 0x693b
movl $0xff000000, %eax       # imm = 0xFF000000
retq
cmpl $0x67, %edi
je 0x6944
cmpl $0x74, %edi
jne 0x692b
addl %esi, %esi
movl $0x1, %eax
jmp 0x694b
addl %esi, %esi
movl $0x3, %eax
movl %esi, %ecx
shll %cl, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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
testl %edx, %edx
jle 0x6985
movq %rdi, %rbx
movslq %esi, %rax
movl %edx, %r15d
addq %rax, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movsbl (%rbx,%r14), %edi
movl %r14d, %esi
callq 0x68f1
addl %eax, %ebp
incq %r14
cmpq %r14, %r15
jne 0x696c
jmp 0x6987
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x72d2
movb (%rdi), %cl
testb %cl, %cl
je 0x72d2
incq %rdi
movsbl %cl, %ecx
movl %eax, %edx
shll $0x5, %edx
movl %eax, %esi
shrl $0x2, %esi
addl %edx, %esi
addl %ecx, %esi
xorl %esi, %eax
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x72b6
retq
// File: /workspace/github_c_makefile_star2_O3/sc932[P]ALE/src/ALElike.c
// Function: getTotalLikelihood
double getTotalLikelihood(alignSet_t *head) {
  double likeNormalizer = 0.0;
  likeNormalizer += head->likelihood*head->likelihoodInsert;
  alignSet_t *current = head;
  while(current->nextAlignment != NULL){
    current = current->nextAlignment;
    likeNormalizer += current->likelihood*current->likelihoodInsert;
  }
  return likeNormalizer;
}

// Assembly:
movsd (%rdi), %xmm1
mulsd 0x8(%rdi), %xmm1
xorpd %xmm0, %xmm0
addsd %xmm1, %xmm0
movq 0x48(%rdi), %rax
testq %rax, %rax
je 0x7300
movsd (%rax), %xmm1
mulsd 0x8(%rax), %xmm1
addsd %xmm1, %xmm0
movq 0x48(%rax), %rax
jmp 0x72e8
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq %rax, %rdx
shrq $0x30, %rdx
shlq $0x2, %rdx
addq 0x30(%rdi), %rdx
shrl $0x18, %eax
movl 0x10(%rdi), %ecx
leal 0x1(%rcx), %edi
sarl %edi
movslq %edi, %rdi
addq %rax, %rdi
addq %rdx, %rdi
xorl %edx, %edx
callq 0x9b40
movsd 0x15fbd(%rip), %xmm1    # 0x1da30
subsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x3290
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x3290
movsd 0x18(%rsp), %xmm2
movapd %xmm0, %xmm3
movl 0x10(%rbx), %eax
leal -0x1(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
addsd %xmm0, %xmm0
movapd %xmm2, %xmm1
maxsd %xmm3, %xmm1
mulsd %xmm0, %xmm1
testl %eax, %eax
movsd %xmm1, 0x10(%rsp)
jle 0x7b33
xorpd %xmm5, %xmm5
xorpd %xmm4, %xmm4
movsd %xmm3, 0x20(%rsp)
movsd %xmm5, 0x28(%rsp)
movsd %xmm4, 0x8(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
mulsd %xmm3, %xmm1
movapd %xmm5, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addsd %xmm0, %xmm0
subsd 0x10(%rsp), %xmm0
callq 0x3680
movsd 0x28(%rsp), %xmm5
movsd 0x8(%rsp), %xmm4
movsd 0x20(%rsp), %xmm3
movsd 0x18(%rsp), %xmm2
addsd %xmm0, %xmm4
addsd 0x15f04(%rip), %xmm5    # 0x1da30
addl $-0x1, %ebx
jb 0x7ad6
jmp 0x7b37
xorpd %xmm4, %xmm4
movapd %xmm4, %xmm0
callq 0x3290
addsd 0x10(%rsp), %xmm0
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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, %eax
cmpl %edx, %esi
jg 0x7d60
leal (%rax,%rsi), %edx
movl %edx, %r8d
shrl $0x1f, %r8d
addl %edx, %r8d
sarl %r8d
movslq %r8d, %rdx
cmpl %ecx, (%rdi,%rdx,4)
jge 0x7d51
incl %r8d
movl %r8d, %esi
jmp 0x7d59
je 0x7d60
decl %r8d
movl %r8d, %eax
leal (%rax,%rsi), %edx
cmpl %eax, %esi
jle 0x7d34
cmpl %eax, %esi
cmovll %esi, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movl 0x4(%rdi), %r9d
cmpl %esi, %r9d
jg 0x7dea
movq 0x8(%rdi), %rdx
movq %rdx, %r8
shrq $0x30, %r8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
je 0x7de8
shrl $0x18, %edx
addq 0x30(%rdi), %rdx
xorl %edi, %edi
movl $0x1, %r10d
movl -0x4(%rdx,%r10,4), %ecx
movl %ecx, %ebx
shrl $0x4, %ebx
addl %ecx, %ecx
movl $0x3c1a7, %r11d         # imm = 0x3C1A7
shrl %cl, %r11d
testb $0x2, %r11b
jne 0x7db1
movl %r9d, %ecx
jmp 0x7db9
leal (%rbx,%r9), %ecx
cmpl %esi, %ecx
jge 0x7dd7
cmpq %r8, %r10
jae 0x7de8
andl $0x1, %r11d
negl %r11d
andl %ebx, %r11d
addl %r11d, %edi
incq %r10
movl %ecx, %r9d
cmpl %esi, %ecx
jle 0x7d91
jmp 0x7de8
andl $0x1, %r11d
negl %r11d
subl %r9d, %esi
andl %r11d, %esi
addl %edi, %esi
movl %esi, %eax
popq %rbx
retq
leaq 0x1a506(%rip), %rdi     # 0x222f7
leaq 0x19f6d(%rip), %rsi     # 0x21d65
leaq 0x1a50f(%rip), %rcx     # 0x2230e
movl $0x4fd, %edx            # imm = 0x4FD
callq 0x3230
// File: /workspace/github_c_makefile_star2_O3/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 0x8081
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x803c
jnp 0x8076
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x4(%rsp), %r12
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
movq 0x30(%r14), %rdx
movq %r12, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x7e22
movq 0x38(%r14), %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x7e22
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x80a9
movq %rsi, %r14
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x80b1
jp 0x80b1
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x80c6
movq 0x8(%rbx), %rdi
callq 0x1060c
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0x80a9
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1060c
// File: /workspace/github_c_makefile_star2_O3/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 0x15881(%rip), %xmm1    # 0x1db30
movapd %xmm1, %xmm4
movapd 0x157f5(%rip), %xmm1    # 0x1dab0
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 0x15859(%rip), %xmm2    # 0x1db40
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_O3/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
movsd %xmm1, 0x20(%rsp)
movapd %xmm0, %xmm1
testl %esi, %esi
movsd %xmm0, 0x18(%rsp)
jle 0x8362
movq %rdi, %r14
movl %ebx, %r15d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtss2sd (%r14,%r12,4), %xmm0
addsd %xmm1, %xmm0
callq 0x827c
movsd 0x18(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
incq %r12
cmpq %r12, %r15
jne 0x8330
jmp 0x836c
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x10(%rsp)
movapd %xmm1, %xmm0
callq 0x827c
mulsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x3290
mulsd 0x10(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
testl %edi, %edi
movsd %xmm0, 0x20(%rsp)
jle 0x851d
movsd 0x155bd(%rip), %xmm1    # 0x1da68
addsd %xmm0, %xmm1
movsd %xmm1, 0x28(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x15569(%rip), %xmm1    # 0x1da30
movl %ebx, %ebp
movsd %xmm1, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
addsd %xmm1, %xmm0
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 0x15519(%rip), %xmm1    # 0x1da30
decl %ebp
jne 0x84c9
jmp 0x8527
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x15501(%rip), %xmm0    # 0x1da30
subsd 0x18(%rsp), %xmm0
callq 0x3290
mulsd 0x20(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
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_O3/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 0x154ea(%rip), %xmm2    # 0x1da78
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 0x19f52(%rip), %rdi     # 0x2251e
movb $0x1, %al
jmp 0x3210
// File: /workspace/github_c_makefile_star2_O3/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
movq (%r12,%rbp,8), %rax
movsd 0x8(%rsp), %xmm0
testq %rax, %rax
jle 0x861a
movsd (%r13,%rbp,8), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%r13,%rbp,8)
movsd 0x1544f(%rip), %xmm1    # 0x1da78
ucomisd %xmm0, %xmm1
jbe 0x8646
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, (%r13,%rbp,8)
movsd 0x15432(%rip), %xmm0    # 0x1da78
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 0x868d
cltq
leaq 0x1562a(%rip), %rcx     # 0x1dcb0
movsd (%rcx,%rax,8), %xmm0
jmp 0x8698
movsd 0x10(%rsp), %xmm0
callq 0x58f6
movsd %xmm0, (%rbx,%rbp,8)
incq %rbp
cmpq $0x65, %rbp
jne 0x85f8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jle 0x8d17
movq 0x8(%rdi), %rsi
movq %rsi, %r8
shrq $0x30, %r8
shlq $0x2, %r8
addq 0x30(%rdi), %r8
shrl $0x18, %esi
leaq 0x1(%rcx), %rdx
shrq %rdx
addq %rsi, %rdx
addq %r8, %rdx
xorl %esi, %esi
movb (%rdx,%rsi), %dil
cmpb $0x53, %dil
jg 0x8d18
leal -0x1(%rdi), %r8d
cmpb $0x20, %r8b
jb 0x8d1e
addb $-0x33, %dil
cmpb $0xc, %dil
jbe 0x8d21
incq %rsi
cmpq %rsi, %rcx
jne 0x8cf1
retq
movl $0x40, %eax
retq
xorl %eax, %eax
retq
movl $0x21, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8d67
testq %rsi, %rsi
je 0x8d67
testb $-0x40, 0xc(%rdi)
je 0x8d86
movabsq $0xc000000000, %rax     # imm = 0xC000000000
testq %rax, 0x8(%rsi)
je 0x8da5
movq 0x30(%rdi), %rdi
movq 0x30(%rsi), %rsi
popq %rax
jmp 0x3330
leaq 0x198a7(%rip), %rdi     # 0x22615
leaq 0x18ff0(%rip), %rsi     # 0x21d65
leaq 0x198b2(%rip), %rcx     # 0x2262e
movl $0x6df, %edx            # imm = 0x6DF
callq 0x3230
leaq 0x198cd(%rip), %rdi     # 0x2265a
leaq 0x18fd1(%rip), %rsi     # 0x21d65
leaq 0x19893(%rip), %rcx     # 0x2262e
movl $0x6e2, %edx            # imm = 0x6E2
callq 0x3230
leaq 0x198de(%rip), %rdi     # 0x2268a
leaq 0x18fb2(%rip), %rsi     # 0x21d65
leaq 0x19874(%rip), %rcx     # 0x2262e
movl $0x6e3, %edx            # imm = 0x6E3
callq 0x3230
// File: /workspace/github_c_makefile_star2_O3/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 0x8d38
testl %eax, %eax
jne 0x8e03
movl (%r14), %ecx
xorl %eax, %eax
cmpl (%rbx), %ecx
setge %cl
jne 0x8dfa
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 0x8e03
movb %cl, %al
leal -0x1(,%rax,2), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8fa9
movl %esi, %eax
leaq 0x14c3f(%rip), %rcx     # 0x1dbb4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x0, 0x23acf(%rip)     # 0x2ca54
jne 0x8fa7
movq (%rdi), %rax
movq 0x30(%rax), %rsi
movzwl 0xc(%rax), %edx
leaq 0x197b3(%rip), %rdi     # 0x2274c
xorl %eax, %eax
callq 0x3210
movb $0x1, 0x23aad(%rip)     # 0x2ca54
popq %rax
retq
leaq 0x197a4(%rip), %rdi     # 0x22754
xorl %eax, %eax
callq 0x3210
movl $0x1, %edi
callq 0x35c0
// File: /workspace/github_c_makefile_star2_O3/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 0x14aa0(%rip), %xmm0    # 0x1da98
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
callq 0xbd04
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
andps 0x14b3b(%rip), %xmm0    # 0x1db50
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_O3/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, %rdx      # imm = 0x900000000
andq 0x8(%rsi), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movabsq $0x100000000, %r8       # imm = 0x100000000
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %r8, %rdx
jne 0x942a
movl 0x14(%rsi), %ecx
movl 0x18(%rsi), %eax
movl %eax, 0x14(%rdi)
movl $0xffffffff, 0x1c(%rdi) # imm = 0xFFFFFFFF
movl %ecx, 0x24(%rdi)
movq %rsi, 0x30(%rdi)
movq $0x0, 0x38(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r14d
movl %edx, %r12d
movl %esi, %ebx
movq %rdi, %r15
xorl %r13d, %r13d
xorl %eax, %eax
callq 0xabe0
movl %eax, %ebp
addl %ebx, %ebp
subl %r12d, %r14d
jle 0x9bc6
movslq %r12d, %rax
addq %rax, %r15
xorpd %xmm1, %xmm1
xorl %r12d, %r12d
movsbl (%r15,%r12), %eax
cmpl %eax, %ebp
jg 0x9b9a
movsbl %al, %edi
movl %ebx, %esi
movsd %xmm1, (%rsp)
callq 0xabe7
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
incl %r13d
incq %r12
cmpl %r12d, %r14d
jne 0x9b76
testl %r13d, %r13d
je 0x9bc6
xorps %xmm0, %xmm0
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 0xabe7
// File: /workspace/github_c_makefile_star2_O3/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 0x9bfb
cmpl $0x5, %edx
ja 0x9bf7
movq 0x30(%rsi), %rax
cmpl $0x2, %edi
jne 0x9bfc
addq $0x2, %rax
jmp 0x9bff
incq 0x30(%rsi)
retq
incq %rax
movq %rax, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rdi, %rbx
xorl %eax, %eax
testl %edx, %edx
je 0xa91d
movq %rsi, %r14
movl %edx, %r12d
leaq 0x185a8(%rip), %r13     # 0x22e81
xorl %ebp, %ebp
xorl %ecx, %ecx
movslq %ecx, %r15
leaq (%rbx,%r15), %rdi
movl (%r14,%rbp,4), %edx
shrl $0x4, %edx
leaq 0x17b3d(%rip), %rsi     # 0x2242f
xorl %eax, %eax
callq 0x35b0
movl (%r14,%rbp,4), %ecx
andl $0xf, %ecx
movb (%rcx,%r13), %dl
leal (%rax,%r15), %ecx
incl %ecx
addl %r15d, %eax
cltq
movb %dl, (%rbx,%rax)
incq %rbp
cmpq %rbp, %r12
jne 0xa8dd
movslq %ecx, %rax
movb $0x0, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x21f6e(%rip), %rax     # 0x2ca48
testq %rax, %rax
je 0xab3c
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rax), %rdi
callq 0x3070
movq 0x21f52(%rip), %rax     # 0x2ca48
movq $0x0, (%rax)
cmpl $0x0, (%rbx)
jle 0xab2c
xorl %r14d, %r14d
movq 0xa0(%rbx), %rax
movq (%rax,%r14,8), %r15
movq 0x18(%r15), %rdi
callq 0x3070
movq $0x0, 0x18(%r15)
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0xab05
movq $0x0, 0x21f11(%rip) # 0x2ca48
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0xac13
movl %edi, %esi
leaq 0x19032(%rip), %rdi     # 0x23c30
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
movl $0x3e, %ebx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x18614(%rip), %rcx     # 0x23230
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xac54
movl %edi, %esi
leaq 0x19021(%rip), %rdi     # 0x23c60
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
movl $0x3e, %ebx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x187d3(%rip), %rcx     # 0x23430
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xac95
movl %edi, %esi
leaq 0x19013(%rip), %rdi     # 0x23c93
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
movl $0x3e, %ebx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x18992(%rip), %rcx     # 0x23630
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movslq %esi, %r15
movq %r15, %rdi
shlq $0x5, %rdi
callq 0x3420
cmpl $0x2, %r15d
jl 0xacf1
decl %r14d
movq (%rbx), %rcx
shlq $0x5, %r14
xorl %edx, %edx
movups (%rcx,%rdx), %xmm0
movups 0x10(%rcx,%rdx), %xmm1
movups %xmm1, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
addq $0x20, %rdx
cmpq %rdx, %r14
jne 0xacd6
movq %rax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
movaps %xmm0, 0x10(%rsp)
testl %edi, %edi
jle 0xad85
movl %edi, %ebx
movapd 0x184cc(%rip), %xmm1    # 0x231e0
xorpd 0x10(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsi2ss %edi, %xmm0
cvtss2sd %xmm0, %xmm0
divsd %xmm0, %xmm1
movapd %xmm1, 0x20(%rsp)
negl %ebx
movl $0x1, %r14d
movsd 0x12cf1(%rip), %xmm1    # 0x1da30
mulsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movapd 0x20(%rsp), %xmm0
callq 0x3680
mulsd 0x8(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r14d, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
leal (%rbx,%r14), %eax
incl %eax
movl %r14d, %ecx
incl %ecx
movapd %xmm0, %xmm1
movl %ecx, %r14d
cmpl $0x1, %eax
jne 0xad3f
jmp 0xad8d
movsd 0x12ca3(%rip), %xmm0    # 0x1da30
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testl %esi, %esi
je 0xaeeb
movl %esi, %eax
xorl %esi, %esi
movsbq (%rdi,%rsi), %r8
movb %r8b, (%rdx,%rsi)
incl -0x100(%rcx,%r8,4)
incq %rsi
cmpq %rsi, %rax
jne 0xaed2
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r14
movl %esi, %r12d
shrl $0x2, %r12d
xorl %eax, %eax
cmpl $0x4, %esi
jb 0xaf8a
movl %r12d, %r13d
xorl %ebp, %ebp
movsbl (%r14,%rbp,4), %edi
movsbl 0x1(%r14,%rbp,4), %esi
movsbl 0x2(%r14,%rbp,4), %edx
movsbl 0x3(%r14,%rbp,4), %ecx
callq 0xae33
movb %al, (%rbx,%rbp)
incq %rbp
cmpq %rbp, %r13
jne 0xaf5d
movl %r15d, %eax
andl $-0x4, %eax
andl $0x3, %r15d
leaq 0x1828b(%rip), %rcx     # 0x23220
movslq (%rcx,%r15,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movl %eax, %eax
movb (%r14,%rax), %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
jmp 0xb004
movl %eax, %eax
movb (%r14,%rax), %cl
movb 0x1(%r14,%rax), %dl
cmpb $0x41, %cl
sete %al
cmpb $0x47, %cl
sete %sil
orb %al, %sil
cmpb $0x43, %cl
sete %cl
orb %al, %cl
addb %cl, %cl
orb %sil, %cl
cmpb $0x41, %dl
sete %sil
cmpb $0x47, %dl
sete %al
orb %sil, %al
shlb $0x2, %al
cmpb $0x43, %dl
sete %dl
orb %sil, %dl
shlb $0x3, %dl
orb %cl, %al
orb %dl, %al
jmp 0xb025
movl %eax, %eax
movsbl (%r14,%rax), %edi
movsbl 0x1(%r14,%rax), %esi
movsbl 0x2(%r14,%rax), %edx
movl $0x54, %ecx
callq 0xae33
movb %al, (%rbx,%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testl %edx, %edx
jle 0xb0af
movl %edx, %eax
xorl %ecx, %ecx
movl $0x47, %r8d
movl $0x54, %r9d
testb $0x2, %dil
movl $0x41, %r10d
cmovel %r8d, %r10d
movl $0x43, %r11d
cmovel %r9d, %r11d
testb $0x1, %dil
cmovnel %r10d, %r11d
movb %r11b, (%rsi,%rcx)
shrb $0x2, %dil
incq %rcx
cmpq %rcx, %rax
jne 0xb07a
cmpl $0x3, %edx
jg 0xb0cf
movslq %edx, %rax
addq %rax, %rsi
movl $0x3, %eax
subl %edx, %eax
incq %rax
movq %rsi, %rdi
movl $0x20, %esi
movq %rax, %rdx
jmp 0x3260
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movl %esi, %edx
movl %esi, %eax
shrl $0x2, %eax
cmpl $0x4, %esi
jb 0xb12f
movl %eax, %ecx
xorl %esi, %esi
movl $0x47, %r8d
movl $0x54, %r9d
movb (%rdi,%rsi), %r10b
xorl %r11d, %r11d
testb $0x2, %r10b
movl $0x41, %ebx
cmovel %r8d, %ebx
movl $0x43, %ebp
cmovel %r9d, %ebp
testb $0x1, %r10b
cmovnel %ebx, %ebp
movb %bpl, 0x4(%rsp,%r11)
shrb $0x2, %r10b
incq %r11
cmpq $0x4, %r11
jne 0xb0f8
incq %rsi
cmpq %rcx, %rsi
jne 0xb0f1
andl $0x3, %edx
je 0xb142
movzbl (%rdi,%rax), %edi
leaq 0x4(%rsp), %rsi
callq 0xb066
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xb25d
movq %rsi, %r14
testq %rsi, %rsi
je 0xb27c
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0xb20f
callq 0x3070
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 0xb237
callq 0x3630
jmp 0xb239
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 0x18a66(%rip), %rdi     # 0x23cca
leaq 0x18a6b(%rip), %rsi     # 0x23cd6
leaq 0x18a95(%rip), %rcx     # 0x23d07
movl $0x162, %edx            # imm = 0x162
callq 0x3230
leaq 0x18ab9(%rip), %rdi     # 0x23d3c
leaq 0x18a4c(%rip), %rsi     # 0x23cd6
leaq 0x18a76(%rip), %rcx     # 0x23d07
movl $0x163, %edx            # imm = 0x163
callq 0x3230
// File: /workspace/github_c_makefile_star2_O3/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:
testl %esi, %esi
jle 0xb316
movl %esi, %ecx
xorl %edx, %edx
movabsq $0x1000000011, %rsi     # imm = 0x1000000011
xorl %eax, %eax
movzbl (%rdi,%rdx), %r8d
leal -0x43(%r8), %r10d
cmpl $0x24, %r10d
ja 0xb2ff
movl $0x1, %r9d
btq %r10, %rsi
jb 0xb30a
xorl %r9d, %r9d
cmpb $0x63, %r8b
sete %r9b
addl %r9d, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0xb2e4
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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
xorl %eax, %eax
cmpl (%rsi), %ecx
jne 0xb88b
movl $0x1, %eax
testl %ecx, %ecx
jle 0xb88b
movq 0x10(%rdi), %rdx
movq 0xa0(%rsi), %rsi
xorl %edi, %edi
movl (%rdx,%rdi,4), %r8d
movq (%rsi,%rdi,8), %r9
cmpl 0x8(%r9), %r8d
jne 0xb88c
incq %rdi
cmpq %rdi, %rcx
jne 0xb875
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movslq 0x8(%rdi), %rax
testq %rax, %rax
jle 0xbcc2
movq 0x30(%rdi), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
xorps %xmm1, %xmm1
cvtss2sd (%rcx,%rdx,4), %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0xbcac
jmp 0xbcc6
xorpd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xbd3f
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movl 0x18(%rdi), %ebp
cmpl %ebp, %eax
cmovll %eax, %ebp
movzbl 0xb(%rdi), %esi
addq 0x30(%rdi), %rsi
callq 0xf7bd
movl 0x4(%rbx), %ecx
addl %eax, %ecx
addl 0x18(%rbx), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
subl %ebp, %eax
jl 0xbd5e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x16011(%rip), %rdi     # 0x21d57
leaq 0x17f89(%rip), %rsi     # 0x23cd6
leaq 0x180aa(%rip), %rcx     # 0x23dfe
movl $0x240, %edx            # imm = 0x240
callq 0x3230
leaq 0x180bc(%rip), %rdi     # 0x23e21
leaq 0x17f6a(%rip), %rsi     # 0x23cd6
leaq 0x1808b(%rip), %rcx     # 0x23dfe
movl $0x247, %edx            # imm = 0x247
callq 0x3230
// File: /workspace/github_c_makefile_star2_O3/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 0xbf17
movq %rsi, %rbx
testq %rsi, %rsi
je 0xbf36
movq %rdi, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14659
testl %eax, %eax
jle 0xbf0a
testb $0xf, 0xd(%rbx)
jne 0xbee6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xbd7d
movl $0xd, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x17f78(%rip), %rdi     # 0x23e96
leaq 0x17db1(%rip), %rsi     # 0x23cd6
leaq 0x17f76(%rip), %rcx     # 0x23ea2
movl $0x296, %edx            # imm = 0x296
callq 0x3230
leaq 0x15e1a(%rip), %rdi     # 0x21d57
leaq 0x17d92(%rip), %rsi     # 0x23cd6
leaq 0x17f57(%rip), %rcx     # 0x23ea2
movl $0x297, %edx            # imm = 0x297
callq 0x3230
// File: /workspace/github_c_makefile_star2_O3/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, 0x10(%rsp)
movslq (%rdi), %rax
movq %rax, 0x8(%rsp)
movl $0x1, %ebp
testq %rax, %rax
jle 0xc2ea
xorl %r12d, %r12d
movl $0x82045, %r13d         # imm = 0x82045
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
movq 0xa0(%rax), %rax
movq (%rax,%r12,8), %r15
movl 0x8(%r15), %eax
testl %eax, %eax
jle 0xc2c6
xorl %r14d, %r14d
movq 0x10(%r15), %rcx
movzbl (%rcx,%r14), %ecx
addl $-0x41, %ecx
cmpl $0x13, %ecx
ja 0xc26d
btl %ecx, %r13d
jae 0xc26d
incq %r14
movslq %eax, %rcx
cmpq %rcx, %r14
jl 0xc249
jmp 0xc2c6
incl %ebx
movl 0x20(%r15), %eax
movq 0x28(%r15), %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(%r15)
movslq 0x20(%r15), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x20(%r15)
movl %r14d, (%rax,%rcx,4)
movl 0x8(%r15), %eax
xorl %ebp, %ebp
jmp 0xc260
incq %r12
cmpq 0x8(%rsp), %r12
jne 0xc22a
testl %ebp, %ebp
jne 0xc2ea
leaq 0x17dbd(%rip), %rdi     # 0x2409c
xorl %ebp, %ebp
movl %ebx, %esi
xorl %eax, %eax
callq 0x3210
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq