LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: recordPval
int recordPval(Hash** table, float p, uint32_t length) {

  // check hashtable for matching p-value
  uint32_t idx = jenkins_one_at_a_time_hash(p);
  for (Hash* h = table[idx]; h != NULL; h = h->next)
    if (p == h->val) {
      // match: add length to bucket
      h->len += length;
      return 0;
    }

  // no match: add info into bucket
  Hash* newVal = (Hash*) memalloc(sizeof(Hash));
  newVal->val = p;
  newVal->len = length;
  newVal->next = table[idx];
  table[idx] = newVal;
  return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movss %xmm0, 0xc(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
movzbl 0xc(%rsp,%rax), %edx
addl %ecx, %edx
movl %edx, %esi
shll $0xa, %esi
addl %edx, %esi
movl %esi, %ecx
shrl $0x6, %ecx
xorl %esi, %ecx
incq %rax
cmpq $0x4, %rax
jne 0x3e12
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
movl %ecx, %r14d
shll $0xf, %r14d
addl %ecx, %r14d
movl $0xccd8ec3d, %eax       # imm = 0xCCD8EC3D
imulq %r14, %rax
shrq $0x34, %rax
imull $0x13fed1, %eax, %eax   # imm = 0x13FED1
subl %eax, %r14d
movq (%rbx,%r14,8), %rax
testq %rax, %rax
je 0x3e74
movss (%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x3e6e
jnp 0x3ea7
movq 0x10(%rax), %rax
jmp 0x3e5e
movl $0x18, %edi
movss %xmm0, 0x8(%rsp)
callq 0x3913
movss 0x8(%rsp), %xmm0
movss %xmm0, (%rax)
movl %ebp, %ecx
movq %rcx, 0x8(%rax)
movq (%rbx,%r14,8), %rcx
movq %rcx, 0x10(%rax)
movq %rax, (%rbx,%r14,8)
movl $0x1, %eax
jmp 0x3eaf
movl %ebp, %ecx
addq %rcx, 0x8(%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: hashPval
Hash** hashPval(Chrom* chrom, int chromLen, int n,
    int64_t* pLen) {

  // create hashtable for conversion of p-values to q-values
  Hash** table = (Hash**) memalloc(HASH_SIZE * sizeof(Hash*));
  for (int i = 0; i < HASH_SIZE; i++)
    table[i] = NULL;

  // loop through chroms
  for (int i = 0; i < chromLen; i++) {
    Chrom* chr = chrom + i;
    if (chr->skip || chr->pval[n] == NULL)
      continue;

    // populate hashtable
    Pileup* p = chr->pval[n]; // use the last p-value array
    uint32_t start = 0;
    for (uint32_t m = 0; m < chr->pvalLen[n]; m++) {
      // record p-value and length in hashtable
      if (p->cov[m] != SKIP)
        *pLen += recordPval(table, p->cov[m],
          p->end[m] - start);
      start = p->end[m];
    }
  }

  return table;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movl %edx, %r12d
movl %esi, %ebp
movq %rdi, (%rsp)
movl $0x9ff688, %edi         # imm = 0x9FF688
callq 0x3913
movq %rax, %r15
movl $0x9ff688, %edx         # imm = 0x9FF688
movq %rax, %rdi
xorl %esi, %esi
callq 0x2140
testl %ebp, %ebp
jle 0x3f82
movslq %r12d, %r12
movl %ebp, %eax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
imulq $0x68, %rbp, %r13
movq (%rsp), %rax
cmpb $0x0, 0xc(%rax,%r13)
jne 0x3f78
addq (%rsp), %r13
movq 0x48(%r13), %rax
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0x3f78
movq 0x50(%r13), %rax
cmpl $0x0, (%rax,%r12,4)
je 0x3f78
movq (%r14), %rcx
xorl %ebx, %ebx
xorl %edx, %edx
movq 0x8(%r14), %rsi
movss (%rsi,%rbx,4), %xmm0
ucomiss 0xe209(%rip), %xmm0     # 0x12150
jne 0x3f4b
jnp 0x3f69
movl (%rcx,%rbx,4), %esi
subl %edx, %esi
movq %r15, %rdi
callq 0x3dfb
movl %eax, %eax
movq 0x10(%rsp), %rcx
addq %rax, (%rcx)
movq (%r14), %rcx
movq 0x50(%r13), %rax
movl (%rcx,%rbx,4), %edx
incq %rbx
movl (%rax,%r12,4), %esi
cmpq %rsi, %rbx
jb 0x3f37
incq %rbp
cmpq 0x8(%rsp), %rbp
jne 0x3f04
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: collectPval
float* collectPval(Hash** table, uint64_t** pEnd,
    int64_t pLen, uint64_t* checkLen) {
  float* pVal = (float*) memalloc(pLen * sizeof(float));
  int64_t idx = 0;
  for (int i = 0; i < HASH_SIZE; i++)
    for (Hash* h = table[i]; h != NULL; h = h->next) {
      pVal[idx] = h->val;
      (*pEnd)[idx] = h->len;
      *checkLen += h->len;
      idx++;
    }
  if (idx != pLen)
    exit(error(errMsg[ERRPVAL], ERRISSUE));
  return pVal;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq (,%rdx,4), %rdi
callq 0x3913
xorl %ecx, %ecx
xorl %edx, %edx
movq (%r12,%rcx,8), %rsi
testq %rsi, %rsi
je 0x3fe5
movq (%r15), %rdi
movss (%rsi), %xmm0
movss %xmm0, (%rax,%rdx,4)
movq 0x8(%rsi), %r8
movq %r8, (%rdi,%rdx,8)
addq %r8, (%r14)
incq %rdx
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
jne 0x3fc5
incq %rcx
cmpq $0x13fed1, %rcx         # imm = 0x13FED1
jne 0x3fb9
cmpq %rbx, %rdx
jne 0x4002
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x2a91
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: bd0
double bd0(double x, double np) {
  double ej, s, s1, v;
  if (fabs(x-np) < 0.1*(x+np)) {
    v = (x-np)/(x+np);
    s = (x-np)*v;
    if (fabs(s) < DBL_MIN)
      return s;
    ej = 2*x*v;
    v = v*v;
    for (int j = 1; j < 1000; j++) {
      ej *= v;
      s1 = s+ej/((j<<1)+1);
      if (s1 == s)
        return s1;
      s = s1;
    }
  }
  return x * log(x / np) + np - x;
}

// Assembly:
movapd %xmm0, %xmm5
subsd %xmm1, %xmm0
movapd 0xdffe(%rip), %xmm4     # 0x12190
andpd %xmm0, %xmm4
movapd %xmm5, %xmm2
addsd %xmm1, %xmm2
movsd 0xde72(%rip), %xmm3     # 0x12018
mulsd %xmm2, %xmm3
ucomisd %xmm4, %xmm3
jbe 0x4218
movapd %xmm0, %xmm6
divsd %xmm2, %xmm6
mulsd %xmm6, %xmm0
movapd 0xdfcc(%rip), %xmm2     # 0x12190
andpd %xmm0, %xmm2
movsd 0xde50(%rip), %xmm3     # 0x12020
ucomisd %xmm2, %xmm3
ja 0x424d
movapd %xmm5, %xmm2
addsd %xmm5, %xmm2
mulsd %xmm6, %xmm2
mulsd %xmm6, %xmm6
movl $0x3, %eax
movapd %xmm0, %xmm3
mulsd %xmm6, %xmm2
xorps %xmm4, %xmm4
cvtsi2sd %eax, %xmm4
movapd %xmm2, %xmm0
divsd %xmm4, %xmm0
addsd %xmm3, %xmm0
ucomisd %xmm3, %xmm0
jne 0x420e
jnp 0x424d
addl $0x2, %eax
cmpl $0x7d1, %eax            # imm = 0x7D1
jne 0x41eb
subq $0x18, %rsp
movapd %xmm5, %xmm0
divsd %xmm1, %xmm0
movsd %xmm5, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
callq 0x2170
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: stirlerr
double stirlerr(double n) {
  double S0 = 1.0 / 12;
  double S1 = 1.0 / 360;
  double S2 = 1.0 / 1260;
  double S3 = 1.0 / 1680;
  double S4 = 1.0 / 1188;
  double sferr[16] = {
    0.0,
    0.0810614667953272582196702,
    0.0413406959554092940938221,
    0.02767792568499833914878929,
    0.02079067210376509311152277,
    0.01664469118982119216319487,
    0.01387612882307074799874573,
    0.01189670994589177009505572,
    0.010411265261972096497478567,
    0.009255462182712732917728637,
    0.008330563433362871256469318,
    0.007573675487951840794972024,
    0.006942840107209529865664152,
    0.006408994188004207068439631,
    0.005951370112758847735624416,
    0.005554733551962801371038690
  };

  double nn = n * n;
  if (n > 80.0)
    return (S0-(S1-S2/nn)/nn)/n;
  if (n > 35.0)
    return (S0-(S1-(S2-S3/nn)/nn)/nn)/n;
  if (n > 15.0)
    return (S0-(S1-(S2-(S3-S4/nn)/nn)/nn)/nn)/n;
  return sferr[(int) n];
}

// Assembly:
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
ucomisd 0xddca(%rip), %xmm0     # 0x12028
jbe 0x4286
movsd 0xde08(%rip), %xmm2     # 0x12070
divsd %xmm1, %xmm2
addsd 0xdde4(%rip), %xmm2     # 0x12058
divsd %xmm1, %xmm2
movsd 0xdde0(%rip), %xmm1     # 0x12060
subsd %xmm2, %xmm1
jmp 0x42c4
ucomisd 0xdda2(%rip), %xmm0     # 0x12030
jbe 0x42cd
movsd 0xddd0(%rip), %xmm2     # 0x12068
divsd %xmm1, %xmm2
addsd 0xddac(%rip), %xmm2     # 0x12050
divsd %xmm1, %xmm2
movsd 0xdda8(%rip), %xmm3     # 0x12058
subsd %xmm2, %xmm3
divsd %xmm1, %xmm3
movsd 0xdda0(%rip), %xmm1     # 0x12060
subsd %xmm3, %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
retq
ucomisd 0xdd63(%rip), %xmm0     # 0x12038
jbe 0x4310
movsd 0xdd61(%rip), %xmm2     # 0x12040
divsd %xmm1, %xmm2
addsd 0xdd5d(%rip), %xmm2     # 0x12048
divsd %xmm1, %xmm2
movsd 0xdd59(%rip), %xmm3     # 0x12050
subsd %xmm2, %xmm3
divsd %xmm1, %xmm3
movsd 0xdd51(%rip), %xmm2     # 0x12058
subsd %xmm3, %xmm2
jmp 0x4274
cvttsd2si %xmm0, %eax
cltq
leaq 0xe173(%rip), %rcx      # 0x12490
movsd (%rcx,%rax,8), %xmm1
jmp 0x42c8
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: pd_upper_series
double pd_upper_series(double x, double alph) {
  double term = x / alph;
  double sum = term;
  do {
    alph++;
    term *= x / alph;
    sum += term;
  } while (term > sum * DBL_EPSILON);
  return log(sum);
}

// Assembly:
movapd %xmm0, %xmm3
divsd %xmm1, %xmm3
movsd 0xdce6(%rip), %xmm4     # 0x12088
movsd 0xdce6(%rip), %xmm5     # 0x12090
movapd %xmm3, %xmm2
addsd %xmm4, %xmm1
movapd %xmm0, %xmm6
divsd %xmm1, %xmm6
mulsd %xmm6, %xmm3
addsd %xmm3, %xmm2
movapd %xmm2, %xmm6
mulsd %xmm5, %xmm6
ucomisd %xmm6, %xmm3
ja 0x43ae
movapd %xmm2, %xmm0
jmp 0x2170
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: pd_lower_series
double pd_lower_series(double lambda, double y) {
  double term = 1, sum = 0;
  while (y >= 1 && term > sum * DBL_EPSILON) {
    term *= y / lambda;
    sum += term;
    y--;
  }
  return log1p(sum);
}

// Assembly:
movapd %xmm0, %xmm2
xorpd %xmm0, %xmm0
ucomisd 0xdc9f(%rip), %xmm1     # 0x12088
jb 0x2160
movsd 0xdc91(%rip), %xmm3     # 0x12088
movsd 0xdc99(%rip), %xmm4     # 0x12098
movsd 0xdc89(%rip), %xmm5     # 0x12090
movapd %xmm3, %xmm6
movapd %xmm6, %xmm7
movapd %xmm1, %xmm6
divsd %xmm2, %xmm6
mulsd %xmm7, %xmm6
addsd %xmm6, %xmm0
addsd %xmm4, %xmm1
ucomisd %xmm3, %xmm1
movapd %xmm0, %xmm7
mulsd %xmm5, %xmm7
jb 0x2160
ucomisd %xmm7, %xmm6
ja 0x440b
jmp 0x2160
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: pgamma_smallx
double pgamma_smallx(double x, double alph) {
  double sum = 0.0;
  double c = alph;
  double n = 0.0;
  double term;
  do {
    n++;
    c *= -x / n;
    term = c / (alph + n);
    sum += term;
  } while (fabs(term) > DBL_EPSILON * fabs(sum));
  double lf2 = alph * log(x) - lgamma(alph + 1);
  return R_Log1_Exp(log1p(sum) + lf2);
}

// Assembly:
subq $0x28, %rsp
movapd 0xdd53(%rip), %xmm9     # 0x121a0
xorpd %xmm0, %xmm9
xorpd %xmm2, %xmm2
movsd 0xdc2a(%rip), %xmm3     # 0x12088
movapd 0xdd2a(%rip), %xmm4     # 0x12190
movsd 0xdc22(%rip), %xmm5     # 0x12090
movapd %xmm1, %xmm6
xorpd %xmm10, %xmm10
addsd %xmm3, %xmm2
movapd %xmm9, %xmm7
divsd %xmm2, %xmm7
mulsd %xmm7, %xmm6
movapd %xmm2, %xmm7
addsd %xmm1, %xmm7
movapd %xmm6, %xmm8
divsd %xmm7, %xmm8
addsd %xmm8, %xmm10
movapd %xmm10, %xmm7
andpd %xmm4, %xmm8
andpd %xmm4, %xmm7
mulsd %xmm5, %xmm7
ucomisd %xmm7, %xmm8
ja 0x4477
movsd %xmm1, (%rsp)
movapd %xmm10, 0x10(%rsp)
callq 0x2170
movsd %xmm0, 0x8(%rsp)
movsd 0xdbb1(%rip), %xmm0     # 0x12088
addsd (%rsp), %xmm0
callq 0x21f0
movsd 0x8(%rsp), %xmm1
mulsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movapd 0x10(%rsp), %xmm0
callq 0x2160
addsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsp)
movapd 0x10(%rsp), %xmm0
callq 0x2160
movsd (%rsp), %xmm1
ucomisd 0xdb7c(%rip), %xmm1     # 0x120a0
addsd 0x8(%rsp), %xmm0
jbe 0x4542
callq 0x2210
xorpd 0xdc67(%rip), %xmm0     # 0x121a0
addq $0x28, %rsp
jmp 0x2170
callq 0x22d0
xorpd 0xdc51(%rip), %xmm0     # 0x121a0
addq $0x28, %rsp
jmp 0x2160
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: pgamma
double pgamma(double x, double alph) {

  if (x < 1)
    // small values of x
    return pgamma_smallx(x, alph);

  else if (x <= alph - 1) {
    // larger alph than x
    double sum = pd_upper_series(x, alph);
    double d = dpois(alph - 1, x);
    return R_Log1_Exp(sum + d);
  }

  // x > alph - 1
  double sum = pd_lower_series(x, alph - 1);
  double d = dpois(alph - 1, x);
  return sum + d;
}

// Assembly:
subq $0x18, %rsp
movapd %xmm0, %xmm6
movsd 0xdb20(%rip), %xmm2     # 0x12088
ucomisd %xmm0, %xmm2
jbe 0x457b
movapd %xmm6, %xmm0
addq $0x18, %rsp
jmp 0x4440
movsd 0xdb15(%rip), %xmm3     # 0x12098
addsd %xmm1, %xmm3
ucomisd %xmm6, %xmm3
movsd %xmm3, 0x10(%rsp)
movsd %xmm6, 0x8(%rsp)
jae 0x45c6
movapd %xmm6, %xmm0
movapd %xmm3, %xmm1
callq 0x43d9
movsd %xmm0, (%rsp)
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x4324
addsd (%rsp), %xmm0
addq $0x18, %rsp
retq
movapd %xmm6, %xmm3
divsd %xmm1, %xmm3
movsd 0xdaba(%rip), %xmm4     # 0x12090
movapd %xmm3, %xmm0
addsd %xmm2, %xmm1
movapd %xmm6, %xmm5
divsd %xmm1, %xmm5
mulsd %xmm5, %xmm3
addsd %xmm3, %xmm0
movapd %xmm0, %xmm5
mulsd %xmm4, %xmm5
ucomisd %xmm5, %xmm3
ja 0x45da
callq 0x2170
movsd %xmm0, (%rsp)
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x4324
addsd (%rsp), %xmm0
ucomisd 0xda7c(%rip), %xmm0     # 0x120a0
jbe 0x463c
callq 0x2210
xorpd 0xdb6d(%rip), %xmm0     # 0x121a0
addq $0x18, %rsp
jmp 0x2170
callq 0x22d0
xorpd 0xdb57(%rip), %xmm0     # 0x121a0
addq $0x18, %rsp
jmp 0x2160
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: multPval
float multPval(Pileup** pval, int n, uint32_t idx[]) {
  double sum = 0.0;
  int df = 0;
  for (int j = 0; j < n; j++)
    if (pval[j] != NULL && pval[j]->cov[idx[j]] != SKIP) {
      sum += pval[j]->cov[idx[j]];
      df += 2;
    }
  if (df == 0)
    return SKIP;
  if (df == 2 || ! sum)
    return (float) sum;

  // calculate p-value using chi-squared dist.
  double p = pchisq(2.0 * sum / M_LOG10E, df);
  return p > FLT_MAX ? FLT_MAX : (float) p;
}

// Assembly:
pushq %rax
testl %esi, %esi
jle 0x471a
movq %rdi, %rax
movl %esi, %ecx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movss 0xdaa0(%rip), %xmm1     # 0x12150
xorl %edi, %edi
movq (%rax,%rsi,8), %r8
testq %r8, %r8
je 0x46db
movq 0x8(%r8), %r8
movl (%rdx,%rsi,4), %r9d
movss (%r8,%r9,4), %xmm2
ucomiss %xmm1, %xmm2
jne 0x46d0
jnp 0x46db
cvtss2sd %xmm2, %xmm2
addsd %xmm2, %xmm0
addl $0x2, %edi
incq %rsi
cmpq %rsi, %rcx
jne 0x46b2
testl %edi, %edi
je 0x472b
cmpl $0x2, %edi
je 0x4724
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x46f7
jnp 0x4724
addsd %xmm0, %xmm0
divsd 0xd9b5(%rip), %xmm0     # 0x120b8
callq 0x4652
movsd 0xd9b0(%rip), %xmm1     # 0x120c0
minsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
jmp 0x472b
movss 0xda2e(%rip), %xmm1     # 0x12150
jmp 0x472b
xorps %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm1
movaps %xmm1, %xmm0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: countIntervals2
uint32_t countIntervals2(Chrom* c, int n) {
  uint32_t num = 1;
  uint32_t idx[n];  // indexes into each pval array
  for (int j = 0; j < n; j++)
    idx[j] = 0;
  for (uint32_t k = 1; k < c->len; k++) {
    bool add = false;
    for (int j = 0; j < n; j++)
      if (c->pval[j] != NULL
          && c->pval[j]->end[idx[j]] == k) {
        if (! add) {
          num++;
          add = true;
        }
        idx[j]++;
      }
  }
  return num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r12d
movq %rsp, %r15
leaq 0xf(,%r12,4), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
testl %esi, %esi
jle 0x476e
leaq (,%r12,4), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2140
movl 0x8(%r14), %ecx
movl $0x1, %eax
cmpl $0x2, %ecx
jb 0x47ca
movl $0x1, %edx
testl %ebx, %ebx
jle 0x47c4
movq 0x48(%r14), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movq (%rsi,%rdi,8), %r9
testq %r9, %r9
je 0x47bc
movq (%r9), %r10
movl (%r15,%rdi,4), %r9d
cmpl %edx, (%r10,%r9,4)
jne 0x47bc
notb %r8b
movzbl %r8b, %r8d
andl $0x1, %r8d
addl %r8d, %eax
incl %r9d
movl %r9d, (%r15,%rdi,4)
movb $0x1, %r8b
incq %rdi
cmpq %rdi, %r12
jne 0x478e
incl %edx
cmpl %ecx, %edx
jne 0x4781
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: printLog
void printLog(File log, bool gzOut, Chrom* chr,
    uint32_t start, int n, uint32_t m, uint32_t j,
    uint32_t k, uint32_t idx[], bool qvalOpt,
    bool sig) {
  if (! n) {
    // single replicate
    printInterval(log, gzOut, chr->name,
      start, chr->pval[n]->end[m],
      chr->expt->cov[j], chr->ctrl->cov[k],
      chr->pval[n]->cov[m], qvalOpt,
      qvalOpt ? chr->qval->cov[m] : SKIP, sig);
  } else {
    // multiple replicates
    printIntervalN(log, gzOut, chr->name,
      start, chr->pval[n]->end[m], chr->pval, n, idx,
      chr->pval[n]->cov[m], qvalOpt,
      qvalOpt ? chr->qval->cov[m] : SKIP, sig);
    // update indexes into pval arrays
    for (int r = 0; r < n; r++)
      if (chr->pval[r] != NULL
          && chr->pval[r]->end[idx[r]] == chr->pval[n]->end[m])
        idx[r]++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %eax
movq %rdx, %rbx
movb 0x60(%rsp), %r11b
movb 0x58(%rsp), %r10b
movq (%rdx), %rdx
movq 0x48(%rbx), %r9
testl %r8d, %r8d
je 0x508e
movl %r8d, %r14d
movq 0x50(%rsp), %r15
movslq %r8d, %r12
movq (%r9,%r12,8), %r8
movl %eax, %r13d
movq (%r8), %rax
movq 0x8(%r8), %rbp
movl (%rax,%r13,4), %r8d
movss (%rbp,%r13,4), %xmm0
testb %r10b, %r10b
je 0x50df
movq 0x60(%rbx), %rax
movq 0x8(%rax), %rax
movss (%rax,%r13,4), %xmm1
jmp 0x50e7
movq (%r9), %r8
movl %eax, %eax
movq (%r8), %r9
movq 0x8(%r8), %r14
movl (%r9,%rax,4), %r8d
movq 0x28(%rbx), %r9
movq 0x38(%rbx), %r15
movq 0x8(%r9), %r9
movl 0x40(%rsp), %r12d
movss (%r9,%r12,4), %xmm0
movq 0x8(%r15), %r9
movl 0x48(%rsp), %r15d
movss (%r9,%r15,4), %xmm1
movss (%r14,%rax,4), %xmm2
testb %r10b, %r10b
je 0x5145
movq 0x60(%rbx), %r9
movq 0x8(%r9), %r9
movss (%r9,%rax,4), %xmm3
jmp 0x514d
movss 0xd069(%rip), %xmm1     # 0x12150
movzbl %r11b, %eax
movzbl %r10b, %r10d
movzbl %sil, %esi
pushq %rax
pushq %r10
pushq %r15
pushq %r14
callq 0x4bbb
addq $0x20, %rsp
testl %r14d, %r14d
jle 0x513f
movq 0x48(%rbx), %rax
movl %r14d, %ecx
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
testq %rsi, %rsi
je 0x5137
movq (%rsi), %rdi
movl (%r15,%rdx,4), %esi
movl (%rdi,%rsi,4), %edi
movq (%rax,%r12,8), %r8
movq (%r8), %r8
cmpl (%r8,%r13,4), %edi
jne 0x5137
incl %esi
movl %esi, (%r15,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x5111
addq $0x8, %rsp
jmp 0x5167
movss 0xd003(%rip), %xmm3     # 0x12150
subq $0x8, %rsp
movzbl %r11b, %eax
movzbl %sil, %esi
movzbl %r10b, %r9d
pushq %rax
callq 0x4e77
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: printPeak
void printPeak(File out, bool gzOut, char* name,
    int64_t start, int64_t end, int count, float signal,
    float pval, float qval, uint32_t pos) {
  if (gzOut) {
    gzprintf(out.gzf, "%s\t%ld\t%ld\tpeak_%d\t%d\t.\t%f\t%f",
      name, start, end, count,
      MIN((unsigned int) (1000.0f * signal / (end - start)
        + 0.5f), 1000),
      signal, pval);
    if (qval == SKIP)
      gzprintf(out.gzf, "\t-1\t%d\n", pos);
    else
      gzprintf(out.gzf, "\t%f\t%d\n", qval, pos);
  } else {
    fprintf(out.f, "%s\t%ld\t%ld\tpeak_%d\t%d\t.\t%f\t%f",
      name, start, end, count,
      MIN((unsigned int) (1000.0f * signal / (end - start)
        + 0.5f), 1000),
      signal, pval);
    if (qval == SKIP)
      fprintf(out.f, "\t-1\t%d\n", pos);
    else
      fprintf(out.f, "\t%f\t%d\n", qval, pos);
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movss %xmm2, 0x14(%rsp)
movaps %xmm0, %xmm2
movq %rdi, %r14
cvtss2sd %xmm0, %xmm0
mulss 0xce17(%rip), %xmm2     # 0x12154
movq %r8, %rax
subq %rcx, %rax
cvtsi2ss %rax, %xmm3
movl 0x30(%rsp), %ebx
divss %xmm3, %xmm2
addss 0xce00(%rip), %xmm2     # 0x12158
cvttss2si %xmm2, %rdi
movl $0x3e8, %eax            # imm = 0x3E8
cmpl %eax, %edi
cmovbl %edi, %eax
cvtss2sd %xmm1, %xmm1
testl %esi, %esi
je 0x53ae
movl %eax, (%rsp)
leaq 0xe164(%rip), %rsi      # 0x134dd
movq %r14, %rdi
movb $0x2, %al
callq 0x20e0
movss 0x14(%rsp), %xmm0
ucomiss 0xcdc0(%rip), %xmm0     # 0x12150
jne 0x53ed
jp 0x53ed
leaq 0xe160(%rip), %rsi      # 0x134fb
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x20e0
movl %eax, (%rsp)
leaq 0xe125(%rip), %rsi      # 0x134dd
movq %r14, %rdi
movb $0x2, %al
callq 0x21d0
movss 0x14(%rsp), %xmm0
ucomiss 0xcd81(%rip), %xmm0     # 0x12150
jne 0x540b
jp 0x540b
leaq 0xe121(%rip), %rsi      # 0x134fb
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x21d0
cvtss2sd %xmm0, %xmm0
leaq 0xe10b(%rip), %rsi      # 0x13503
movq %r14, %rdi
movl %ebx, %edx
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x20e0
cvtss2sd %xmm0, %xmm0
leaq 0xe0ed(%rip), %rsi      # 0x13503
movq %r14, %rdi
movl %ebx, %edx
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x21d0
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: checkPeak
void checkPeak(File out, bool gzOut, char* name,
    int64_t start, int64_t end, int* count, float auc,
    float pval, float qval, uint32_t pos, float minAUC,
    int minLen, uint64_t* peakBP) {
  if (start != -1 && auc >= minAUC
      && end - start >= minLen) {
    printPeak(out, gzOut, name, start, end, *count,
      auc, pval, qval, pos);
    (*peakBP) += end - start;
    (*count)++;
  }
}

// Assembly:
cmpq $-0x1, %rcx
je 0x5476
ucomiss %xmm3, %xmm0
jb 0x5476
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, %r14
subq %rcx, %r14
movslq 0x38(%rsp), %rax
cmpq %rax, %r14
jl 0x546d
movq %r9, %rbx
movq 0x40(%rsp), %r15
movl 0x30(%rsp), %eax
movl (%r9), %r9d
movl %eax, (%rsp)
movzbl %sil, %esi
callq 0x531e
addq %r14, (%r15)
incl (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: updatePeak
void updatePeak(int64_t* peakStart, int64_t* peakEnd,
    uint32_t start, uint32_t end, float* auc, float pqval,
    float minPQval, float pval, float qval,
    float* summitVal, float* summitPval, float* summitQval,
    uint32_t* summitPos, uint32_t* summitLen) {
  // update peak AUC, coordinates
  uint32_t len = end - start;
  *auc += len * (pqval - minPQval); // sum AUC
  if (*peakStart == -1)
    *peakStart = start; // start new potential peak
  *peakEnd = end;       // end of potential peak (for now)

  // check if interval is summit for this peak
  if (pqval > *summitVal) {
    *summitVal = pqval;
    *summitPval = pval;
    *summitQval = qval;
    *summitPos = (end + start)/2 - *peakStart; // midpoint of interval
    *summitLen = len;
  } else if (pqval == *summitVal) {
    // update summitPos only if interval is longer
    if (len > *summitLen) {
      *summitPos = (end + start)/2 - *peakStart; // midpoint of interval
      *summitLen = len;
      // assume summitPval, summitQval remain the same
    }
  }
}

// Assembly:
movl %ecx, %eax
subl %edx, %eax
cvtsi2ss %rax, %xmm4
movaps %xmm0, %xmm5
subss %xmm1, %xmm5
mulss %xmm4, %xmm5
addss (%r8), %xmm5
movss %xmm5, (%r8)
cmpq $-0x1, (%rdi)
jne 0x54b5
movl %edx, %r8d
movq %r8, (%rdi)
movq 0x20(%rsp), %r8
movl %ecx, %r10d
movq %r10, (%rsi)
movss (%r9), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x54e4
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %r10
movss %xmm0, (%r9)
movss %xmm2, (%r10)
movss %xmm3, (%rsi)
jmp 0x54f0
ucomiss %xmm0, %xmm1
jne 0x5500
jp 0x5500
cmpl (%r8), %eax
jbe 0x5500
movq 0x18(%rsp), %rsi
addl %edx, %ecx
shrl %ecx
subl (%rdi), %ecx
movl %ecx, (%rsi)
movl %eax, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: checkChrom
bool checkChrom(char* chr, int xcount, char** xchrList) {
  for (int i = 0; i < xcount; i++)
    if (!strcmp(xchrList[i], chr))
      return true;
  return false;
}

// Assembly:
testl %esi, %esi
jle 0x5f24
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq (%rdx), %rdi
movq %r14, %rsi
callq 0x21b0
testl %eax, %eax
je 0x5f27
movl %ebp, %r15d
movl $0x1, %ecx
movq %rcx, %r12
cmpq %rcx, %r15
je 0x5f1c
movq (%rbx,%r12,8), %rdi
movq %r14, %rsi
callq 0x21b0
leaq 0x1(%r12), %rcx
testl %eax, %eax
jne 0x5eff
cmpq %r15, %r12
setb %al
jmp 0x5f29
xorl %eax, %eax
retq
movb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: getIdx
int getIdx(File in, bool gz, char* line, bool qvalOpt,
    int* idxQ) {
  if (getLine(line, MAX_SIZE, in, gz) == NULL)
    exit(error("<header>", ERRLOGIDX));
  char matchP[8] = "-log(p)";
  char matchQ[8] = "-log(q)";
  int idxP = -1;
  int i = 0;
  char* field = strtok(line, TABN);
  while (field != NULL) {
    if (!strncmp(field, matchP, 7))
      idxP = i;
    else if (!strncmp(field, matchQ, 7))
      *idxQ = i;
    field = strtok(NULL, TABN);
    i++;
  }
  if (idxP == -1)
    exit(error(matchP, ERRLOGIDX));
  if (qvalOpt && *idxQ == -1)
    exit(error(matchQ, ERRLOGIDX));
  return idxP;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x10(%rsp)
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %rdx
testl %esi, %esi
je 0x5f63
movq %rdx, %rdi
movq %r14, %rsi
movl $0xfff0, %edx           # imm = 0xFFF0
callq 0x2090
jmp 0x5f70
movq %r14, %rdi
movl $0xfff0, %esi           # imm = 0xFFF0
callq 0x21a0
testq %rax, %rax
je 0x6047
movl %ebx, 0xc(%rsp)
movabsq $0x297028676f6c2d, %rax # imm = 0x297028676F6C2D
movq %rax, 0x20(%rsp)
movabsq $0x297128676f6c2d, %rax # imm = 0x297128676F6C2D
movq %rax, 0x18(%rsp)
leaq 0xd70c(%rip), %rsi      # 0x136ae
movq %r14, %rdi
callq 0x2280
testq %rax, %rax
je 0x603d
movq %rax, %r13
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
leaq 0x20(%rsp), %r14
leaq 0xd6e5(%rip), %r15      # 0x136ae
movl %ebp, %r12d
movl $0x7, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x2060
movl %ebx, %ebp
testl %eax, %eax
je 0x6002
movl $0x7, %edx
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
callq 0x2060
testl %eax, %eax
jne 0x5fff
movq 0x10(%rsp), %rax
movl %ebx, (%rax)
movl %r12d, %ebp
xorl %edi, %edi
movq %r15, %rsi
callq 0x2280
movq %rax, %r13
incl %ebx
testq %rax, %rax
jne 0x5fc9
cmpl $-0x1, %ebp
je 0x603d
cmpb $0x0, 0xc(%rsp)
je 0x602c
movq 0x10(%rsp), %rax
cmpl $-0x1, (%rax)
je 0x604c
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20(%rsp), %rdi
callq 0x2b32
callq 0x2b43
leaq 0x18(%rsp), %rdi
callq 0x2b21
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: loadBDG
void loadBDG(char* line, char** chr, uint32_t* start,
    uint32_t* end, char** pStat, int idxP, char** qStat,
    int idxQ, bool qvalOpt) {
  int idx = qvalOpt ? idxQ : idxP;
  char* field = strtok(line, TABN);
  for (int i = 0; i <= idx; i++) {
    if (field == NULL)
      exit(error("", ERRLOG));
    switch (i) {
      case CHR: *chr = field; break;
      case START: *start = getInt(field); break;
      case END: *end = getInt(field); break;
      default:
        if (i == idxP)
          *pStat = field;
        else if (i == idxQ)
          *qStat = field;
    }
    field = strtok(NULL, TABN);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r14d
movq %r8, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %r12
movq %rsi, %r13
cmpb $0x0, 0x60(%rsp)
movl %r9d, %ebx
cmovnel 0x58(%rsp), %ebx
leaq 0xd623(%rip), %rsi      # 0x136ae
callq 0x2280
testl %ebx, %ebx
js 0x6108
incl %ebx
xorl %r15d, %r15d
leaq 0xd60e(%rip), %rbp      # 0x136ae
testq %rax, %rax
je 0x6117
cmpl $0x2, %r15d
je 0x60ca
cmpl $0x1, %r15d
je 0x60bc
testl %r15d, %r15d
jne 0x60db
movq %rax, (%r13)
jmp 0x60f6
movq %rax, %rdi
callq 0x3961
movl %eax, (%r12)
jmp 0x60f6
movq %rax, %rdi
callq 0x3961
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x60f6
cmpl %r15d, %r14d
jne 0x60e7
movq 0x8(%rsp), %rcx
jmp 0x60f3
cmpl %r15d, 0x58(%rsp)
jne 0x60f6
movq 0x50(%rsp), %rcx
movq %rax, (%rcx)
xorl %edi, %edi
movq %rbp, %rsi
callq 0x2280
incl %r15d
cmpl %r15d, %ebx
jne 0x60a0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2b5b
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: do_del
double do_del(double y, double temp, bool ret) {
  double xsq = trunc(y * 16) / 16;
  double del = (y - xsq) * (y + xsq);
  if (ret)
    return log1p(-exp((-xsq * xsq - del) / 2.0) * temp);
  return (-xsq * xsq - del) / 2.0 + log(temp);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
movsd %xmm1, (%rsp)
movapd %xmm0, %xmm1
movsd %xmm0, 0x18(%rsp)
movsd 0xb1dc(%rip), %xmm0     # 0x120c8
mulsd %xmm1, %xmm0
callq 0x2080
mulsd 0xb1d3(%rip), %xmm0     # 0x120d0
movapd %xmm0, %xmm1
movsd 0x18(%rsp), %xmm2
addsd %xmm2, %xmm1
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
movapd 0xb285(%rip), %xmm1     # 0x121a0
xorpd %xmm0, %xmm1
mulsd %xmm0, %xmm1
subsd %xmm2, %xmm1
mulsd 0xb179(%rip), %xmm1     # 0x120a8
testl %ebx, %ebx
je 0x6f53
movapd %xmm1, %xmm0
callq 0x22d0
xorpd 0xb25c(%rip), %xmm0     # 0x121a0
mulsd (%rsp), %xmm0
addq $0x20, %rsp
popq %rbx
jmp 0x2160
movsd (%rsp), %xmm0
movapd %xmm1, (%rsp)
callq 0x2170
addsd (%rsp), %xmm0
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: calcPval
float calcPval(float exptVal, float ctrlVal) {
  if (ctrlVal == SKIP)
    return SKIP; // in a skipped region
  if (ctrlVal == 0.0f)
    return exptVal == 0.0f ? 0.0f : FLT_MAX;
  if (exptVal == 0.0f)
    return 0.0f;

  // calculate meanlog and sdlog for plnorm()
  double meanlog, sdlog;
  double mu = ctrlVal;
  if (mu > 7.0) {
    double sd = 10.0 * log10(mu);
    mu *= mu;
    sd *= sd;
    meanlog = log(mu / sqrt(sd + mu));
    sdlog = sqrt(log1p(sd / mu));
  } else {
    meanlog = log(mu) - LOGSQRT;
    sdlog = SQRTLOG;
  }

  // calculate pval by plnorm()
  double pval = plnorm(exptVal, meanlog, sdlog);
  return pval > FLT_MAX ? FLT_MAX : (float) pval;
}

// Assembly:
movaps %xmm0, %xmm2
movss 0xaf3c(%rip), %xmm0     # 0x12150
ucomiss %xmm0, %xmm1
jne 0x721c
jp 0x721c
retq
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x723a
jp 0x723a
cmpeqss %xmm0, %xmm2
movss 0xaf2d(%rip), %xmm0     # 0x12160
andnps %xmm0, %xmm2
movaps %xmm2, %xmm0
retq
ucomiss %xmm0, %xmm2
jne 0x7241
jnp 0x721b
subq $0x38, %rsp
movaps %xmm2, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
ucomiss 0xaf04(%rip), %xmm1     # 0x1215c
jbe 0x72ca
movsd %xmm0, 0x8(%rsp)
callq 0x21c0
mulsd 0xaed3(%rip), %xmm0     # 0x12140
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm2
movsd %xmm2, 0x8(%rsp)
mulsd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movapd %xmm2, %xmm1
addsd %xmm0, %xmm1
sqrtsd %xmm1, %xmm1
movapd %xmm2, %xmm0
divsd %xmm1, %xmm0
callq 0x2170
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
divsd 0x8(%rsp), %xmm0
callq 0x2160
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x72e4
xorps %xmm2, %xmm2
sqrtsd %xmm0, %xmm2
jmp 0x72ed
callq 0x2170
movaps %xmm0, %xmm1
addsd 0xae56(%rip), %xmm1     # 0x12130
movsd 0xae56(%rip), %xmm2     # 0x12138
jmp 0x72f3
callq 0x22c0
movapd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rsp), %xmm0
callq 0x71b8
movsd 0xadb7(%rip), %xmm1     # 0x120c0
minsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: countIntervals
uint32_t countIntervals(Chrom* chr) {
  uint32_t num = 0;
  uint32_t k = 0;
  for (uint32_t j = 0; j < chr->exptLen; j++) {
    while (k < chr->ctrlLen
        && chr->ctrl->end[k] < chr->expt->end[j]) {
      num++;
      k++;
    }
    if (chr->ctrl->end[k] == chr->expt->end[j])
      k++;
    num++;
  }
  return num;
}

// Assembly:
movl 0x30(%rdi), %ecx
testq %rcx, %rcx
je 0x7382
pushq %rbx
movl 0x40(%rdi), %edx
movq 0x28(%rdi), %rax
movq 0x38(%rdi), %rsi
movq (%rsi), %rsi
movq (%rax), %rdi
xorl %r8d, %r8d
xorl %r10d, %r10d
xorl %eax, %eax
movl (%rdi,%r8,4), %r9d
cmpl %edx, %r10d
jae 0x7367
movl %r10d, %r11d
leal (%rdx,%rax), %ebx
subl %r10d, %ebx
cmpl %r9d, (%rsi,%r11,4)
jae 0x7364
incl %eax
incq %r11
cmpq %r11, %rdx
jne 0x734d
movl %ebx, %eax
movl %edx, %r10d
jmp 0x7367
movl %r11d, %r10d
movl %r10d, %r11d
xorl %ebx, %ebx
cmpl %r9d, (%rsi,%r11,4)
sete %bl
addl %ebx, %r10d
incl %eax
incq %r8
cmpq %rcx, %r8
jne 0x733b
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: printPileHeader
void printPileHeader(File pile, char* exptName,
    char* ctrlName, bool gzOut) {
  if (gzOut) {
    gzprintf(pile.gzf, "# experimental file: %s; control file: %s\n",
      exptName, ctrlName && strcmp(ctrlName, "null") ? ctrlName : NA);
    gzprintf(pile.gzf, "chr\tstart\tend\texperimental\tcontrol\t-log(p)\n");
  } else {
    fprintf(pile.f, "# experimental file: %s; control file: %s\n",
      exptName, ctrlName && strcmp(ctrlName, "null") ? ctrlName : NA);
    fprintf(pile.f, "chr\tstart\tend\texperimental\tcontrol\t-log(p)\n");
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
testl %ecx, %ecx
je 0x73ba
testq %r15, %r15
je 0x73dd
leaq 0xc80e(%rip), %rsi      # 0x13bb1
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
leaq 0xc0ff(%rip), %rcx      # 0x134b3
cmovneq %r15, %rcx
jmp 0x73e4
testq %r15, %r15
je 0x740e
leaq 0xc7eb(%rip), %rsi      # 0x13bb1
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
leaq 0xc0dc(%rip), %rcx      # 0x134b3
cmovneq %r15, %rcx
jmp 0x7415
leaq 0xc0cf(%rip), %rcx      # 0x134b3
leaq 0xc416(%rip), %rsi      # 0x13801
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x20e0
leaq 0xc42d(%rip), %rsi      # 0x1382c
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x20e0
leaq 0xc09e(%rip), %rcx      # 0x134b3
leaq 0xc3e5(%rip), %rsi      # 0x13801
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0xc3fc(%rip), %rdi      # 0x1382c
movl $0x2b, %esi
movl $0x1, %edx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x22b0
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: printPile
void printPile(File pile, char* name, uint32_t start,
    uint32_t end, float expt, float ctrl, float pval,
    bool gzOut) {
  if (gzOut) {
    if (ctrl == SKIP)
      gzprintf(pile.gzf, "%s\t%d\t%d\t%f\t%f\t%s\n",
        name, start, end, expt, 0.0f, NA);
    else
      gzprintf(pile.gzf, "%s\t%d\t%d\t%f\t%f\t%f\n",
        name, start, end, expt, ctrl, pval);
  } else {
    if (ctrl == SKIP)
      fprintf(pile.f, "%s\t%d\t%d\t%f\t%f\t%s\n",
        name, start, end, expt, 0.0f, NA);
    else
      fprintf(pile.f, "%s\t%d\t%d\t%f\t%f\t%f\n",
        name, start, end, expt, ctrl, pval);
  }
}

// Assembly:
movl %ecx, %eax
movl %edx, %ecx
movq %rsi, %rdx
cvtss2sd %xmm0, %xmm0
testl %r8d, %r8d
je 0x747d
ucomiss 0xacf2(%rip), %xmm1     # 0x12150
jne 0x74a3
jp 0x74a3
leaq 0xc3ef(%rip), %rsi      # 0x13858
leaq 0xc043(%rip), %r9       # 0x134b3
xorps %xmm1, %xmm1
movl %eax, %r8d
movb $0x2, %al
jmp 0x20e0
ucomiss 0xaccc(%rip), %xmm1     # 0x12150
jne 0x74bc
jp 0x74bc
leaq 0xc3c9(%rip), %rsi      # 0x13858
leaq 0xc01d(%rip), %r9       # 0x134b3
xorps %xmm1, %xmm1
movl %eax, %r8d
movb $0x2, %al
jmp 0x21d0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
leaq 0xc3b9(%rip), %rsi      # 0x1386b
movl %eax, %r8d
movb $0x3, %al
jmp 0x20e0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
leaq 0xc3a0(%rip), %rsi      # 0x1386b
movl %eax, %r8d
movb $0x3, %al
jmp 0x21d0
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: saveConst
void saveConst(Pileup* p, uint32_t* size, uint32_t* mem,
    uint32_t len, float val) {
  if (! *mem) {
    p->end = (uint32_t*) memalloc(sizeof(uint32_t));
    p->cov = (float*) memalloc(sizeof(float));
    *mem = 1;
  }
  p->end[0] = len;
  p->cov[0] = val;
  *size = 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, (%rdx)
je 0x781b
movq 0x8(%r14), %rax
jmp 0x784c
movq %rdx, %r15
movl $0x4, %edi
movss %xmm0, 0x4(%rsp)
callq 0x3913
movq %rax, (%r14)
movl $0x4, %edi
callq 0x3913
movss 0x4(%rsp), %xmm0
movq %rax, 0x8(%r14)
movl $0x1, (%r15)
movq (%r14), %rcx
movl %ebp, (%rcx)
movss %xmm0, (%rax)
movl $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: calcLambda
float calcLambda(Chrom* chrom, int chromLen,
    double fragLen, uint64_t genomeLen) {
  if (! genomeLen) {
    for (int i = 0; i < chromLen; i++) {
      Chrom* chr = chrom + i;
      if (! chr->skip && chr->save) {
        genomeLen += chr->len;
        for (int j = 0; j < chr->bedLen; j += 2)
          genomeLen -= chr->bed[j+1] - chr->bed[j];
      }
    }
    if (! genomeLen)
      exit(error("", ERRGEN));
  }
  return fragLen / genomeLen;
}

// Assembly:
pushq %rax
testq %rdx, %rdx
jne 0x78c9
testl %esi, %esi
jle 0x78f4
movl %esi, %eax
xorl %ecx, %ecx
xorl %edx, %edx
imulq $0x68, %rcx, %r8
cmpb $0x0, 0xc(%rdi,%r8)
jne 0x78bc
addq %rdi, %r8
cmpb $0x1, 0xd(%r8)
jne 0x78bc
movl 0x8(%r8), %esi
addq %rsi, %rdx
movslq 0x18(%r8), %rsi
testq %rsi, %rsi
jle 0x78bc
movq 0x10(%r8), %r8
xorl %r9d, %r9d
movl 0x4(%r8,%r9,4), %r10d
subl (%r8,%r9,4), %r10d
subq %r10, %rdx
addq $0x2, %r9
cmpq %rsi, %r9
jb 0x78a7
incq %rcx
cmpq %rax, %rcx
jne 0x787a
testq %rdx, %rdx
je 0x78f4
movq %rdx, %xmm1
punpckldq 0xa97a(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xa982(%rip), %xmm1     # 0x12260
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
popq %rax
retq
callq 0x2c4a
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: saveLambda
void saveLambda(Chrom* chr, float lambda) {
  if (chr->bedLen == 0) {
    // no BED intervals: save constant of lambda
    saveConst(chr->ctrl, &chr->ctrlLen, &chr->ctrlMem,
      chr->len, lambda);
    return;
  }

  // with BED intervals
  int num = chr->bedLen + 1;  // number of array intervals
  int idx = 0;    // index into chr->bed array
  bool save = true;
  if (chr->bed[0] == 0) {
    num--;
    idx++;
    save = false; // 1st interval skipped
  }
  if (chr->bed[chr->bedLen - 1] == chr->len)
    num--;

  // expand pileup arrays (if necessary)
  if (num > chr->ctrlMem) {
    chr->ctrl->end = (uint32_t*) memrealloc(chr->ctrl->end,
      num * sizeof(uint32_t));
    chr->ctrl->cov = (float*) memrealloc(chr->ctrl->cov,
      num * sizeof(float));
    chr->ctrlMem = num;
  }
  chr->ctrlLen = num;

  // populate chr->ctrl arrays: alternate lambda and -1
  for (int j = 0; j < num - 1; j++) {
    chr->ctrl->end[j] = chr->bed[idx];
    chr->ctrl->cov[j] = save ? lambda : SKIP;
    save = ! save;
    idx++;
  }
  chr->ctrl->end[num-1] = chr->len;
  chr->ctrl->cov[num-1] = save ? lambda : SKIP;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x18(%rdi), %rax
testq %rax, %rax
je 0x79db
movq 0x10(%rbx), %rcx
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpl $0x0, (%rcx)
sete %r12b
setne %bpl
movl %ebp, %r13d
addl %eax, %r13d
movl -0x4(%rcx,%rax,4), %eax
xorl %ecx, %ecx
cmpl 0x8(%rbx), %eax
sete %cl
subl %ecx, %r13d
cmpl 0x44(%rbx), %r13d
jbe 0x7984
movq 0x38(%rbx), %rax
movq (%rax), %rdi
movslq %r13d, %r14
shlq $0x2, %r14
movq %r14, %rsi
movss %xmm0, 0x4(%rsp)
callq 0x3925
movq 0x38(%rbx), %rcx
movq %rax, (%rcx)
movq 0x8(%rcx), %rdi
movq %r14, %rsi
callq 0x3925
movss 0x4(%rsp), %xmm0
movq 0x38(%rbx), %rcx
movq %rax, 0x8(%rcx)
movl %r13d, 0x44(%rbx)
movl %r13d, 0x40(%rbx)
leal -0x1(%r13), %eax
cmpl $0x1, %r13d
jle 0x7a00
movq 0x38(%rbx), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
movl %eax, %esi
movb %r12b, %r15b
shll $0x2, %r15d
addq 0x10(%rbx), %r15
xorl %edi, %edi
movss 0xa79c(%rip), %xmm2     # 0x12150
movl (%r15,%rdi,4), %r8d
movl %r8d, (%rdx,%rdi,4)
movaps %xmm0, %xmm1
testb $0x1, %bpl
jne 0x79c8
movaps %xmm2, %xmm1
movss %xmm1, (%rcx,%rdi,4)
xorb $0x1, %bpl
incq %rdi
cmpq %rdi, %rsi
jne 0x79b4
jmp 0x7a0b
movq 0x38(%rbx), %rdi
leaq 0x40(%rbx), %rsi
movl 0x8(%rbx), %ecx
addq $0x44, %rbx
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7801
movq 0x38(%rbx), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
movl 0x8(%rbx), %esi
cltq
movl %esi, (%rdx,%rax,4)
testb $0x1, %bpl
jne 0x7a21
movss 0xa72f(%rip), %xmm0     # 0x12150
movss %xmm0, (%rcx,%rax,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: savePileupNoCtrl
void savePileupNoCtrl(Chrom* chrom, int chromLen,
    double fragLen, uint64_t genomeLen, bool verbose) {
  float lambda = calcLambda(chrom, chromLen, fragLen,
    genomeLen);
  if (verbose)
    fprintf(stderr, "  Background pileup value: %f\n",
      lambda);
  for (int i = 0; i < chromLen; i++) {
    Chrom* chr = chrom + i;
    if (chr->skip || ! chr->save)
      continue;
    saveLambda(chr, lambda);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %ecx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x7866
movss %xmm0, 0xc(%rsp)
testl %r14d, %r14d
jne 0x7a88
testl %ebp, %ebp
jle 0x7a7f
movl %ebp, %r14d
cmpb $0x0, 0xc(%rbx)
jne 0x7a76
cmpb $0x1, 0xd(%rbx)
jne 0x7a76
movq %rbx, %rdi
movss 0xc(%rsp), %xmm0
callq 0x78f9
addq $0x68, %rbx
decq %r14
jne 0x7a5c
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movss 0xc(%rsp), %xmm0
callq 0x2c62
jmp 0x7a55
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: getVal
float getVal(int32_t cov, uint8_t frac) {
  return (float) cov
    + ((frac & 0x7) / 8.0f)
    + (((frac >> 3) & 0x3) / 6.0f)
    + (((frac >> 5) & 0x7) / 10.0f);
}

// Assembly:
cvtsi2ss %edi, %xmm0
movl %esi, %eax
andl $0x7, %eax
cvtsi2ss %eax, %xmm1
mulss 0xa6ba(%rip), %xmm1     # 0x12164
addss %xmm0, %xmm1
movl %esi, %eax
shrl $0x3, %eax
andl $0x3, %eax
shrl $0x5, %esi
movd %esi, %xmm0
movd %eax, %xmm2
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
cvtdq2ps %xmm0, %xmm2
divps 0xa7a1(%rip), %xmm2     # 0x12270
movaps %xmm2, %xmm0
shufps $0x55, %xmm2, %xmm0     # xmm0 = xmm0[1,1],xmm2[1,1]
addss %xmm1, %xmm0
addss %xmm2, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: subFrac
void subFrac(int16_t* cov, uint8_t* frac, uint8_t count) {
  switch (count) {
    case 8:
      if (*frac & 0x7)
        (*frac)--;
      else {
        (*cov)--;
        *frac |= 0x7;
      }
      break;
    case 4:
      if (*frac & 0x6)
        *frac -= 0x2;
      else {
        (*cov)--;
        *frac |= 0x6;
      }
      break;
    case 2:
      if (*frac & 0x4)
        *frac &= 0xFB;
      else {
        (*cov)--;
        *frac |= 0x4;
      }
      break;
    case 6:
      if (*frac & 0x18)
        *frac -= 0x8;
      else if (*frac & 0x4) {
        *frac |= 0x10;
        *frac &= 0xFB;
      } else {
        (*cov)--;
        *frac |= 0x14;
      }
      break;
    case 3:
      if (*frac & 0x10)
        *frac &= 0xEF;
      else if (*frac & 0x4) {
        *frac &= 0xFB;
        *frac += 0x8;
      } else {
        (*cov)--;
        *frac += 0xC;
      }
      break;
    case 10:
      if (*frac & 0xE0)
        *frac -= 0x20;
      else if (*frac & 0x4) {
        *frac &= 0xFB;
        *frac |= 0x80;
      } else {
        (*cov)--;
        *frac |= 0x84;
      }
      break;
    case 5:
      if (*frac & 0xC0)
        *frac -= 0x40;
      else if (*frac & 0x4) {
        *frac &= 0xFB;
        *frac += 0x60;
      } else {
        (*cov)--;
        *frac |= 0x4;
        *frac += 0x60;
      }
      break;
    default: ;
      char msg[MAX_ALNS];
      sprintf(msg, "%s (%d)", errMsg[ERRALNS], count);
      exit(error(msg, ERRISSUE));
  }
}

// Assembly:
leal -0x2(%rdx), %eax
cmpl $0x8, %eax
ja 0x8882
leaq 0x9b81(%rip), %rcx      # 0x12344
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb (%rsi), %al
testb $0x4, %al
jne 0x8842
decw (%rdi)
movb (%rsi), %al
orb $0x4, %al
jmp 0x887f
movzbl (%rsi), %eax
testb $0x18, %al
je 0x884a
addb $-0x8, %al
jmp 0x887f
movzbl (%rsi), %eax
testb $0x10, %al
jne 0x883a
testb $0x4, %al
jne 0x8869
decw (%rdi)
movb (%rsi), %al
addb $0xc, %al
jmp 0x887f
movb (%rsi), %al
testb $0x7, %al
je 0x8857
decb %al
jmp 0x887f
movb (%rsi), %al
testb $0x6, %al
je 0x8860
addb $-0x2, %al
jmp 0x887f
movb (%rsi), %al
cmpb $0x40, %al
jae 0x883e
testb $0x4, %al
jne 0x886f
decw (%rdi)
movb (%rsi), %al
orb $0x4, %al
jmp 0x8871
movb (%rsi), %al
cmpb $0x20, %al
jae 0x8846
testb $0x4, %al
jne 0x8875
decw (%rdi)
movb (%rsi), %al
orb $-0x7c, %al
jmp 0x887f
andb $-0x11, %al
jmp 0x887f
addb $-0x40, %al
jmp 0x887f
andb $-0x5, %al
jmp 0x887f
addb $-0x20, %al
jmp 0x887f
testb $0x4, %al
jne 0x887b
decw (%rdi)
movb (%rsi), %al
orb $0x14, %al
jmp 0x887f
decw (%rdi)
movb (%rsi), %al
orb $0x7, %al
jmp 0x887f
decw (%rdi)
movb (%rsi), %al
orb $0x6, %al
jmp 0x887f
andb $-0x15, %al
addb $0x8, %al
jmp 0x887f
andb $0x3b, %al
addb $0x60, %al
jmp 0x887f
andb $0x1b, %al
orb $-0x80, %al
jmp 0x887f
andb $-0x15, %al
orb $0x10, %al
movb %al, (%rsi)
retq
subq $0x88, %rsp
movzbl %dl, %edi
movq %rsp, %rsi
callq 0x2dcb
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: printBED
void printBED(File bed, bool gzOut, char* chr,
    int64_t start, int64_t end, char* qname,
    uint8_t count, bool ctrl, int sample) {
  if (gzOut)
    gzprintf(bed.gzf, "%s\t%ld\t%ld\t%s_%d_%c_%d\n",
      chr, start, end, qname, count, ctrl ? 'C' : 'E',
      sample);
  else
    fprintf(bed.f, "%s\t%ld\t%ld\t%s_%d_%c_%d\n",
      chr, start, end, qname, count, ctrl ? 'C' : 'E',
      sample);
}

// Assembly:
pushq %rbx
movl 0x20(%rsp), %r11d
movzbl 0x10(%rsp), %r10d
movb 0x18(%rsp), %al
xorb $0x1, %al
movzbl %al, %eax
leal 0x43(,%rax,2), %ebx
subq $0x8, %rsp
testl %esi, %esi
je 0x88cd
leaq 0xb0b7(%rip), %rsi      # 0x13976
xorl %eax, %eax
pushq %r11
pushq %rbx
pushq %r10
callq 0x20e0
jmp 0x88e0
leaq 0xb0a2(%rip), %rsi      # 0x13976
xorl %eax, %eax
pushq %r11
pushq %rbx
pushq %r10
callq 0x21d0
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: calcAvgLen
int calcAvgLen(double totalLen, uint64_t pairedPr,
    bool verbose) {
  if (! pairedPr) {
    if (verbose) {
      fprintf(stderr, "Warning! No paired alignments to calculate avg frag ");
      fprintf(stderr, "length --\n  Printing unpaired alignments \"as is\"\n");
    }
    return 0;
  }
  return (int) (totalLen / pairedPr + 0.5);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x8bed
movq %rdi, %xmm1
punpckldq 0x9689(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9691(%rip), %xmm1     # 0x12260
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
addsd 0x94c1(%rip), %xmm0     # 0x120a8
cvttsd2si %xmm0, %ebx
jmp 0x8bf4
xorl %ebx, %ebx
testb %sil, %sil
jne 0x8bf8
movl %ebx, %eax
popq %rbx
retq
callq 0x2ea2
jmp 0x8bf4