// File: /workspace/github_c_makefile_star2_O1/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, 0x94(%rsp)
movq %r9, 0xb8(%rsp)
movq %r8, 0xc8(%rsp)
movq %rcx, 0xc0(%rsp)
movq %rdi, 0xa8(%rsp)
movq 0x170(%rsp), %r12
imull $0xfff0, %esi, %ebx     # imm = 0xFFF0
addl %edx, %ebx
leal (,%rbx,4), %ecx
movl $0x2, %r15d
cmpl $0x9, %ecx
jb 0xb29b
movl $0xaaaaaaab, %eax       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
movl $0x1, %ecx
addl %r15d, %r15d
cmpl $0x1d, %ecx
ja 0xb29b
incl %ecx
cmpl %eax, %r15d
jb 0xb28c
movl (%r12), %r10d
cmpl %r10d, %r15d
jbe 0xb2c5
movq 0x168(%rsp), %r14
movq (%r14), %rdi
movl %r15d, %esi
shlq $0x3, %rsi
callq 0x3915
movq %rax, (%r14)
movl %r15d, (%r12)
movl %r15d, %r10d
movq 0x1d0(%rsp), %rsi
movq 0x1c8(%rsp), %rdx
movq 0x1c0(%rsp), %rax
movq 0x1b8(%rsp), %rcx
movq 0x1b0(%rsp), %rdi
movq 0x1a8(%rsp), %r9
movq 0x1a0(%rsp), %r8
movl %r10d, %r15d
movl %r10d, 0x80(%rsp)
testl %r10d, %r10d
movq 0x168(%rsp), %r14
je 0xb32b
xorl %r10d, %r10d
movq (%r14), %r11
movq $0x0, (%r11,%r10,8)
incq %r10
cmpq %r10, %r15
jne 0xb318
movq %r15, 0xd0(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq %rdi, (%rsp)
movq 0xa8(%rsp), %rdi
movl %ebx, %esi
movq 0x198(%rsp), %rdx
callq 0xa3f0
testl %ebx, %ebx
je 0xb660
movl %ebx, %ebp
xorl %r14d, %r14d
movzbl 0x190(%rsp), %eax
movl %eax, 0x9c(%rsp)
movzbl 0x150(%rsp), %eax
movl %eax, 0x98(%rsp)
movzbl 0x1e0(%rsp), %eax
movl %eax, 0xa4(%rsp)
movzbl 0x158(%rsp), %eax
movl %eax, 0xa0(%rsp)
movzbl 0x148(%rsp), %eax
movl %eax, 0x90(%rsp)
movzbl 0x138(%rsp), %eax
movl %eax, 0x8c(%rsp)
movzbl 0x120(%rsp), %eax
movl %eax, 0x88(%rsp)
movzbl 0x110(%rsp), %eax
movl %eax, 0x84(%rsp)
movq %rbp, 0xb0(%rsp)
movl 0xa4(%rsp), %r12d
movl 0xa0(%rsp), %r13d
movl 0x98(%rsp), %ebx
movq 0x198(%rsp), %rax
movl (%rax,%r14,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
movq 0xa8(%rsp), %rax
addq (%rax,%rcx,8), %r15
movq 0x168(%rsp), %rax
movq (%rax), %rsi
movq %r15, %rdi
movl 0x80(%rsp), %edx
movq 0x188(%rsp), %rcx
movl 0x9c(%rsp), %r8d
movl 0x98(%rsp), %r9d
callq 0xaf7f
movl $0x1, %ecx
movq 0xc8(%rsp), %rdx
testb %al, %al
jne 0xb62c
movq 0x168(%rsp), %rax
movq (%rax), %rsi
movq %r15, %rdi
movl 0x80(%rsp), %edx
movl 0x9c(%rsp), %ecx
movq 0x178(%rsp), %r8
movl 0x180(%rsp), %r9d
callq 0xadad
movq (%r15), %rdi
movq 0x8(%r15), %rsi
movzbl 0x10(%r15), %edx
movss 0x28(%r15), %xmm0
movl %r12d, 0x78(%rsp)
movq 0x1d8(%rsp), %rax
movq %rax, 0x70(%rsp)
movl 0x160(%rsp), %eax
movl %eax, 0x68(%rsp)
movl %r13d, 0x60(%rsp)
movl %ebx, 0x58(%rsp)
movl 0x90(%rsp), %eax
movl %eax, 0x50(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x48(%rsp)
movl 0x8c(%rsp), %eax
movl %eax, 0x40(%rsp)
movl 0x130(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x128(%rsp), %eax
movl %eax, 0x30(%rsp)
movl 0x88(%rsp), %eax
movl %eax, 0x28(%rsp)
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm1, (%rsp)
movl $0x1, 0x20(%rsp)
movl 0x84(%rsp), %ecx
movl 0x118(%rsp), %r8d
xorl %r9d, %r9d
movss 0x94(%rsp), %xmm1
callq 0x977b
movl %eax, %eax
movq 0xb8(%rsp), %rbp
addq %rax, (%rbp)
movq (%r15), %rdi
movq 0x18(%r15), %rsi
movzbl 0x20(%r15), %edx
movss 0x2c(%r15), %xmm0
movl %r12d, 0x78(%rsp)
movq 0x1d8(%rsp), %rax
movq %rax, 0x70(%rsp)
movl 0x160(%rsp), %eax
movl %eax, 0x68(%rsp)
movl %r13d, 0x60(%rsp)
movl %ebx, 0x58(%rsp)
movl 0x90(%rsp), %eax
movl %eax, 0x50(%rsp)
movq 0x140(%rsp), %rax
movq %rax, 0x48(%rsp)
movl 0x8c(%rsp), %eax
movl %eax, 0x40(%rsp)
movl 0x130(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x128(%rsp), %eax
movl %eax, 0x30(%rsp)
movl 0x88(%rsp), %eax
movl %eax, 0x28(%rsp)
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm1, (%rsp)
movl $0x0, 0x20(%rsp)
movl 0x84(%rsp), %ecx
movl 0x118(%rsp), %r8d
xorl %r9d, %r9d
movss 0x94(%rsp), %xmm1
callq 0x977b
movl %eax, %ecx
movq %rbp, %rdx
movq 0xb0(%rsp), %rbp
addq %rcx, (%rdx)
movq (%r15), %rdi
callq 0x2040
movq 0x8(%r15), %rdi
callq 0x2040
movq 0x18(%r15), %rdi
callq 0x2040
movq 0xc0(%rsp), %rax
incq (%rax)
incq %r14
cmpq %r14, %rbp
jne 0xb401
cmpl $0x0, 0x80(%rsp)
movq 0x168(%rsp), %r12
je 0xb6ab
xorl %r14d, %r14d
movq (%r12), %rax
movq (%rax,%r14,8), %rbx
testq %rbx, %rbx
je 0xb69e
movq (%rbx), %rdi
callq 0x2040
movq 0x28(%rbx), %r15
movq %rbx, %rdi
callq 0x2040
movq %r15, %rbx
testq %r15, %r15
jne 0xb682
incq %r14
cmpq 0xd0(%rsp), %r14
jne 0xb675
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq