LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ssw.c
// Function: qP_byte
static __m128i* qP_byte (const int8_t* read_num,
				  const int8_t* mat,
				  const int32_t readLen,
				  const int32_t n,	/* the edge length of the squre matrix mat */
				  uint8_t bias) {

	int32_t segLen = (readLen + 15) / 16; /* Split the 128 bit register into 16 pieces.
								     Each piece is 8 bit. Split the read into 16 segments.
								     Calculat 16 segments in parallel.
								   */
	__m128i* vProfile = (__m128i*)malloc(n * segLen * sizeof(__m128i));
	int8_t* t = (int8_t*)vProfile;
	int32_t nt, i, j, segNum;

	/* Generate query profile rearrange query sequence & calculate the weight of match/mismatch */
	for (nt = 0; LIKELY(nt < n); nt ++) {
		for (i = 0; i < segLen; i ++) {
			j = i;
			for (segNum = 0; LIKELY(segNum < 16) ; segNum ++) {
				*t++ = j>= readLen ? bias : mat[nt * n + read_num[j]] + bias;
				j += segLen;
			}
		}
	}
	return vProfile;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
leal 0xf(%r14), %eax
pushq $0x10
popq %rcx
cltd
idivl %ecx
movl %eax, %r13d
imull %ebp, %eax
movslq %eax, %rdi
shlq $0x4, %rdi
callq 0x3420
testl %ebp, %ebp
jle 0x39e3
movl %r13d, %ecx
cmpl $0x2, %r13d
pushq $0x1
popq %rdx
cmovgel %r13d, %edx
xorl %esi, %esi
movq %rax, %r11
testl %r14d, %r14d
jle 0x39dd
movl %esi, %edi
imull %ebp, %edi
movslq %edi, %rdi
xorl %r9d, %r9d
movq %r11, %r8
xorl %r10d, %r10d
movq %r9, %r11
movl %ebx, %r13d
cmpl %r14d, %r11d
jge 0x39bb
movsbq (%r12,%r11), %r13
addq %rdi, %r13
movb (%r15,%r13), %r13b
addb %bl, %r13b
movb %r13b, (%r8,%r10)
addq %rcx, %r11
incq %r10
cmpl $0x10, %r10d
jne 0x39a4
incq %r9
leaq (%r8,%r10), %r11
cmpq %rdx, %r9
jne 0x399b
addq %r10, %r8
movq %r8, %r11
incl %esi
cmpl %ebp, %esi
jne 0x398b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ssw.c
// Function: qP_word
static __m128i* qP_word (const int8_t* read_num,
				  const int8_t* mat,
				  const int32_t readLen,
				  const int32_t n) {

	int32_t segLen = (readLen + 7) / 8;
	__m128i* vProfile = (__m128i*)malloc(n * segLen * sizeof(__m128i));
	int16_t* t = (int16_t*)vProfile;
	int32_t nt, i, j;
	int32_t segNum;

	/* Generate query profile rearrange query sequence & calculate the weight of match/mismatch */
	for (nt = 0; LIKELY(nt < n); nt ++) {
		for (i = 0; i < segLen; i ++) {
			j = i;
			for (segNum = 0; LIKELY(segNum < 8) ; segNum ++) {
				*t++ = j>= readLen ? 0 : mat[nt * n + read_num[j]];
				j += segLen;
			}
		}
	}
	return vProfile;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
leal 0x7(%r14), %eax
pushq $0x8
popq %rcx
cltd
idivl %ecx
movl %eax, %ebp
imull %ebx, %eax
movslq %eax, %rdi
shlq $0x4, %rdi
callq 0x3420
testl %ebx, %ebx
jle 0x3a90
movl %ebp, %ecx
cmpl $0x2, %ebp
pushq $0x1
popq %rdx
cmovgel %ebp, %edx
xorl %esi, %esi
movq %rax, %r11
testl %r14d, %r14d
jle 0x3a8a
movl %esi, %edi
imull %ebx, %edi
movslq %edi, %rdi
xorl %r9d, %r9d
movq %r11, %r8
xorl %r10d, %r10d
movq %r9, %r11
cmpl %r14d, %r11d
jge 0x3a64
movsbq (%r12,%r11), %r13
addq %rdi, %r13
movsbl (%r15,%r13), %ebp
jmp 0x3a66
xorl %ebp, %ebp
movw %bp, (%r8,%r10)
addq %rcx, %r11
addq $0x2, %r10
cmpl $0x10, %r10d
jne 0x3a50
incq %r9
leaq (%r8,%r10), %r11
cmpq %rdx, %r9
jne 0x3a47
addq %r10, %r8
movq %r8, %r11
incl %esi
cmpl %ebx, %esi
jne 0x3a37
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: lnfact2
double lnfact2(double input){
  double input2 = input*input;
  double input3 = input*input2;
  double input5 = input3*input2;
  double input7 = input5*input2;
  return (input - 0.5)*log(input) - input + lnfactconst2 + 1.0/(12.0*input) - 1.0/(360.0*input3) + 1.0/(1260.0*input5) - 1.0/(1680.0*input7);
}

// Assembly:
subq $0x28, %rsp
movsd %xmm0, (%rsp)
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movapd %xmm3, %xmm2
mulsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movapd %xmm3, %xmm1
mulsd %xmm2, %xmm1
movsd %xmm1, 0x18(%rsp)
mulsd %xmm1, %xmm3
movsd %xmm3, 0x20(%rsp)
movsd 0x1839d(%rip), %xmm1    # 0x1da20
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x3290
mulsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
subsd %xmm1, %xmm0
addsd 0x1837f(%rip), %xmm0    # 0x1da28
mulsd 0x1837f(%rip), %xmm1    # 0x1da30
movapd %xmm1, %xmm3
movsd 0x1837b(%rip), %xmm1    # 0x1da38
movapd %xmm1, %xmm2
divsd %xmm3, %xmm2
addsd %xmm2, %xmm0
movsd 0x10(%rsp), %xmm3
mulsd 0x18369(%rip), %xmm3    # 0x1da40
movapd %xmm1, %xmm2
divsd %xmm3, %xmm2
addsd %xmm2, %xmm0
movsd 0x18(%rsp), %xmm3
mulsd 0x18357(%rip), %xmm3    # 0x1da48
movapd %xmm1, %xmm2
divsd %xmm3, %xmm2
movsd 0x20(%rsp), %xmm3
mulsd 0x18349(%rip), %xmm3    # 0x1da50
addsd %xmm2, %xmm0
divsd %xmm3, %xmm1
addsd %xmm1, %xmm0
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: getNegBinomZnorm
double getNegBinomZnorm(double r){
  double ans = 0.0;
  int n = 0;
  double diff = 1.0;
  while((diff > 1e-8 || n < r) && n < 10000000){
      diff = exp(2.0*lnfact2(r + (double)n) - 2.0*lnfact2(r) - 2.0*lnfact2((double)n + 1.0) + (r + (double)n)*log(4.0));
      ans += diff;
      n++;
  }
  return ans;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movsd %xmm0, (%rsp)
movsd 0x1830e(%rip), %xmm0    # 0x1da38
xorpd %xmm1, %xmm1
movl $0x1, %ebx
leal -0x1(%rbx), %eax
ucomisd 0x1831a(%rip), %xmm0    # 0x1da58
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
jbe 0x5753
cmpl $0x98967f, %eax         # imm = 0x98967F
jbe 0x576d
jmp 0x57f4
cmpl $0x98967f, %eax         # imm = 0x98967F
ja 0x57f4
movsd (%rsp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x57f4
addsd (%rsp), %xmm2
movsd %xmm2, 0x10(%rsp)
movapd %xmm2, %xmm0
movsd %xmm1, 0x18(%rsp)
callq 0x5644
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
callq 0x5644
movsd 0x8(%rsp), %xmm1
addsd %xmm1, %xmm1
addsd %xmm0, %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movl %ebx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x5644
addsd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd 0x18286(%rip), %xmm0    # 0x1da60
addsd %xmm1, %xmm0
callq 0x3680
movsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
incl %ebx
jmp 0x5733
movapd %xmm1, %xmm0
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: GetInsertProbNormal
double GetInsertProbNormal(double point, const double sigma){
  if (sigma == 0.0){
      return 1.0;
  }
  double p1 = erf((point + 0.5)/sqrt(2*sigma*sigma));
  double p2 = erf((point - 0.5)/sqrt(2*sigma*sigma));
  double prob = 0.5*(p1 - p2);
  ////printf("Point: %lf, p1: %lf, p2: %lf = %lf\n", point, erf((point + 0.5)/sqrt(2*sigma*sigma)), erf((point - 0.5)/sqrt(2*sigma*sigma)), prob);
  return prob;
}

// Assembly:
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x5866
jp 0x5866
movsd 0x181d3(%rip), %xmm0    # 0x1da38
retq
subq $0x28, %rsp
movsd 0x181f6(%rip), %xmm3    # 0x1da68
movsd %xmm0, 0x18(%rsp)
addsd %xmm0, %xmm3
movapd %xmm1, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
movsd %xmm0, 0x10(%rsp)
ucomisd %xmm2, %xmm0
movsd %xmm1, 0x20(%rsp)
movapd %xmm1, %xmm0
jae 0x58bc
movsd 0x10(%rsp), %xmm0
movsd %xmm3, 0x8(%rsp)
callq 0x3600
movsd 0x8(%rsp), %xmm3
divsd %xmm0, %xmm3
movapd %xmm3, %xmm0
callq 0x3080
movsd 0x18(%rsp), %xmm1
addsd 0x18149(%rip), %xmm1    # 0x1da20
movsd %xmm0, 0x8(%rsp)
xorpd %xmm0, %xmm0
movsd 0x10(%rsp), %xmm2
ucomisd %xmm0, %xmm2
movsd 0x20(%rsp), %xmm0
jae 0x590a
movsd 0x10(%rsp), %xmm0
movsd %xmm1, 0x18(%rsp)
callq 0x3600
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x3080
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
mulsd 0x1813b(%rip), %xmm0    # 0x1da68
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: getMD
char *getMD(bam1_t *bam, char *ref) {
    char *md = (char*) bam_aux_get(bam, "MD");
    if (md == NULL) {
        bam_fillmd1_core_ALE(bam, ref);
        md = (char*) bam_aux_get(bam, "MD");
    }
    return md;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1c3a8(%rip), %rsi     # 0x21cf4
callq 0xe226
testq %rax, %rax
je 0x595e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c264
leaq 0x1c384(%rip), %rsi     # 0x21cf4
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xe226
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: getInsertLikelihoodBAM
double getInsertLikelihoodBAM(bam1_t *read1, double mu, double sigma){
  assert(read1 != NULL);
  double mapLength = (double)getFragmentMapLenBAM(read1);
  assert(mapLength > 0.0);
  double likelihood = GetInsertProbNormal(fabs(mapLength - mu), sigma);
  //printf("getInsertLikelihoodBAM(%lf,%lf,%lf): %e\n",fabs(mapLength - mu), mu, sigma,likelihood);
  assert(likelihood >= 0.0 && likelihood <= 1.0);
  return likelihood;
}

// Assembly:
subq $0x18, %rsp
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
testq %rdi, %rdi
je 0x59da
callq 0xba81
testl %eax, %eax
jle 0x59f9
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
subsd 0x8(%rsp), %xmm0
andpd 0x1812e(%rip), %xmm0    # 0x1dae0
movsd 0x10(%rsp), %xmm1
callq 0x5851
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x5a18
movsd 0x18069(%rip), %xmm1    # 0x1da38
ucomisd %xmm0, %xmm1
jb 0x5a18
addq $0x18, %rsp
retq
leaq 0x1c316(%rip), %rdi     # 0x21cf7
leaq 0x1c31d(%rip), %rsi     # 0x21d05
leaq 0x1c320(%rip), %rcx     # 0x21d0f
movl $0x8c, %edx
callq 0x3230
leaq 0x1c347(%rip), %rdi     # 0x21d47
leaq 0x1c2fe(%rip), %rsi     # 0x21d05
leaq 0x1c301(%rip), %rcx     # 0x21d0f
movl $0x8e, %edx
callq 0x3230
leaq 0x1c338(%rip), %rdi     # 0x21d57
leaq 0x1c2df(%rip), %rsi     # 0x21d05
leaq 0x1c2e2(%rip), %rcx     # 0x21d0f
movl $0x91, %edx
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: loglikeMiss
double loglikeMiss(char *readQual, int seqPos, int missLen, int qOff){
  int i;
  double loglikelihood = 0.0;
  for(i = seqPos; i < seqPos + missLen; i++){
    //likelihood = likelihood*((1.0 - 0.99)/3.0);
    //likelihood = likelihood*((1.0 - getQtoP(readQual[i], qOff))/3.0); // sometimes want -33/64?
    double logp = getQtoLogPMiss(readQual[i], qOff);
    ////printf("likeMiss(%d, %d, %c): %lf %lf %lf %lf\n", missLen, i, readQual[i] + 33, logp, loglikelihood, exp(logp), exp(loglikelihood));
    loglikelihood += logp;
  }
  ////printf("loglikeMiss(%d): %e\n", missLen, loglikelihood);
  assert(loglikelihood <= 0.0);
  return loglikelihood;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorpd %xmm1, %xmm1
testl %edx, %edx
jle 0x5a76
movl %ecx, %ebx
movq %rdi, %r14
addl %esi, %edx
movslq %esi, %r15
movslq %edx, %r12
movsd %xmm1, (%rsp)
movsbl (%r14,%r15), %edi
movl %ebx, %esi
callq 0xa9a1
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
incq %r15
cmpq %r12, %r15
jl 0x5a54
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x5a90
movapd %xmm1, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1c2e7(%rip), %rdi     # 0x21d7e
leaq 0x1c267(%rip), %rsi     # 0x21d05
leaq 0x1c2ee(%rip), %rcx     # 0x21d93
movl $0xa1, %edx
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: loglikeMatch
double loglikeMatch(char *readQual, int seqPos, int matchLen, int qOff){
  int i;
  double loglikelihood = 0.0;
  for(i = seqPos; i < seqPos + matchLen; i++){
    loglikelihood += getQtoLogP(readQual[i], qOff);// sometimes want -33/64?
    ////printf("likeMatch %d %d %f %f %f\n", i, readQual[i], QtoLogP[readQual[i] - qOff], getQtoLogP(readQual[i], qOff), loglikelihood);
  }
  ////printf("loglikeMatch(%d): %e\n", matchLen, loglikelihood);
  assert(loglikelihood <= 0.0);
  return loglikelihood;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorpd %xmm1, %xmm1
testl %edx, %edx
jle 0x5aee
movl %ecx, %ebx
movq %rdi, %r14
addl %esi, %edx
movslq %esi, %r15
movslq %edx, %r12
movsd %xmm1, (%rsp)
movsbl (%r14,%r15), %edi
movl %ebx, %esi
callq 0xa960
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
incq %r15
cmpq %r12, %r15
jl 0x5acc
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jb 0x5b08
movapd %xmm1, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1c26f(%rip), %rdi     # 0x21d7e
leaq 0x1c1ef(%rip), %rsi     # 0x21d05
leaq 0x1c2a0(%rip), %rcx     # 0x21dbd
movl $0xae, %edx
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: loglikeDeletion
double loglikeDeletion(char *readQual, int seqPos, int deletionLength, int qOff, int readLen) {
  // assume as unlikely as a substitution of previous base
  // TODO refine
  int delPos = (seqPos > 0) ? seqPos - 1 : seqPos;
  assert(delPos >= 0);
  double loglikelihood = loglikeMiss(readQual, delPos, 1, qOff) * (double)deletionLength;
  if (seqPos > 0 && delPos+1 < readLen) {
    loglikelihood += loglikeMiss(readQual, delPos+1, 1, qOff) * (double)deletionLength;
    loglikelihood /= 2.0;
  }
  ////printf("loglikeDeletion(%d): %e\n", deletionLength, loglikelihood);
  return loglikelihood;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %eax, %eax
testl %esi, %esi
setg %al
movl %esi, %r15d
subl %eax, %r15d
js 0x5bbb
movl %r8d, %ebp
movl %ecx, %ebx
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %r14
movl %r15d, %esi
movl $0x1, %edx
callq 0x5a37
cvtsi2sd %r13d, %xmm1
mulsd %xmm1, %xmm0
testl %r12d, %r12d
jle 0x5bac
incl %r15d
cmpl %ebp, %r15d
jge 0x5bac
movq %r14, %rdi
movl %r15d, %esi
movl $0x1, %edx
movl %ebx, %ecx
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
callq 0x5a37
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
mulsd 0x17ebc(%rip), %xmm0    # 0x1da68
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c226(%rip), %rdi     # 0x21de8
leaq 0x1c13c(%rip), %rsi     # 0x21d05
leaq 0x1c224(%rip), %rcx     # 0x21df4
movl $0xc0, %edx
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: getSeqPosForAlignment
int getSeqPosForAlignment(bam1_t *read) {
	int seqPos = 0;
	uint32_t *cigar = bam1_cigar(read);
	int numCigarOperations = read->core.n_cigar;
    uint32_t cigarInt = *(cigar);
    uint32_t cigarFlag = (cigarInt & BAM_CIGAR_MASK);
    uint32_t count = (cigarInt >> BAM_CIGAR_SHIFT);
    if (cigarFlag == BAM_CSOFT_CLIP)
    	seqPos += count;
    return seqPos;
}

// Assembly:
movq 0x30(%rdi), %rax
movzbl 0xb(%rdi), %ecx
movl (%rax,%rcx), %ecx
movl %ecx, %edx
andl $0xf, %edx
shrl $0x4, %ecx
xorl %eax, %eax
cmpl $0x4, %edx
cmovel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/sc932[P]ALE/src/ALElike.c
// Function: getMatchLogLikelihoodBAM
double getMatchLogLikelihoodBAM(bam1_t *read, contig_t *contig, int qOff, int alignmentLength) {
	float depthContributions[alignmentLength];
	double placeLogLikelihoods[alignmentLength];
	int i;
	double loglikelihood = getContributionsForPositions(read, contig, qOff, alignmentLength, depthContributions, placeLogLikelihoods, 1);

	for(i = 0; i < alignmentLength ; i++)
		loglikelihood += placeLogLikelihoods[i];

	loglikelihood = validateLogLikelihood( loglikelihood );
	return loglikelihood;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %ecx, %r15d
movq %rsp, %r8
leaq 0xf(,%r15,4), %rax
andq $-0x10, %rax
subq %rax, %r8
movq %r8, %rsp
movq %rsp, %r14
leaq 0xf(,%r15,8), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
subq $0x8, %rsp
movq %r14, %r9
pushq $0x1
callq 0x5c84
addq $0x10, %rsp
testl %ebx, %ebx
jle 0x65b6
xorl %eax, %eax
addsd (%r14,%rax,8), %xmm0
incq %rax
cmpq %rax, %r15
jne 0x65a8
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa88a
// File: /workspace/github_c_makefile_star2_O1/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 0x65dd
cmpl $0x46, %edi
jg 0x65f5
cmpl $0x41, %edi
je 0x6604
cmpl $0x43, %edi
je 0x65ec
jmp 0x65ff
cmpl $0x66, %edi
jg 0x6605
cmpl $0x61, %edi
je 0x6604
cmpl $0x63, %edi
jne 0x65ff
addl %esi, %esi
movl $0x2, %eax
jmp 0x661f
cmpl $0x47, %edi
je 0x6618
cmpl $0x54, %edi
je 0x660f
movl $0xff000000, %eax       # imm = 0xFF000000
retq
cmpl $0x67, %edi
je 0x6618
cmpl $0x74, %edi
jne 0x65ff
addl %esi, %esi
movl $0x1, %eax
jmp 0x661f
addl %esi, %esi
movl $0x3, %eax
movl %esi, %ecx
shll %cl, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6659
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 0x65c5
addl %eax, %ebp
incq %r14
cmpq %r14, %r15
jne 0x6640
jmp 0x665b
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6f70
movb (%rdi), %cl
testb %cl, %cl
je 0x6f70
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 0x6f54
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6f9e
movsd (%rax), %xmm1
mulsd 0x8(%rax), %xmm1
addsd %xmm1, %xmm0
movq 0x48(%rax), %rax
jmp 0x6f86
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9888
movsd 0x1631c(%rip), %xmm1    # 0x1da38
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 0x77dc
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 0x16263(%rip), %xmm5    # 0x1da38
addl $-0x1, %ebx
jb 0x777f
jmp 0x77e0
xorpd %xmm4, %xmm4
movapd %xmm4, %xmm0
callq 0x3290
addsd 0x10(%rsp), %xmm0
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7a0e
leal (%rax,%rsi), %edx
movl %edx, %r8d
shrl $0x1f, %r8d
addl %edx, %r8d
sarl %r8d
movslq %r8d, %rdx
cmpl %ecx, (%rdi,%rdx,4)
jge 0x79ff
incl %r8d
movl %r8d, %esi
jmp 0x7a07
je 0x7a0e
decl %r8d
movl %r8d, %eax
leal (%rax,%rsi), %edx
cmpl %eax, %esi
jle 0x79e2
cmpl %eax, %esi
cmovll %esi, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7aaa
movq 0x8(%rdi), %rdx
movq %rdx, %r8
shrq $0x30, %r8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x7a36
popq %rbx
retq
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 0x7a65
movl %r9d, %ecx
jmp 0x7a6d
leal (%rbx,%r9), %ecx
cmpl %esi, %ecx
jge 0x7a82
andl $0x1, %r11d
negl %r11d
andl %ebx, %r11d
addl %r11d, %edi
movb $0x1, %r11b
movl %ecx, %r9d
jmp 0x7a96
andl $0x1, %r11d
negl %r11d
movl %esi, %eax
subl %r9d, %eax
andl %r11d, %eax
addl %edi, %eax
xorl %r11d, %r11d
testb %r11b, %r11b
je 0x7a34
cmpq %r8, %r10
jae 0x7a34
incq %r10
cmpl %esi, %r9d
jle 0x7a45
jmp 0x7a34
leaq 0x1a7e6(%rip), %rdi     # 0x22297
leaq 0x1a24d(%rip), %rsi     # 0x21d05
leaq 0x1a7ef(%rip), %rcx     # 0x222ae
movl $0x4fd, %edx            # imm = 0x4FD
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/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 0x7d42
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7cfd
jnp 0x7d37
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 0x7ae2
movq 0x38(%r14), %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x7ae2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7d6a
movq %rsi, %r14
movsd (%rsi), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7d72
jp 0x7d72
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x7d87
movq 0x8(%rbx), %rdi
callq 0x10273
movq 0x38(%r14), %rsi
testq %rsi, %rsi
je 0x7d6a
movq 0x8(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10273
// File: /workspace/github_c_makefile_star2_O1/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
movsd %xmm0, 0x8(%rsp)
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movsd %xmm3, 0x10(%rsp)
movapd %xmm3, %xmm1
mulsd %xmm3, %xmm1
movsd %xmm1, 0x18(%rsp)
mulsd %xmm1, %xmm3
movsd %xmm3, 0x20(%rsp)
callq 0x3290
movsd 0x8(%rsp), %xmm3
addsd %xmm3, %xmm3
movsd 0x15ab4(%rip), %xmm1    # 0x1da38
movapd %xmm1, %xmm2
divsd %xmm3, %xmm2
subsd %xmm2, %xmm0
movsd 0x10(%rsp), %xmm3
mulsd 0x15b02(%rip), %xmm3    # 0x1daa0
movapd %xmm1, %xmm2
divsd %xmm3, %xmm2
addsd %xmm2, %xmm0
movsd 0x18(%rsp), %xmm3
mulsd 0x15af0(%rip), %xmm3    # 0x1daa8
movapd %xmm1, %xmm2
divsd %xmm3, %xmm2
movsd 0x20(%rsp), %xmm3
mulsd 0x15ae2(%rip), %xmm3    # 0x1dab0
addsd %xmm2, %xmm0
divsd %xmm3, %xmm1
addsd %xmm1, %xmm0
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8045
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 0x7f3d
movsd 0x18(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
incq %r12
cmpq %r12, %r15
jne 0x8013
jmp 0x804f
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x10(%rsp)
movapd %xmm1, %xmm0
callq 0x7f3d
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_O1/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 0x8200
movsd 0x15902(%rip), %xmm1    # 0x1da90
addsd %xmm0, %xmm1
movsd %xmm1, 0x28(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x1588e(%rip), %xmm1    # 0x1da38
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 0x1583e(%rip), %xmm1    # 0x1da38
decl %ebp
jne 0x81ac
jmp 0x820a
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x15826(%rip), %xmm0    # 0x1da38
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_O1/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 0x15847(%rip), %xmm2    # 0x1dab8
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 0x1a20f(%rip), %rdi     # 0x224be
movb $0x1, %al
jmp 0x3210
// File: /workspace/github_c_makefile_star2_O1/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 0x82fd
movsd (%r13,%rbp,8), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%r13,%rbp,8)
movsd 0x157ac(%rip), %xmm1    # 0x1dab8
ucomisd %xmm0, %xmm1
jbe 0x8321
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, (%r13,%rbp,8)
movsd (%r13,%rbp,8), %xmm0
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 0x836f
cltq
leaq 0x158e8(%rip), %rcx     # 0x1dc50
movsd (%rcx,%rax,8), %xmm0
jmp 0x837a
movsd 0x10(%rsp), %xmm0
callq 0x5718
movsd %xmm0, (%rbx,%rbp,8)
incq %rbp
cmpq $0x65, %rbp
jne 0x82db
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
testl %ecx, %ecx
jle 0x8a4f
movq 0x8(%rdi), %rax
movq %rax, %rsi
shrq $0x30, %rsi
shlq $0x2, %rsi
addq 0x30(%rdi), %rsi
shrl $0x18, %eax
leaq 0x1(%rcx), %rdx
shrq %rdx
addq %rax, %rdx
addq %rsi, %rdx
xorl %esi, %esi
movb (%rdx,%rsi), %r8b
movl $0x40, %eax
movb $0x1, %dil
cmpb $0x53, %r8b
jg 0x8a42
leal -0x1(%r8), %r9d
xorl %eax, %eax
cmpb $0x20, %r9b
jb 0x8a42
addb $-0x33, %r8b
cmpb $0xd, %r8b
setb %dil
movl $0x0, %eax
adcl $-0x1, %eax
orl $0x21, %eax
testb %dil, %dil
jne 0x8a54
incq %rsi
cmpq %rsi, %rcx
jne 0x8a0d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8a95
testq %rsi, %rsi
je 0x8a95
testb $-0x40, 0xc(%rdi)
je 0x8ab4
movabsq $0xc000000000, %rax     # imm = 0xC000000000
testq %rax, 0x8(%rsi)
je 0x8ad3
movq 0x30(%rdi), %rdi
movq 0x30(%rsi), %rsi
popq %rax
jmp 0x3330
leaq 0x19b19(%rip), %rdi     # 0x225b5
leaq 0x19262(%rip), %rsi     # 0x21d05
leaq 0x19b24(%rip), %rcx     # 0x225ce
movl $0x6df, %edx            # imm = 0x6DF
callq 0x3230
leaq 0x19b3f(%rip), %rdi     # 0x225fa
leaq 0x19243(%rip), %rsi     # 0x21d05
leaq 0x19b05(%rip), %rcx     # 0x225ce
movl $0x6e2, %edx            # imm = 0x6E2
callq 0x3230
leaq 0x19b50(%rip), %rdi     # 0x2262a
leaq 0x19224(%rip), %rsi     # 0x21d05
leaq 0x19ae6(%rip), %rcx     # 0x225ce
movl $0x6e3, %edx            # imm = 0x6E3
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/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 0x8a66
testl %eax, %eax
jne 0x8b2d
movl (%r14), %eax
xorl %ecx, %ecx
xorl %edx, %edx
cmpl (%rbx), %eax
setge %dl
leal -0x1(%rdx,%rdx), %eax
cmovel %ecx, %eax
jne 0x8b2d
movl 0x4(%r14), %eax
xorl %edx, %edx
cmpl 0x4(%rbx), %eax
setge %dl
leal -0x1(%rdx,%rdx), %eax
cmovel %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8cd3
movl %esi, %eax
leaq 0x14ec5(%rip), %rcx     # 0x1db64
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x0, 0x23da5(%rip)     # 0x2ca54
jne 0x8cd1
movq (%rdi), %rax
movq 0x30(%rax), %rsi
movzwl 0xc(%rax), %edx
leaq 0x19a29(%rip), %rdi     # 0x226ec
xorl %eax, %eax
callq 0x3210
movb $0x1, 0x23d83(%rip)     # 0x2ca54
popq %rax
retq
leaq 0x19a1a(%rip), %rdi     # 0x226f4
xorl %eax, %eax
callq 0x3210
movl $0x1, %edi
callq 0x35c0
// File: /workspace/github_c_makefile_star2_O1/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 0x14dae(%rip), %xmm0    # 0x1dad0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
callq 0xba81
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
andps 0x14dc1(%rip), %xmm0    # 0x1db00
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_O1/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 0x914d
movl 0x18(%rsi), %eax
movl %eax, 0x14(%rdi)
movl $0xffffffff, 0x1c(%rdi) # imm = 0xFFFFFFFF
movl 0x14(%rsi), %eax
jmp 0x9158
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x14(%rdi)
movl %eax, 0x1c(%rdi)
movl %eax, 0x24(%rdi)
movq %rsi, 0x30(%rdi)
movq $0x0, 0x38(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa918
movl %eax, %ebp
addl %ebx, %ebp
xorpd %xmm1, %xmm1
subl %r12d, %r14d
jle 0x98ed
movslq %r12d, %rax
addq %rax, %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movsbl (%r15,%r12), %eax
cmpl %eax, %ebp
jg 0x98e5
movsbl %al, %edi
movl %ebx, %esi
movsd %xmm1, (%rsp)
callq 0xa91f
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
incl %r13d
incq %r12
cmpl %r12d, %r14d
jne 0x98c1
testl %r13d, %r13d
je 0x9911
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 0xa91f
// File: /workspace/github_c_makefile_star2_O1/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 0x9946
cmpl $0x5, %edx
ja 0x9942
movq 0x30(%rsi), %rax
cmpl $0x2, %edi
jne 0x9947
addq $0x2, %rax
jmp 0x994a
incq 0x30(%rsi)
retq
incq %rax
movq %rax, 0x30(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa649
movq %rsi, %r14
movl %edx, %r12d
leaq 0x1881c(%rip), %r13     # 0x22e21
xorl %ebp, %ebp
xorl %ecx, %ecx
movslq %ecx, %r15
leaq (%rbx,%r15), %rdi
movl (%r14,%rbp,4), %edx
shrl $0x4, %edx
leaq 0x17db1(%rip), %rsi     # 0x223cf
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 0xa609
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_O1/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 0x22234(%rip), %rax     # 0x2ca48
testq %rax, %rax
je 0xa876
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rax), %rdi
callq 0x3070
movq 0x22218(%rip), %rax     # 0x2ca48
movq $0x0, (%rax)
cmpl $0x0, (%rbx)
jle 0xa866
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 0xa83f
movq $0x0, 0x221d7(%rip) # 0x2ca48
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xa94b
movl %edi, %esi
leaq 0x1926a(%rip), %rdi     # 0x23ba0
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
movl $0x3e, %ebx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x1884c(%rip), %rcx     # 0x231a0
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa98c
movl %edi, %esi
leaq 0x19259(%rip), %rdi     # 0x23bd0
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
movl $0x3e, %ebx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x18a0b(%rip), %rcx     # 0x233a0
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa9cd
movl %edi, %esi
leaq 0x1924b(%rip), %rdi     # 0x23c03
xorl %ebp, %ebp
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3210
testl %ebx, %ebx
movl $0x3e, %ebx
cmovsl %ebp, %ebx
movl %ebx, %eax
leaq 0x18bca(%rip), %rcx     # 0x235a0
movsd (%rcx,%rax,8), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xaa29
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 0xaa0e
movq %rax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq