// File: /workspace/github_c_makefile_star2_O0/jsh58[P]Genrich/Genrich.c
// Function: findDupsSn
void findDupsSn(Read** readSn, int readIdxSn,
    int readLenSn, uint64_t* countSn, uint64_t* dupsSn,
    uint64_t* singlePr, bool extendOpt, int extend,
    float asDiff, bool atacOpt, int atacLen5, int atacLen3,
    bool atacAdj, File bed, bool bedOpt, bool gzOut,
    bool ctrl, int sample, HashAln** table,
    uint32_t hashSize, File dups, bool dupsVerb,
    uint32_t* order, uint32_t* order0, uint32_t* order1,
    uint32_t* order2, uint16_t* qual, uint16_t* qual0,
    uint16_t* qual1, uint16_t* qual2, uint64_t* errCount,
    bool verbose) {

  // sort reads by qual score sum
  uint32_t count = readIdxSn * MAX_SIZE + readLenSn;
  sortReads(readSn, count, order, qual, order0, order1,
    order2, qual0, qual1, qual2);

  // loop through singleton reads
  for (uint32_t i = 0; i < count; i++) {
    Read* r = readSn[order[i] / MAX_SIZE]
      + order[i] % MAX_SIZE;

    // check hashtable for matches
    if (checkHashSn(r, table, hashSize, dups,
        dupsVerb, gzOut))
      (*dupsSn)++;
    else {
      // add alignments to hashtable
      addHashSn(r, table, hashSize, dupsVerb);
      // process alignments too
      *singlePr += processSingle(r->name, r->aln,
        r->alnLen, extendOpt, extend, false,
        NULL, NULL, NULL, NULL,
        r->score, asDiff, r->first,
        atacOpt, atacLen5, atacLen3, atacAdj,
        bed, bedOpt, gzOut, ctrl, sample, errCount,
        verbose);
    }

    // free Read
    free(r->name);
    free(r->aln);

    (*countSn)++;
  }

  // free nodes of hashtable
  for (uint32_t i = 0; i < hashSize; i++) {
    HashAln* tmp;
    HashAln* h = table[i];
    while (h != NULL) {
      free(h->name);
      tmp = h->next;
      free(h);
      h = tmp;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r9, %r11
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r12
movb 0x210(%rsp), %al
movb %al, 0xa7(%rsp)
movq 0x208(%rsp), %rax
movq 0x200(%rsp), %rax
movq 0x1f8(%rsp), %rax
movq 0x1f0(%rsp), %rax
movq 0x1e8(%rsp), %rax
movq 0x1e0(%rsp), %rax
movq 0x1d8(%rsp), %rax
movq 0x1d0(%rsp), %rax
movq 0x1c8(%rsp), %rax
movb 0x1c0(%rsp), %cl
movq 0x1b8(%rsp), %r13
movl 0x1b0(%rsp), %eax
movq 0x1a8(%rsp), %rax
movl 0x1a0(%rsp), %eax
movb 0x198(%rsp), %dl
movb 0x190(%rsp), %sil
movb 0x188(%rsp), %dil
movq 0x180(%rsp), %rax
movb 0x178(%rsp), %r8b
movl 0x170(%rsp), %r9d
movl 0x168(%rsp), %r9d
movb 0x160(%rsp), %r9b
movl 0x158(%rsp), %r10d
movb 0x150(%rsp), %r10b
movq %rax, 0x110(%rsp)
movb 0xa7(%rsp), %al
movq %r13, 0x108(%rsp)
movq %r12, 0x100(%rsp)
movl %r15d, 0xfc(%rsp)
movl %ebp, 0xf8(%rsp)
movq %r14, 0xf0(%rsp)
movq %rbx, 0xe8(%rsp)
movq %r11, 0xe0(%rsp)
andb $0x1, %r10b
movb %r10b, 0xdf(%rsp)
movss %xmm0, 0xd8(%rsp)
andb $0x1, %r9b
movb %r9b, 0xd7(%rsp)
andb $0x1, %r8b
movb %r8b, 0xd6(%rsp)
andb $0x1, %dil
movb %dil, 0xd5(%rsp)
andb $0x1, %sil
movb %sil, 0xd4(%rsp)
andb $0x1, %dl
movb %dl, 0xd3(%rsp)
andb $0x1, %cl
movb %cl, 0xd2(%rsp)
andb $0x1, %al
movb %al, 0xd1(%rsp)
imull $0xfff0, 0xfc(%rsp), %eax # imm = 0xFFF0
addl 0xf8(%rsp), %eax
movl %eax, 0xcc(%rsp)
movq 0x100(%rsp), %rdi
movl 0xcc(%rsp), %esi
movq 0x1c8(%rsp), %rdx
movq 0x1e8(%rsp), %rcx
movq 0x1d0(%rsp), %r8
movq 0x1d8(%rsp), %r9
movq 0x1e0(%rsp), %rbx
movq 0x1f0(%rsp), %r11
movq 0x1f8(%rsp), %r10
movq 0x200(%rsp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0xf290
movl $0x0, 0xc8(%rsp)
movl 0xc8(%rsp), %eax
cmpl 0xcc(%rsp), %eax
jae 0x12139
movq 0x100(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x1c8(%rsp), %rax
movl 0xc8(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl $0xfff0, %ecx           # imm = 0xFFF0
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movq 0x90(%rsp), %rax
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x98(%rsp)
movq 0x1c8(%rsp), %rax
movl 0xc8(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl $0xfff0, %ecx           # imm = 0xFFF0
xorl %edx, %edx
divl %ecx
movq 0x98(%rsp), %rax
movl %edx, %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
movq 0x1a8(%rsp), %rsi
movl 0x1b0(%rsp), %edx
movb 0xd2(%rsp), %r8b
movb 0xd4(%rsp), %al
movq 0x108(%rsp), %rcx
andb $0x1, %r8b
andb $0x1, %al
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11a40
testb $0x1, %al
jne 0x11f01
jmp 0x11f18
movq 0xe8(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x120f0
movq 0xc0(%rsp), %rdi
movq 0x1a8(%rsp), %rsi
movl 0x1b0(%rsp), %edx
movb 0xd2(%rsp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x118d0
movq 0xc0(%rsp), %rax
movq (%rax), %rdi
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0xc0(%rsp), %rax
movzbl 0x10(%rax), %edx
movb 0xdf(%rsp), %cl
movl 0x158(%rsp), %r8d
movq 0xc0(%rsp), %rax
movss 0x28(%rax), %xmm0
movss 0xd8(%rsp), %xmm1
movq 0xc0(%rsp), %rax
movb 0x24(%rax), %al
movb %al, 0x83(%rsp)
movb 0xd7(%rsp), %al
movb %al, 0x84(%rsp)
movl 0x168(%rsp), %eax
movl %eax, 0x88(%rsp)
movl 0x170(%rsp), %r13d
movb 0xd6(%rsp), %r12b
movb 0xd5(%rsp), %r14b
movb 0xd4(%rsp), %bpl
movb 0xd3(%rsp), %bl
movl 0x1a0(%rsp), %r11d
movq 0x208(%rsp), %r10
movb 0xd1(%rsp), %al
movb %al, 0x85(%rsp)
movq 0x110(%rsp), %r15
xorl %r9d, %r9d
xorl %eax, %eax
movb 0x83(%rsp), %al
andb $0x1, %cl
andb $0x1, %al
movb %al, 0x86(%rsp)
movb 0x84(%rsp), %al
andb $0x1, %al
movb %al, 0x87(%rsp)
movb 0x85(%rsp), %al
andb $0x1, %r12b
andb $0x1, %r14b
andb $0x1, %bpl
andb $0x1, %bl
andb $0x1, %al
movb %al, 0x8f(%rsp)
movb 0x86(%rsp), %al
movzbl %cl, %ecx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movzbl %al, %eax
movl %eax, 0x20(%rsp)
movb 0x87(%rsp), %al
movzbl %al, %eax
movl %eax, 0x28(%rsp)
movl 0x88(%rsp), %eax
movl %eax, 0x30(%rsp)
movb 0x8f(%rsp), %al
movl %r13d, 0x38(%rsp)
movzbl %r12b, %r12d
movl %r12d, 0x40(%rsp)
movq %r15, 0x48(%rsp)
movzbl %r14b, %r14d
movl %r14d, 0x50(%rsp)
movzbl %bpl, %ebp
movl %ebp, 0x58(%rsp)
movzbl %bl, %ebx
movl %ebx, 0x60(%rsp)
movl %r11d, 0x68(%rsp)
movq %r10, 0x70(%rsp)
movzbl %al, %eax
movl %eax, 0x78(%rsp)
callq 0xd7b0
movslq %eax, %rcx
movq 0xe0(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0xc0(%rsp), %rax
movq (%rax), %rdi
callq 0x2040
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
movq 0xf0(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc8(%rsp)
jmp 0x11e2f
movl $0x0, 0xbc(%rsp)
movl 0xbc(%rsp), %eax
cmpl 0x1b0(%rsp), %eax
jae 0x121d9
movq 0x1a8(%rsp), %rax
movl 0xbc(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0xa8(%rsp)
cmpq $0x0, 0xa8(%rsp)
je 0x121c1
movq 0xa8(%rsp), %rax
movq (%rax), %rdi
callq 0x2040
movq 0xa8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0xb0(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x2040
movq 0xb0(%rsp), %rax
movq %rax, 0xa8(%rsp)
jmp 0x12173
jmp 0x121c3
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
jmp 0x12144
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax,%rax)