// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: addHashDc
void addHashDc(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 pos = (a->strand ? a->pos[0] : a->pos[1]);
    for (int j = 0; j < r->alnLenR2; j++) {
      Aln* b = r->alnR2 + j;
      uint32_t pos1 = (b->strand ? b->pos[0] : b->pos[1]);
      uint32_t idx = jenkins_hash_aln(a->chrom, b->chrom,
        pos, pos1, a->strand, b->strand, DISCORD, hashSize);
      addToHash(a->chrom, b->chrom, pos, pos1, a->strand,
        b->strand, table, idx, dupsVerb ? r->name : NULL);

      // also add both alignments as singletons to hashtable
      if (tableSn != NULL && hashSizeSn) {
        if (! j)
          checkAndAdd(tableSn, hashSizeSn, a->chrom, pos,
            a->strand, dupsVerb ? r->name : NULL);
        if (! k)
          checkAndAdd(tableSn, hashSizeSn, b->chrom, pos1,
            b->strand, dupsVerb ? r->name : NULL);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, 0xc(%rsp)
movq %rdx, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdi, %rbx
movq %r8, 0x18(%rsp)
testq %r8, %r8
setne %al
movl %r9d, 0x14(%rsp)
testl %r9d, %r9d
setne %cl
andb %al, %cl
movb %cl, 0xb(%rsp)
xorl %ecx, %ecx
movq %rdi, 0x30(%rsp)
movzbl 0x10(%rbx), %eax
cmpq %rax, %rcx
jae 0x9b76
movq 0x8(%rbx), %rax
movq %rcx, 0x20(%rsp)
imulq $0x28, %rcx, %rcx
leaq (%rax,%rcx), %rdx
movzbl 0x10(%rax,%rcx), %eax
xorl $0x1, %eax
movq %rdx, 0x28(%rsp)
movl (%rdx,%rax,4), %eax
movl %eax, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r14d, %r14d
movzbl 0x20(%rbx), %eax
cmpq %rax, %r14
jae 0x9b69
movq %r14, 0x50(%rsp)
movq 0x18(%rbx), %rdx
leaq (%rdx,%r13), %rax
movzbl 0x10(%rdx,%r13), %r15d
movl %r15d, %ecx
xorl $0x1, %ecx
movl (%rax,%rcx,4), %ecx
movq 0x28(%rsp), %rax
movq 0x20(%rax), %r12
movq %rdx, 0x48(%rsp)
movq 0x20(%rdx,%r13), %rbp
movb 0x10(%rax), %al
movzbl %al, %ebx
movq %r12, %rdi
movq %rbp, %rsi
movl 0x10(%rsp), %edx
movl %ecx, %r14d
movl %ebx, %r8d
movl %r15d, %r9d
pushq 0x40(%rsp)
pushq $0x2
callq 0x9101
popq %rcx
popq %rdx
cmpb $0x0, 0xc(%rsp)
je 0x9ab3
movq 0x30(%rsp), %rcx
movq (%rcx), %r10
jmp 0x9ab6
xorl %r10d, %r10d
subq $0x8, %rsp
movzbl %r15b, %r9d
movq %r12, %rdi
movq %rbp, %rsi
movl 0x18(%rsp), %edx
movl %r14d, %ebp
movl %r14d, %ecx
movl %ebx, %r8d
pushq %r10
pushq %rax
pushq 0x50(%rsp)
callq 0x91f7
addq $0x20, %rsp
cmpb $0x0, 0xb(%rsp)
movq 0x30(%rsp), %rbx
movq 0x50(%rsp), %r14
je 0x9b5d
testq %r13, %r13
jne 0x9b26
cmpb $0x0, 0xc(%rsp)
je 0x9b03
movq (%rbx), %r9
jmp 0x9b06
xorl %r9d, %r9d
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rdx
movzbl 0x10(%rax), %r8d
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %ecx
callq 0x931f
cmpq $0x0, 0x20(%rsp)
jne 0x9b5d
cmpb $0x0, 0xc(%rsp)
je 0x9b3a
movq (%rbx), %r9
jmp 0x9b3d
xorl %r9d, %r9d
movq 0x48(%rsp), %rax
movq 0x20(%rax,%r13), %rdx
movzbl 0x10(%rax,%r13), %r8d
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %esi
movl %ebp, %ecx
callq 0x931f
incq %r14
addq $0x28, %r13
jmp 0x9a40
movq 0x20(%rsp), %rcx
incq %rcx
jmp 0x9a08
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq