LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0xa47a
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 0xa430
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
pushq %r12
pushq %r11
pushq %r10
pushq 0x70(%rsp)
callq 0xa325
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: 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 0xa4cc
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rdi, %rcx
shrq $0x21, %rcx
movl $0x1, %edx
addl %eax, %eax
cmpl $0x1d, %edx
ja 0xa4cc
incl %edx
cmpl %ecx, %eax
jb 0xa4bf
retq
// File: /workspace/github_c_makefile_star2_O1/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
xorl %ecx, %ecx
testl %edx, %edx
movq %rsi, %r11
cmoveq %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 0xa4f1
cmpl $0x2, %eax
jne 0xa524
leal 0x1(%rdx), %r11d
testl %edx, %edx
movl %r11d, %edx
je 0xa4e6
xorl %esi, %esi
leaq -0x4(%rsp), %rdx
leaq -0x8(%rsp), %rdi
testl %esi, %esi
movq %rdi, %r11
cmoveq %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 0xa53b
cmpl $0x1, %eax
je 0xa56e
leal 0x1(%rsi), %r11d
testl %esi, %esi
movl %r11d, %esi
je 0xa530
testl %eax, %eax
jle 0xa5a5
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 0xa57c
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_O1/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
movl $0x30, %edi
callq 0x3903
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)
movq $0x0, (%rbx)
testq %r14, %r14
je 0xa639
movq %r14, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x3903
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_O1/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 0xa6d7
movl 0x10(%rsp), %r10d
cmpl $0x2, %r10d
ja 0xa6d9
movq 0x8(%rax), %r11
cmpl $0x1, %r10d
je 0xa69b
testl %r10d, %r10d
jne 0xa6ad
cmpq %rdi, %r11
jne 0xa6ce
cmpl %edx, 0x18(%rax)
jne 0xa6ce
cmpl %ecx, 0x1c(%rax)
jne 0xa6ce
jmp 0xa6d7
cmpq %rdi, %r11
jne 0xa6ce
cmpl %edx, 0x18(%rax)
jne 0xa6ce
cmpb %r8b, 0x20(%rax)
jne 0xa6ce
jmp 0xa6d7
cmpq %rdi, %r11
jne 0xa6ce
cmpq %rsi, 0x10(%rax)
jne 0xa6ce
cmpl %edx, 0x18(%rax)
jne 0xa6ce
cmpl %ecx, 0x1c(%rax)
jne 0xa6ce
cmpb %r8b, 0x20(%rax)
jne 0xa6ce
cmpb %r9b, 0x21(%rax)
je 0xa6d7
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0xa67b
popq %rcx
retq
callq 0x2f1f
// File: /workspace/github_c_makefile_star2_O1/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 0xa4cd
addq $0x10, %rsp
movl %eax, %ecx
movq (%rbx,%rcx,8), %rcx
testq %rcx, %rcx
je 0xa730
cmpq %r15, 0x8(%rcx)
jne 0xa72a
cmpl %ebp, 0x18(%rcx)
jne 0xa72a
cmpb %r12b, 0x20(%rcx)
je 0xa751
movq 0x28(%rcx), %rcx
jmp 0xa714
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 0xa5c2
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: 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 0xa7d4
cmpl $0x1, %ebx
je 0xa7a1
testl %ebx, %ebx
jne 0xa86c
movq (%rcx), %rcx
subq $0x8, %rsp
testb %sil, %sil
je 0xa84d
leaq 0x9376(%rip), %rsi      # 0x13b0f
movl %r9d, %r8d
movl %r10d, %r9d
jmp 0xa7c6
movq (%rcx), %rcx
xorb $0x1, %al
movzbl %al, %eax
leal 0x2b(,%rax,2), %eax
subq $0x8, %rsp
testb %sil, %sil
je 0xa81d
leaq 0x9366(%rip), %rsi      # 0x13b26
movl %r9d, %r8d
movl %eax, %r9d
xorl %eax, %eax
pushq %r11
callq 0x20e0
jmp 0xa863
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 0xa82c
leaq 0x9336(%rip), %rsi      # 0x13b3d
movl %r9d, %r8d
movl %eax, %r9d
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r10
pushq %rbx
callq 0x20e0
jmp 0xa847
leaq 0x9302(%rip), %rsi      # 0x13b26
movl %r9d, %r8d
movl %eax, %r9d
jmp 0xa85a
leaq 0x930a(%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 0xa867
leaq 0x92bb(%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 0x2f37
// File: /workspace/github_c_makefile_star2_O1/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 %r9d, 0x10(%rsp)
movq %r8, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
cmpb $0x0, 0x10(%rdi)
je 0xa9ac
movq %rdi, %rbx
cmpq $0x0, 0x18(%rsp)
setne %al
cmpl $0x0, 0x10(%rsp)
setne %cl
andb %al, %cl
movb %cl, 0xf(%rsp)
movl $0x20, %r14d
xorl %ebp, %ebp
movq %rdi, 0x20(%rsp)
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 0x30(%rsp)
pushq $0x0
callq 0xa4cd
addq $0x10, %rsp
movl $0x0, %r10d
cmpb $0x0, 0x14(%rsp)
je 0xa910
movq 0x20(%rsp), %rcx
movq (%rcx), %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 0x40(%rsp)
callq 0xa5c2
addq $0x20, %rsp
cmpb $0x0, 0xf(%rsp)
movq 0x20(%rsp), %rbx
je 0xa998
cmpb $0x0, 0x14(%rsp)
je 0xa94d
movq (%rbx), %r9
jmp 0xa950
xorl %r9d, %r9d
movq (%r13,%r14), %rdx
movl -0x20(%r13,%r14), %ecx
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
movl $0x1, %r8d
callq 0xa6de
cmpb $0x0, 0x14(%rsp)
je 0xa97a
movq (%rbx), %r9
jmp 0xa97d
xorl %r9d, %r9d
movq (%r13,%r14), %rdx
movl -0x1c(%r13,%r14), %ecx
movq 0x18(%rsp), %rdi
movl 0x10(%rsp), %esi
xorl %r8d, %r8d
callq 0xa6de
incq %rbp
movzbl 0x10(%rbx), %eax
addq $0x28, %r14
cmpq %rax, %rbp
jb 0xa8c8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: 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
setne %bl
je 0xaab1
movl %r8d, 0xc(%rsp)
movl %r9d, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x8(%rdi), %r14
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 0xa4cd
addq $0x10, %rsp
movl %eax, %eax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xaa62
cmpq %r12, 0x8(%rax)
jne 0xaa5c
cmpl %r15d, 0x18(%rax)
jne 0xaa5c
cmpl %ebp, 0x1c(%rax)
je 0xaa62
movq 0x28(%rax), %rax
jmp 0xaa46
testq %rax, %rax
jne 0xaa76
incq %r13
cmpq 0x20(%rsp), %r13
setb %bl
jne 0xaa03
jmp 0xaab1
cmpb $0x0, 0xc(%rsp)
je 0xaab1
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 0xa75a
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_O1/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 0xb772
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 0xa4cd
addq $0x10, %rsp
movl $0x0, %r10d
cmpb $0x0, 0x4(%rsp)
je 0xb738
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 0xa5c2
addq $0x20, %rsp
incq %r15
movzbl 0x10(%r12), %eax
addq $0x28, %r14
cmpq %rax, %r15
jb 0xb6ec
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: 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
setne %bl
je 0xb880
movl %r8d, 0xc(%rsp)
movl %r9d, 0x8(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x8(%rdi), %rax
movq %rax, 0x20(%rsp)
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 0xa4cd
addq $0x10, %rsp
movl %eax, %eax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xb82e
cmpq %r15, 0x8(%rax)
jne 0xb828
cmpl %ebp, 0x18(%rax)
jne 0xb828
cmpb %r12b, 0x20(%rax)
je 0xb82e
movq 0x28(%rax), %rax
jmp 0xb812
testq %rax, %rax
jne 0xb840
incq %r14
cmpq %r13, %r14
setb %bl
jne 0xb7ca
jmp 0xb880
cmpb $0x0, 0xc(%rsp)
je 0xb880
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 0xa75a
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_O1/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 0xc26f
movl %eax, 0x4(%rdi)
jmp 0xc271
movl %eax, (%rdi)
movss 0x5eff(%rip), %xmm1     # 0x12178
ucomiss %xmm1, %xmm0
jne 0xc280
jnp 0xc294
movss 0x8(%rdi), %xmm1
ucomiss 0x5eec(%rip), %xmm1     # 0x12178
jne 0xc290
jnp 0xc299
addss %xmm0, %xmm1
movss %xmm1, 0x8(%rdi)
movb $0x1, 0xe(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc306
movq (%rdi), %rdi
leaq (%rax,%rax,4), %r10
leaq (%rdi,%r10,8), %rdi
movq %rcx, 0x20(%rdi)
movss %xmm0, 0x8(%rdi)
movzwl %dx, %ecx
btl $0x8, %ecx
setae 0xc(%rdi)
movl 0x8(%rsp), %edx
movw $0x1, 0xd(%rdi)
testb $0x40, %cl
jne 0xc2ec
movl %edx, (%rdi)
shll $0x1b, %ecx
sarl $0x1f, %ecx
andl %r9d, %ecx
addl %r8d, %ecx
xorl %r8d, %r8d
movl %ecx, %edx
jmp 0xc2fd
shll $0x1b, %ecx
sarl $0x1f, %ecx
andl %r9d, %ecx
addl %r8d, %ecx
movl %ecx, (%rdi)
movb $0x1, %r8b
movl %edx, 0x4(%rdi)
movb %r8b, 0xf(%rdi)
incl (%rsi)
cmpl $0x80, %eax
setne %al
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xc362
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_O1/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 0xc389
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 0xc375
jmp 0xc38b
xorl %ecx, %ecx
movl $0xffff, %eax           # imm = 0xFFFF
cmpl %eax, %ecx
cmovll %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl %ecx, 0x4(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
leaq 0x7224(%rip), %rsi      # 0x13b61
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x2280
movl $0x0, %ebx
testq %rax, %rax
je 0xc9b7
movq %rax, %r13
xorl %ebx, %ebx
leaq 0x7206(%rip), %r14      # 0x13b63
leaq 0x71fd(%rip), %rbp      # 0x13b61
leaq 0x71fc(%rip), %r15      # 0x13b67
xorl %r12d, %r12d
movl $0x3, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x2060
testl %eax, %eax
je 0xc99e
movl $0x3, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x2060
addq $0x3, %r13
testl %eax, %eax
cmoveq %r13, %rbx
jmp 0xc9a5
addq $0x3, %r13
movq %r13, %r12
xorl %edi, %edi
movq %rbp, %rsi
callq 0x2280
movq %rax, %r13
testq %rax, %rax
jne 0xc96e
testq %r12, %r12
je 0xc9e4
testq %rbx, %rbx
je 0xc9e4
movb 0x70(%rsp), %r15b
movb 0x68(%rsp), %bpl
movq 0x60(%rsp), %r14
movq %r12, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xc9ea
cmpl $0xa, %ecx
je 0xc9ea
incq %rax
jmp 0xc9d3
addq $0x28, %rsp
jmp 0xca40
movb $0x0, (%rax)
movq %rbx, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xca01
cmpl $0xa, %ecx
je 0xca01
incq %rax
jmp 0xc9f0
movb $0x0, (%rax)
movq %rbx, %rdi
callq 0x3951
movzbl %r15b, %r10d
movzbl %bpl, %r11d
movq %r12, %rdi
movl %eax, %esi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movl 0x4(%rsp), %r8d
movq 0x18(%rsp), %r9
pushq %r10
pushq %r11
pushq %r14
pushq 0x38(%rsp)
callq 0xc71f
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: 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 0x70f6(%rip), %rsi      # 0x13b61
callq 0x2280
testq %rax, %rax
je 0xcb68
movq %rax, %r13
leaq 0x70e8(%rip), %rsi      # 0x13b6b
movq %rax, %rdi
callq 0x21b0
testl %eax, %eax
je 0xcad8
leaq 0x70e7(%rip), %rsi      # 0x13b7d
movq %r13, %rdi
callq 0x21b0
testl %eax, %eax
jne 0xcb68
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 0xc910
addq $0x28, %rsp
jmp 0xcb6c
leaq 0x7082(%rip), %rsi      # 0x13b61
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x2280
testq %rax, %rax
je 0xcb2c
movq %rax, %r14
xorl %ebx, %ebx
leaq 0x7076(%rip), %r15      # 0x13b6f
leaq 0x7061(%rip), %r12      # 0x13b61
movl $0x3, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2060
addq $0x3, %r14
testl %eax, %eax
cmoveq %r14, %rbx
xorl %edi, %edi
movq %r12, %rsi
callq 0x2280
movq %rax, %r14
testq %rax, %rax
jne 0xcb00
movb 0x50(%rsp), %al
testq %rbx, %rbx
je 0xcb4c
movq %rbx, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0xcb49
cmpl $0xa, %edx
je 0xcb49
incq %rcx
jmp 0xcb38
movb $0x0, (%rcx)
testb %al, %al
je 0xcb68
testq %rbx, %rbx
je 0xcb77
leaq 0x7017(%rip), %rsi      # 0x13b73
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
jne 0xcb77
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2f90
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: loadFields
bool loadFields(uint16_t* flag, char** rname, uint32_t* pos,
    uint8_t* mapq, char** cigar, char** rnext, uint32_t* pnext,
    int32_t* tlen, char** seq, char** qual, char** extra) {
  *extra = NULL;  // reset 'extra' fields
  int i = 2;
  char* field = strtok(NULL, TAB);
  while (field != NULL) {
    switch (i) {
      case FLAG: *flag = getInt(field); break;
      case RNAME: *rname = field; break;
      case POS: *pos = getInt(field) - 1; break;  // convert to 0-based
      case MAPQ: *mapq = getInt(field); break;
      case CIGAR: *cigar = field; break;
      case RNEXT: *rnext = field; break;
      case PNEXT: *pnext = getInt(field) - 1; break;  // convert to 0-based
      case TLEN: *tlen = getInt(field); break;
      case SEQ: *seq = field; break;
      case QUAL: *qual = field; break;
      default: return false;
    }
    if (++i > 11) {
      *extra = strtok(NULL, "\n");
      break;
    }
    field = strtok(NULL, TAB);
  }
  return i > 11;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, (%rsp)
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movq 0x70(%rsp), %rax
movq $0x0, (%rax)
leaq 0x6fad(%rip), %rsi      # 0x13b61
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x2280
testq %rax, %rax
je 0xcca3
movl $0x2, %r14d
leaq 0x5795(%rip), %r15      # 0x12368
leaq 0x6f87(%rip), %rbx      # 0x13b61
leal -0x2(%r14), %ecx
cmpl $0x9, %ecx
ja 0xccb4
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movq %rax, %rdi
callq 0x3951
movw %ax, (%rbp)
jmp 0xcc63
movq 0x8(%rsp), %rcx
jmp 0xcc60
movq 0x68(%rsp), %rcx
jmp 0xcc60
movq %rax, %rdi
callq 0x3951
decl %eax
movl %eax, (%r12)
jmp 0xcc63
movq %rax, %rdi
callq 0x3951
movq (%rsp), %rcx
movb %al, (%rcx)
jmp 0xcc63
movq %rax, %rdi
callq 0x3951
movq 0x58(%rsp), %rcx
jmp 0xcc57
movq %rax, (%r13)
jmp 0xcc63
movq 0x10(%rsp), %rcx
jmp 0xcc60
movq %rax, %rdi
callq 0x3951
decl %eax
movq 0x50(%rsp), %rcx
movl %eax, (%rcx)
jmp 0xcc63
movq 0x60(%rsp), %rcx
movq %rax, (%rcx)
cmpl $0xb, %r14d
je 0xcc8b
incl %r14d
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2280
testq %rax, %rax
jne 0xcbda
decl %r14d
cmpl $0xb, %r14d
setae %bl
jmp 0xcca3
leaq 0x6a1d(%rip), %rsi      # 0x136af
xorl %edi, %edi
callq 0x2280
movq 0x70(%rsp), %rcx
movq %rax, (%rcx)
movb $0x1, %bl
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0xcca3
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: getScore
float getScore(char* extra) {
  if (extra == NULL)
    return NOSCORE;
  char* end;
  char* field = strtok_r(extra, TAB, &end);
  while (field != NULL) {
    char* tag = strtok(field, COL);
    if (!strcmp(tag, SCORE)) {
      for (int i = 0; i < 2; i++) {
        tag = strtok(NULL, COL);
        if (tag == NULL)
          return NOSCORE;
        if (i)
          return getFloat(tag);
      }
    }
    field = strtok_r(NULL, TAB, &end);
  }
  return NOSCORE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0xcd6a
leaq 0x6e8b(%rip), %rsi      # 0x13b61
leaq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x2190
movq %rax, %r13
leaq 0x6e7c(%rip), %r15      # 0x13b69
leaq 0x6e8d(%rip), %r12      # 0x13b81
testq %r13, %r13
je 0xcd6a
movss %xmm0, 0xc(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x2280
movq %rax, %rdi
movq %r12, %rsi
callq 0x21b0
movl %eax, %ebp
testl %eax, %eax
je 0xcd37
xorl %edi, %edi
leaq 0x6e3d(%rip), %rsi      # 0x13b61
movq %r14, %rdx
callq 0x2190
movq %rax, %r13
movss 0xc(%rsp), %xmm0
jmp 0xcd64
movb $0x1, %bl
xorl %edi, %edi
movq %r15, %rsi
callq 0x2280
testq %rax, %rax
je 0xcd5c
testb $0x1, %bl
movl $0x0, %ebx
jne 0xcd39
movq %rax, %rdi
callq 0x3927
jmp 0xcd64
movss 0x5414(%rip), %xmm0     # 0x12178
testl %ebp, %ebp
jne 0xccf4
jmp 0xcd72
movss 0x5406(%rip), %xmm0     # 0x12178
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: parseCigar
int parseCigar(char* cigar, int* offset) {
  int length = 0; // length of sequence
  int pos = 0;    // position of current op in cigar
  char op;
  int len = strlen(cigar);
  for (int i = 0; i < len; i++) {
    if (cigar[i] < 0x30 || cigar[i] > 0x39) {
      op = cigar[i];
      cigar[i] = '\0';
      int opLen = getInt(cigar + pos); // length of current op
      switch (op) {
        case 'M':
        case '=':
        case 'X':
          length += opLen;
          break;
        case 'I':
        case 'S':
          length += opLen;
          *offset -= opLen;
          break;
        case 'D':
          *offset += opLen;
          break;
        case 'N':
        case 'H':
        case 'P':
          break;
        default: ;
          char msg[4] = "' '";
          msg[1] = op;
          exit(error(msg, ERRCIGAR));
      }
      pos = i + 1;
    }
  }
  return length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
callq 0x20f0
movq %rax, %r15
testl %r15d, %r15d
jle 0xce2d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
movl $0x141, %ebx            # imm = 0x141
xorl %ebp, %ebp
xorl %eax, %eax
movzbl (%r14,%r13), %r12d
leal -0x3a(%r12), %ecx
cmpb $-0xb, %cl
ja 0xce23
movb $0x0, (%r14,%r13)
movslq %eax, %rdi
addq %r14, %rdi
callq 0x3951
leal -0x48(%r12), %ecx
cmpl $0x10, %ecx
ja 0xcdfd
btl %ecx, %ebx
jb 0xce1f
movl $0x802, %edx            # imm = 0x802
btl %ecx, %edx
jb 0xce0d
movl $0x10020, %edx          # imm = 0x10020
btl %ecx, %edx
jb 0xce09
cmpl $0x44, %r12d
je 0xce18
cmpl $0x3d, %r12d
jne 0xce40
addl %eax, %ebp
jmp 0xce1f
addl %eax, %ebp
movq 0x8(%rsp), %rcx
subl %eax, (%rcx)
jmp 0xce1f
movq 0x8(%rsp), %rcx
addl %eax, (%rcx)
leal 0x1(%r13), %eax
incq %r13
cmpq %r13, %r15
jne 0xcdbb
jmp 0xce2f
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14(%rsp), %rdi
movl %r12d, %esi
callq 0x2fa8
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: calcDist
int calcDist(char* qname, char* seq, char* cigar) {
  int length = strcmp(seq, "*") ? strlen(seq) : 0;
  int offset = 0;
  if (strcmp(cigar, "*")) {
    int len = parseCigar(cigar, &offset);
    if (! length)
      length = len;
    else if (length != len)
      exit(error(qname, ERRMISM));
  } else if (! length)
    exit(error(qname, ERRINFO));
  return length + offset;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x6651(%rip), %rsi      # 0x134b7
movq %r14, %rdi
callq 0x21b0
testl %eax, %eax
je 0xce7f
movq %r14, %rdi
callq 0x20f0
movq %rax, %r14
jmp 0xce82
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
leaq 0x6626(%rip), %rsi      # 0x134b7
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
je 0xcebc
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
callq 0xcd81
testl %r14d, %r14d
je 0xcec9
cmpl %eax, %r14d
je 0xcecc
movq %rbx, %rdi
callq 0x2fc3
testl %r14d, %r14d
jne 0xcecc
movq %rbx, %rdi
callq 0x2fd4
movl %eax, %r14d
addl 0xc(%rsp), %r14d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: readInt32
int32_t readInt32(gzFile in, bool end) {
  int32_t ans = 0;
  for (int i = 0; i < sizeof(int32_t); i++) {
    int m = gzgetc(in);
    if (m == -1) {
      if (end)
        exit(error("", ERRBAM));
      else
        return EOF;
    }
    ans = ans | ((m & 0xFF) << (i*8));
  }
  return ans;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
movl (%r14), %eax
testl %eax, %eax
je 0xd8ed
decl %eax
movl %eax, (%r14)
incq 0x10(%r14)
movq 0x8(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%r14)
movzbl (%rax), %eax
jmp 0xd8f5
movq %r14, %rdi
callq 0x20a0
cmpl $-0x1, %eax
je 0xd906
movzbl %al, %edx
movl %r15d, %ecx
shll %cl, %edx
orl %edx, %ebp
jmp 0xd90a
testb %bl, %bl
jne 0xd92d
cmpl $-0x1, %eax
je 0xd91b
addl $0x8, %r15d
cmpl $0x20, %r15d
jne 0xd8cc
jmp 0xd920
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x303a
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: loadInt32
int32_t loadInt32(char** block) {
  int32_t ans = 0;
  for (int i = 0; i < sizeof(int32_t); i++) {
    ans = ans | ((**block & 0xFF) << (i*8));
    (*block)++;
  }
  return ans;
}

// Assembly:
movq (%rdi), %rdx
incq %rdx
xorl %ecx, %ecx
xorl %eax, %eax
movzbl -0x1(%rdx), %esi
shll %cl, %esi
orl %esi, %eax
movq %rdx, (%rdi)
addl $0x8, %ecx
incq %rdx
cmpl $0x20, %ecx
jne 0xd93c
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: calcDistBAM
int calcDistBAM(int32_t l_seq, uint16_t n_cigar_op,
    uint32_t* cigar) {
  int length = l_seq;
  for (int i = 0; i < n_cigar_op; i++) {
    uint8_t op = cigar[i] & 0xF;
    uint32_t op_len = cigar[i] >> 4;
    if (op == 1 || op == 4)  // 'I' or 'S'
      length -= op_len;
    else if (op == 2)        // 'D'
      length += op_len;
  }
  return length;
}

// Assembly:
movl %edi, %eax
testl %esi, %esi
je 0xdb1b
movzwl %si, %ecx
xorl %esi, %esi
movl (%rdx,%rsi,4), %edi
movl %edi, %r8d
andl $0xf, %r8d
shrl $0x4, %edi
cmpl $0x4, %r8d
je 0xdb0d
cmpl $0x2, %r8d
je 0xdb11
cmpl $0x1, %r8d
jne 0xdb13
subl %edi, %eax
jmp 0xdb13
addl %edi, %eax
incq %rsi
cmpq %rsi, %rcx
jne 0xdaee
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: arrayLen
int arrayLen(char* extra) {
  int size = 0;
  switch (extra[0]) {
    case 'c': size = sizeof(int8_t); break;
    case 'C': size = sizeof(uint8_t); break;
    case 's': size = sizeof(int16_t); break;
    case 'S': size = sizeof(uint16_t); break;
    case 'i': size = sizeof(int32_t); break;
    case 'I': size = sizeof(uint32_t); break;
    case 'f': size = sizeof(float); break;
    default: ;
      char msg[4] = "' '";
      msg[1] = extra[0];
      exit(error(msg, ERRTYPE));
  }
  extra++;
  int32_t count = loadInt32(&extra);
  return 1 + sizeof(int32_t) + size * count;
}

// Assembly:
pushq %rax
movzbl (%rdi), %esi
movl $0x1, %edx
cmpl $0x62, %esi
jle 0xdb3b
cmpl $0x68, %esi
jg 0xdb54
cmpl $0x63, %esi
je 0xdb6a
cmpl $0x66, %esi
je 0xdb65
jmp 0xdb4a
cmpl $0x43, %esi
je 0xdb6a
cmpl $0x49, %esi
je 0xdb65
cmpl $0x53, %esi
je 0xdb5e
leaq 0x4(%rsp), %rdi
callq 0x3052
cmpl $0x69, %esi
je 0xdb65
cmpl $0x73, %esi
jne 0xdb4a
movl $0x2, %edx
jmp 0xdb6a
movl $0x4, %edx
incq %rdi
xorl %ecx, %ecx
xorl %eax, %eax
movzbl (%rdi), %esi
shll %cl, %esi
orl %esi, %eax
addl $0x8, %ecx
incq %rdi
cmpl $0x20, %ecx
jne 0xdb71
imull %edx, %eax
addl $0x5, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: loadInt
int64_t loadInt(char* block, size_t size) {
  int64_t ans = 0;
  for (int i = 0; i < size; i++)
    ans = ans | ((block[i] & 0xFF) << (i*8));
  return ans;
}

// Assembly:
xorl %ecx, %ecx
testq %rsi, %rsi
je 0xdbb0
xorl %edx, %edx
xorl %eax, %eax
movzbl (%rdi,%rdx), %r8d
shll %cl, %r8d
movslq %r8d, %r8
orq %r8, %rax
incq %rdx
addl $0x8, %ecx
cmpq %rdx, %rsi
jne 0xdb96
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: openWrite
void openWrite(char* outFile, File* out, bool gz) {
  if (outFile[0] == '-' && strlen(outFile) > 1)
    exit(error(outFile, ERRNAME));
  if (gz) {
    if (!strcmp(outFile + strlen(outFile) - strlen(GZEXT), GZEXT)
        || !strcmp(outFile, "/dev/null"))
      out->gzf = gzopen(outFile, "w");
    else if (!strcmp(outFile, "-"))
      out->gzf = gzdopen(fileno(stdout), "wb");
    else {
      // add ".gz" to outFile
      char* outFile2 = memalloc(strlen(outFile)
        + strlen(GZEXT) + 1);
      strcpy(outFile2, outFile);
      strcat(outFile2, GZEXT);
      out->gzf = gzopen(outFile2, "w");
      free(outFile2);
    }
    if (out->gzf == NULL)
      exit(error(outFile, ERROPENW));
  } else {
    out->f = (strcmp(outFile, "-") ?
      fopen(outFile, "w") : stdout);
    if (out->f == NULL)
      exit(error(outFile, ERROPENW));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x2d, (%rdi)
jne 0xec04
movq %rbx, %rdi
callq 0x20f0
cmpq $0x2, %rax
jae 0xed28
testb %bpl, %bpl
je 0xeca8
movq %rbx, %rdi
callq 0x20f0
movq %rax, %r15
leaq (%rbx,%rax), %rdi
addq $-0x3, %rdi
leaq 0x4f8b(%rip), %rsi      # 0x13bb2
callq 0x21b0
testl %eax, %eax
je 0xeccc
leaq 0x4f7b(%rip), %rsi      # 0x13bb6
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
je 0xeccc
leaq 0x4f70(%rip), %rsi      # 0x13bc2
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
je 0xed09
addq $0x4, %r15
movq %r15, %rdi
callq 0x3903
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2070
movq %r15, %rdi
callq 0x20f0
movl $0x7a672e, (%r15,%rax)  # imm = 0x7A672E
leaq 0x4f2d(%rip), %rsi      # 0x13bc0
movq %r15, %rdi
callq 0x2260
movq %rax, (%r14)
movq %r15, %rdi
callq 0x2040
jmp 0xecde
leaq 0x4f13(%rip), %rsi      # 0x13bc2
movq %rbx, %rdi
callq 0x21b0
testl %eax, %eax
je 0xecec
leaq 0x4efe(%rip), %rsi      # 0x13bc0
movq %rbx, %rdi
callq 0x2270
jmp 0xecf6
leaq 0x4eed(%rip), %rsi      # 0x13bc0
movq %rbx, %rdi
callq 0x2260
movq %rax, (%r14)
cmpq $0x0, (%r14)
jne 0xecfe
movq %rbx, %rdi
callq 0x31cd
movq 0xb2cd(%rip), %rax      # 0x19fc0
movq (%rax), %rax
movq %rax, (%r14)
testq %rax, %rax
je 0xed30
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xb2b0(%rip), %rax      # 0x19fc0
movq (%rax), %rdi
callq 0x2220
leaq 0x4ea5(%rip), %rsi      # 0x13bc4
movl %eax, %edi
callq 0x20c0
jmp 0xecdb
movq %rbx, %rdi
callq 0x31de
movq %rbx, %rdi
callq 0x31bc
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: checkBAM
bool checkBAM(File in, bool gz) {
  if (! gz)
    return false;
  char magic[5] = "BAM\1";  // BAM magic string
  for (int i = 0; i < 4; i++) {
    char m = gzgetc(in.gzf);
    if (m == -1)
      exit(error("", ERROPEN));
    if (m != magic[i]) {
      // push back chars before returning false
      if (gzungetc(m, in.gzf) == -1)
        exit(error("", ERRUNGET));
      for (int j = i - 1; j > -1; j--)
        if (gzungetc(magic[j], in.gzf) == -1)
          exit(error("", ERRUNGET));
      return false;
    }
  }
  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testl %esi, %esi
je 0xedc7
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x4e76(%rip), %r14      # 0x13bc7
movq %rax, %r15
movl (%rbx), %eax
testl %eax, %eax
je 0xed72
decl %eax
movl %eax, (%rbx)
incq 0x10(%rbx)
movq 0x8(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rbx)
movb (%rax), %al
jmp 0xed7a
movq %rbx, %rdi
callq 0x20a0
cmpb $-0x1, %al
je 0xedcf
cmpb (%r15,%r14), %al
jne 0xed97
leaq 0x1(%r15), %rax
cmpq $0x4, %rax
jne 0xed51
cmpq $0x3, %r15
setae %al
jmp 0xedc9
movsbl %al, %edi
movq %rbx, %rsi
callq 0x20b0
cmpl $-0x1, %eax
je 0xedd4
testq %r15, %r15
jle 0xedc7
movsbl -0x1(%r15,%r14), %edi
decq %r15
movq %rbx, %rsi
callq 0x20b0
cmpl $-0x1, %eax
jne 0xeda7
callq 0x31ef
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
callq 0x321f
callq 0x3207
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: openRead
bool openRead(char* inFile, File* in) {

  // open file or stdin
  bool stdinBool = ! strcmp(inFile, "-");
  FILE* dummy = (stdinBool ? stdin : fopen(inFile, "r"));
  if (dummy == NULL)
    exit(error(inFile, ERROPEN));

  // check for gzip compression: magic number 0x1F, 0x8B
  bool gzip = true;
  int save = 0;  // first char to pushback (for stdin)
  int i, j;
  for (i = 0; i < 2; i++) {
    j = fgetc(dummy);
    if (j == EOF)
      exit(error(inFile, ERROPEN));
    if ( (i && (unsigned char) j != 0x8B)
        || (! i && (unsigned char) j != 0x1F) ) {
      gzip = false;
      break;
    }
    if (! i)
      save = j;
  }

  // for stdin, push back chars
  if (stdinBool) {
    if (gzip)
      exit(error("", ERRGZIP));
    if (ungetc(j, dummy) == EOF)
      exit(error("", ERRUNGET));
    if (i && ungetc(save, dummy) == EOF)
      exit(error("", ERRUNGET));
  }

  // open file
  if (gzip) {
    if (fclose(dummy))
      exit(error("<dummy>", ERRCLOSE));
    in->gzf = gzopen(inFile, "r");
    if (in->gzf == NULL)
      exit(error(inFile, ERROPEN));
  } else {
    if (! stdinBool)
      rewind(dummy);
    in->f = dummy;
  }

  return gzip;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
leaq 0x4dcc(%rip), %rsi      # 0x13bc2
callq 0x21b0
movl %eax, %r15d
testl %eax, %eax
je 0xee16
leaq 0x39e1(%rip), %rsi      # 0x127ea
movq %rbx, %rdi
callq 0x2270
movq %rax, %r12
jmp 0xee20
movq 0xb1ab(%rip), %rax      # 0x19fc8
movq (%rax), %r12
movq %rbx, 0x8(%rsp)
testq %r12, %r12
je 0xef1d
xorl %ebp, %ebp
movl $0x1f, %r14d
xorl %ebx, %ebx
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x2150
cmpl $-0x1, %eax
je 0xef13
testl %ebx, %ebx
movzbl %al, %ecx
movl $0x8b, %edx
cmovel %r14d, %edx
cmpl %edx, %ecx
jne 0xee74
testl %ebx, %ebx
cmovel %eax, %r13d
incl %ebx
cmpl $0x1, %ebx
setne %bpl
je 0xee3b
movl $0x1, %ebx
testl %r15d, %r15d
jne 0xeeae
testb $0x1, %bpl
jne 0xef2c
movl %eax, %edi
movq %r12, %rsi
callq 0x2240
cmpl $-0x1, %eax
je 0xef31
testl %ebx, %ebx
je 0xeeae
movl %r13d, %edi
movq %r12, %rsi
callq 0x2240
cmpl $-0x1, %eax
je 0xef36
testb $0x1, %bpl
je 0xeee9
movq %r12, %rdi
callq 0x20d0
testl %eax, %eax
jne 0xef27
leaq 0x3923(%rip), %rsi      # 0x127ea
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x2260
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
testq %rax, %rax
jne 0xeefe
movq %rbx, %rdi
callq 0x3268
testl %r15d, %r15d
je 0xeef6
movq %r12, %rdi
callq 0x2120
movq 0x10(%rsp), %rax
movq %r12, (%rax)
andb $0x1, %bpl
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
callq 0x32aa
movq 0x8(%rsp), %rdi
callq 0x32bc
callq 0x3250
callq 0x3292
callq 0x327a
callq 0x3238
// File: /workspace/github_c_makefile_star2_O1/jsh58[P]Genrich/Genrich.c
// Function: saveXChrom
int saveXChrom(char* xchrom, char*** xchrList) {
  int i = 0;
  char* chrom = strtok(xchrom, COM);
  while (chrom != NULL) {
    *xchrList = (char**) memrealloc(*xchrList,
      (i + 1) * sizeof(char*));
    (*xchrList)[i] = (char*) memalloc(1 + strlen(chrom));
    strcpy((*xchrList)[i], chrom);
    i++;
    chrom = strtok(NULL, COM);
  }
  return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq 0x2f90(%rip), %rsi      # 0x13bd4
callq 0x2280
testq %rax, %rax
je 0x10cb4
movq %rax, %r13
movl $0x8, %r15d
xorl %r14d, %r14d
leaq 0x2f73(%rip), %r12      # 0x13bd4
movq %r14, %rbp
movq (%rbx), %rdi
incq %r14
movq %r15, %rsi
callq 0x3915
movq %rax, (%rbx)
movq %r13, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x3903
movq (%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
movq (%rbx), %rax
movq (%rax,%rbp,8), %rdi
movq %r13, %rsi
callq 0x2070
xorl %edi, %edi
movq %r12, %rsi
callq 0x2280
movq %rax, %r13
addq $0x8, %r15
testq %rax, %rax
jne 0x10c61
jmp 0x10cb7
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq