// File: /workspace/github_c_makefile_star2_O0/jsh58[P]Genrich/Genrich.c
// Function: findDupsPr
void findDupsPr(Read** readPr, int readIdxPr,
    int readLenPr, uint64_t* countPr, uint64_t* dupsPr,
    uint64_t* pairedPr, double* totalLen, 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 = readIdxPr * MAX_SIZE + readLenPr;
  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;

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

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

    // check hashtable for matches
    if (checkHashPr(r, *table, hashSize, dups,
        dupsVerb, gzOut))
      (*dupsPr)++;
    else {
      // add alignments to hashtable(s)
      addHashPr(r, *table, hashSize, dupsVerb,
        tableSn, hashSizeSn);
      // process alignments too
      *pairedPr += processPair(r->name, r->aln,
        r->alnLen, totalLen, r->score, asDiff,
        atacOpt, atacLen5, atacLen3, atacAdj,
        bed, bedOpt, gzOut, ctrl, sample, errCount,
        verbose);
    }

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

    (*countPr)++;
  }

  // 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
movq %r9, %r10
movq %r8, %r11
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
movb 0x1d8(%rsp), %al
movb %al, 0x5f(%rsp)
movq 0x1d0(%rsp), %rax
movq 0x1c8(%rsp), %rax
movq 0x1c0(%rsp), %rax
movq 0x1b8(%rsp), %rax
movq 0x1b0(%rsp), %rax
movq 0x1a8(%rsp), %rax
movq 0x1a0(%rsp), %rax
movq 0x198(%rsp), %rax
movq 0x190(%rsp), %rax
movb 0x188(%rsp), %cl
movq 0x180(%rsp), %r12
movl 0x178(%rsp), %eax
movq 0x170(%rsp), %rax
movq 0x168(%rsp), %rax
movq 0x160(%rsp), %rax
movl 0x158(%rsp), %eax
movb 0x150(%rsp), %dl
movb 0x148(%rsp), %sil
movb 0x140(%rsp), %dil
movq 0x138(%rsp), %r13
movb 0x130(%rsp), %r8b
movl 0x128(%rsp), %eax
movl 0x120(%rsp), %eax
movb 0x118(%rsp), %r9b
movq 0x110(%rsp), %rax
movb 0x5f(%rsp), %al
movq %r13, 0xd0(%rsp)
movq %r12, 0xc8(%rsp)
movq %r15, 0xc0(%rsp)
movl %r14d, 0xbc(%rsp)
movl %ebp, 0xb8(%rsp)
movq %rbx, 0xb0(%rsp)
movq %r11, 0xa8(%rsp)
movq %r10, 0xa0(%rsp)
movss %xmm0, 0x9c(%rsp)
andb $0x1, %r9b
movb %r9b, 0x9b(%rsp)
andb $0x1, %r8b
movb %r8b, 0x9a(%rsp)
andb $0x1, %dil
movb %dil, 0x99(%rsp)
andb $0x1, %sil
movb %sil, 0x98(%rsp)
andb $0x1, %dl
movb %dl, 0x97(%rsp)
andb $0x1, %cl
movb %cl, 0x96(%rsp)
andb $0x1, %al
movb %al, 0x95(%rsp)
imull $0xfff0, 0xbc(%rsp), %eax # imm = 0xFFF0
addl 0xb8(%rsp), %eax
movl %eax, 0x90(%rsp)
movl 0x90(%rsp), %edi
callq 0xf3b0
movl %eax, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
movq 0x168(%rsp), %rcx
cmpl (%rcx), %eax
jbe 0x10495
movq 0x160(%rsp), %rax
movq (%rax), %rdi
movl 0x8c(%rsp), %eax
movl %eax, %esi
shlq $0x3, %rsi
callq 0x28e0
movq %rax, %rcx
movq 0x160(%rsp), %rax
movq %rcx, (%rax)
movl 0x8c(%rsp), %ecx
movq 0x168(%rsp), %rax
movl %ecx, (%rax)
jmp 0x104a6
movq 0x168(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x8c(%rsp)
movl $0x0, 0x88(%rsp)
movl 0x88(%rsp), %eax
cmpl 0x8c(%rsp), %eax
jae 0x104ee
movq 0x160(%rsp), %rax
movq (%rax), %rax
movl 0x88(%rsp), %ecx
movq $0x0, (%rax,%rcx,8)
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
jmp 0x104b1
movq 0xc0(%rsp), %rdi
movl 0x90(%rsp), %esi
movq 0x190(%rsp), %rdx
movq 0x1b0(%rsp), %rcx
movq 0x198(%rsp), %r8
movq 0x1a0(%rsp), %r9
movq 0x1a8(%rsp), %rbx
movq 0x1b8(%rsp), %r11
movq 0x1c0(%rsp), %r10
movq 0x1c8(%rsp), %rax
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0xf290
movl $0x0, 0x84(%rsp)
movl 0x84(%rsp), %eax
cmpl 0x90(%rsp), %eax
jae 0x107aa
movq 0xc0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x190(%rsp), %rax
movl 0x84(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl $0xfff0, %ecx           # imm = 0xFFF0
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x50(%rsp)
movq 0x190(%rsp), %rax
movl 0x84(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl $0xfff0, %ecx           # imm = 0xFFF0
xorl %edx, %edx
divl %ecx
movq 0x50(%rsp), %rax
movl %edx, %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
movq 0x160(%rsp), %rax
movq (%rax), %rsi
movl 0x8c(%rsp), %edx
movb 0x96(%rsp), %r8b
movb 0x98(%rsp), %al
movq 0xc8(%rsp), %rcx
andb $0x1, %r8b
andb $0x1, %al
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x10100
testb $0x1, %al
jne 0x10623
jmp 0x1063a
movq 0xa8(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x10767
movq 0x78(%rsp), %rdi
movq 0x160(%rsp), %rax
movq (%rax), %rsi
movl 0x8c(%rsp), %edx
movb 0x96(%rsp), %al
movq 0x170(%rsp), %r8
movl 0x178(%rsp), %r9d
andb $0x1, %al
movzbl %al, %ecx
callq 0xfe40
movq 0x78(%rsp), %rax
movq (%rax), %rdi
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x78(%rsp), %rax
movzbl 0x10(%rax), %edx
movq 0x110(%rsp), %rcx
movq 0x78(%rsp), %rax
movss 0x28(%rax), %xmm0
movss 0x9c(%rsp), %xmm1
movb 0x9b(%rsp), %r8b
movl 0x120(%rsp), %r9d
movl 0x128(%rsp), %r13d
movb 0x9a(%rsp), %r12b
movb 0x99(%rsp), %r14b
movb 0x98(%rsp), %bpl
movb 0x97(%rsp), %bl
movl 0x158(%rsp), %r11d
movq 0x1d0(%rsp), %r10
movb 0x95(%rsp), %al
movq 0xd0(%rsp), %r15
andb $0x1, %r8b
andb $0x1, %r12b
andb $0x1, %r14b
andb $0x1, %bpl
andb $0x1, %bl
andb $0x1, %al
movzbl %r8b, %r8d
movl %r13d, (%rsp)
movzbl %r12b, %r12d
movl %r12d, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movzbl %r14b, %r14d
movl %r14d, 0x18(%rsp)
movzbl %bpl, %ebp
movl %ebp, 0x20(%rsp)
movzbl %bl, %ebx
movl %ebx, 0x28(%rsp)
movl %r11d, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movzbl %al, %eax
movl %eax, 0x40(%rsp)
callq 0xdef0
movslq %eax, %rcx
movq 0xa0(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x78(%rsp), %rax
movq (%rax), %rdi
callq 0x2040
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
movq 0xb0(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x10560
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
cmpl 0x8c(%rsp), %eax
jae 0x1081f
movq 0x160(%rsp), %rax
movq (%rax), %rax
movl 0x74(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
je 0x10810
movq 0x60(%rsp), %rax
movq (%rax), %rdi
callq 0x2040
movq 0x60(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x60(%rsp), %rdi
callq 0x2040
movq 0x68(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x107d7
jmp 0x10812
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x107b2
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)