LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x8bb4
testl %ebx, %ebx
js 0x8d32
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 0x8d24
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 0x8cba
movq 0x20(%rbx,%r14), %rdi
cmpb $0x1, 0x10(%rbx,%r14)
jne 0x8cca
movl (%rbx,%r14), %esi
leal (%rsi,%r13), %edx
jmp 0x8cd7
movq 0x20(%rbx,%r14), %rdi
movl (%rbx,%r14), %esi
movl 0x4(%rbx,%r14), %edx
jmp 0x8cd7
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 0x88e6
addq $0x30, %rsp
movq 0x18(%rbx,%r14), %rdi
callq 0x2040
addq $0x28, %r14
cmpq %r14, %r12
jne 0x8c95
incq %rbp
cmpq 0x38(%rsp), %rbp
jne 0x8c71
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: 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
movl (%r9), %ecx
movl (%r8), %eax
testl %ecx, %ecx
jne 0x8dad
movq 0x40(%rsp), %rbp
xorl %ecx, %ecx
cmpl (%rbp), %eax
jne 0x8dad
cltq
movq (%r13), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x3925
movq %rax, (%r13)
movl $0x27fd80, %edi         # imm = 0x27FD80
callq 0x3913
movq (%r13), %rcx
movslq (%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, (%rbp)
movl (%rbx), %eax
movl (%r14), %ecx
movq (%r13), %rdx
cltq
movq (%rdx,%rax,8), %r13
movslq %ecx, %rax
leaq (%rax,%rax,4), %rbp
movq %r12, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x3913
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 0x8e23
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_O3/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 0x8e9e
movq 0x20(%rsi), %rdi
cmpb $0x1, 0x10(%rsi)
jne 0x8edb
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 0x8efd
testb %al, %al
je 0x8f0a
movb 0x50(%rsp), %dil
movl 0x48(%rsp), %eax
movl 0x40(%rsp), %r10d
cmpb $0x1, 0x10(%rsi)
jne 0x8f4d
movl (%rsi), %r8d
testb %dil, %dil
je 0x8ec9
addl $0x5, %r8d
movl %r8d, (%rsi)
movq 0x20(%rsi), %rdi
movl %r8d, %esi
subl %r10d, %esi
movslq %esi, %rsi
addl %r8d, %eax
jmp 0x8ee6
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 0x8f39
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 0x88e6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rsi), %r8d
testb %dil, %dil
je 0x8f5e
addl $-0x5, %r8d
movl %r8d, 0x4(%rsi)
movq 0x20(%rsi), %rdi
movl %r8d, %esi
subl %eax, %esi
movslq %esi, %rsi
addl %r8d, %r10d
movzbl %r12b, %eax
movzbl %r15b, %r15d
movzbl %r14b, %r14d
movzbl %bpl, %r12d
movzbl %dl, %r8d
movq %r10, %rdx
pushq %rax
jmp 0x8eff
// File: /workspace/github_c_makefile_star2_O3/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 0x9171
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 0x8f8a
addq $0x58, %rsp
jmp 0x91b0
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 0x88e6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: 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 %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl (%rdx), %eax
movl (%rsi), %ecx
testl %eax, %eax
jne 0x9214
movslq %ecx, %rax
cmpl (%r12), %eax
jne 0x923b
movq (%r15), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x3925
movq %rax, (%r15)
movl $0x2ffd00, %edi         # imm = 0x2FFD00
callq 0x3913
movq (%r15), %rcx
movslq (%r12), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, (%r12)
movl (%r14), %ecx
movl (%rbx), %eax
movq (%r15), %rdx
movslq %ecx, %rcx
movq (%rdx,%rcx,8), %rcx
leal 0x1(%rax), %edx
movl %edx, (%rbx)
cmpl $0xfff0, %edx           # imm = 0xFFF0
jne 0x924a
movl $0x0, (%rbx)
incl (%r14)
movl $0xffef, %eax           # imm = 0xFFEF
jmp 0x924a
movq (%r15), %rcx
movq (%rcx,%rax,8), %rcx
movl $0x1, (%rbx)
xorl %eax, %eax
cltq
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r15
movq %rcx, %rbx
testl %esi, %esi
jle 0x9390
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
movq %r15, 0x8(%rsp)
movaps %xmm0, %xmm2
subss %xmm1, %xmm2
movss 0x8ed9(%rip), %xmm1     # 0x12174
cmpneqss %xmm0, %xmm1
andps %xmm1, %xmm2
andnps %xmm0, %xmm1
orps %xmm2, %xmm1
movl %esi, %r13d
leaq (,%r13,8), %rax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpb $0x0, 0xd(%r14,%rcx)
jne 0x92d9
cmpb %bpl, 0xf(%r14,%rcx)
jne 0x92d9
movss 0x8(%r14,%rcx), %xmm0
ucomiss %xmm1, %xmm0
jb 0x92d9
incb %dl
addq $0x28, %rcx
cmpq %rcx, %rax
jne 0x92bc
movzbl %dl, %r15d
leal (,%r15,8), %eax
leaq (%rax,%rax,4), %rdi
movaps %xmm1, 0x10(%rsp)
callq 0x3913
movaps 0x10(%rsp), %xmm1
movq %rax, (%rbx)
movq 0x8(%rsp), %rax
movb %r15b, (%rax)
testl %r12d, %r12d
jle 0x939e
shlq $0x3, %r13
leaq (,%r13,4), %rax
addq %r13, %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpb $0x0, 0xd(%r14,%rcx)
jne 0x9385
cmpb %bpl, 0xf(%r14,%rcx)
jne 0x9385
movss 0x8(%r14,%rcx), %xmm0
ucomiss %xmm1, %xmm0
jb 0x9385
movq (%rbx), %rsi
movzbl %dl, %edx
leaq (%rdx,%rdx,4), %rdi
movb $0x0, 0xd(%rsi,%rdi,8)
movb %bpl, 0xf(%rsi,%rdi,8)
movb 0x10(%r14,%rcx), %r8b
movb %r8b, 0x10(%rsi,%rdi,8)
movss %xmm0, 0x8(%rsi,%rdi,8)
movq 0x20(%r14,%rcx), %r8
movq %r8, 0x20(%rsi,%rdi,8)
movl (%r14,%rcx), %r8d
movl %r8d, (%rsi,%rdi,8)
movl 0x4(%r14,%rcx), %r8d
movl %r8d, 0x4(%rsi,%rdi,8)
incb %dl
addq $0x28, %rcx
cmpq %rcx, %rax
jne 0x9328
jmp 0x939e
xorl %edi, %edi
callq 0x3913
movq %rax, (%rbx)
movb $0x0, (%r15)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: 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 0x9876
movl %esi, %esi
xorl %r10d, %r10d
xorl %r11d, %r11d
leaq (%r10,%r10,4), %rbx
cmpb $0x0, 0xd(%rdi,%rbx,8)
jne 0x986e
leaq (%rdi,%rbx,8), %rbx
cmpb %dl, 0xf(%rbx)
jne 0x986e
movss 0x8(%rbx), %xmm0
ucomiss (%r8), %xmm0
jb 0x986e
movq 0x20(%rbx), %rbx
cmpb $0x1, 0xd(%rbx)
jne 0x986e
cmpb $0x0, 0xc(%rbx)
jne 0x986e
testl %r11d, %r11d
jle 0x9842
movl %r11d, %r14d
xorl %ebx, %ebx
ucomiss (%rax,%rbx,4), %xmm0
ja 0x9844
incq %rbx
cmpq %rbx, %r14
jne 0x982f
movl %r14d, %ebx
jmp 0x9844
xorl %ebx, %ebx
cmpl %ebx, %r11d
jle 0x9864
movslq %r11d, %r14
movslq %ebx, %r15
movss -0x4(%rax,%r14,4), %xmm1
movss %xmm1, (%rax,%r14,4)
decq %r14
cmpq %r15, %r14
jg 0x984f
movl %ebx, %ebx
movss %xmm0, (%rax,%rbx,4)
incl %r11d
incq %r10
cmpq %rsi, %r10
jne 0x97f6
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_O3/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 0x9c3c
movl %esi, %esi
xorl %r9d, %r9d
xorl %r10d, %r10d
leaq (%r9,%r9,4), %r11
cmpb $0x1, 0xd(%rdi,%r11,8)
jne 0x9c30
leaq (%rdi,%r11,8), %r11
cmpb $0x1, 0xe(%r11)
jne 0x9c30
movss 0x8(%r11), %xmm0
ucomiss (%rcx), %xmm0
jb 0x9c30
movq 0x20(%r11), %r11
cmpb $0x1, 0xd(%r11)
jne 0x9c30
cmpb $0x0, 0xc(%r11)
jne 0x9c30
testl %r10d, %r10d
jle 0x9c03
movl %r10d, %ebx
xorl %r11d, %r11d
ucomiss (%rax,%r11,4), %xmm0
ja 0x9c06
incq %r11
cmpq %r11, %rbx
jne 0x9bef
movl %ebx, %r11d
jmp 0x9c06
xorl %r11d, %r11d
cmpl %r11d, %r10d
jle 0x9c24
movslq %r10d, %rbx
movslq %r11d, %r14
movss -0x4(%rax,%rbx,4), %xmm1
movss %xmm1, (%rax,%rbx,4)
decq %rbx
cmpq %r14, %rbx
jg 0x9c11
movl %r11d, %r11d
movss %xmm0, (%rax,%r11,4)
incl %r10d
incq %r9
cmpq %rsi, %r9
jne 0x9bb0
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_O3/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 0xa563
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 0xa347
addq $0x30, %rsp
testl %eax, %eax
je 0xa529
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 0xa4a7
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 0xa563
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movq %r14, %r8
movq %rbx, %r9
pushq %r13
pushq %r11
pushq %r10
pushq %rax
callq 0xa4a7
addq $0x20, %rsp
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: sortReads
void sortReads(Read** arr, uint32_t count, uint32_t* order,
    uint16_t* qual, uint32_t* order0, uint32_t* order1,
    uint32_t* order2, uint16_t* qual0, uint16_t* qual1,
    uint16_t* qual2) {

  // initialize order and qual arrays
  for (uint32_t i = 0; i < count; i++) {
    order[i] = i;
    qual[i] = (arr[i / MAX_SIZE] + i % MAX_SIZE)->qual;
  }

  // initialize johnSort()
  johnSort(qual, order, 0, count, qual0, qual1, qual2,
    order0, order1, order2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r11
movq %r8, %r10
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ecx
movq 0x50(%rsp), %r9
movq 0x48(%rsp), %r8
movq 0x40(%rsp), %r12
testl %esi, %esi
je 0xa5fc
movl %ecx, %esi
movl $0x22, %r13d
xorl %ebp, %ebp
movabsq $0x800800800800801, %r15 # imm = 0x800800800800801
movq %rbp, %rax
shrq $0x4, %rax
mulq %r15
shrq $0x7, %rdx
imulq $0x2ffd00, %rdx, %rax   # imm = 0x2FFD00
movq %r13, %rdx
subq %rax, %rdx
movl %ebp, (%r14,%rbp,4)
movl %ebp, %eax
shrl $0x4, %eax
imulq $0x10010011, %rax, %rax # imm = 0x10010011
shrq $0x25, %rax
andl $-0x8, %eax
movq (%rdi,%rax), %rax
movzwl (%rax,%rdx), %eax
movw %ax, (%rbx,%rbp,2)
incq %rbp
addq $0x30, %r13
cmpq %rbp, %rsi
jne 0xa5b2
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
pushq %r12
pushq %r11
pushq %r10
pushq 0x70(%rsp)
callq 0xa4a7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: calcHashSize
uint32_t calcHashSize(uint32_t count) {
  uint32_t size = 2;
  uint32_t val = MIN(UINT32_MAX, 4 * count / 3);
  for (int i = 1; i < 31; i++) {
    if (size >= val)
      return size;
    size *= 2;
  }
  // max size 2^31
  return size;
}

// Assembly:
shll $0x2, %edi
movl $0x2, %eax
cmpl $0x9, %edi
jb 0xa64e
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rdi, %rcx
shrq $0x21, %rcx
movl $0x1, %edx
addl %eax, %eax
cmpl $0x1d, %edx
ja 0xa64e
incl %edx
cmpl %ecx, %eax
jb 0xa641
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: jenkins_hash_aln
uint32_t jenkins_hash_aln(Chrom* chrom, Chrom* chrom1,
    uint32_t pos, uint32_t pos1, bool strand, bool strand1,
    int alignType, uint32_t hashSize) {
  uint32_t hash = 0;
  unsigned char* p;

  // hash Chrom*
  int end = (alignType == DISCORD ? 2 : 1);
  for (int j = 0; j < end; j++) {
    p = (unsigned char*) (j ? chrom1 : chrom);
    for (int i = 0; i < sizeof(Chrom*); i++) {
      hash += p[i];
      hash += hash << 10;
      hash ^= hash >> 6;
    }
  }

  // hash pos
  end = (alignType == SINGLE ? 1 : 2);
  for (int j = 0; j < end; j++) {
    p = (unsigned char*) (j ? &pos1 : &pos);
    for (int i = 0; i < sizeof(uint32_t); i++) {
      hash += p[i];
      hash += hash << 10;
      hash ^= hash >> 6;
    }
  }

  // hash strand
  end = alignType;  // convenient!
  for (int j = 0; j < end; j++) {
    p = (unsigned char*) (j ? &strand1 : &strand);
    for (int i = 0; i < sizeof(bool); i++) {
      hash += p[i];
      hash += hash << 10;
      hash ^= hash >> 6;
    }
  }

  hash += hash << 3;
  hash ^= hash >> 11;
  hash += hash << 15;
  return hash % hashSize;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x28(%rsp), %r10d
movl 0x20(%rsp), %eax
movl %edx, -0x4(%rsp)
movl %ecx, -0x8(%rsp)
xorl %ecx, %ecx
movb $0x1, %dl
testb $0x1, %dl
movq %rsi, %r11
cmovneq %rdi, %r11
xorl %ebx, %ebx
movzbl (%r11,%rbx), %ebp
addl %ecx, %ebp
movl %ebp, %r14d
shll $0xa, %r14d
addl %ebp, %r14d
movl %r14d, %ecx
shrl $0x6, %ecx
xorl %r14d, %ecx
incq %rbx
cmpq $0x8, %rbx
jne 0xa674
cmpl $0x2, %eax
sete %r11b
testb %dl, %r11b
movl $0x0, %edx
jne 0xa668
movb $0x1, %sil
leaq -0x4(%rsp), %rdx
leaq -0x8(%rsp), %rdi
testb $0x1, %sil
movq %rdi, %r11
cmovneq %rdx, %r11
xorl %ebx, %ebx
movzbl (%r11,%rbx), %ebp
addl %ecx, %ebp
movl %ebp, %r14d
shll $0xa, %r14d
addl %ebp, %r14d
movl %r14d, %ecx
shrl $0x6, %ecx
xorl %r14d, %ecx
incq %rbx
cmpq $0x4, %rbx
jne 0xa6c2
cmpl $0x1, %eax
setne %r11b
testb %sil, %r11b
movl $0x0, %esi
jne 0xa6b5
testl %eax, %eax
jle 0xa72d
xorl %edx, %edx
movzbl %r8b, %esi
movzbl %r9b, %edi
testl %edx, %edx
movl %edi, %r8d
cmovel %esi, %r8d
movzbl %r8b, %r8d
addl %ecx, %r8d
movl %r8d, %r9d
shll $0xa, %r9d
addl %r8d, %r9d
movl %r9d, %ecx
shrl $0x6, %ecx
xorl %r9d, %ecx
incl %edx
cmpl %edx, %eax
jne 0xa704
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shll $0xf, %eax
addl %ecx, %eax
xorl %edx, %edx
divl %r10d
movl %edx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: checkHash
HashAln* checkHash(Chrom* chrom, Chrom* chrom1,
    uint32_t pos, uint32_t pos1, bool strand, bool strand1,
    int alignType, HashAln** table, uint32_t idx) {
  for (HashAln* h = table[idx]; h != NULL; h = h->next) {
    // check for match, based on alignment type
    switch (alignType) {
      case PAIRED:
        if (chrom == h->chrom && pos == h->pos
            && pos1 == h->pos1)
          return h;
        break;
      case SINGLE:
        if (chrom == h->chrom && pos == h->pos
            && strand == h->strand)
          return h;
        break;
      case DISCORD:
        if (chrom == h->chrom && chrom1 == h->chrom1
            && pos == h->pos && pos1 == h->pos1
            && strand == h->strand && strand1 == h->strand1)
          return h;
        break;
      default:
        exit(error("", ERRALNTYPE));
    }
  }
  return NULL;
}

// Assembly:
pushq %rax
movl 0x20(%rsp), %eax
movq 0x18(%rsp), %r10
movq (%r10,%rax,8), %rax
testq %rax, %rax
je 0xa85f
movl 0x10(%rsp), %r10d
cmpl $0x2, %r10d
ja 0xa863
movq 0x8(%rax), %r11
cmpl $0x1, %r10d
je 0xa823
testl %r10d, %r10d
jne 0xa835
cmpq %rdi, %r11
jne 0xa856
cmpl %edx, 0x18(%rax)
jne 0xa856
cmpl %ecx, 0x1c(%rax)
jne 0xa856
jmp 0xa861
cmpq %rdi, %r11
jne 0xa856
cmpl %edx, 0x18(%rax)
jne 0xa856
cmpb %r8b, 0x20(%rax)
jne 0xa856
jmp 0xa861
cmpq %rdi, %r11
jne 0xa856
cmpq %rsi, 0x10(%rax)
jne 0xa856
cmpl %edx, 0x18(%rax)
jne 0xa856
cmpl %ecx, 0x1c(%rax)
jne 0xa856
cmpb %r8b, 0x20(%rax)
jne 0xa856
cmpb %r9b, 0x21(%rax)
je 0xa861
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0xa803
xorl %eax, %eax
popq %rcx
retq
callq 0x2f45
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: checkAndAdd
void checkAndAdd(HashAln** tableSn, uint32_t hashSizeSn,
    Chrom* chrom, uint32_t pos, bool strand, char* name) {
  uint32_t idx = jenkins_hash_aln(chrom, NULL, pos, 0,
    strand, 0, SINGLE, hashSizeSn);
  if (! checkHash(chrom, NULL, pos, 0, strand, 0, SINGLE,
      tableSn, idx))
    addToHash(chrom, NULL, pos, 0, strand, 0, tableSn,
      idx, name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %r14
movl %r8d, %r12d
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %eax
movq %rdi, %rbx
movq %rdx, %rdi
xorl %esi, %esi
movl %ecx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %rax
pushq $0x1
callq 0xa64f
addq $0x10, %rsp
movl %eax, %ecx
movq (%rbx,%rcx,8), %rcx
testq %rcx, %rcx
je 0xa8ba
cmpq %r15, 0x8(%rcx)
jne 0xa8b4
cmpl %ebp, 0x18(%rcx)
jne 0xa8b4
cmpb %r12b, 0x20(%rcx)
je 0xa8db
movq 0x28(%rcx), %rcx
jmp 0xa89e
subq $0x8, %rsp
movzbl %r12b, %r8d
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %r14
pushq %rax
pushq %rbx
callq 0xa74a
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: logDup
void logDup(File dups, bool gzOut, char* name,
    Chrom* chrom, Chrom* chrom1, uint32_t pos,
    uint32_t pos1, bool strand, bool strand1,
    char* match, int alignType) {
  switch (alignType) {
    case PAIRED:
      if (gzOut)
        gzprintf(dups.gzf, "%s\t%s:%d-%d\t%s\tpaired\n",
          name, chrom->name, pos, pos1, match);
      else
        fprintf(dups.f, "%s\t%s:%d-%d\t%s\tpaired\n",
          name, chrom->name, pos, pos1, match);
      break;
    case SINGLE:
      if (gzOut)
        gzprintf(dups.gzf, "%s\t%s:%d,%c\t%s\tsingle\n",
          name, chrom->name, pos, strand ? '+' : '-',
          match);
      else
        fprintf(dups.f, "%s\t%s:%d,%c\t%s\tsingle\n",
          name, chrom->name, pos, strand ? '+' : '-',
          match);
      break;
    case DISCORD:
      if (gzOut)
        gzprintf(dups.gzf, "%s\t%s:%d,%c;%s:%d,%c\t%s\tdiscordant\n",
          name, chrom->name, pos, strand ? '+' : '-',
          chrom1->name, pos1, strand1 ? '+' : '-', match);
      else
        fprintf(dups.f, "%s\t%s:%d,%c;%s:%d,%c\t%s\tdiscordant\n",
          name, chrom->name, pos, strand ? '+' : '-',
          chrom1->name, pos1, strand1 ? '+' : '-', match);
      break;
    default:
      exit(error("", ERRALNTYPE));
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x40(%rsp), %ebx
movq 0x38(%rsp), %r11
movb 0x28(%rsp), %al
movl 0x20(%rsp), %r10d
cmpl $0x2, %ebx
je 0xa95e
cmpl $0x1, %ebx
je 0xa92b
testl %ebx, %ebx
jne 0xa9f6
movq (%rcx), %rcx
subq $0x8, %rsp
testb %sil, %sil
je 0xa9d7
leaq 0x91ec(%rip), %rsi      # 0x13b0f
movl %r9d, %r8d
movl %r10d, %r9d
jmp 0xa950
movq (%rcx), %rcx
xorb $0x1, %al
movzbl %al, %eax
leal 0x2b(,%rax,2), %eax
subq $0x8, %rsp
testb %sil, %sil
je 0xa9a7
leaq 0x91dc(%rip), %rsi      # 0x13b26
movl %r9d, %r8d
movl %eax, %r9d
xorl %eax, %eax
pushq %r11
callq 0x20e0
jmp 0xa9ed
movb 0x30(%rsp), %bpl
movq (%rcx), %rcx
xorb $0x1, %al
movzbl %al, %eax
leal 0x2b(,%rax,2), %eax
movq (%r8), %rbx
xorb $0x1, %bpl
movzbl %bpl, %r8d
leal 0x2b(,%r8,2), %r14d
testb %sil, %sil
je 0xa9b6
leaq 0x91ac(%rip), %rsi      # 0x13b3d
movl %r9d, %r8d
movl %eax, %r9d
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r10
pushq %rbx
callq 0x20e0
jmp 0xa9d1
leaq 0x9178(%rip), %rsi      # 0x13b26
movl %r9d, %r8d
movl %eax, %r9d
jmp 0xa9e4
leaq 0x9180(%rip), %rsi      # 0x13b3d
movl %r9d, %r8d
movl %eax, %r9d
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r10
pushq %rbx
callq 0x21d0
addq $0x20, %rsp
jmp 0xa9f1
leaq 0x9131(%rip), %rsi      # 0x13b0f
movl %r9d, %r8d
movl %r10d, %r9d
xorl %eax, %eax
pushq %r11
callq 0x21d0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x2f5d
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: addHashPr
void addHashPr(Read* r, HashAln** table,
    uint32_t hashSize, bool dupsVerb,
    HashAln** tableSn, uint32_t hashSizeSn) {
  for (int k = 0; k < r->alnLen; k++) {
    Aln* a = r->aln + k;
    uint32_t idx = jenkins_hash_aln(a->chrom, NULL,
      a->pos[0], a->pos[1], 0, 0, PAIRED, hashSize);
    addToHash(a->chrom, NULL, a->pos[0], a->pos[1],
      0, 0, table, idx, dupsVerb ? r->name : NULL);

    // also add both alignments as singletons to hashtable
    if (tableSn != NULL && hashSizeSn) {
      checkAndAdd(tableSn, hashSizeSn, a->chrom, a->pos[0],
        true, dupsVerb ? r->name : NULL);
      checkAndAdd(tableSn, hashSizeSn, a->chrom, a->pos[1],
        false, dupsVerb ? r->name : NULL);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, 0x14(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
cmpb $0x0, 0x10(%rdi)
je 0xab70
movq %rdi, %r12
testq %r8, %r8
setne %al
testl %r9d, %r9d
setne %cl
andb %al, %cl
movb %cl, 0xf(%rsp)
movl $0x20, %r14d
xorl %ebx, %ebx
movl %r9d, 0x10(%rsp)
movq %r8, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x8(%r12), %r13
movq (%r13,%r14), %r12
movl -0x20(%r13,%r14), %r15d
movl -0x1c(%r13,%r14), %ebp
movq %r12, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq 0x30(%rsp)
pushq $0x0
callq 0xa64f
addq $0x10, %rsp
cmpb $0x0, 0x14(%rsp)
je 0xaaea
subq $0x8, %rsp
movq %r12, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
movq 0x20(%rsp), %r12
pushq (%r12)
pushq %rax
pushq 0x40(%rsp)
callq 0xa74a
addq $0x20, %rsp
cmpb $0x0, 0xf(%rsp)
movl 0x10(%rsp), %ebp
movq 0x20(%rsp), %r15
je 0xab5a
movq (%r13,%r14), %rdx
movl -0x20(%r13,%r14), %ecx
movq (%r12), %r9
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %r8d
callq 0xa868
movq (%r12), %r9
jmp 0xab43
subq $0x8, %rsp
movq %r12, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq %rax
pushq 0x40(%rsp)
callq 0xa74a
addq $0x20, %rsp
cmpb $0x0, 0xf(%rsp)
movl 0x10(%rsp), %ebp
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r12
je 0xab5a
movq (%r13,%r14), %rdx
movl -0x20(%r13,%r14), %ecx
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0xa868
xorl %r9d, %r9d
movq (%r13,%r14), %rdx
movl -0x1c(%r13,%r14), %ecx
movq %r15, %rdi
movl %ebp, %esi
xorl %r8d, %r8d
callq 0xa868
incq %rbx
movzbl 0x10(%r12), %eax
addq $0x28, %r14
cmpq %rax, %rbx
jb 0xaa4d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: checkHashPr
bool checkHashPr(Read* r, HashAln** table,
    uint32_t hashSize, File dups, bool dupsVerb,
    bool gzOut) {
  for (int k = 0; k < r->alnLen; k++) {
    Aln* a = r->aln + k;
    uint32_t idx = jenkins_hash_aln(a->chrom, NULL,
      a->pos[0], a->pos[1], 0, 0, PAIRED, hashSize);
    HashAln* h = checkHash(a->chrom, NULL, a->pos[0],
      a->pos[1], 0, 0, PAIRED, table, idx);
    if (h) {
      if (dupsVerb)
        logDup(dups, gzOut, r->name, a->chrom, NULL,
          a->pos[0], a->pos[1], 0, 0, h->name, PAIRED);
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movzbl 0x10(%rdi), %eax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0xac32
movl %r8d, 0xc(%rsp)
movl %r9d, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x8(%rdi), %r14
movb $0x1, %bl
xorl %r13d, %r13d
leaq (,%r13,4), %rax
addq %r13, %rax
movq 0x20(%r14,%rax,8), %r12
movl (%r14,%rax,8), %r15d
movl 0x4(%r14,%rax,8), %ebp
movq %r12, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq 0x30(%rsp)
pushq $0x0
callq 0xa64f
addq $0x10, %rsp
movl %eax, %eax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xac25
cmpq %r12, 0x8(%rax)
jne 0xac1f
cmpl %r15d, 0x18(%rax)
jne 0xac1f
cmpl %ebp, 0x1c(%rax)
je 0xac36
movq 0x28(%rax), %rax
jmp 0xac09
incq %r13
cmpq 0x20(%rsp), %r13
setb %bl
jne 0xabc6
xorl %ebx, %ebx
jmp 0xac71
cmpb $0x0, 0xc(%rsp)
je 0xac71
movq 0x10(%rsp), %rcx
movq (%rcx), %rdx
subq $0x8, %rsp
xorl %r10d, %r10d
movzbl 0x10(%rsp), %esi
movq 0x20(%rsp), %rdi
movq %r12, %rcx
xorl %r8d, %r8d
movl %r15d, %r9d
pushq %r10
pushq (%rax)
pushq %r10
pushq %r10
pushq %rbp
callq 0xa8e4
addq $0x30, %rsp
andb $0x1, %bl
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: addHashSn
void addHashSn(Read* r, HashAln** table,
    uint32_t hashSize, bool dupsVerb) {
  for (int k = 0; k < r->alnLen; k++) {
    Aln* a = r->aln + k;
    uint32_t pos = (a->strand ? a->pos[0] : a->pos[1]);
    uint32_t idx = jenkins_hash_aln(a->chrom, NULL,
      pos, 0, a->strand, 0, SINGLE, hashSize);
    addToHash(a->chrom, NULL, pos, 0, a->strand, 0,
      table, idx, dupsVerb ? r->name : NULL);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0x4(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
cmpb $0x0, 0x10(%rdi)
je 0xb9dc
movq %rdi, %r12
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%r12), %rax
leaq (%rax,%r14), %rcx
movzbl 0x10(%rax,%r14), %r13d
movl %r13d, %edx
xorl $0x1, %edx
movl (%rcx,%rdx,4), %ebp
movq 0x20(%rax,%r14), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %r13d, %r8d
xorl %r9d, %r9d
pushq 0x10(%rsp)
pushq $0x1
callq 0xa64f
addq $0x10, %rsp
movl $0x0, %r10d
cmpb $0x0, 0x4(%rsp)
je 0xb9a2
movq (%r12), %r10
subq $0x8, %rsp
movzbl %r13b, %r8d
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %r10
pushq %rax
pushq 0x20(%rsp)
callq 0xa74a
addq $0x20, %rsp
incq %r15
movzbl 0x10(%r12), %eax
addq $0x28, %r14
cmpq %rax, %r15
jb 0xb956
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: checkHashSn
bool checkHashSn(Read* r, HashAln** table,
    uint32_t hashSize, File dups, bool dupsVerb,
    bool gzOut) {
  for (int k = 0; k < r->alnLen; k++) {
    Aln* a = r->aln + k;
    uint32_t pos = (a->strand ? a->pos[0] : a->pos[1]);
    uint32_t idx = jenkins_hash_aln(a->chrom, NULL,
      pos, 0, a->strand, 0, SINGLE, hashSize);
    HashAln* h = checkHash(a->chrom, NULL, pos, 0,
      a->strand, 0, SINGLE, table, idx);
    if (h) {
      if (dupsVerb)
        logDup(dups, gzOut, r->name, a->chrom, NULL,
          pos, 0, a->strand, 0, h->name, SINGLE);
      return true;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movzbl 0x10(%rdi), %r13d
testq %r13, %r13
je 0xbaa2
movl %r8d, 0xc(%rsp)
movl %r9d, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x20(%rsp)
movb $0x1, %bl
xorl %r14d, %r14d
leaq (%r14,%r14,4), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rax,8), %rax
movzbl 0x10(%rax), %r12d
movl %r12d, %ecx
xorl $0x1, %ecx
movl (%rax,%rcx,4), %ebp
movq 0x20(%rax), %r15
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %r12d, %r8d
xorl %r9d, %r9d
pushq 0x30(%rsp)
pushq $0x1
callq 0xa64f
addq $0x10, %rsp
movl %eax, %eax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xba97
cmpq %r15, 0x8(%rax)
jne 0xba91
cmpl %ebp, 0x18(%rax)
jne 0xba91
cmpb %r12b, 0x20(%rax)
je 0xbaa6
movq 0x28(%rax), %rax
jmp 0xba7b
incq %r14
cmpq %r13, %r14
setb %bl
jne 0xba33
xorl %ebx, %ebx
jmp 0xbae6
cmpb $0x0, 0xc(%rsp)
je 0xbae6
movq 0x10(%rsp), %rcx
movq (%rcx), %rdx
subq $0x8, %rsp
xorl %r10d, %r10d
movzbl %r12b, %r11d
movzbl 0x10(%rsp), %esi
movq 0x20(%rsp), %rdi
movq %r15, %rcx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq $0x1
pushq (%rax)
pushq %r10
pushq %r11
pushq %r10
callq 0xa8e4
addq $0x30, %rsp
andb $0x1, %bl
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: updatePairedAln
void updatePairedAln(Aln* a, uint16_t flag,
    uint32_t pos, int length, float score) {
  if (flag & 0x40)
    a->pos[0] = flag & 0x10 ? pos + length : pos;
  else
    a->pos[1] = flag & 0x10 ? pos + length : pos;
  if (score == NOSCORE)
    a->score = NOSCORE;
  else if (a->score != NOSCORE)
    a->score += score;
  a->full = true;
}

// Assembly:
movl %esi, %eax
shll $0x1b, %eax
sarl $0x1f, %eax
andl %ecx, %eax
addl %edx, %eax
testb $0x40, %sil
jne 0xc49e
movl %eax, 0x4(%rdi)
jmp 0xc4a0
movl %eax, (%rdi)
movss 0x5ccc(%rip), %xmm1     # 0x12174
ucomiss %xmm1, %xmm0
jne 0xc4af
jnp 0xc4c3
movss 0x8(%rdi), %xmm1
ucomiss 0x5cb9(%rip), %xmm1     # 0x12174
jne 0xc4bf
jnp 0xc4c8
addss %xmm0, %xmm1
movss %xmm1, 0x8(%rdi)
movb $0x1, 0xe(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: savePairedAln
bool savePairedAln(Aln** aln, int* alnLen,
    uint16_t flag, Chrom* chrom, uint32_t pos,
    int length, uint32_t pnext, float score) {

  // check for excessive alignments
  if (*alnLen == MAX_ALNS)
    return false;

  // save aln info
  Aln* a = *aln + *alnLen;
  a->chrom = chrom;
  a->score = score;
  a->primary = (bool) (!(flag & 0x100));
  a->full = false;
  a->paired = true;

  // save positions for this aln (corrected if rev-comp),
  //   and for its pair (pnext, uncorrected)
  if (flag & 0x40) {
    a->pos[0] = flag & 0x10 ? pos + length : pos;
    a->pos[1] = pnext;
    a->first = true;
  } else {
    a->pos[0] = pnext;
    a->pos[1] = flag & 0x10 ? pos + length : pos;
    a->first = false;
  }

  (*alnLen)++;
  return true;
}

// Assembly:
movslq (%rsi), %rax
cmpq $0x80, %rax
je 0xc536
movl 0x8(%rsp), %r10d
movq (%rdi), %rdi
leaq (%rax,%rax,4), %r11
movq %rcx, 0x20(%rdi,%r11,8)
movss %xmm0, 0x8(%rdi,%r11,8)
movzwl %dx, %ecx
btl $0x8, %ecx
setae 0xc(%rdi,%r11,8)
movl %ecx, %edx
andl $0x40, %edx
shll $0x1b, %ecx
sarl $0x1f, %ecx
andl %r9d, %ecx
addl %r8d, %ecx
testl %edx, %edx
movl %ecx, %r8d
cmovel %r10d, %r8d
cmovnel %r10d, %ecx
movw $0x1, 0xd(%rdi,%r11,8)
shrl $0x6, %edx
movl %r8d, (%rdi,%r11,8)
movl %ecx, 0x4(%rdi,%r11,8)
movb %dl, 0xf(%rdi,%r11,8)
incl (%rsi)
cmpl $0x80, %eax
setne %al
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: saveSingleAln
bool saveSingleAln(Aln** aln, int* alnLen,
    uint16_t flag, Chrom* chrom, uint32_t pos,
    int length, float score) {

  // check for excessive alignments
  if (*alnLen == MAX_ALNS)
    return false;

  // save aln info
  Aln* a = *aln + *alnLen;
  a->chrom = chrom;
  a->score = score;
  a->primary = (bool) (!(flag & 0x100));
  a->paired = false;
  a->strand = (bool) (!(flag & 0x10));
  a->first = (bool) (flag & 0x40);
  a->pos[0] = pos;
  a->pos[1] = pos + length;
  (*alnLen)++;
  return true;
}

// Assembly:
movslq (%rsi), %rax
cmpq $0x80, %rax
je 0xc592
movq (%rdi), %rdi
leaq (%rax,%rax,4), %r10
movq %rcx, 0x20(%rdi,%r10,8)
movss %xmm0, 0x8(%rdi,%r10,8)
movzwl %dx, %ecx
btl $0x8, %ecx
setae 0xc(%rdi,%r10,8)
movb $0x0, 0xd(%rdi,%r10,8)
testb $0x10, %cl
sete 0x10(%rdi,%r10,8)
shrb $0x6, %cl
andb $0x1, %cl
movb %cl, 0xf(%rdi,%r10,8)
movl %r8d, (%rdi,%r10,8)
addl %r8d, %r9d
movl %r9d, 0x4(%rdi,%r10,8)
incl (%rsi)
cmpl $0x80, %eax
setne %al
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: sumQual
uint16_t sumQual(char* qual, int len, int offset) {
  if (qual[0] == 0xFF)  // BAM 'null' value
    return 0;
  int sum = 0;
  for (int i = 0; i < len; i++)
    sum += qual[i] - offset;
  return sum > UINT16_MAX ? UINT16_MAX : (uint16_t) sum;
}

// Assembly:
testl %esi, %esi
jle 0xc5b9
movl %esi, %eax
xorl %esi, %esi
xorl %ecx, %ecx
movsbl (%rdi,%rsi), %r8d
subl %edx, %ecx
addl %r8d, %ecx
incq %rsi
cmpq %rsi, %rax
jne 0xc5a5
jmp 0xc5bb
xorl %ecx, %ecx
movl $0xffff, %eax           # imm = 0xFFFF
cmpl %eax, %ecx
cmovll %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: loadChrom
void loadChrom(char* line, int* chromLen, Chrom** chrom,
    int xcount, char** xchrList, int xBedLen, Bed* xBed,
    bool ctrl, bool verbose) {
  // parse SAM header line for chrom info
  char* name = NULL, *len = NULL;
  char* field = strtok(NULL, TAB);
  while (field != NULL) {
    if (!strncmp(field, "SN:", 3))
      name = field + 3;
    else if (!strncmp(field, "LN:", 3))
      len = field + 3;
    field = strtok(NULL, TAB);
  }
  if (name == NULL || len == NULL)
    return;

  // remove trailing '\n'
  int i;
  for (i = 0; name[i] != '\n' && name[i] != '\0'; i++) ;
  name[i] = '\0';
  for (i = 0; len[i] != '\n' && len[i] != '\0'; i++) ;
  len[i] = '\0';

  // save chrom info to array (*chrom)
  saveChrom(name, (uint32_t) getInt(len), chromLen, chrom,
    xcount, xchrList, xBedLen, xBed, ctrl, verbose);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebx
movq %r8, %r14
movl %ecx, %r12d
movq %rdx, %r15
movq %rsi, 0x10(%rsp)
leaq 0x7108(%rip), %rsi      # 0x13b61
xorl %edi, %edi
callq 0x2280
testq %rax, %rax
je 0xcaeb
movq %r15, 0x8(%rsp)
movq %r14, %r15
movq %rbx, %rbp
xorl %ebx, %ebx
leaq 0x70e4(%rip), %r14      # 0x13b61
xorl %r13d, %r13d
movzbl (%rax), %ecx
cmpl $0x4c, %ecx
je 0xcaa1
cmpl $0x53, %ecx
jne 0xcab3
cmpb $0x4e, 0x1(%rax)
jne 0xcab3
leaq 0x3(%rax), %rcx
cmpb $0x3a, 0x2(%rax)
cmoveq %rcx, %r13
jmp 0xcab3
cmpb $0x4e, 0x1(%rax)
jne 0xcab3
leaq 0x3(%rax), %rcx
cmpb $0x3a, 0x2(%rax)
cmoveq %rcx, %rbx
xorl %edi, %edi
movq %r14, %rsi
callq 0x2280
testq %rax, %rax
jne 0xca80
testq %r13, %r13
movq %r15, %r14
movl %r12d, %r15d
movq 0x8(%rsp), %r12
je 0xcaeb
testq %rbx, %rbx
je 0xcaeb
movq %r13, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xcaf1
cmpl $0xa, %ecx
je 0xcaf1
incq %rax
jmp 0xcada
addq $0x18, %rsp
jmp 0xcb44
movb $0x0, (%rax)
movq %rbx, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xcb08
cmpl $0xa, %ecx
je 0xcb08
incq %rax
jmp 0xcaf7
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0x3961
movzbl 0x60(%rsp), %r10d
movzbl 0x58(%rsp), %r11d
movq %r13, %rdi
movl %eax, %esi
movq 0x10(%rsp), %rdx
movq %r12, %rcx
movl %r15d, %r8d
movq %r14, %r9
pushq %r10
pushq %r11
pushq 0x60(%rsp)
pushq %rbp
callq 0xc85f
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: checkHeader
void checkHeader(char* line, int* chromLen, Chrom** chrom,
    int xcount, char** xchrList, int xBedLen, Bed* xBed,
    bool ctrl, bool sortOpt, bool verbose) {

  // load tag from SAM header line
  char* tag = strtok(line, TAB);
  if (tag == NULL)
    return;

  if (! strcmp(tag, "@HD")) {
    // first header line: check sort order
    char* order = NULL;
    char* field = strtok(NULL, TAB);
    while (field != NULL) {
      if (!strncmp(field, "SO:", 3))
        order = field + 3;
      field = strtok(NULL, TAB);
    }
    if (order != NULL) {
      // removing trailing '\n'
      int i;
      for (i = 0; order[i] != '\n' && order[i] != '\0'; i++) ;
      order[i] = '\0';
    }

    // sort order must be queryname
    if (sortOpt && (order == NULL
        || strcmp(order, "queryname")))
      exit(error("", ERRSORT));

  } else if (! strcmp(tag, "@SQ"))
    // load chrom lengths from header line
    loadChrom(line, chromLen, chrom, xcount, xchrList,
      xBedLen, xBed, ctrl, verbose);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movq %r8, %r14
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
leaq 0x6ff2(%rip), %rsi      # 0x13b61
callq 0x2280
testq %rax, %rax
je 0xcc5e
movq %rax, %r13
leaq 0x6fdc(%rip), %rsi      # 0x13b63
movq %rax, %rdi
callq 0x21b0
testl %eax, %eax
je 0xcbdc
leaq 0x6fd7(%rip), %rsi      # 0x13b71
movq %r13, %rdi
callq 0x21b0
testl %eax, %eax
jne 0xcc5e
movb 0x48(%rsp), %al
subq $0x8, %rsp
movzbl 0x60(%rsp), %edi
movzbl %al, %eax
movq %r12, %rsi
movq %r15, %rdx
movl %ebp, %ecx
movq %r14, %r8
movl %ebx, %r9d
pushq %rdi
pushq %rax
pushq 0x58(%rsp)
callq 0xca33
addq $0x28, %rsp
jmp 0xcc62
movb 0x50(%rsp), %bpl
leaq 0x6f79(%rip), %rsi      # 0x13b61
xorl %edi, %edi
callq 0x2280
testq %rax, %rax
je 0xcc3c
xorl %ebx, %ebx
leaq 0x6f64(%rip), %r14      # 0x13b61
cmpb $0x53, (%rax)
jne 0xcc14
cmpb $0x4f, 0x1(%rax)
jne 0xcc14
leaq 0x3(%rax), %rcx
cmpb $0x3a, 0x2(%rax)
cmoveq %rcx, %rbx
xorl %edi, %edi
movq %r14, %rsi
callq 0x2280
testq %rax, %rax
jne 0xcbfd
testq %rbx, %rbx
je 0xcc3c
movq %rbx, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xcc43
cmpl $0xa, %ecx
je 0xcc43
incq %rax
jmp 0xcc2b
testb %bpl, %bpl
je 0xcc5e
jmp 0xcc6d
movb $0x0, (%rax)
testb %bpl, %bpl
je 0xcc5e
leaq 0x6f15(%rip), %rsi      # 0x13b67
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
jne 0xcc6d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2fb6