LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x739d
leaq 0x8fb6(%rip), %rcx      # 0x10294
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb (%rsi), %al
testb $0x4, %al
jne 0x735d
decw (%rdi)
movb (%rsi), %al
orb $0x4, %al
jmp 0x739a
movzbl (%rsi), %eax
testb $0x18, %al
je 0x7365
addb $-0x8, %al
jmp 0x739a
movzbl (%rsi), %eax
testb $0x10, %al
jne 0x7355
testb $0x4, %al
jne 0x7384
decw (%rdi)
movb (%rsi), %al
addb $0xc, %al
jmp 0x739a
movb (%rsi), %al
testb $0x7, %al
je 0x7372
decb %al
jmp 0x739a
movb (%rsi), %al
testb $0x6, %al
je 0x737b
addb $-0x2, %al
jmp 0x739a
movb (%rsi), %al
cmpb $0x40, %al
jae 0x7359
testb $0x4, %al
jne 0x738a
decw (%rdi)
movb (%rsi), %al
orb $0x4, %al
jmp 0x738c
movb (%rsi), %al
cmpb $0x20, %al
jae 0x7361
testb $0x4, %al
jne 0x7390
decw (%rdi)
movb (%rsi), %al
orb $-0x7c, %al
jmp 0x739a
andb $-0x11, %al
jmp 0x739a
addb $-0x40, %al
jmp 0x739a
andb $-0x5, %al
jmp 0x739a
addb $-0x20, %al
jmp 0x739a
testb $0x4, %al
jne 0x7396
decw (%rdi)
movb (%rsi), %al
orb $0x14, %al
jmp 0x739a
decw (%rdi)
movb (%rsi), %al
orb $0x7, %al
jmp 0x739a
decw (%rdi)
movb (%rsi), %al
orb $0x6, %al
jmp 0x739a
andb $-0x15, %al
addb $0x8, %al
jmp 0x739a
andb $0x3b, %al
addb $0x60, %al
jmp 0x739a
andb $0x1b, %al
orb $-0x80, %al
jmp 0x739a
andb $-0x15, %al
orb $0x10, %al
movb %al, (%rsi)
retq
pushq %rbx
subq $0x80, %rsp
movzbl %dl, %ecx
movq 0xfee1(%rip), %rdx      # 0x17290
leaq 0xa508(%rip), %rsi      # 0x118be
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2290
pushq $0x21
popq %rsi
movq %rbx, %rdi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/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 0x740f
leaq 0xa4c5(%rip), %rsi      # 0x118c6
xorl %eax, %eax
pushq %r11
pushq %rbx
pushq %r10
callq 0x20e0
jmp 0x7422
leaq 0xa4b0(%rip), %rsi      # 0x118c6
xorl %eax, %eax
pushq %r11
pushq %rbx
pushq %r10
callq 0x21c0
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x778d
movq %rdi, %xmm1
punpckldq 0x8ac9(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x8ad1(%rip), %xmm1     # 0x10240
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
addsd 0x8921(%rip), %xmm0     # 0x100a8
cvttsd2si %xmm0, %ebx
jmp 0x7794
xorl %ebx, %ebx
testb %sil, %sil
jne 0x779c
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0xf855(%rip), %r15      # 0x16ff8
movq (%r15), %rcx
leaq 0xa216(%rip), %rdi      # 0x119c3
pushq $0x34
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x22b0
movq (%r15), %rcx
leaq 0xa232(%rip), %rdi      # 0x119f8
pushq $0x31
popq %rsi
movq %r14, %rdx
callq 0x22b0
jmp 0x7794
// File: /workspace/github_c_makefile_star2_O2/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, %r12d
movq %r8, 0x20(%rsp)
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, 0x40(%rsp)
movb 0x88(%rsp), %bl
movb 0x80(%rsp), %r14b
movzbl 0xa0(%rsp), %esi
movq %rcx, %rdi
movq %rsi, 0x18(%rsp)
callq 0x7750
movl %eax, %r13d
movslq %ebp, %rax
xorl %ebp, %ebp
testl %r15d, %r15d
cmovlel %ebp, %r15d
movq %r15, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movl %eax, %eax
movq %rax, 0x28(%rsp)
movzbl %bl, %eax
movq %rax, 0x10(%rsp)
movzbl %r14b, %eax
movq %rax, 0x8(%rsp)
movzbl %r12b, %r15d
cmpq 0x38(%rsp), %rbp
jg 0x790a
cmpq 0x28(%rsp), %rbp
movl $0xfff0, %eax           # imm = 0xFFF0
cmoveq 0x30(%rsp), %rax
imulq $0x28, %rax, %r12
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x7902
movq 0x40(%rsp), %rax
movq (%rax,%rbp,8), %rbx
testl %r13d, %r13d
je 0x789c
movq 0x20(%rbx,%r14), %rdi
cmpb $0x1, 0x10(%rbx,%r14)
jne 0x78ac
movl (%rbx,%r14), %esi
leal (%rsi,%r13), %edx
jmp 0x78b9
movq 0x20(%rbx,%r14), %rdi
movl (%rbx,%r14), %esi
movl 0x4(%rbx,%r14), %edx
jmp 0x78b9
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 0x7428
addq $0x30, %rsp
movq 0x18(%rbx,%r14), %rdi
callq 0x2040
addq $0x28, %r14
jmp 0x786e
incq %rbp
jmp 0x784c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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 0x7985
movq 0x40(%rsp), %rbp
xorl %ecx, %ecx
cmpl (%rbp), %eax
jne 0x7985
cltq
movq (%r13), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x2776
movq %rax, (%r13)
movl $0x27fd80, %edi         # imm = 0x27FD80
callq 0x2752
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
imulq $0x28, %rax, %rbp
movq %r12, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x2752
movq %rax, 0x18(%r13,%rbp)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2070
movq 0x20(%r15), %rax
movq %rax, 0x20(%r13,%rbp)
movb 0x10(%r15), %al
movb %al, 0x10(%r13,%rbp)
movl (%r15), %eax
movl %eax, (%r13,%rbp)
movl 0x4(%r15), %eax
movl %eax, 0x4(%r13,%rbp)
movl 0x4(%rsp), %eax
movb %al, 0x11(%r13,%rbp)
movl (%r14), %eax
incl %eax
movl %eax, (%r14)
cmpl $0xfff0, %eax           # imm = 0xFFF0
jne 0x79f8
andl $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_O2/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 0x7a73
movq 0x20(%rsi), %rdi
cmpb $0x1, 0x10(%rsi)
jne 0x7ab0
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 0x7ad2
testb %al, %al
je 0x7adf
movb 0x50(%rsp), %dil
movl 0x48(%rsp), %eax
movl 0x40(%rsp), %r10d
cmpb $0x1, 0x10(%rsi)
jne 0x7b22
movl (%rsi), %r8d
testb %dil, %dil
je 0x7a9e
addl $0x5, %r8d
movl %r8d, (%rsi)
movq 0x20(%rsi), %rdi
movl %r8d, %esi
subl %r10d, %esi
movslq %esi, %rsi
addl %r8d, %eax
jmp 0x7abb
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 0x7b0e
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 0x7428
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rsi), %r8d
testb %dil, %dil
je 0x7b33
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 0x7ad4
// File: /workspace/github_c_makefile_star2_O2/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 0x7d46
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 0x7b5f
addq $0x58, %rsp
jmp 0x7d85
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 0x7428
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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, %r14
movq %rsi, %rbx
movq %rdi, %r15
movl (%rdx), %ecx
movl (%rsi), %eax
testl %ecx, %ecx
jne 0x7dea
xorl %ecx, %ecx
cmpl (%r12), %eax
jne 0x7dea
cltq
movq (%r15), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x2776
movq %rax, (%r15)
movl $0x2ffd00, %edi         # imm = 0x2FFD00
callq 0x2752
movq (%r15), %rcx
movslq (%r12), %rdx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %eax
movl %eax, (%r12)
movl (%rbx), %eax
movl (%r14), %ecx
movq (%r15), %rdx
cltq
movq (%rdx,%rax,8), %rax
leal 0x1(%rcx), %edx
movl %edx, (%r14)
cmpl $0xfff0, %edx           # imm = 0xFFF0
jne 0x7e07
andl $0x0, (%r14)
incl (%rbx)
movslq %ecx, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %r8, %r15
movq %rcx, %rbx
movl %edx, %ebp
movq %rdi, %r14
movaps %xmm0, %xmm2
subss %xmm1, %xmm2
movss 0x8347(%rip), %xmm1     # 0x1018c
cmpneqss %xmm0, %xmm1
andps %xmm1, %xmm2
andnps %xmm0, %xmm1
orps %xmm2, %xmm1
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %esi
imulq $0x28, %rsi, %r12
xorl %r13d, %r13d
cmpq %rax, %r12
je 0x7e8a
cmpb $0x0, 0xd(%r14,%rax)
jne 0x7e84
cmpb %bpl, 0xf(%r14,%rax)
jne 0x7e84
movss 0x8(%r14,%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0x7e84
incb %r13b
addq $0x28, %rax
jmp 0x7e61
movzbl %r13b, %eax
imulq $0x28, %rax, %rdi
movaps %xmm1, (%rsp)
callq 0x2752
movaps (%rsp), %xmm1
movq %rax, (%rbx)
movb %r13b, (%r15)
xorl %eax, %eax
xorl %ecx, %ecx
cmpq %rax, %r12
je 0x7f0f
cmpb $0x0, 0xd(%r14,%rax)
jne 0x7f09
cmpb %bpl, 0xf(%r14,%rax)
jne 0x7f09
movss 0x8(%r14,%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0x7f09
movq (%rbx), %rdx
movzbl %cl, %ecx
imulq $0x28, %rcx, %rsi
movb $0x0, 0xd(%rdx,%rsi)
movb %bpl, 0xf(%rdx,%rsi)
movb 0x10(%r14,%rax), %dil
movb %dil, 0x10(%rdx,%rsi)
movss %xmm0, 0x8(%rdx,%rsi)
movq 0x20(%r14,%rax), %rdi
movq %rdi, 0x20(%rdx,%rsi)
movl (%r14,%rax), %edi
movl %edi, (%rdx,%rsi)
movl 0x4(%r14,%rax), %edi
movl %edi, 0x4(%rdx,%rsi)
incb %cl
addq $0x28, %rax
jmp 0x7ea9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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
pushq $0x1
popq %rcx
movaps %xmm2, %xmm1
movq %r14, %r8
movl %ebp, %r9d
callq 0x7f1e
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 0x7e1d
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_O2/jsh58[P]Genrich/Genrich.c
// Function: saveAlnsPair
void saveAlnsPair(char* qname, Aln* aln, int alnLen,
    float score, float asDiff, Read* r, uint16_t qualR1,
    uint16_t qualR2) {
  // populate Read* struct
  r->name = (char*) memalloc(1 + strlen(qname));
  strcpy(r->name, qname);
  r->qual = MIN(qualR1 + qualR2, UINT16_MAX);
  r->score = score;

  // adjust AS tolerance for secondary alns
  if (score != NOSCORE)
    score -= asDiff;

  // determine number of valid paired alignments
  uint8_t count = 0;
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (a->paired && a->full && a->score >= score)
      count++;
  }
  r->aln = (Aln*) memalloc(count * sizeof(Aln));
  r->alnLen = 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->full && a->score >= score) {
      Aln* b = r->aln + j;
      b->paired = a->paired;
      b->full = a->full;
      b->score = a->score;
      b->chrom = a->chrom;
      // ensure positions are ordered
      if (a->pos[0] > a->pos[1]) {
        b->pos[0] = a->pos[1];
        b->pos[1] = a->pos[0];
      } else {
        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
movl %r9d, %r12d
movl %r8d, %ebp
movq %rcx, %r14
movss %xmm1, (%rsp)
movaps %xmm0, 0x10(%rsp)
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r13
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x2752
movq %rax, (%r14)
movq %rax, %rdi
movq %r13, %rsi
callq 0x2070
addl %r12d, %ebp
movl $0xffff, %eax           # imm = 0xFFFF
cmpl %eax, %ebp
cmovael %eax, %ebp
movw %bp, 0x22(%r14)
movaps 0x10(%rsp), %xmm2
movss %xmm2, 0x28(%r14)
movaps %xmm2, %xmm0
subss (%rsp), %xmm0
movss 0x80f6(%rip), %xmm1     # 0x1018c
cmpneqss %xmm2, %xmm1
andps %xmm1, %xmm0
andnps %xmm2, %xmm1
orps %xmm0, %xmm1
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
imulq $0x28, %r15, %r15
xorl %r12d, %r12d
cmpq %rax, %r15
je 0x80db
cmpb $0x1, 0xd(%rbx,%rax)
jne 0x80d5
cmpb $0x1, 0xe(%rbx,%rax)
jne 0x80d5
movss 0x8(%rbx,%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0x80d5
incb %r12b
addq $0x28, %rax
jmp 0x80b4
movzbl %r12b, %eax
imulq $0x28, %rax, %rdi
movaps %xmm1, (%rsp)
callq 0x2752
movaps (%rsp), %xmm1
movq %rax, 0x8(%r14)
movb %r12b, 0x10(%r14)
xorl %ecx, %ecx
xorl %edx, %edx
cmpq %rcx, %r15
je 0x8166
cmpb $0x1, 0xd(%rbx,%rcx)
jne 0x8160
movb 0xe(%rbx,%rcx), %sil
cmpb $0x1, %sil
jne 0x8160
movss 0x8(%rbx,%rcx), %xmm0
ucomiss %xmm1, %xmm0
jb 0x8160
movzbl %dl, %edx
imulq $0x28, %rdx, %rdi
movb $0x1, 0xd(%rax,%rdi)
movb %sil, 0xe(%rax,%rdi)
movss %xmm0, 0x8(%rax,%rdi)
movq 0x20(%rbx,%rcx), %rsi
movq %rsi, 0x20(%rax,%rdi)
movl (%rbx,%rcx), %esi
movl 0x4(%rbx,%rcx), %r8d
cmpl %r8d, %esi
movl %r8d, %r9d
cmovbl %esi, %r9d
cmoval %esi, %r8d
movl %r9d, (%rax,%rdi)
movl %r8d, 0x4(%rax,%rdi)
incb %dl
addq $0x28, %rcx
jmp 0x80fc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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 %r14
pushq %rbx
movzbl (%rcx), %r9d
leal 0xf(,%r9,4), %r10d
andl $-0x10, %r10d
movq %rsp, %rax
subq %r10, %rax
movq %rax, %rsp
xorl %r10d, %r10d
testl %esi, %esi
cmovlel %r10d, %esi
xorl %r11d, %r11d
cmpq %rsi, %r10
je 0x83bd
imulq $0x28, %r10, %rbx
cmpb $0x0, 0xd(%rdi,%rbx)
jne 0x83b8
addq %rdi, %rbx
cmpb %dl, 0xf(%rbx)
jne 0x83b8
movss 0x8(%rbx), %xmm0
ucomiss (%r8), %xmm0
jb 0x83b8
movq 0x20(%rbx), %rbx
cmpb $0x1, 0xd(%rbx)
jne 0x83b8
cmpb $0x0, 0xc(%rbx)
jne 0x83b8
testl %r11d, %r11d
movl $0x0, %ebx
cmovgl %r11d, %ebx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x8393
ucomiss (%rax,%r14,4), %xmm0
ja 0x8390
incq %r14
jmp 0x837f
movl %r14d, %ebx
movslq %r11d, %r14
movslq %ebx, %rbx
cmpq %rbx, %r14
jle 0x83b0
movss -0x4(%rax,%r14,4), %xmm1
movss %xmm1, (%rax,%r14,4)
decq %r14
jmp 0x8399
movss %xmm0, (%rax,%rbx,4)
incl %r11d
incq %r10
jmp 0x833d
leal -0x1(%r9), %edx
cmpb $0xb, %r9b
movzbl %dl, %edx
pushq $0xa
popq %rsi
cmovbl %edx, %esi
movb %sil, (%rcx)
movzbl %sil, %ecx
movss -0x4(%rax,%rcx,4), %xmm0
movss %xmm0, (%r8)
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
movzbl (%rdx), %r8d
leal 0xf(,%r8,4), %r9d
andl $-0x10, %r9d
movq %rsp, %rax
subq %r9, %rax
movq %rax, %rsp
xorl %r9d, %r9d
testl %esi, %esi
cmovlel %r9d, %esi
xorl %r10d, %r10d
cmpq %rsi, %r9
je 0x8769
imulq $0x28, %r9, %r11
cmpb $0x1, 0xd(%rdi,%r11)
jne 0x8761
addq %rdi, %r11
cmpb $0x1, 0xe(%r11)
jne 0x8761
movss 0x8(%r11), %xmm0
ucomiss (%rcx), %xmm0
jb 0x8761
movq 0x20(%r11), %r11
cmpb $0x1, 0xd(%r11)
jne 0x8761
cmpb $0x0, 0xc(%r11)
jne 0x8761
testl %r10d, %r10d
movl $0x0, %r11d
cmovgl %r10d, %r11d
xorl %ebx, %ebx
cmpq %rbx, %r11
je 0x873d
ucomiss (%rax,%rbx,4), %xmm0
ja 0x873a
incq %rbx
jmp 0x872a
movl %ebx, %r11d
movslq %r10d, %rbx
movslq %r11d, %r11
cmpq %r11, %rbx
jle 0x8758
movss -0x4(%rax,%rbx,4), %xmm1
movss %xmm1, (%rax,%rbx,4)
decq %rbx
jmp 0x8743
movss %xmm0, (%rax,%r11,4)
incl %r10d
incq %r9
jmp 0x86df
leal -0x1(%r8), %esi
cmpb $0xb, %r8b
movzbl %sil, %esi
pushq $0xa
popq %rdi
cmovbl %esi, %edi
movb %dil, (%rdx)
movzbl %dil, %edx
movss -0x4(%rax,%rdx,4), %xmm0
movss %xmm0, (%rcx)
leaq -0x8(%rbp), %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x9035
movq %r9, %rbx
movq %r8, %r14
movl %ecx, %ebp
movq %rsi, %r15
movq %rdi, %r12
leaq 0x4(%rsp), %rax
andl $0x0, (%rax)
subq $0x8, %rsp
movl %r13d, %edx
pushq %rax
pushq 0x68(%rsp)
pushq 0x68(%rsp)
pushq 0x68(%rsp)
pushq 0x68(%rsp)
callq 0x8e42
addq $0x30, %rsp
testl %eax, %eax
je 0x8ffb
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 0x8f7c
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 0x9035
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movq %r14, %r8
movq %rbx, %r9
pushq %r13
pushq %r11
pushq %r10
pushq %rax
callq 0x8f7c
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_O2/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 %rdx, %rbx
movq 0x50(%rsp), %r9
movq 0x48(%rsp), %r8
movl %esi, %r14d
pushq $0x22
popq %r12
xorl %esi, %esi
movl $0xfff0, %ebp           # imm = 0xFFF0
movl $0xfff0, %r15d          # imm = 0xFFF0
movq %rsi, %rax
xorl %edx, %edx
divq %rbp
cmpq %rsi, %r14
je 0x90b0
imulq $0x2ffd00, %rax, %rax   # imm = 0x2FFD00
movq %r12, %r13
subq %rax, %r13
movl %esi, (%rbx,%rsi,4)
movl %esi, %eax
xorl %edx, %edx
divl %r15d
movq (%rdi,%rax,8), %rax
movzwl (%rax,%r13), %eax
movw %ax, (%rcx,%rsi,2)
incq %rsi
addq $0x30, %r12
jmp 0x9076
movq %rcx, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl %r14d, %ecx
pushq 0x40(%rsp)
pushq %r11
pushq %r10
pushq 0x70(%rsp)
callq 0x8f7c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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:
leal (,%rdi,4), %eax
pushq $0x3
popq %rcx
xorl %edx, %edx
divl %ecx
pushq $0x1
popq %rdx
pushq $0x2
popq %rcx
cmpl $0x1e, %edx
ja 0x90fe
cmpl %eax, %ecx
jae 0x90fe
addl %ecx, %ecx
incl %edx
jmp 0x90ef
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 %edx, %edx
cmpl $0x2, %eax
sete %dl
incl %edx
xorl %ecx, %ecx
xorl %r11d, %r11d
cmpl %edx, %r11d
je 0x915b
testl %r11d, %r11d
movq %rsi, %rbx
cmoveq %rdi, %rbx
xorl %r14d, %r14d
cmpq $0x8, %r14
je 0x9156
movzbl (%rbx,%r14), %ebp
addl %ebp, %ecx
imull $0x401, %ecx, %ebp      # imm = 0x401
movl %ebp, %ecx
shrl $0x6, %ecx
xorl %ebp, %ecx
incq %r14
jmp 0x9137
incl %r11d
jmp 0x9125
xorl %edx, %edx
cmpl $0x1, %eax
setne %dl
incl %edx
xorl %esi, %esi
leaq -0x4(%rsp), %rdi
leaq -0x8(%rsp), %r11
cmpl %edx, %esi
je 0x91a4
testl %esi, %esi
movq %r11, %rbx
cmoveq %rdi, %rbx
xorl %r14d, %r14d
cmpq $0x4, %r14
je 0x91a0
movzbl (%rbx,%r14), %ebp
addl %ebp, %ecx
imull $0x401, %ecx, %ebp      # imm = 0x401
movl %ebp, %ecx
shrl $0x6, %ecx
xorl %ebp, %ecx
incq %r14
jmp 0x9181
incl %esi
jmp 0x9171
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
movzbl %r8b, %esi
movzbl %r9b, %edi
cmpl %edx, %eax
je 0x91db
testl %edx, %edx
movl %edi, %r8d
cmovel %esi, %r8d
movzbl %r8b, %r8d
addl %r8d, %ecx
imull $0x401, %ecx, %r8d      # imm = 0x401
movl %r8d, %ecx
shrl $0x6, %ecx
xorl %r8d, %ecx
incl %edx
jmp 0x91b3
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
imull $0x8001, %ecx, %eax     # imm = 0x8001
xorl %edx, %edx
divl %r10d
movl %edx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: addToHash
void addToHash(Chrom* chrom, Chrom* chrom1, uint32_t pos,
    uint32_t pos1, bool strand, bool strand1,
    HashAln** table, uint32_t idx, char* name) {
  HashAln* h = (HashAln*) memalloc(sizeof(HashAln));
  h->chrom = chrom;
  h->chrom1 = chrom1;
  h->pos = pos;
  h->pos1 = pos1;
  h->strand = strand;
  h->strand1 = strand1;
  h->name = NULL;
  if (name) {
    h->name = (char*) memalloc(1 + strlen(name));
    strcpy(h->name, name);
  }
  h->next = table[idx];
  table[idx] = h;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movl %r8d, %r15d
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %rbp
pushq $0x30
popq %rdi
callq 0x2752
movq %rax, %rbx
movq %rbp, 0x8(%rax)
movq %r14, 0x10(%rax)
movq 0x50(%rsp), %r14
movl %r13d, 0x18(%rax)
movl %r12d, 0x1c(%rax)
movb %r15b, 0x20(%rax)
movl 0x4(%rsp), %eax
movb %al, 0x21(%rbx)
andq $0x0, (%rbx)
testq %r14, %r14
je 0x9269
movq %r14, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x2752
movq %rax, (%rbx)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2070
movl 0x48(%rsp), %eax
movq 0x40(%rsp), %rdx
movq (%rdx,%rax,8), %rcx
movq %rcx, 0x28(%rbx)
movq %rbx, (%rdx,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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
movl 0x10(%rsp), %r10d
shlq $0x3, %rax
addq 0x18(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x9306
cmpl $0x2, %r10d
je 0x92de
cmpl $0x1, %r10d
je 0x92cb
testl %r10d, %r10d
jne 0x9308
cmpq %rdi, 0x8(%rax)
jne 0x9300
cmpl %edx, 0x18(%rax)
jne 0x9300
cmpl %ecx, 0x1c(%rax)
jne 0x9300
jmp 0x9306
cmpq %rdi, 0x8(%rax)
jne 0x9300
cmpl %edx, 0x18(%rax)
jne 0x9300
cmpb %r8b, 0x20(%rax)
jne 0x9300
jmp 0x9306
cmpq %rdi, 0x8(%rax)
jne 0x9300
cmpq %rsi, 0x10(%rax)
jne 0x9300
cmpl %edx, 0x18(%rax)
jne 0x9300
cmpl %ecx, 0x1c(%rax)
jne 0x9300
cmpb %r8b, 0x20(%rax)
jne 0x9300
cmpb %r9b, 0x21(%rax)
je 0x9306
addq $0x28, %rax
jmp 0x92a0
popq %rcx
retq
leaq 0x8800(%rip), %rdi      # 0x11b0f
pushq $0x28
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movl %r8d, %r12d
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %eax
movq %rdi, %rbx
pushq $0x1
popq %r14
movq %rdx, %rdi
xorl %esi, %esi
movl %ecx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %rax
pushq %r14
callq 0x9101
popq %rcx
popq %rdx
movl %eax, %r13d
subq $0x8, %rsp
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %r12d, %r8d
xorl %r9d, %r9d
pushq %r13
pushq %rbx
pushq %r14
callq 0x928d
addq $0x20, %rsp
testq %rax, %rax
je 0x9384
addq $0x8, %rsp
jmp 0x93a8
subq $0x8, %rsp
movzbl %r12b, %r8d
movq %r15, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq 0x8(%rsp)
pushq %r13
pushq %rbx
callq 0x91f7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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 0x942d
cmpl $0x1, %ebx
je 0x93fa
testl %ebx, %ebx
jne 0x94c3
movq (%rcx), %rcx
subq $0x8, %rsp
testb %sil, %sil
je 0x94a6
leaq 0x866d(%rip), %rsi      # 0x11a5f
movl %r9d, %r8d
movl %r10d, %r9d
jmp 0x941f
movq (%rcx), %rcx
xorb $0x1, %al
movzbl %al, %eax
leal 0x2b(,%rax,2), %eax
subq $0x8, %rsp
testb %sil, %sil
je 0x9476
leaq 0x865d(%rip), %rsi      # 0x11a76
movl %r9d, %r8d
movl %eax, %r9d
xorl %eax, %eax
pushq %r11
callq 0x20e0
jmp 0x94bc
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 0x9485
leaq 0x862d(%rip), %rsi      # 0x11a8d
movl %r9d, %r8d
movl %eax, %r9d
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r10
pushq %rbx
callq 0x20e0
jmp 0x94a0
leaq 0x85f9(%rip), %rsi      # 0x11a76
movl %r9d, %r8d
movl %eax, %r9d
jmp 0x94b3
leaq 0x8601(%rip), %rsi      # 0x11a8d
movl %r9d, %r8d
movl %eax, %r9d
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r10
pushq %rbx
callq 0x21c0
addq $0x20, %rsp
jmp 0x94be
leaq 0x85b2(%rip), %rsi      # 0x11a5f
movl %r9d, %r8d
movl %r10d, %r9d
xorl %eax, %eax
pushq %r11
callq 0x21c0
popq %rcx
popq %rdx
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8645(%rip), %rdi      # 0x11b0f
pushq $0x28
popq %rsi
callq 0x2724
pushq $0x1
popq %rdi
callq 0x22a0
// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdi, %rbx
movq %r8, 0x18(%rsp)
testq %r8, %r8
setne %al
movl %r9d, 0x14(%rsp)
testl %r9d, %r9d
setne %cl
andb %al, %cl
movb %cl, 0xf(%rsp)
pushq $0x20
popq %r14
xorl %ecx, %ecx
movzbl 0x10(%rbx), %eax
cmpq %rax, %rcx
jae 0x9607
movq %rcx, 0x30(%rsp)
movq %rbx, %rbp
movq 0x8(%rbx), %r13
movq (%r13,%r14), %rbx
movl -0x20(%r13,%r14), %r15d
movl -0x1c(%r13,%r14), %r12d
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq 0x28(%rsp)
pushq $0x0
callq 0x9101
popq %rcx
popq %rdx
movl $0x0, %r10d
cmpb $0x0, 0x10(%rsp)
je 0x9572
movq (%rbp), %r10
subq $0x8, %rsp
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r10
pushq %rax
pushq 0x38(%rsp)
callq 0x91f7
addq $0x20, %rsp
cmpb $0x0, 0xf(%rsp)
movq %rbp, %rbx
je 0x95f6
cmpb $0x0, 0x10(%rsp)
je 0x95ad
movq (%rbx), %r9
jmp 0x95b0
xorl %r9d, %r9d
movq (%r13,%r14), %rdx
movl -0x20(%r13,%r14), %ecx
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
pushq $0x1
popq %r8
callq 0x931f
cmpb $0x0, 0x10(%rsp)
je 0x95d8
movq (%rbx), %r9
jmp 0x95db
xorl %r9d, %r9d
movq (%r13,%r14), %rdx
movl -0x1c(%r13,%r14), %ecx
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
xorl %r8d, %r8d
callq 0x931f
movq 0x30(%rsp), %rcx
incq %rcx
addq $0x28, %r14
jmp 0x951b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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
movl %r9d, 0x8(%rsp)
movl %r8d, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
pushq $-0x1
popq %r12
xorl %ecx, %ecx
movq %rdi, 0x30(%rsp)
movzbl 0x10(%rdi), %ebx
incq %r12
cmpq %rbx, %r12
jae 0x9714
movq %rbx, 0x18(%rsp)
leaq 0x28(%rcx), %r14
movq 0x8(%rdi), %r13
movq 0x20(%r13,%rcx), %rbx
movl (%r13,%rcx), %ebp
movl 0x4(%r13,%rcx), %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq 0x28(%rsp)
pushq $0x0
callq 0x9101
popq %rcx
popq %rdx
subq $0x8, %rsp
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq 0x30(%rsp)
pushq $0x0
callq 0x928d
movq 0x50(%rsp), %rdi
addq $0x20, %rsp
movq %r14, %rcx
testq %rax, %rax
je 0x9648
cmpb $0x0, 0xc(%rsp)
movq 0x18(%rsp), %rbx
je 0x9714
movq (%rdi), %rdx
movq -0x8(%r13,%r14), %rcx
movl -0x28(%r13,%r14), %r9d
movl -0x24(%r13,%r14), %esi
movq (%rax), %rax
subq $0x30, %rsp
andl $0x0, 0x20(%rsp)
andl $0x0, 0x10(%rsp)
movq %rax, 0x18(%rsp)
andl $0x0, 0x8(%rsp)
movl %esi, (%rsp)
movzbl 0x38(%rsp), %esi
movq 0x40(%rsp), %rdi
xorl %r8d, %r8d
callq 0x93b3
addq $0x30, %rsp
cmpq %rbx, %r12
setb %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: 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)
movq %rdi, %r12
xorl %r14d, %r14d
xorl %r15d, %r15d
movzbl 0x10(%r12), %eax
cmpq %rax, %r15
jae 0xa333
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 0x9101
popq %rcx
popq %rdx
movl $0x0, %r10d
cmpb $0x0, 0x4(%rsp)
je 0xa303
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 0x91f7
addq $0x20, %rsp
incq %r15
addq $0x28, %r14
jmp 0xa2ae
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq