LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x6004
movq %rdx, %rdi
movq %r14, %rsi
movl $0xfff0, %edx           # imm = 0xFFF0
callq 0x2090
jmp 0x6011
movq %r14, %rdi
movl $0xfff0, %esi           # imm = 0xFFF0
callq 0x21a0
testq %rax, %rax
je 0x60e5
movl %ebx, 0xc(%rsp)
movabsq $0x297028676f6c2d, %rax # imm = 0x297028676F6C2D
movq %rax, 0x20(%rsp)
movabsq $0x297128676f6c2d, %rax # imm = 0x297128676F6C2D
movq %rax, 0x18(%rsp)
leaq 0xd66b(%rip), %rsi      # 0x136ae
movq %r14, %rdi
callq 0x2280
testq %rax, %rax
je 0x60b6
movq %rax, %r13
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
leaq 0x20(%rsp), %r14
leaq 0xd648(%rip), %r15      # 0x136ae
movl $0x7, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x2060
movl %ebx, %r12d
testl %eax, %eax
je 0x609d
movl $0x7, %edx
movq %r13, %rdi
leaq 0x18(%rsp), %rsi
callq 0x2060
testl %eax, %eax
jne 0x609a
movq 0x10(%rsp), %rax
movl %ebx, (%rax)
movl %ebp, %r12d
xorl %edi, %edi
movq %r15, %rsi
callq 0x2280
movq %rax, %r13
incl %ebx
movl %r12d, %ebp
testq %rax, %rax
jne 0x6066
jmp 0x60bc
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $-0x1, %r12d
je 0x60ea
cmpb $0x0, 0xc(%rsp)
je 0x60d3
movq 0x10(%rsp), %rax
cmpl $-0x1, (%rax)
je 0x60f4
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2b1a
leaq 0x20(%rsp), %rdi
callq 0x2b09
leaq 0x18(%rsp), %rdi
callq 0x2af8
// File: /workspace/github_c_makefile_star2_O1/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 0xd57b(%rip), %rsi      # 0x136ae
callq 0x2280
testl %ebx, %ebx
js 0x61b0
incl %ebx
xorl %r15d, %r15d
leaq 0xd566(%rip), %rbp      # 0x136ae
testq %rax, %rax
je 0x61bf
cmpl $0x2, %r15d
je 0x6172
cmpl $0x1, %r15d
je 0x6164
testl %r15d, %r15d
jne 0x6183
movq %rax, (%r13)
jmp 0x619e
movq %rax, %rdi
callq 0x3951
movl %eax, (%r12)
jmp 0x619e
movq %rax, %rdi
callq 0x3951
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x619e
cmpl %r15d, %r14d
jne 0x618f
movq 0x8(%rsp), %rcx
jmp 0x619b
cmpl %r15d, 0x58(%rsp)
jne 0x619e
movq 0x50(%rsp), %rcx
movq %rax, (%rcx)
xorl %edi, %edi
movq %rbp, %rsi
callq 0x2280
incl %r15d
cmpl %r15d, %ebx
jne 0x6148
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2b32
// File: /workspace/github_c_makefile_star2_O1/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 0xb230(%rip), %xmm0     # 0x120d0
mulsd %xmm1, %xmm0
callq 0x2080
mulsd 0xb227(%rip), %xmm0     # 0x120d8
movapd %xmm0, %xmm1
movsd 0x18(%rsp), %xmm2
addsd %xmm2, %xmm1
subsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
movapd 0xb2d1(%rip), %xmm1     # 0x121a0
xorpd %xmm0, %xmm1
mulsd %xmm0, %xmm1
subsd %xmm2, %xmm1
mulsd 0xb1cd(%rip), %xmm1     # 0x120b0
testl %ebx, %ebx
je 0x6f07
movapd %xmm1, %xmm0
callq 0x22d0
xorpd 0xb2a8(%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_O1/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 0xaf90(%rip), %xmm0     # 0x12158
ucomiss %xmm0, %xmm1
jne 0x71d0
jp 0x71d0
retq
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x71ee
jp 0x71ee
cmpeqss %xmm0, %xmm2
movss 0xaf81(%rip), %xmm0     # 0x12168
andnps %xmm0, %xmm2
movaps %xmm2, %xmm0
retq
ucomiss %xmm0, %xmm2
jne 0x71f5
jnp 0x71cf
subq $0x38, %rsp
movaps %xmm2, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
ucomiss 0xaf58(%rip), %xmm1     # 0x12164
jbe 0x7252
movsd %xmm0, 0x8(%rsp)
callq 0x21c0
movaps %xmm0, %xmm1
mulsd 0xaf24(%rip), %xmm1     # 0x12148
movsd 0x8(%rsp), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, 0x18(%rsp)
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x726c
sqrtsd %xmm0, %xmm0
jmp 0x7271
callq 0x2170
movaps %xmm0, %xmm1
addsd 0xaed6(%rip), %xmm1     # 0x12138
movsd 0xaed6(%rip), %xmm2     # 0x12140
jmp 0x72bd
callq 0x22c0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x2170
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
divsd 0x8(%rsp), %xmm0
callq 0x2160
ucomisd 0xaead(%rip), %xmm0     # 0x12150
jb 0x72ae
xorps %xmm2, %xmm2
sqrtsd %xmm0, %xmm2
jmp 0x72b7
callq 0x22c0
movapd %xmm0, %xmm2
movsd 0x10(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rsp), %xmm0
callq 0x716c
movsd 0xadf5(%rip), %xmm1     # 0x120c8
minsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7368
pushq %r15
pushq %r14
pushq %rbx
movl 0x40(%rdi), %edx
movq 0x28(%rdi), %rax
movq 0x38(%rdi), %rsi
movq (%rsi), %rsi
movq (%rax), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %eax, %eax
cmpl %edx, %r10d
jae 0x7345
movq 0x28(%rdi), %r11
movq 0x38(%rdi), %r15
movq (%r11), %r11
movl (%r11,%r9,4), %r11d
leal (%rdx,%rax), %ebx
subl %r10d, %ebx
movl %r10d, %r14d
shlq $0x2, %r14
addq (%r15), %r14
cmpl %r11d, (%r14)
jae 0x7345
incl %eax
incl %r10d
addq $0x4, %r14
cmpl %r10d, %edx
jne 0x732d
movl %ebx, %eax
movl %edx, %r10d
movl %r10d, %r11d
movl (%rsi,%r11,4), %r11d
xorl %ebx, %ebx
cmpl (%r8,%r9,4), %r11d
sete %bl
addl %ebx, %r10d
incl %eax
incq %r9
cmpq %rcx, %r9
jne 0x7309
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x73a0
testq %r15, %r15
je 0x73c3
leaq 0xc832(%rip), %rsi      # 0x13bbb
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
leaq 0xc119(%rip), %rcx      # 0x134b3
cmovneq %r15, %rcx
jmp 0x73ca
testq %r15, %r15
je 0x73f4
leaq 0xc80f(%rip), %rsi      # 0x13bbb
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
leaq 0xc0f6(%rip), %rcx      # 0x134b3
cmovneq %r15, %rcx
jmp 0x73fb
leaq 0xc0e9(%rip), %rcx      # 0x134b3
leaq 0xc430(%rip), %rsi      # 0x13801
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x20e0
leaq 0xc447(%rip), %rsi      # 0x1382c
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x20e0
leaq 0xc0b8(%rip), %rcx      # 0x134b3
leaq 0xc3ff(%rip), %rsi      # 0x13801
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x21d0
leaq 0xc416(%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_O1/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 0x7463
ucomiss 0xad14(%rip), %xmm1     # 0x12158
jne 0x7489
jp 0x7489
leaq 0xc409(%rip), %rsi      # 0x13858
leaq 0xc05d(%rip), %r9       # 0x134b3
xorps %xmm1, %xmm1
movl %eax, %r8d
movb $0x2, %al
jmp 0x20e0
ucomiss 0xacee(%rip), %xmm1     # 0x12158
jne 0x74a2
jp 0x74a2
leaq 0xc3e3(%rip), %rsi      # 0x13858
leaq 0xc037(%rip), %r9       # 0x134b3
xorps %xmm1, %xmm1
movl %eax, %r8d
movb $0x2, %al
jmp 0x21d0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
leaq 0xc3d3(%rip), %rsi      # 0x1386b
movl %eax, %r8d
movb $0x3, %al
jmp 0x20e0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
leaq 0xc3ba(%rip), %rsi      # 0x1386b
movl %eax, %r8d
movb $0x3, %al
jmp 0x21d0
// File: /workspace/github_c_makefile_star2_O1/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)
jne 0x782c
movq %rdx, %r15
movl $0x4, %edi
movss %xmm0, 0x4(%rsp)
callq 0x3903
movq %rax, (%r14)
movl $0x4, %edi
callq 0x3903
movss 0x4(%rsp), %xmm0
movq %rax, 0x8(%r14)
movl $0x1, (%r15)
movq (%r14), %rax
movl %ebp, (%rax)
movq 0x8(%r14), %rax
movss %xmm0, (%rax)
movl $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x78ad
testl %esi, %esi
jle 0x78a6
movl %esi, %eax
xorl %ecx, %ecx
xorl %edx, %edx
imulq $0x68, %rcx, %r8
cmpb $0x0, 0xc(%rdi,%r8)
jne 0x789c
addq %rdi, %r8
cmpb $0x1, 0xd(%r8)
jne 0x789c
movl 0x8(%r8), %esi
addq %rsi, %rdx
movslq 0x18(%r8), %rsi
testq %rsi, %rsi
jle 0x789c
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 0x7887
incq %rcx
cmpq %rax, %rcx
jne 0x785a
jmp 0x78a8
xorl %edx, %edx
testq %rdx, %rdx
je 0x78d8
movq %rdx, %xmm1
punpckldq 0xa996(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xa99e(%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 0x2c32
// File: /workspace/github_c_makefile_star2_O1/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 0x79fb
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 0x7968
movq 0x38(%rbx), %rax
movq (%rax), %rdi
movslq %r13d, %r14
shlq $0x2, %r14
movq %r14, %rsi
movss %xmm0, 0x4(%rsp)
callq 0x3915
movq 0x38(%rbx), %rcx
movq %rax, (%rcx)
movq 0x8(%rcx), %rdi
movq %r14, %rsi
callq 0x3915
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 $0x2, %r13d
jl 0x79c6
movq 0x38(%rbx), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
cmpl $0x2, %eax
movl $0x1, %esi
cmovgel %eax, %esi
movb %r12b, %r15b
shll $0x2, %r15d
addq 0x10(%rbx), %r15
xorl %edi, %edi
movss 0xa7b7(%rip), %xmm2     # 0x12158
movl (%r15,%rdi,4), %r8d
movl %r8d, (%rcx,%rdi,4)
movaps %xmm0, %xmm1
testb $0x1, %bpl
jne 0x79b5
movaps %xmm2, %xmm1
movss %xmm1, (%rdx,%rdi,4)
xorb $0x1, %bpl
incq %rdi
cmpq %rdi, %rsi
jne 0x79a1
movl 0x8(%rbx), %edx
movq 0x38(%rbx), %rcx
movq (%rcx), %rsi
cltq
movl %edx, (%rsi,%rax,4)
testb $0x1, %bpl
jne 0x79e3
movss 0xa775(%rip), %xmm0     # 0x12158
movq 0x8(%rcx), %rcx
movss %xmm0, (%rcx,%rax,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 0x77e7
// File: /workspace/github_c_makefile_star2_O1/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 0x784a
movss %xmm0, 0xc(%rsp)
testl %r14d, %r14d
jne 0x7a73
testl %ebp, %ebp
jle 0x7a6a
movl %ebp, %r14d
cmpb $0x0, 0xc(%rbx)
jne 0x7a61
cmpb $0x1, 0xd(%rbx)
jne 0x7a61
movq %rbx, %rdi
movss 0xc(%rsp), %xmm0
callq 0x78dd
addq $0x68, %rbx
decq %r14
jne 0x7a47
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movss 0xc(%rsp), %xmm0
callq 0x2c4a
jmp 0x7a40
// File: /workspace/github_c_makefile_star2_O1/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 0xa6d7(%rip), %xmm1     # 0x1216c
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 0xa7b6(%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_O1/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 0x87d4
leaq 0x9c2f(%rip), %rcx      # 0x12344
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb (%rsi), %al
testb $0x4, %al
jne 0x8794
decw (%rdi)
movb (%rsi), %al
orb $0x4, %al
jmp 0x87d1
movzbl (%rsi), %eax
testb $0x18, %al
je 0x879c
addb $-0x8, %al
jmp 0x87d1
movzbl (%rsi), %eax
testb $0x10, %al
jne 0x878c
testb $0x4, %al
jne 0x87bb
decw (%rdi)
movb (%rsi), %al
addb $0xc, %al
jmp 0x87d1
movb (%rsi), %al
testb $0x7, %al
je 0x87a9
decb %al
jmp 0x87d1
movb (%rsi), %al
testb $0x6, %al
je 0x87b2
addb $-0x2, %al
jmp 0x87d1
movb (%rsi), %al
cmpb $0x40, %al
jae 0x8790
testb $0x4, %al
jne 0x87c1
decw (%rdi)
movb (%rsi), %al
orb $0x4, %al
jmp 0x87c3
movb (%rsi), %al
cmpb $0x20, %al
jae 0x8798
testb $0x4, %al
jne 0x87c7
decw (%rdi)
movb (%rsi), %al
orb $-0x7c, %al
jmp 0x87d1
andb $-0x11, %al
jmp 0x87d1
addb $-0x40, %al
jmp 0x87d1
andb $-0x5, %al
jmp 0x87d1
addb $-0x20, %al
jmp 0x87d1
testb $0x4, %al
jne 0x87cd
decw (%rdi)
movb (%rsi), %al
orb $0x14, %al
jmp 0x87d1
decw (%rdi)
movb (%rsi), %al
orb $0x7, %al
jmp 0x87d1
decw (%rdi)
movb (%rsi), %al
orb $0x6, %al
jmp 0x87d1
andb $-0x15, %al
addb $0x8, %al
jmp 0x87d1
andb $0x3b, %al
addb $0x60, %al
jmp 0x87d1
andb $0x1b, %al
orb $-0x80, %al
jmp 0x87d1
andb $-0x15, %al
orb $0x10, %al
movb %al, (%rsi)
retq
subq $0x88, %rsp
movzbl %dl, %edi
movq %rsp, %rsi
callq 0x2e09
// File: /workspace/github_c_makefile_star2_O1/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 0x881f
leaq 0xb165(%rip), %rsi      # 0x13976
xorl %eax, %eax
pushq %r11
pushq %rbx
pushq %r10
callq 0x20e0
jmp 0x8832
leaq 0xb150(%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_O1/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 0x8b10
movq %rdi, %xmm1
punpckldq 0x9766(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x976e(%rip), %xmm1     # 0x12260
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
addsd 0x95a6(%rip), %xmm0     # 0x120b0
cvttsd2si %xmm0, %ebx
jmp 0x8b17
xorl %ebx, %ebx
testb %sil, %sil
jne 0x8b1b
movl %ebx, %eax
popq %rbx
retq
callq 0x2ee0
jmp 0x8b17
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: processAvgExt
void processAvgExt(Aln** unpair, int unpairIdx,
    int unpairLen, double totalLen, uint64_t pairedPr,
    File bed, bool bedOpt, bool gzOut, bool ctrl,
    int sample, uint64_t* errCount, bool verbose) {

  // determine average fragment length
  int avgLen = calcAvgLen(totalLen, pairedPr, verbose);

  // process each alignment
  for (int i = 0; i <= unpairIdx; i++) {

    int end = (i == unpairIdx ? unpairLen : MAX_SIZE);
    for (int j = 0; j < end; j++) {

      Aln* a = unpair[i] + j;
      if (! avgLen)
        saveInterval(a->chrom, a->pos[0], a->pos[1], a->name,
          a->count, bed, bedOpt, gzOut, ctrl, sample,
          errCount, verbose);
      else if (a->strand)
        saveInterval(a->chrom, a->pos[0], a->pos[0] + avgLen,
          a->name, a->count, bed, bedOpt, gzOut, ctrl,
          sample, errCount, verbose);
      else
        saveInterval(a->chrom, (signed) (a->pos[1] - avgLen),
          a->pos[1], a->name, a->count, bed, bedOpt, gzOut,
          ctrl, sample, errCount, verbose);

      // free memory
      free(a->name);
    }

  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %r14d
movq %r8, 0x20(%rsp)
movl %edx, 0x2c(%rsp)
movl %esi, %ebx
movq %rdi, 0x40(%rsp)
movzbl 0xa0(%rsp), %esi
movq %rcx, %rdi
movq %rsi, 0x18(%rsp)
callq 0x8ad7
testl %ebx, %ebx
js 0x8c55
movl %eax, %r13d
movq %rbx, %rax
movl %eax, %ecx
movq %rcx, 0x30(%rsp)
incl %eax
movq %rax, 0x38(%rsp)
xorl %ebp, %ebp
movzbl 0x88(%rsp), %eax
movq %rax, 0x10(%rsp)
movzbl 0x80(%rsp), %eax
movq %rax, 0x8(%rsp)
movzbl %r14b, %r15d
cmpq 0x30(%rsp), %rbp
movl $0xfff0, %eax           # imm = 0xFFF0
cmovel 0x2c(%rsp), %eax
testl %eax, %eax
jle 0x8c47
movl %eax, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %r12
xorl %r14d, %r14d
movq 0x40(%rsp), %rax
movq (%rax,%rbp,8), %rbx
testl %r13d, %r13d
je 0x8bdd
movq 0x20(%rbx,%r14), %rdi
cmpb $0x1, 0x10(%rbx,%r14)
jne 0x8bed
movl (%rbx,%r14), %esi
leal (%rsi,%r13), %edx
jmp 0x8bfa
movq 0x20(%rbx,%r14), %rdi
movl (%rbx,%r14), %esi
movl 0x4(%rbx,%r14), %edx
jmp 0x8bfa
movl 0x4(%rbx,%r14), %edx
movl %edx, %eax
subl %r13d, %eax
movslq %eax, %rsi
movq 0x18(%rbx,%r14), %rcx
movzbl 0x11(%rbx,%r14), %r8d
movq 0x20(%rsp), %r9
pushq 0x18(%rsp)
pushq 0xa0(%rsp)
movl 0xa0(%rsp), %eax
pushq %rax
pushq 0x28(%rsp)
pushq 0x28(%rsp)
pushq %r15
callq 0x8838
addq $0x30, %rsp
movq 0x18(%rbx,%r14), %rdi
callq 0x2040
addq $0x28, %r14
cmpq %r14, %r12
jne 0x8bb8
incq %rbp
cmpq 0x38(%rsp), %rbp
jne 0x8b94
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: saveAvgExt
void saveAvgExt(char* qname, Aln* b, uint8_t count,
    Aln*** unpair, int* unpairIdx, int* unpairLen,
    int* unpairMem) {

  // alloc memory if necessary
  if (*unpairLen == 0 && *unpairIdx == *unpairMem) {
    *unpair = (Aln**) memrealloc(*unpair,
      (*unpairMem + 1) * sizeof(Aln*));
    (*unpair)[*unpairMem] = (Aln*) memalloc(MAX_SIZE
      * sizeof(Aln));
    (*unpairMem)++;
  }

  // copy alignment info
  Aln* a = (*unpair)[*unpairIdx] + *unpairLen;
  a->name = (char*) memalloc(1 + strlen(qname));
  strcpy(a->name, qname);
  a->chrom = b->chrom;
  a->strand = b->strand;
  a->pos[0] = b->pos[0];
  a->pos[1] = b->pos[1];
  a->count = count;

  (*unpairLen)++;
  if (*unpairLen == MAX_SIZE) {
    *unpairLen = 0;
    (*unpairIdx)++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r13
movl %edx, 0x4(%rsp)
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x0, (%r9)
jne 0x8cc6
movq 0x40(%rsp), %rbp
movslq (%rbp), %rax
cmpl %eax, (%rbx)
jne 0x8cc6
movq (%r13), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x3915
movq %rax, (%r13)
movl $0x27fd80, %edi         # imm = 0x27FD80
callq 0x3903
movq (%r13), %rcx
movslq (%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, (%rbp)
movq (%r13), %rax
movslq (%rbx), %rcx
movq (%rax,%rcx,8), %r13
movslq (%r14), %rax
leaq (%rax,%rax,4), %rbp
movq %r12, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x3903
movq %rax, 0x18(%r13,%rbp,8)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2070
movq 0x20(%r15), %rax
movq %rax, 0x20(%r13,%rbp,8)
movb 0x10(%r15), %al
movb %al, 0x10(%r13,%rbp,8)
movl (%r15), %eax
movl %eax, (%r13,%rbp,8)
movl 0x4(%r15), %eax
movl %eax, 0x4(%r13,%rbp,8)
movl 0x4(%rsp), %eax
movb %al, 0x11(%r13,%rbp,8)
movl (%r14), %eax
incl %eax
movl %eax, (%r14)
cmpl $0xfff0, %eax           # imm = 0xFFF0
jne 0x8d3d
movl $0x0, (%r14)
incl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: saveUnpair
void saveUnpair(char* qname, Aln* a, uint8_t count,
    bool extendOpt, int extend, bool atacOpt,
    int atacLen5, int atacLen3, bool atacAdj,
    File bed, bool bedOpt, bool gzOut, bool ctrl,
    int sample, uint64_t* errCount, bool verbose) {
  if (extendOpt) {
    if (a->strand)
      saveInterval(a->chrom, a->pos[0], a->pos[0] + extend,
        qname, count, bed, bedOpt, gzOut, ctrl, sample,
        errCount, verbose);
    else
      saveInterval(a->chrom, (signed) (a->pos[1] - extend),
        a->pos[1], qname, count, bed, bedOpt, gzOut, ctrl,
        sample, errCount, verbose);
  } else if (atacOpt) {
    if (a->strand) {
      if (atacAdj)
        a->pos[0] += ATACADJF;
      saveInterval(a->chrom, (signed) (a->pos[0] - atacLen5),
        a->pos[0] + atacLen3, qname, count, bed, bedOpt,
        gzOut, ctrl, sample, errCount, verbose);
    } else {
      if (atacAdj)
        a->pos[1] += ATACADJR;
      saveInterval(a->chrom, (signed) (a->pos[1] - atacLen3),
        a->pos[1] + atacLen5, qname, count, bed, bedOpt,
        gzOut, ctrl, sample, errCount, verbose);
    }
  } else
    saveInterval(a->chrom, a->pos[0], a->pos[1], qname,
      count, bed, bedOpt, gzOut, ctrl, sample, errCount,
      verbose);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %eax
movl %ecx, %r10d
movq %rdi, %rcx
movb 0x88(%rsp), %r12b
movq 0x80(%rsp), %rbx
movl 0x78(%rsp), %r11d
movb 0x70(%rsp), %r15b
movb 0x68(%rsp), %r14b
movb 0x60(%rsp), %bpl
movq 0x58(%rsp), %r9
testl %r10d, %r10d
je 0x8db8
movq 0x20(%rsi), %rdi
cmpb $0x1, 0x10(%rsi)
jne 0x8de9
movl (%rsi), %esi
addl %esi, %r8d
movzbl %r12b, %r10d
movzbl %r15b, %r15d
movzbl %r14b, %r14d
movzbl %bpl, %r12d
movzbl %dl, %eax
movq %r8, %rdx
movl %eax, %r8d
jmp 0x8e0b
testb %al, %al
je 0x8e18
movb 0x50(%rsp), %dil
movl 0x48(%rsp), %eax
movl 0x40(%rsp), %r10d
cmpb $0x1, 0x10(%rsi)
jne 0x8e5b
testb %dil, %dil
je 0x8ddc
addl $0x5, (%rsi)
movq 0x20(%rsi), %rdi
movl (%rsi), %esi
addl %esi, %eax
subl %r10d, %esi
jmp 0x8df1
movl 0x4(%rsi), %eax
movl %eax, %esi
subl %r8d, %esi
movslq %esi, %rsi
movzbl %r12b, %r10d
movzbl %r15b, %r15d
movzbl %r14b, %r14d
movzbl %bpl, %r12d
movzbl %dl, %r8d
movq %rax, %rdx
pushq %r10
pushq %rbx
pushq %r11
pushq %r15
pushq %r14
pushq %r12
jmp 0x8e47
movq 0x20(%rsi), %rdi
movl (%rsi), %eax
movl 0x4(%rsi), %r10d
movzbl %r12b, %r12d
movzbl %r15b, %r15d
movzbl %r14b, %r14d
movzbl %bpl, %r13d
movzbl %dl, %r8d
movq %rax, %rsi
movq %r10, %rdx
pushq %r12
pushq %rbx
pushq %r11
pushq %r15
pushq %r14
pushq %r13
callq 0x8838
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb %dil, %dil
je 0x8e64
addl $-0x5, 0x4(%rsi)
movq 0x20(%rsi), %rdi
movl 0x4(%rsi), %esi
addl %esi, %r10d
subl %eax, %esi
movslq %esi, %rsi
movzbl %r12b, %eax
movzbl %r15b, %r15d
movzbl %r14b, %r14d
movzbl %bpl, %r12d
movzbl %dl, %r8d
movq %r10, %rdx
pushq %rax
jmp 0x8e0d
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: saveFragAtac
uint32_t saveFragAtac(Chrom* c, uint32_t start,
    uint32_t end, int atacLen5, int atacLen3, bool atacAdj,
    char* qname, uint8_t count, File bed, bool bedOpt,
    bool gzOut, bool ctrl, int sample, uint64_t* errCount,
    bool verbose) {
  if (atacAdj) {
    start += ATACADJF;
    end += ATACADJR;
  }
  if (start + atacLen3 >= (signed) (end - atacLen3))
    // expanded intervals overlap: just save one
    return saveInterval(c, (signed) (start - atacLen5),
      end + atacLen5, qname, count, bed, bedOpt, gzOut,
      ctrl, sample, errCount, verbose);
  // save two intervals
  return saveInterval(c, (signed) (start - atacLen5),
      start + atacLen3, qname, count, bed, bedOpt,
      gzOut, ctrl, sample, errCount, verbose)
    + saveInterval(c, (signed) (end - atacLen3),
      end + atacLen5, qname, count, bed, bedOpt,
      gzOut, ctrl, sample, errCount, verbose);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebp
movb 0xa0(%rsp), %r10b
movl 0x90(%rsp), %r14d
movb 0x88(%rsp), %r11b
movb 0x80(%rsp), %r13b
movb 0x78(%rsp), %cl
movb 0x68(%rsp), %al
leal 0x5(%rsi), %r15d
leal -0x5(%rdx), %r12d
testl %r9d, %r9d
cmovel %edx, %r12d
cmovel %esi, %r15d
leal (%r15,%r8), %edx
movl %r12d, %ebx
subl %r8d, %ebx
subl %ebp, %r15d
movslq %r15d, %rsi
cmpl %ebx, %edx
jae 0x8f91
movl %edx, %edx
movq %rdi, 0x10(%rsp)
movzbl %r10b, %r14d
movzbl %r11b, %r15d
movzbl %r13b, %r11d
movq %r11, 0x18(%rsp)
movzbl %cl, %r10d
movq %r10, 0x20(%rsp)
movzbl %al, %r13d
movq 0x60(%rsp), %rcx
movl %r13d, %r8d
movq 0x70(%rsp), %r9
pushq %r14
movq 0xa0(%rsp), %rax
pushq %rax
movl 0xa0(%rsp), %eax
pushq %rax
pushq %r15
pushq %r11
pushq %r10
callq 0x8838
addq $0x30, %rsp
movl %eax, 0xc(%rsp)
movslq %ebx, %rsi
addl %ebp, %r12d
movq 0x10(%rsp), %rdi
movq %r12, %rdx
movq 0x60(%rsp), %rcx
movl %r13d, %r8d
movq 0x70(%rsp), %r9
pushq %r14
pushq 0xa0(%rsp)
movl 0xa0(%rsp), %eax
pushq %rax
pushq %r15
pushq 0x38(%rsp)
pushq 0x48(%rsp)
callq 0x8838
addq $0x30, %rsp
addl 0xc(%rsp), %eax
addq $0x28, %rsp
jmp 0x8fce
addl %ebp, %r12d
movzbl %r10b, %r10d
movzbl %r11b, %r11d
movzbl %r13b, %ebx
movzbl %cl, %r15d
movzbl %al, %r8d
movq %r12, %rdx
movq 0x60(%rsp), %rcx
movq 0x70(%rsp), %r9
pushq %r10
pushq 0xa0(%rsp)
pushq %r14
pushq %r11
pushq %rbx
pushq %r15
callq 0x8838
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: saveFragment
uint32_t saveFragment(char* qname, Aln* a, uint8_t count,
    bool atacOpt, int atacLen5, int atacLen3, bool atacAdj,
    File bed, bool bedOpt, bool gzOut, bool ctrl,
    int sample, uint64_t* errCount, bool verbose) {
  // ensure start < end
  uint32_t start, end;
  if (a->pos[0] > a->pos[1]) {
    start = a->pos[1];
    end = a->pos[0];
  } else {
    start = a->pos[0];
    end = a->pos[1];
  }
  if (atacOpt)
    return saveFragAtac(a->chrom, start, end, atacLen5,
      atacLen3, atacAdj, qname, count, bed, bedOpt,
      gzOut, ctrl, sample, errCount, verbose);
  return saveInterval(a->chrom, start, end, qname,
    count, bed, bedOpt, gzOut, ctrl, sample, errCount,
    verbose);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rax
movb 0x78(%rsp), %r13b
movb 0x60(%rsp), %r14b
movb 0x58(%rsp), %r12b
movb 0x50(%rsp), %bpl
movq 0x48(%rsp), %r15
movl (%rsi), %edi
movl 0x4(%rsi), %ebx
cmpl %ebx, %edi
movl %ebx, %r11d
cmovbl %edi, %r11d
cmoval %edi, %ebx
testl %ecx, %ecx
je 0x9074
movb 0x40(%rsp), %cl
movq 0x20(%rsi), %rdi
subq $0x8, %rsp
movzbl %r13b, %r13d
movzbl %r14b, %r14d
movzbl %r12b, %r12d
movzbl %bpl, %r10d
movzbl %dl, %r15d
movzbl %cl, %ebp
movl %r11d, %esi
movl %ebx, %edx
movl %r8d, %ecx
movl %r9d, %r8d
movl %ebp, %r9d
pushq %r13
pushq 0x80(%rsp)
movl 0x80(%rsp), %r11d
pushq %r11
pushq %r14
pushq %r12
pushq %r10
pushq 0x80(%rsp)
pushq %r15
pushq %rax
callq 0x8e8d
addq $0x58, %rsp
jmp 0x90b3
movq 0x20(%rsi), %rdi
movl %r11d, %esi
movl %ebx, %ecx
movzbl %r13b, %r10d
movzbl %r14b, %r11d
movzbl %r12b, %ebx
movzbl %bpl, %r14d
movzbl %dl, %r8d
movq %rcx, %rdx
movq %rax, %rcx
movq %r15, %r9
pushq %r10
pushq 0x78(%rsp)
movl 0x78(%rsp), %eax
pushq %rax
pushq %r11
pushq %rbx
pushq %r14
callq 0x8838
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: createRead
Read* createRead(Read*** read, int* readIdx,
    int* readLen, int* readMem) {
  // alloc memory if necessary
  if (*readLen == 0 && *readIdx == *readMem) {
    // check if max. number of reads exceeded
    if ((*readMem + 1) * MAX_SIZE > UINT32_MAX) {
      char msg[MAX_ALNS];
      sprintf(msg, "Exceeded max. number of reads (%u)",
        UINT32_MAX);
      exit(error(msg, ERRISSUE));
    }

    *read = (Read**) memrealloc(*read,
      (*readMem + 1) * sizeof(Read*));
    (*read)[*readMem] = (Read*) memalloc(MAX_SIZE
      * sizeof(Read));
    (*readMem)++;
  }
  Read* r = (*read)[*readIdx] + *readLen;

  // update indexes
  (*readLen)++;
  if (*readLen == MAX_SIZE) {
    *readLen = 0;
    (*readIdx)++;
  }
  return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
cmpl $0x0, (%rdx)
jne 0x910e
movq %rcx, %r15
movslq (%rcx), %rax
cmpl %eax, (%rbx)
jne 0x910e
movq (%r12), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x3915
movq %rax, (%r12)
movl $0x2ffd00, %edi         # imm = 0x2FFD00
callq 0x3903
movq (%r12), %rcx
movslq (%r15), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, (%r15)
movq (%r12), %rax
movslq (%rbx), %rcx
movq (%rax,%rcx,8), %rax
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
cmpl $0xfff0, %edx           # imm = 0xFFF0
jne 0x9133
movl $0x0, (%r14)
incl (%rbx)
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: copyAlns
void copyAlns(Aln* aln, int alnLen, float score,
    float asDiff, bool first, Aln** dest,
    uint8_t* destLen) {
  // adjust AS tolerance for secondary alns
  if (score != NOSCORE)
    score -= asDiff;

  // determine number of valid single alignments
  uint8_t count = 0;
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (! a->paired && a->first == first
        && a->score >= score)
      count++;
  }
  *dest = (Aln*) memalloc(count * sizeof(Aln));
  *destLen = count;

  // copy alignment info for valid alignments
  uint8_t j = 0;  // index into r->aln
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (! a->paired && a->first == first
        && a->score >= score) {
      Aln* b = *dest + j;
      b->paired = a->paired;
      b->first = a->first;
      b->strand = a->strand;
      b->score = a->score;
      b->chrom = a->chrom;
      b->pos[0] = a->pos[0];
      b->pos[1] = a->pos[1];
      j++;
    }
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x8(%rsp)
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
movaps %xmm0, %xmm2
subss %xmm1, %xmm2
movss 0x9001(%rip), %xmm1     # 0x12178
cmpneqss %xmm0, %xmm1
andps %xmm1, %xmm2
andnps %xmm0, %xmm1
orps %xmm2, %xmm1
movl %esi, %r13d
testl %esi, %esi
jle 0x91c4
leaq (,%r13,8), %rax
leaq (%rax,%rax,4), %rcx
xorl %edx, %edx
xorl %eax, %eax
cmpb $0x0, 0xd(%r14,%rdx)
jne 0x91b9
cmpb %bpl, 0xf(%r14,%rdx)
jne 0x91b9
movss 0x8(%r14,%rdx), %xmm0
ucomiss %xmm1, %xmm0
jb 0x91b9
incb %al
addq $0x28, %rdx
cmpq %rdx, %rcx
jne 0x919c
jmp 0x91c6
xorl %eax, %eax
movzbl %al, %r15d
leal (,%r15,8), %eax
leaq (%rax,%rax,4), %rdi
movaps %xmm1, 0x10(%rsp)
callq 0x3903
movaps 0x10(%rsp), %xmm1
movq %rax, (%rbx)
movq 0x8(%rsp), %rax
movb %r15b, (%rax)
testl %r12d, %r12d
jle 0x9273
shlq $0x3, %r13
leaq (,%r13,4), %rax
addq %r13, %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpb $0x0, 0xd(%r14,%rcx)
jne 0x926a
movb 0xf(%r14,%rcx), %sil
cmpb %bpl, %sil
jne 0x926a
movss 0x8(%r14,%rcx), %xmm0
ucomiss %xmm1, %xmm0
jb 0x926a
movq (%rbx), %rdi
movzbl %dl, %edx
leaq (%rdx,%rdx,4), %r8
movb $0x0, 0xd(%rdi,%r8,8)
movb %sil, 0xf(%rdi,%r8,8)
movb 0x10(%r14,%rcx), %sil
movb %sil, 0x10(%rdi,%r8,8)
movss %xmm0, 0x8(%rdi,%r8,8)
movq 0x20(%r14,%rcx), %rsi
movq %rsi, 0x20(%rdi,%r8,8)
movl (%r14,%rcx), %esi
movl %esi, (%rdi,%r8,8)
movl 0x4(%r14,%rcx), %esi
movl %esi, 0x4(%rdi,%r8,8)
incb %dl
addq $0x28, %rcx
cmpq %rcx, %rax
jne 0x9208
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: saveAlnsSingle
void saveAlnsSingle(char* qname, Aln* aln, int alnLen,
    float score, float asDiff, bool first, Read* r,
    uint16_t qual) {
  // populate Read* struct
  r->name = (char*) memalloc(1 + strlen(qname));
  strcpy(r->name, qname);
  r->qual = qual;
  r->first = first;
  r->score = score;

  // copy alignments to struct
  copyAlns(aln, alnLen, score, asDiff, first, &r->aln,
    &r->alnLen);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r14d
movq %r8, %rbx
movl %ecx, %ebp
movss %xmm1, 0x4(%rsp)
movss %xmm0, (%rsp)
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r13
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x3903
movq %rax, (%rbx)
movq %rax, %rdi
movq %r13, %rsi
callq 0x2070
movw %r14w, 0x22(%rbx)
movb %bpl, 0x24(%rbx)
movss (%rsp), %xmm0
movss %xmm0, 0x28(%rbx)
leaq 0x8(%rbx), %rcx
addq $0x10, %rbx
movq %r12, %rdi
movl %r15d, %esi
movss 0x4(%rsp), %xmm1
movl %ebp, %edx
movq %rbx, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x914a
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: saveAlnsDiscord
void saveAlnsDiscord(char* qname, Aln* aln, int alnLen,
    float scoreR1, float scoreR2, float asDiff,
    Read* r, uint16_t qualR1, uint16_t qualR2) {
  // save R1 alignments
  saveAlnsSingle(qname, aln, alnLen, scoreR1, asDiff,
    true, r, qualR1);
  // save R2 alignments
  copyAlns(aln, alnLen, scoreR2, asDiff, false, &r->alnR2,
    &r->alnLenR2);
  r->qual = MIN(qualR1 + qualR2, UINT16_MAX);
  r->scoreR2 = scoreR2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r9d, %ebx
movl %r8d, %ebp
movq %rcx, %r14
movss %xmm2, 0xc(%rsp)
movss %xmm1, 0x8(%rsp)
movl %edx, %r15d
movq %rsi, %r12
movaps %xmm2, %xmm1
movl $0x1, %ecx
movq %r14, %r8
movl %ebp, %r9d
callq 0x9282
leaq 0x18(%r14), %rcx
leaq 0x20(%r14), %r8
movq %r12, %rdi
movl %r15d, %esi
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
xorl %edx, %edx
callq 0x914a
addl %ebp, %ebx
movl $0xffff, %eax           # imm = 0xFFFF
cmpl %eax, %ebx
cmovael %eax, %ebx
movw %bx, 0x22(%r14)
movss 0x8(%rsp), %xmm0
movss %xmm0, 0x2c(%r14)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: subsampleSingle
void subsampleSingle(Aln* aln, int alnLen, bool first,
    uint8_t* count, float* score) {

  // insertion sort of aln scores
  float arr[*count];  // sorted array of aln scores
  int k = 0;          // count of valid alns analyzed
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (! a->paired && a->first == first
        && a->score >= *score && a->chrom->save
        && ! a->chrom->skip) {

      // insert a->score into array
      int j;
      for (j = 0; j < k; j++)
        if (a->score > arr[j])
          break;
      for (int m = k; m > j; m--)
        arr[m] = arr[m - 1];
      arr[j] = a->score;
      k++;

    }
  }

  *count = *count > 10 ? 10 : *count - 1; // update count of alns to keep
  *score = arr[*count - 1];               // save new min. score
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movzbl (%rcx), %r9d
leal 0xf(,%r9,4), %r10d
andl $-0x10, %r10d
movq %rsp, %rax
subq %r10, %rax
movq %rax, %rsp
testl %esi, %esi
jle 0x974b
movl %esi, %esi
xorl %r10d, %r10d
xorl %r11d, %r11d
leaq (%r10,%r10,4), %rbx
cmpb $0x0, 0xd(%rdi,%rbx,8)
jne 0x9743
leaq (%rdi,%rbx,8), %rbx
cmpb %dl, 0xf(%rbx)
jne 0x9743
movss 0x8(%rbx), %xmm0
ucomiss (%r8), %xmm0
jb 0x9743
movq 0x20(%rbx), %rbx
cmpb $0x1, 0xd(%rbx)
jne 0x9743
cmpb $0x0, 0xc(%rbx)
jne 0x9743
testl %r11d, %r11d
jle 0x9717
movl %r11d, %r14d
xorl %ebx, %ebx
ucomiss (%rax,%rbx,4), %xmm0
ja 0x9719
incq %rbx
cmpq %rbx, %r14
jne 0x9704
movl %r14d, %ebx
jmp 0x9719
xorl %ebx, %ebx
cmpl %ebx, %r11d
jle 0x9739
movslq %r11d, %r14
movslq %ebx, %r15
movss -0x4(%rax,%r14,4), %xmm1
movss %xmm1, (%rax,%r14,4)
decq %r14
cmpq %r15, %r14
jg 0x9724
movl %ebx, %ebx
movss %xmm0, (%rax,%rbx,4)
incl %r11d
incq %r10
cmpq %rsi, %r10
jne 0x96cb
leal -0x1(%r9), %edx
cmpb $0xb, %r9b
movzbl %dl, %edx
movl $0xa, %esi
cmovbl %edx, %esi
movb %sil, (%rcx)
movzbl %sil, %ecx
movss -0x4(%rax,%rcx,4), %xmm0
movss %xmm0, (%r8)
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: subsamplePair
void subsamplePair(Aln* aln, int alnLen, uint8_t* count,
    float* score) {

  // insertion sort of aln scores
  float arr[*count];  // sorted array of aln scores
  int k = 0;          // count of valid alns analyzed
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (a->paired && a->full && a->score >= *score
        && a->chrom->save && ! a->chrom->skip) {

      // insert a->score into array
      int j;
      for (j = 0; j < k; j++)
        if (a->score > arr[j])
          break;
      for (int m = k; m > j; m--)
        arr[m] = arr[m - 1];
      arr[j] = a->score;
      k++;

    }
  }

  *count = *count > 10 ? 10 : *count - 1; // update count of alns to keep
  *score = arr[*count - 1];               // save new min. score
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movzbl (%rdx), %r8d
leal 0xf(,%r8,4), %r9d
andl $-0x10, %r9d
movq %rsp, %rax
subq %r9, %rax
movq %rax, %rsp
testl %esi, %esi
jle 0x9ae8
movl %esi, %esi
xorl %r9d, %r9d
xorl %r10d, %r10d
leaq (%r9,%r9,4), %r11
cmpb $0x1, 0xd(%rdi,%r11,8)
jne 0x9adc
leaq (%rdi,%r11,8), %r11
cmpb $0x1, 0xe(%r11)
jne 0x9adc
movss 0x8(%r11), %xmm0
ucomiss (%rcx), %xmm0
jb 0x9adc
movq 0x20(%r11), %r11
cmpb $0x1, 0xd(%r11)
jne 0x9adc
cmpb $0x0, 0xc(%r11)
jne 0x9adc
testl %r10d, %r10d
jle 0x9aaf
movl %r10d, %ebx
xorl %r11d, %r11d
ucomiss (%rax,%r11,4), %xmm0
ja 0x9ab2
incq %r11
cmpq %r11, %rbx
jne 0x9a9b
movl %ebx, %r11d
jmp 0x9ab2
xorl %r11d, %r11d
cmpl %r11d, %r10d
jle 0x9ad0
movslq %r10d, %rbx
movslq %r11d, %r14
movss -0x4(%rax,%rbx,4), %xmm1
movss %xmm1, (%rax,%rbx,4)
decq %rbx
cmpq %r14, %rbx
jg 0x9abd
movl %r11d, %r11d
movss %xmm0, (%rax,%r11,4)
incl %r10d
incq %r9
cmpq %rsi, %r9
jne 0x9a5c
leal -0x1(%r8), %esi
cmpb $0xb, %r8b
movzbl %sil, %esi
movl $0xa, %edi
cmovbl %esi, %edi
movb %dil, (%rdx)
movzbl %dil, %edx
movss -0x4(%rax,%rdx,4), %xmm0
movss %xmm0, (%rcx)
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: johnSort
void johnSort(uint16_t* qual, uint32_t* order,
    uint32_t low, uint32_t high, uint16_t* qual0,
    uint16_t* qual1, uint16_t* qual2, uint32_t* order0,
    uint32_t* order1, uint32_t* order2) {
  if (low + 1 < high) {
    uint32_t idx1 = 0; // new low index for upper recursive call
    uint32_t idx = johnPartition(qual, order, low, high,
      qual0, qual1, qual2, order0, order1, order2, &idx1);
    if (idx)
      // lower recursive call
      johnSort(qual, order, low, idx, qual0, qual1,
        qual2, order0, order1, order2);
    if (idx1)
      // upper recursive call
      johnSort(qual, order, idx1, high, qual0, qual1,
        qual2, order0, order1, order2);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r13d
leal 0x1(%r13), %eax
cmpl %ecx, %eax
jae 0xa3e1
movq %r9, %rbx
movq %r8, %r14
movl %ecx, %ebp
movq %rsi, %r15
movq %rdi, %r12
leaq 0x4(%rsp), %rax
movl $0x0, (%rax)
subq $0x8, %rsp
movl %r13d, %edx
pushq %rax
pushq 0x68(%rsp)
pushq 0x68(%rsp)
pushq 0x68(%rsp)
pushq 0x68(%rsp)
callq 0xa19b
addq $0x30, %rsp
testl %eax, %eax
je 0xa3a7
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %eax, %ecx
movq %r14, %r8
movq %rbx, %r9
pushq 0x58(%rsp)
pushq 0x58(%rsp)
pushq 0x58(%rsp)
pushq 0x58(%rsp)
callq 0xa325
addq $0x20, %rsp
movq 0x58(%rsp), %r13
movq 0x50(%rsp), %r11
movq 0x48(%rsp), %r10
movq 0x40(%rsp), %rax
movl 0x4(%rsp), %edx
testl %edx, %edx
je 0xa3e1
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movq %r14, %r8
movq %rbx, %r9
pushq %r13
pushq %r11
pushq %r10
pushq %rax
callq 0xa325
addq $0x20, %rsp
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq