LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: quickSort
void quickSort(float* pVal, uint64_t* pEnd,
    int64_t low, int64_t high) {
  if (low < high) {
    int64_t idx = partition(pVal, pEnd, low, high);
    quickSort(pVal, pEnd, low, idx - 1);
    quickSort(pVal, pEnd, idx + 1, high);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
cmpq %rbx, %r12
jge 0x2936
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x287a
movq %rax, %r13
leaq -0x1(%rax), %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x28ee
incq %r13
movq %r13, %r12
jmp 0x2903
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: lookup
float lookup(float* pVal, uint64_t low, uint64_t high,
    float* qVal, float p) {
  if (low == high)
    return qVal[low];
  uint64_t idx = (low + high) / 2;
  if (pVal[idx] == p)
    return qVal[idx];
  if (pVal[idx] > p)
    return lookup(pVal, low, idx - 1, qVal, p);
  return lookup(pVal, idx + 1, high, qVal, p);
}

// Assembly:
cmpq %rdx, %rsi
je 0x296d
leaq (%rdx,%rsi), %rax
shrq %rax
movss (%rdi,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2958
jnp 0x296a
jbe 0x2962
decq %rax
movq %rax, %rdx
jmp 0x2940
incq %rax
movq %rax, %rsi
jmp 0x2940
movq %rax, %rsi
movss (%rcx,%rsi,4), %xmm0
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: jenkins_one_at_a_time_hash
uint32_t jenkins_one_at_a_time_hash(float f) {
  uint32_t hash = 0;
  unsigned char* p = (unsigned char*) &f;
  for (int i = 0; i < sizeof(float); i++) {
    hash += p[i];
    hash += hash << 10;
    hash ^= hash >> 6;
  }
  hash += hash << 3;
  hash ^= hash >> 11;
  hash += hash << 15;
  return hash % HASH_SIZE;
}

// Assembly:
movss %xmm0, -0x4(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x4, %rax
je 0x2c4a
movzbl -0x4(%rsp,%rax), %edx
addl %edx, %ecx
imull $0x401, %ecx, %edx      # imm = 0x401
movl %edx, %ecx
shrl $0x6, %ecx
xorl %edx, %ecx
incq %rax
jmp 0x2c2b
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
imull $0x8001, %ecx, %eax     # imm = 0x8001
movl $0x13fed1, %ecx         # imm = 0x13FED1
xorl %edx, %edx
divl %ecx
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movss %xmm0, 0x4(%rsp)
callq 0x2c21
movl %eax, %eax
leaq (%r14,%rax,8), %r14
movq %r14, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x2c9e
movss (%rax), %xmm0
ucomiss 0x4(%rsp), %xmm0
jne 0x2c98
jnp 0x2cc5
addq $0x10, %rax
jmp 0x2c83
pushq $0x18
popq %rdi
callq 0x2752
movss 0x4(%rsp), %xmm0
movss %xmm0, (%rax)
movl %ebx, %ecx
movq %rcx, 0x8(%rax)
movq (%r14), %rcx
movq %rcx, 0x10(%rax)
movq %rax, (%r14)
pushq $0x1
popq %rax
jmp 0x2ccd
movl %ebx, %ecx
addq %rcx, 0x8(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, (%rsp)
movl $0x9ff688, %edi         # imm = 0x9FF688
callq 0x2752
movq %rax, %r12
xorl %eax, %eax
cmpq $0x13fed1, %rax         # imm = 0x13FED1
je 0x2d10
andq $0x0, (%r12,%rax,8)
incq %rax
jmp 0x2cfe
movslq %ebp, %r13
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
movq %r14, 0x8(%rsp)
cmpq 0x8(%rsp), %rax
je 0x2d9d
movq %rax, 0x10(%rsp)
imulq $0x68, %rax, %r14
movq (%rsp), %rax
cmpb $0x0, 0xc(%rax,%r14)
jne 0x2d93
addq (%rsp), %r14
movq 0x48(%r14), %rax
movq (%rax,%r13,8), %r15
testq %r15, %r15
je 0x2d93
xorl %ebp, %ebp
xorl %eax, %eax
movq 0x50(%r14), %rcx
movl (%rcx,%r13,4), %ecx
cmpq %rcx, %rbp
jae 0x2d93
movq (%r15), %rcx
movq 0x8(%r15), %rdx
movss (%rdx,%rbp,4), %xmm0
ucomiss 0xd3f6(%rip), %xmm0     # 0x10168
jne 0x2d76
jnp 0x2d8b
movl (%rcx,%rbp,4), %esi
subl %eax, %esi
movq %r12, %rdi
callq 0x2c66
movl %eax, %eax
addq %rax, (%rbx)
movq (%r15), %rcx
movl (%rcx,%rbp,4), %eax
incq %rbp
jmp 0x2d52
movq 0x10(%rsp), %rax
incq %rax
jmp 0x2d21
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2752
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x13fed1, %rcx         # imm = 0x13FED1
je 0x2e0e
leaq (%r12,%rcx,8), %rsi
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x2e09
movss (%rsi), %xmm0
movss %xmm0, (%rax,%rdx,4)
movq 0x8(%rsi), %rdi
movq (%r15), %r8
movq %rdi, (%r8,%rdx,8)
addq %rdi, (%r14)
incq %rdx
addq $0x10, %rsi
jmp 0x2de1
incq %rcx
jmp 0x2dd4
cmpq %rbx, %rdx
jne 0x2e1f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1447a(%rip), %rdi     # 0x172a0
pushq $0x21
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/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
movapd %xmm0, %xmm6
subsd %xmm1, %xmm6
movapd 0xd1a8(%rip), %xmm2     # 0x101a0
andpd %xmm6, %xmm2
addsd %xmm1, %xmm0
movsd 0xd010(%rip), %xmm3     # 0x10018
mulsd %xmm0, %xmm3
ucomisd %xmm2, %xmm3
jbe 0x307e
movapd %xmm6, %xmm2
divsd %xmm0, %xmm2
mulsd %xmm2, %xmm6
movapd 0xd17a(%rip), %xmm0     # 0x101a0
andpd %xmm6, %xmm0
movsd 0xcfee(%rip), %xmm3     # 0x10020
ucomisd %xmm0, %xmm3
jbe 0x303d
movapd %xmm6, %xmm0
retq
movapd %xmm5, %xmm3
addsd %xmm5, %xmm3
mulsd %xmm2, %xmm3
mulsd %xmm2, %xmm2
pushq $0x3
popq %rax
leal 0x2(%rax), %ecx
cmpl $0x7d3, %ecx            # imm = 0x7D3
je 0x307e
cvtsi2sd %eax, %xmm4
mulsd %xmm2, %xmm3
movapd %xmm3, %xmm0
divsd %xmm4, %xmm0
addsd %xmm6, %xmm0
ucomisd %xmm6, %xmm0
movl %ecx, %eax
movapd %xmm0, %xmm6
jne 0x3050
jp 0x3050
retq
subq $0x18, %rsp
movapd %xmm5, %xmm0
divsd %xmm1, %xmm0
movsd %xmm5, 0x8(%rsp)
movsd %xmm1, 0x10(%rsp)
callq 0x2160
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcf64(%rip), %xmm0     # 0x10028
jbe 0x30ec
movsd 0xcfa2(%rip), %xmm2     # 0x10070
divsd %xmm1, %xmm2
addsd 0xcf7e(%rip), %xmm2     # 0x10058
divsd %xmm1, %xmm2
movsd 0xcf7a(%rip), %xmm1     # 0x10060
subsd %xmm2, %xmm1
jmp 0x312a
ucomisd 0xcf3c(%rip), %xmm0     # 0x10030
jbe 0x3133
movsd 0xcf6a(%rip), %xmm2     # 0x10068
divsd %xmm1, %xmm2
addsd 0xcf46(%rip), %xmm2     # 0x10050
divsd %xmm1, %xmm2
movsd 0xcf42(%rip), %xmm3     # 0x10058
subsd %xmm2, %xmm3
divsd %xmm1, %xmm3
movsd 0xcf3a(%rip), %xmm1     # 0x10060
subsd %xmm3, %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
retq
ucomisd 0xcefd(%rip), %xmm0     # 0x10038
jbe 0x3176
movsd 0xcefb(%rip), %xmm2     # 0x10040
divsd %xmm1, %xmm2
addsd 0xcef7(%rip), %xmm2     # 0x10048
divsd %xmm1, %xmm2
movsd 0xcef3(%rip), %xmm3     # 0x10050
subsd %xmm2, %xmm3
divsd %xmm1, %xmm3
movsd 0xceeb(%rip), %xmm2     # 0x10058
subsd %xmm3, %xmm2
jmp 0x30da
cvttsd2si %xmm0, %eax
cltq
leaq 0xd25d(%rip), %rcx      # 0x103e0
movsd (%rcx,%rax,8), %xmm1
jmp 0x312e
// File: /workspace/github_c_makefile_star2_O2/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 0xce80(%rip), %xmm4     # 0x10088
movsd 0xce80(%rip), %xmm5     # 0x10090
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 0x3214
movapd %xmm2, %xmm0
jmp 0x2160
// File: /workspace/github_c_makefile_star2_O2/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
movsd 0xce39(%rip), %xmm3     # 0x10088
movsd 0xce39(%rip), %xmm4     # 0x10090
movsd 0xce39(%rip), %xmm5     # 0x10098
movapd %xmm3, %xmm6
ucomisd %xmm3, %xmm1
movapd %xmm0, %xmm7
mulsd %xmm4, %xmm7
jb 0x2150
ucomisd %xmm7, %xmm6
jbe 0x2150
movapd %xmm1, %xmm7
divsd %xmm2, %xmm7
mulsd %xmm7, %xmm6
addsd %xmm6, %xmm0
addsd %xmm5, %xmm1
jmp 0x3263
// File: /workspace/github_c_makefile_star2_O2/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 0xcf0e(%rip), %xmm9     # 0x101b0
xorpd %xmm0, %xmm9
xorpd %xmm2, %xmm2
movsd 0xcdd5(%rip), %xmm3     # 0x10088
movapd 0xcee5(%rip), %xmm4     # 0x101a0
movsd 0xcdcd(%rip), %xmm5     # 0x10090
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 0x32cc
movsd %xmm1, (%rsp)
movapd %xmm10, 0x10(%rsp)
callq 0x2160
movsd %xmm0, 0x8(%rsp)
movsd 0xcd5c(%rip), %xmm0     # 0x10088
addsd (%rsp), %xmm0
callq 0x21e0
movsd 0x8(%rsp), %xmm1
mulsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movapd 0x10(%rsp), %xmm0
callq 0x2150
addsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsp)
movapd 0x10(%rsp), %xmm0
callq 0x2150
movsd (%rsp), %xmm1
ucomisd 0xcd27(%rip), %xmm1     # 0x100a0
addsd 0x8(%rsp), %xmm0
jbe 0x3397
callq 0x2200
xorpd 0xce22(%rip), %xmm0     # 0x101b0
addq $0x28, %rsp
jmp 0x2160
callq 0x22d0
xorpd 0xce0c(%rip), %xmm0     # 0x101b0
addq $0x28, %rsp
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O2/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
movsd 0xcccf(%rip), %xmm2     # 0x10088
ucomisd %xmm0, %xmm2
jbe 0x33c8
addq $0x18, %rsp
jmp 0x3295
movsd 0xccc8(%rip), %xmm2     # 0x10098
addsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
movsd %xmm0, 0x10(%rsp)
movsd %xmm2, 0x8(%rsp)
jae 0x340f
movapd %xmm2, %xmm1
callq 0x323f
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
callq 0x318a
addsd (%rsp), %xmm0
addq $0x18, %rsp
retq
callq 0x31f8
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
callq 0x318a
addsd (%rsp), %xmm0
ucomisd 0xcc69(%rip), %xmm0     # 0x100a0
jbe 0x344f
callq 0x2200
xorpd 0xcd6a(%rip), %xmm0     # 0x101b0
addq $0x18, %rsp
jmp 0x2160
callq 0x22d0
xorpd 0xcd54(%rip), %xmm0     # 0x101b0
addq $0x18, %rsp
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O2/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
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
movq %rdi, %rax
xorpd %xmm0, %xmm0
movss 0xcc94(%rip), %xmm1     # 0x10168
xorl %edi, %edi
cmpq %rcx, %rsi
je 0x3509
movq (%rax,%rcx,8), %r8
testq %r8, %r8
je 0x3504
movq 0x8(%r8), %r8
movl (%rdx,%rcx,4), %r9d
movss (%r8,%r9,4), %xmm2
ucomiss %xmm1, %xmm2
jne 0x34f9
jnp 0x3504
cvtss2sd %xmm2, %xmm2
addsd %xmm2, %xmm0
addl $0x2, %edi
incq %rcx
jmp 0x34d6
testl %edi, %edi
je 0x3544
cmpl $0x2, %edi
je 0x3540
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x351d
jnp 0x3540
addsd %xmm0, %xmm0
divsd 0xcb8f(%rip), %xmm0     # 0x100b8
callq 0x3465
movsd 0xcb8a(%rip), %xmm1     # 0x100c0
minsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
jmp 0x3544
cvtsd2ss %xmm0, %xmm1
movaps %xmm1, %xmm0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
movl %esi, %eax
movq %rsp, %rcx
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, %rsp
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
cmpq %rax, %rsi
je 0x357b
andl $0x0, (%rcx,%rax,4)
incq %rax
jmp 0x356d
movl 0x8(%rdi), %edx
pushq $0x1
popq %rax
movl %eax, %r8d
cmpl %edx, %r8d
jae 0x35d0
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq %r9, %rsi
je 0x35cb
movq 0x48(%rdi), %r11
movq (%r11,%r9,8), %r11
testq %r11, %r11
je 0x35c6
movq (%r11), %rbx
movl (%rcx,%r9,4), %r11d
cmpl %r8d, (%rbx,%r11,4)
jne 0x35c6
notb %r10b
movzbl %r10b, %r10d
andl $0x1, %r10d
addl %r10d, %eax
incl %r11d
movl %r11d, (%rcx,%r9,4)
movb $0x1, %r10b
incq %r9
jmp 0x358f
incl %r8d
jmp 0x3584
leaq -0x8(%rbp), %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3e53
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 0x3ea4
movq 0x60(%rbx), %rax
movq 0x8(%rax), %rax
movss (%rax,%r13,4), %xmm1
jmp 0x3eac
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 0x3f0b
movq 0x60(%rbx), %r9
movq 0x8(%r9), %r9
movss (%r9,%rax,4), %xmm3
jmp 0x3f13
movss 0xc2bc(%rip), %xmm1     # 0x10168
movzbl %r11b, %eax
movzbl %r10b, %r10d
movzbl %sil, %esi
pushq %rax
pushq %r10
pushq %r15
pushq %r14
callq 0x398e
addq $0x20, %rsp
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
cmpq %rax, %r14
je 0x3f05
movq 0x48(%rbx), %rdx
movq (%rdx,%rax,8), %rcx
testq %rcx, %rcx
je 0x3f00
movq (%rcx), %rsi
movl (%r15,%rax,4), %ecx
movl (%rsi,%rcx,4), %esi
movq (%rdx,%r12,8), %rdx
movq (%rdx), %rdx
cmpl (%rdx,%r13,4), %esi
jne 0x3f00
incl %ecx
movl %ecx, (%r15,%rax,4)
incq %rax
jmp 0x3ed1
addq $0x8, %rsp
jmp 0x3f2d
movss 0xc255(%rip), %xmm3     # 0x10168
subq $0x8, %rsp
movzbl %r11b, %eax
movzbl %sil, %esi
movzbl %r10b, %r9d
pushq %rax
callq 0x3c44
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc054(%rip), %xmm2     # 0x1016c
movq %r8, %rax
subq %rcx, %rax
cvtsi2ss %rax, %xmm3
movl 0x30(%rsp), %ebx
divss %xmm3, %xmm2
addss 0xc03d(%rip), %xmm2     # 0x10170
cvttss2si %xmm2, %rdi
movl $0x3e8, %eax            # imm = 0x3E8
cmpl %eax, %edi
cmovbl %edi, %eax
cvtss2sd %xmm1, %xmm1
testl %esi, %esi
je 0x4189
movl %eax, (%rsp)
leaq 0xd2d9(%rip), %rsi      # 0x1142d
movq %r14, %rdi
movb $0x2, %al
callq 0x20e0
movss 0x14(%rsp), %xmm0
ucomiss 0xbffd(%rip), %xmm0     # 0x10168
jne 0x41c8
jp 0x41c8
leaq 0xd2d5(%rip), %rsi      # 0x1144b
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x20e0
movl %eax, (%rsp)
leaq 0xd29a(%rip), %rsi      # 0x1142d
movq %r14, %rdi
movb $0x2, %al
callq 0x21c0
movss 0x14(%rsp), %xmm0
ucomiss 0xbfbe(%rip), %xmm0     # 0x10168
jne 0x41e6
jp 0x41e6
leaq 0xd296(%rip), %rsi      # 0x1144b
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x21c0
cvtss2sd %xmm0, %xmm0
leaq 0xd280(%rip), %rsi      # 0x11453
movq %r14, %rdi
movl %ebx, %edx
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x20e0
cvtss2sd %xmm0, %xmm0
leaq 0xd262(%rip), %rsi      # 0x11453
movq %r14, %rdi
movl %ebx, %edx
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x21c0
// File: /workspace/github_c_makefile_star2_O2/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 0x4251
ucomiss %xmm3, %xmm0
jb 0x4251
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r8, %r14
subq %rcx, %r14
movslq 0x38(%rsp), %rax
cmpq %rax, %r14
jl 0x4248
movq %r9, %rbx
movq 0x40(%rsp), %r15
movl 0x30(%rsp), %eax
movl (%r9), %r9d
movl %eax, (%rsp)
movzbl %sil, %esi
callq 0x40f9
addq %r14, (%r15)
incl (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x428d
movl %edx, %r8d
movq %r8, (%rdi)
movq 0x20(%rsp), %r8
movl %ecx, %r10d
movq %r10, (%rsi)
movss (%r9), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x42bc
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %r10
movss %xmm0, (%r9)
movss %xmm2, (%r10)
movss %xmm3, (%rsi)
jmp 0x42c8
ucomiss %xmm0, %xmm1
jne 0x42d8
jp 0x42d8
cmpl (%r8), %eax
jbe 0x42d8
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_O2/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
xorl %ecx, %ecx
testl %esi, %esi
movl $0x0, %r12d
cmovgl %esi, %r12d
movq %rcx, %r13
cmpq %rcx, %r12
je 0x4c4f
movq (%r14,%r13,8), %rdi
movq %r15, %rsi
callq 0x21a0
leaq 0x1(%r13), %rcx
testl %eax, %eax
jne 0x4c33
movslq %ebx, %rax
cmpq %rax, %r13
setl %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0xc(%rsp)
movq %rdx, %rbx
movl %esi, %ecx
movq %rdi, %rdx
movq %rbx, %rdi
movl $0xfff0, %esi           # imm = 0xFFF0
callq 0x283f
testq %rax, %rax
je 0x4d53
movabsq $0x297028676f6c2d, %rax # imm = 0x297028676F6C2D
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movabsq $0x297128676f6c2d, %rax # imm = 0x297128676F6C2D
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
leaq 0xc93c(%rip), %r12      # 0x115fe
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2280
movq %rax, %rbx
xorl %r15d, %r15d
pushq $-0x1
popq %r14
pushq $0x7
popq %rbp
testq %rbx, %rbx
je 0x4d2a
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
movq %rbp, %rdx
callq 0x2060
movl %r15d, %r13d
testl %eax, %eax
je 0x4d15
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
movq %rbp, %rdx
callq 0x2060
testl %eax, %eax
jne 0x4d12
movq 0x10(%rsp), %rax
movl %r15d, (%rax)
movl %r14d, %r13d
xorl %edi, %edi
movq %r12, %rsi
callq 0x2280
movq %rax, %rbx
incl %r15d
movl %r13d, %r14d
jmp 0x4cda
cmpl $-0x1, %r14d
je 0x4d5c
cmpb $0x0, 0xc(%rsp)
je 0x4d41
movq 0x10(%rsp), %rax
cmpl $-0x1, (%rax)
je 0x4d63
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc89b(%rip), %rdi      # 0x115f5
jmp 0x4d68
leaq 0x20(%rsp), %rdi
jmp 0x4d68
leaq 0x18(%rsp), %rdi
pushq $0x1f
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/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 0xc851(%rip), %rbp      # 0x115fe
movq %rbp, %rsi
callq 0x2280
xorl %r15d, %r15d
cmpl %ebx, %r15d
jg 0x4e22
testq %rax, %rax
je 0x4e31
cmpl $0x2, %r15d
je 0x4de7
cmpl $0x1, %r15d
je 0x4dd9
testl %r15d, %r15d
jne 0x4df8
movq %rax, (%r13)
jmp 0x4e13
movq %rax, %rdi
callq 0x27cf
movl %eax, (%r12)
jmp 0x4e13
movq %rax, %rdi
callq 0x27cf
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x4e13
cmpl %r15d, %r14d
jne 0x4e04
movq 0x8(%rsp), %rcx
jmp 0x4e10
cmpl %r15d, 0x58(%rsp)
jne 0x4e13
movq 0x50(%rsp), %rcx
movq %rax, (%rcx)
xorl %edi, %edi
movq %rbp, %rsi
callq 0x2280
incl %r15d
jmp 0x4db8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xccd7(%rip), %rdi      # 0x11b0f
pushq $0x20
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/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 0xa65e(%rip), %xmm0     # 0x100c8
mulsd %xmm1, %xmm0
callq 0x2080
mulsd 0xa655(%rip), %xmm0     # 0x100d0
movapd %xmm0, %xmm1
movsd 0x18(%rsp), %xmm2
addsd %xmm2, %xmm1
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
movapd 0xa717(%rip), %xmm1     # 0x101b0
xorpd %xmm0, %xmm1
mulsd %xmm0, %xmm1
subsd %xmm2, %xmm1
mulsd 0xa5fb(%rip), %xmm1     # 0x100a8
testl %ebx, %ebx
je 0x5ad1
movapd %xmm1, %xmm0
callq 0x22d0
xorpd 0xa6ee(%rip), %xmm0     # 0x101b0
mulsd (%rsp), %xmm0
addq $0x20, %rsp
popq %rbx
jmp 0x2150
movsd (%rsp), %xmm0
movapd %xmm1, (%rsp)
callq 0x2160
addsd (%rsp), %xmm0
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xa3f2(%rip), %xmm0     # 0x10168
ucomiss %xmm0, %xmm1
jne 0x5d7e
jp 0x5d7e
retq
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x5d9c
jp 0x5d9c
cmpeqss %xmm0, %xmm2
movss 0xa3e3(%rip), %xmm0     # 0x10178
andnps %xmm0, %xmm2
movaps %xmm2, %xmm0
retq
ucomiss %xmm0, %xmm2
jne 0x5da3
jnp 0x5d7d
subq $0x38, %rsp
movaps %xmm2, 0x20(%rsp)
cvtss2sd %xmm1, %xmm0
ucomiss 0xa3bd(%rip), %xmm1     # 0x10174
jbe 0x5e26
movsd %xmm0, 0x8(%rsp)
callq 0x21b0
mulsd 0xa394(%rip), %xmm0     # 0x10160
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 0x2160
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
divsd 0x8(%rsp), %xmm0
callq 0x2150
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x5e40
sqrtsd %xmm0, %xmm2
jmp 0x5e49
callq 0x2160
movaps %xmm0, %xmm1
addsd 0xa31a(%rip), %xmm1     # 0x10150
movsd 0xa31a(%rip), %xmm2     # 0x10158
jmp 0x5e4f
callq 0x22c0
movapd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm1
cvtss2sd 0x20(%rsp), %xmm0
callq 0x5d1a
movsd 0xa25e(%rip), %xmm1     # 0x100c0
minsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm0
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbx
movl 0x30(%rdi), %ecx
xorl %edx, %edx
xorl %eax, %eax
xorl %esi, %esi
cmpq %rcx, %rdx
je 0x5ecf
movl 0x40(%rdi), %r10d
movl %esi, %r9d
cmpl %r10d, %esi
cmovbel %r10d, %esi
movq 0x28(%rdi), %r11
movq 0x38(%rdi), %r8
movq (%r8), %r8
movq (%r11), %r11
incl %eax
cmpq %r10, %r9
jae 0x5eb0
movl (%r11,%rdx,4), %ebx
cmpl %ebx, (%r8,%r9,4)
jae 0x5eb6
incq %r9
jmp 0x5e9a
movl (%r11,%rdx,4), %ebx
jmp 0x5eb9
movl %r9d, %esi
movl %esi, %r9d
xorl %r10d, %r10d
cmpl %ebx, (%r8,%r9,4)
sete %r10b
addl %r10d, %esi
incq %rdx
jmp 0x5e79
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x5f06
testq %r15, %r15
je 0x5f29
leaq 0xbc12(%rip), %rsi      # 0x11b01
movq %r15, %rdi
callq 0x21a0
testl %eax, %eax
leaq 0xb503(%rip), %rcx      # 0x11403
cmovneq %r15, %rcx
jmp 0x5f30
testq %r15, %r15
je 0x5f5a
leaq 0xbbef(%rip), %rsi      # 0x11b01
movq %r15, %rdi
callq 0x21a0
testl %eax, %eax
leaq 0xb4e0(%rip), %rcx      # 0x11403
cmovneq %r15, %rcx
jmp 0x5f61
leaq 0xb4d3(%rip), %rcx      # 0x11403
leaq 0xb81a(%rip), %rsi      # 0x11751
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x20e0
leaq 0xb831(%rip), %rsi      # 0x1177c
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x20e0
leaq 0xb4a2(%rip), %rcx      # 0x11403
leaq 0xb7e9(%rip), %rsi      # 0x11751
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x21c0
leaq 0xb800(%rip), %rdi      # 0x1177c
pushq $0x2b
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
popq %rbx
popq %r14
popq %r15
jmp 0x22b0
// File: /workspace/github_c_makefile_star2_O2/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 0x5fc5
ucomiss 0xa1c2(%rip), %xmm1     # 0x10168
jne 0x5feb
jp 0x5feb
leaq 0xb7f7(%rip), %rsi      # 0x117a8
leaq 0xb44b(%rip), %r9       # 0x11403
xorps %xmm1, %xmm1
movl %eax, %r8d
movb $0x2, %al
jmp 0x20e0
ucomiss 0xa19c(%rip), %xmm1     # 0x10168
jne 0x6004
jp 0x6004
leaq 0xb7d1(%rip), %rsi      # 0x117a8
leaq 0xb425(%rip), %r9       # 0x11403
xorps %xmm1, %xmm1
movl %eax, %r8d
movb $0x2, %al
jmp 0x21c0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
leaq 0xb7c1(%rip), %rsi      # 0x117bb
movl %eax, %r8d
movb $0x3, %al
jmp 0x20e0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
leaq 0xb7a8(%rip), %rsi      # 0x117bb
movl %eax, %r8d
movb $0x3, %al
jmp 0x21c0
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, (%rdx)
je 0x635a
movq 0x8(%r14), %rax
jmp 0x638b
movq %rdx, %r15
pushq $0x4
popq %r12
movq %r12, %rdi
movss %xmm0, 0xc(%rsp)
callq 0x2752
movq %rax, (%r14)
movq %r12, %rdi
callq 0x2752
movss 0xc(%rsp), %xmm0
movq %rax, 0x8(%r14)
movl $0x1, (%r15)
movq (%r14), %rcx
movl %ebp, (%rcx)
movss %xmm0, (%rax)
movl $0x1, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6402
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
xorl %edx, %edx
cmpq %rsi, %rax
je 0x63fd
imulq $0x68, %rax, %rcx
cmpb $0x0, 0xc(%rdi,%rcx)
jne 0x63f8
addq %rdi, %rcx
cmpb $0x1, 0xd(%rcx)
jne 0x63f8
movl 0x8(%rcx), %r8d
addq %r8, %rdx
movslq 0x18(%rcx), %r8
xorl %r9d, %r9d
cmpq %r8, %r9
jge 0x63f8
movq 0x10(%rcx), %r10
movl 0x4(%r10,%r9,4), %r11d
subl (%r10,%r9,4), %r11d
subq %r11, %rdx
addq $0x2, %r9
jmp 0x63dd
incq %rax
jmp 0x63b6
testq %rdx, %rdx
je 0x642d
movq %rdx, %xmm1
punpckldq 0x9e21(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9e29(%rip), %xmm1     # 0x10240
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
cvtsd2ss %xmm0, %xmm0
popq %rax
retq
leaq 0xb6db(%rip), %rdi      # 0x11b0f
pushq $0x14
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/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 0x6560
movq 0x10(%rbx), %rcx
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpl $0x0, (%rcx)
sete %r13b
setne %bpl
movl %ebp, %r12d
addl %eax, %r12d
movl -0x4(%rcx,%rax,4), %eax
xorl %ecx, %ecx
cmpl 0x8(%rbx), %eax
sete %cl
subl %ecx, %r12d
cmpl 0x44(%rbx), %r12d
jbe 0x64cf
movq 0x38(%rbx), %rax
movq (%rax), %rdi
movslq %r12d, %r14
shlq $0x2, %r14
movq %r14, %rsi
movss %xmm0, 0x4(%rsp)
callq 0x2776
movq 0x38(%rbx), %rcx
movq %rax, (%rcx)
movq 0x8(%rcx), %rdi
movq %r14, %rsi
callq 0x2776
movss 0x4(%rsp), %xmm0
movq 0x38(%rbx), %rcx
movq %rax, 0x8(%rcx)
movl %r12d, 0x44(%rbx)
movl %r12d, 0x40(%rbx)
decl %r12d
xorl %eax, %eax
testl %r12d, %r12d
movl $0x0, %ecx
cmovgl %r12d, %ecx
movb %r13b, %r15b
shll $0x2, %r15d
movss 0x9c75(%rip), %xmm2     # 0x10168
cmpq %rax, %rcx
je 0x652a
movq 0x10(%rbx), %rdx
addq %r15, %rdx
movl (%rdx,%rax,4), %esi
movq 0x38(%rbx), %rdx
movq (%rdx), %rdi
movl %esi, (%rdi,%rax,4)
movaps %xmm0, %xmm1
testb $0x1, %bpl
jne 0x6518
movaps %xmm2, %xmm1
movq 0x8(%rdx), %rdx
movss %xmm1, (%rdx,%rax,4)
xorb $0x1, %bpl
incq %rax
jmp 0x64f3
movl 0x8(%rbx), %edx
movq 0x38(%rbx), %rax
movq (%rax), %rsi
movslq %r12d, %rcx
movl %edx, (%rsi,%rcx,4)
testb $0x1, %bpl
jne 0x6548
movss 0x9c20(%rip), %xmm0     # 0x10168
movq 0x8(%rax), %rax
movss %xmm0, (%rax,%rcx,4)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
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 0x633b
// File: /workspace/github_c_makefile_star2_O2/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 0x63a7
movss %xmm0, 0xc(%rsp)
testl %r14d, %r14d
jne 0x65dd
xorl %r14d, %r14d
testl %ebp, %ebp
cmovgl %ebp, %r14d
subq $0x1, %r14
jb 0x65d4
cmpb $0x0, 0xc(%rbx)
jne 0x65ce
cmpb $0x1, 0xd(%rbx)
jne 0x65ce
movq %rbx, %rdi
movss 0xc(%rsp), %xmm0
callq 0x6444
addq $0x68, %rbx
jmp 0x65ae
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x10a14(%rip), %rax     # 0x16ff8
movq (%rax), %rdi
cvtss2sd 0xc(%rsp), %xmm0
leaq 0xb1da(%rip), %rsi      # 0x117ce
movb $0x1, %al
callq 0x21c0
jmp 0x65a5
// File: /workspace/github_c_makefile_star2_O2/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 0x9b6a(%rip), %xmm1     # 0x1017c
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 0x9c19(%rip), %xmm2     # 0x10250
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_O2/jsh58[P]Genrich/Genrich.c
// Function: updateVal
float updateVal(int16_t dCov, uint8_t dFrac, int32_t* cov,
    uint8_t* frac) {

  // add ints
  *cov += dCov;
  if (! dFrac) {
    if (*cov < 0)
      exit(error(errMsg[ERRPILE], ERRISSUE));
    return getVal(*cov, *frac);
  }

  // sum eighths (and collect halves)
  int half = 0;
  if (dFrac & 0x7) {
    int sum8 = (dFrac & 0x7) + (*frac & 0x7);
    while (sum8 > 3) {
      half++;
      sum8 -= 4;
    }
    *frac = (*frac & 0xF8) | sum8;
  } else if (*frac & 0x4) {
    half++;
    *frac &= 0xFB;
  }

  // sum sixths
  if (dFrac & 0x18) {
    int sum6 = ((dFrac >> 3) & 0x3) + ((*frac >> 3) & 0x3);
    if (sum6 > 2) {
      half++;
      sum6 -= 3;
    }
    *frac = (*frac & 0xE7) | (sum6 << 3);
  }

  // sum tenths
  if (dFrac & 0xE0) {
    int sum10 = ((dFrac >> 5) & 0x7) + ((*frac >> 5) & 0x7);
    if (sum10 > 4) {
      half++;
      sum10 -= 5;
    }
    *frac = (*frac & 0x1F) | (sum10 << 5);
  }

  // combine halves
  while (half > 1) {
    (*cov)++;
    half -= 2;
  }
  if (half)
    *frac |= 0x4;

  // check for negative pileup
  if (*cov < 0)
    exit(error(errMsg[ERRPILE], ERRISSUE));

  return getVal(*cov, *frac);
}

// Assembly:
pushq %rax
addl (%rdx), %edi
movl %edi, (%rdx)
testl %esi, %esi
je 0x6732
movzbl %sil, %edi
movl %edi, %r9d
movb (%rcx), %r8b
andl $0x7, %r9d
je 0x6687
movzbl %r8b, %r8d
movl %r8d, %eax
andl $0x7, %eax
addl %eax, %r9d
movl %r9d, %eax
shrl $0x2, %eax
andb $-0x8, %r8b
andb $0x3, %r9b
orb %r8b, %r9b
movl %r9d, %r8d
jmp 0x6696
xorl %eax, %eax
testb $0x4, %r8b
je 0x6699
pushq $0x1
popq %rax
andb $-0x5, %r8b
movb %r8b, (%rcx)
testb $0x18, %sil
je 0x66e4
movl %edi, %r9d
shrl $0x3, %r9d
andl $0x3, %r9d
movl %r8d, %r10d
shrb $0x3, %r10b
andb $0x3, %r10b
movzbl %r10b, %r10d
addl %r9d, %r10d
cmpl $0x3, %r10d
sbbl $-0x1, %eax
leal -0x3(%r10), %r9d
cmpl $0x3, %r10d
movzbl %r9b, %r9d
cmovbl %r10d, %r9d
andb $-0x19, %r8b
shlb $0x3, %r9b
orb %r8b, %r9b
movb %r9b, (%rcx)
movl %r9d, %r8d
cmpb $0x20, %sil
jb 0x671b
shrl $0x5, %edi
movl %r8d, %esi
shrb $0x5, %sil
movzbl %sil, %esi
addl %edi, %esi
cmpl $0x5, %esi
sbbl $-0x1, %eax
leal 0x3(%rsi), %edi
cmpl $0x5, %esi
movzbl %dil, %edi
cmovbl %esi, %edi
andb $0x1f, %r8b
shlb $0x5, %dil
orb %r8b, %dil
movb %dil, (%rcx)
movl %eax, %esi
cmpl $0x2, %esi
jl 0x6729
incl (%rdx)
addl $-0x2, %esi
jmp 0x671d
testb $0x1, %al
je 0x6730
orb $0x4, (%rcx)
movl (%rdx), %edi
testl %edi, %edi
js 0x673f
movzbl (%rcx), %esi
popq %rax
jmp 0x65fd
movq 0x10b52(%rip), %rdi     # 0x17298
pushq $0x21
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0