// File: /workspace/github_c_makefile_star2_O3/jsh58[P]Genrich/Genrich.c
// Function: findDupsDc
void findDupsDc(Read** readDc, int readIdxDc,
    int readLenDc, uint64_t* countDc, uint64_t* dupsDc,
    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* tableMem, HashAln** tableSn,
    uint32_t hashSizeSn, 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) {

  // initialize hashtable
  uint32_t count = readIdxDc * MAX_SIZE + readLenDc;
  uint32_t hashSize = calcHashSize(count);
  if (hashSize > *tableMem) {
    *table = (HashAln**) memrealloc(*table,
      hashSize * sizeof(HashAln*));
    *tableMem = hashSize;
  } else
    hashSize = *tableMem;
  for (uint32_t i = 0; i < hashSize; i++)
    (*table)[i] = NULL;

  // sort reads by qual score sum
  sortReads(readDc, count, order, qual, order0, order1,
    order2, qual0, qual1, qual2);

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

    // check hashtable for matches
    if (checkHashDc(r, *table, hashSize, dups,
        dupsVerb, gzOut))
      (*dupsDc)++;
    else {
      // add alignments to hashtable(s)
      addHashDc(r, *table, hashSize, dupsVerb,
        tableSn, hashSizeSn);
      // process alignments too (as singletons)
      *singlePr += processSingle(r->name, r->aln,
        r->alnLen, extendOpt, extend, false,
        NULL, NULL, NULL, NULL,
        r->score, asDiff, true,
        atacOpt, atacLen5, atacLen3, atacAdj,
        bed, bedOpt, gzOut, ctrl, sample, errCount,
        verbose);
      *singlePr += processSingle(r->name, r->alnR2,
        r->alnLenR2, extendOpt, extend, false,
        NULL, NULL, NULL, NULL,
        r->scoreR2, asDiff, false,
        atacOpt, atacLen5, atacLen3, atacAdj,
        bed, bedOpt, gzOut, ctrl, sample, errCount,
        verbose);
    }

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

    (*countDc)++;
  }

  // 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 $0xd8, %rsp
movss %xmm0, 0x98(%rsp)
movq %r9, 0xb8(%rsp)
movq %r8, 0xd0(%rsp)
movq %rcx, 0xc8(%rsp)
movq %rdi, 0xa0(%rsp)
movq 0x170(%rsp), %rdi
imull $0xfff0, %esi, %ebx     # imm = 0xFFF0
addl %edx, %ebx
leal (,%rbx,4), %ecx
movl $0x2, %ebp
cmpl $0x9, %ecx
jb 0xb4ac
movl $0xaaaaaaab, %eax       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
movl $0x1, %ecx
addl %ebp, %ebp
cmpl $0x1d, %ecx
ja 0xb4ac
incl %ecx
cmpl %eax, %ebp
jb 0xb49f
movq 0x1d0(%rsp), %r15
movq 0x1c8(%rsp), %r14
movq 0x1c0(%rsp), %r10
movq 0x1b8(%rsp), %rcx
movq 0x1b0(%rsp), %r12
movq 0x1a8(%rsp), %r9
movq 0x1a0(%rsp), %r8
movq 0x168(%rsp), %r11
movl (%rdi), %eax
cmpl %eax, %ebp
jbe 0xb551
movq (%r11), %rdi
movl %ebp, %esi
shlq $0x3, %rsi
movq %r9, %r14
movq %rcx, %r15
movq %r8, %r13
movq %r10, %r12
callq 0x3925
movq %r12, %r10
movq 0x1b0(%rsp), %r12
movq %r13, %r8
movq %r15, %rcx
movq 0x1d0(%rsp), %r15
movq %r14, %r9
movq 0x1c8(%rsp), %r14
movq 0x168(%rsp), %r11
movq %rax, (%r11)
movq 0x170(%rsp), %rax
movl %ebp, (%rax)
movl %ebp, %eax
movq 0xa0(%rsp), %rbp
jmp 0xb561
testl %eax, %eax
movq 0xa0(%rsp), %rbp
je 0xb90e
movl %eax, 0x84(%rsp)
movl %eax, %eax
xorl %esi, %esi
movq (%r11), %rdx
movq $0x0, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0xb56c
movl $0x0, 0x88(%rsp)
movq %r15, 0x18(%rsp)
movq %r14, 0x10(%rsp)
movq %r10, 0x8(%rsp)
movq %r12, (%rsp)
movq %rbp, %rdi
movl %ebx, %esi
movq 0x198(%rsp), %rdx
callq 0xa572
testl %ebx, %ebx
je 0xb8af
movl %ebx, %eax
movq %rax, 0xc0(%rsp)
xorl %r12d, %r12d
movzbl 0x190(%rsp), %eax
movl %eax, 0x9c(%rsp)
movzbl 0x150(%rsp), %r13d
movzbl 0x1e0(%rsp), %eax
movl %eax, 0x94(%rsp)
movzbl 0x158(%rsp), %eax
movl %eax, 0xb4(%rsp)
movzbl 0x148(%rsp), %eax
movl %eax, 0xb0(%rsp)
movzbl 0x138(%rsp), %eax
movl %eax, 0xac(%rsp)
movzbl 0x120(%rsp), %eax
movl %eax, 0xa8(%rsp)
movzbl 0x110(%rsp), %eax
movl %eax, 0x8c(%rsp)
movl %r13d, 0x90(%rsp)
movl 0xac(%rsp), %ebx
movq 0x198(%rsp), %rax
movl (%rax,%r12,4), %eax
movl %eax, %ecx
shrl $0x4, %ecx
imulq $0x10010011, %rcx, %rcx # imm = 0x10010011
shrq $0x28, %rcx
imull $0xfff0, %ecx, %edx     # imm = 0xFFF0
subl %edx, %eax
leaq (%rax,%rax,2), %r15
shlq $0x4, %r15
addq (%rbp,%rcx,8), %r15
movq 0x168(%rsp), %rax
movq (%rax), %rsi
movq %r15, %rdi
movl 0x84(%rsp), %edx
movq 0x188(%rsp), %rcx
movl 0x9c(%rsp), %r8d
movl %r13d, %r9d
callq 0xb1a7
movl $0x1, %ecx
movq 0xd0(%rsp), %rdx
testb %al, %al
jne 0xb876
movq 0x168(%rsp), %rax
movq (%rax), %rsi
movq %r15, %rdi
movl 0x84(%rsp), %edx
movl 0x9c(%rsp), %ecx
movq 0x178(%rsp), %r8
movl 0x180(%rsp), %r9d
callq 0xafcb
movq (%r15), %rdi
movq 0x8(%r15), %rsi
movzbl 0x10(%r15), %edx
movss 0x28(%r15), %xmm0
movl 0x94(%rsp), %eax
movl %eax, 0x78(%rsp)
movq 0x1d8(%rsp), %r14
movq %r14, 0x70(%rsp)
movl 0x160(%rsp), %r13d
movl %r13d, 0x68(%rsp)
movl 0xb4(%rsp), %r13d
movl %r13d, 0x60(%rsp)
movl 0x90(%rsp), %eax
movl %eax, 0x58(%rsp)
movl 0xb0(%rsp), %r14d
movl %r14d, 0x50(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x48(%rsp)
movl %ebx, 0x40(%rsp)
movl 0x130(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x128(%rsp), %eax
movl %eax, 0x30(%rsp)
movl 0xa8(%rsp), %ebp
movl %ebp, 0x28(%rsp)
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm1, (%rsp)
movl $0x1, 0x20(%rsp)
movl 0x8c(%rsp), %ecx
movl 0x118(%rsp), %r8d
xorl %r9d, %r9d
movss 0x98(%rsp), %xmm1
callq 0x98a6
movl %eax, %eax
movq 0xb8(%rsp), %rcx
addq %rax, (%rcx)
movq (%r15), %rdi
movq 0x18(%r15), %rsi
movzbl 0x20(%r15), %edx
movss 0x2c(%r15), %xmm0
movl 0x94(%rsp), %eax
movl %eax, 0x78(%rsp)
movq 0x1d8(%rsp), %rax
movq %rax, 0x70(%rsp)
movl 0x160(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x90(%rsp), %eax
movl %r13d, 0x60(%rsp)
movl %eax, %r13d
movl %eax, 0x58(%rsp)
movl %r14d, 0x50(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x48(%rsp)
movl %ebx, 0x40(%rsp)
movl 0x130(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x128(%rsp), %eax
movl %eax, 0x30(%rsp)
movl %ebp, 0x28(%rsp)
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm1, (%rsp)
movl $0x0, 0x20(%rsp)
movl 0x8c(%rsp), %ecx
movl 0x118(%rsp), %r8d
xorl %r9d, %r9d
movss 0x98(%rsp), %xmm1
callq 0x98a6
movl %eax, %ecx
movq 0xb8(%rsp), %rdx
movq 0xa0(%rsp), %rbp
addq %rcx, (%rdx)
movq (%r15), %rdi
callq 0x2040
movq 0x8(%r15), %rdi
callq 0x2040
movq 0x18(%r15), %rdi
callq 0x2040
movq 0xc8(%rsp), %rax
incq (%rax)
incq %r12
cmpq %r12, 0xc0(%rsp)
jne 0xb645
cmpb $0x0, 0x88(%rsp)
jne 0xb8fc
movl 0x84(%rsp), %r14d
xorl %r15d, %r15d
movq 0x168(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rbx
testq %rbx, %rbx
je 0xb8f4
movq (%rbx), %rdi
callq 0x2040
movq 0x28(%rbx), %r12
movq %rbx, %rdi
callq 0x2040
movq %r12, %rbx
testq %r12, %r12
jne 0xb8d8
incq %r15
cmpq %r14, %r15
jne 0xb8c4
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x0, 0x84(%rsp)
movb $0x1, %al
movl %eax, 0x88(%rsp)
jmp 0xb58a