// File: /workspace/github_c_makefile_star2_O0/jsh58[P]Genrich/Genrich.c
// Function: processAlns
void processAlns(char* qname, Aln* aln, int alnLen,
    double* totalLen, uint64_t* pairedPr,
    uint64_t* singlePr, uint64_t* orphan, bool singleOpt,
    bool extendOpt, int extend, bool avgExtOpt,
    Aln*** unpair, int* unpairIdx, int* unpairLen,
    int* unpairMem, float asDiff, bool atacOpt,
    int atacLen5, int atacLen3, bool atacAdj, File bed,
    bool bedOpt, bool gzOut, bool ctrl, int sample,
    bool dupsOpt, Read*** readPr, int* readIdxPr,
    int* readLenPr, int* readMemPr, Read*** readDc,
    int* readIdxDc, int* readLenDc, int* readMemDc,
    Read*** readSn, int* readIdxSn, int* readLenSn,
    int* readMemSn, uint16_t qualR1, uint16_t qualR2,
    uint64_t* errCount, bool verbose) {

  // determine if paired alns are valid, and best score
  float scorePr = NOSCORE, scoreR1 = NOSCORE,
    scoreR2 = NOSCORE;
  bool pair = false, singleR1 = false, singleR2 = false;
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (a->paired) {
      if (a->full) {
        // valid paired aln
        if (! pair || scorePr < a->score)
          scorePr = a->score; // best score so far
        pair = true;
      } else
        (*orphan)++;  // incomplete paired alignment
    } else if (singleOpt && ! pair) {
      // update best scores of unpaired alns
      if (a->first && scoreR1 <= a->score) {
        scoreR1 = a->score;
        singleR1 = true;
      } else if (! a->first && scoreR2 <= a->score) {
        scoreR2 = a->score;
        singleR2 = true;
      }
    }
  }

  if (dupsOpt)
    // save alignments for later evaluation of duplicates
    saveAlns(qname, aln, alnLen, pair, singleOpt, singleR1,
      singleR2, scorePr, scoreR1, scoreR2, asDiff,
      readPr, readIdxPr, readLenPr, readMemPr,
      readDc, readIdxDc, readLenDc, readMemDc,
      readSn, readIdxSn, readLenSn, readMemSn,
      qualR1, qualR2);

  else {
    // process alns directly
    if (pair)
      // process paired alignments
      *pairedPr += processPair(qname, aln, alnLen,
        totalLen, scorePr, asDiff, atacOpt, atacLen5,
        atacLen3, atacAdj, bed, bedOpt, gzOut, ctrl,
        sample, errCount, verbose);
    else if (singleOpt) {
      // process unpaired alignments (separately for R1, R2)
      if (singleR1)
        *singlePr += processSingle(qname, aln, alnLen,
          extendOpt, extend, avgExtOpt,
          unpair, unpairIdx, unpairLen, unpairMem,
          scoreR1, asDiff, true,
          atacOpt, atacLen5, atacLen3, atacAdj,
          bed, bedOpt, gzOut, ctrl, sample, errCount,
          verbose);
      if (singleR2)
        *singlePr += processSingle(qname, aln, alnLen,
          extendOpt, extend, avgExtOpt,
          unpair, unpairIdx, unpairLen, unpairMem,
          scoreR2, asDiff, false,
          atacOpt, atacLen5, atacLen3, atacAdj,
          bed, bedOpt, gzOut, ctrl, sample, errCount,
          verbose);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movl %edx, %ebp
movq %rsi, %r13
movb 0x2d0(%rsp), %al
movb %al, 0x11e(%rsp)
movq 0x2c8(%rsp), %rax
movw 0x2c0(%rsp), %ax
movw 0x2b8(%rsp), %ax
movq 0x2b0(%rsp), %rax
movq 0x2a8(%rsp), %rax
movq 0x2a0(%rsp), %rax
movq 0x298(%rsp), %rax
movq 0x290(%rsp), %rax
movq 0x288(%rsp), %rax
movq 0x280(%rsp), %rax
movq 0x278(%rsp), %rax
movq 0x270(%rsp), %rax
movq 0x268(%rsp), %rax
movq 0x260(%rsp), %rax
movq 0x258(%rsp), %rax
movb 0x250(%rsp), %cl
movl 0x248(%rsp), %eax
movb 0x240(%rsp), %dl
movb 0x238(%rsp), %sil
movb 0x230(%rsp), %al
movb %al, 0x11f(%rsp)
movq 0x228(%rsp), %rax
movq %rax, 0x110(%rsp)
movb 0x220(%rsp), %r8b
movl 0x218(%rsp), %eax
movl 0x210(%rsp), %eax
movb 0x208(%rsp), %r9b
movq 0x200(%rsp), %rax
movq 0x1f8(%rsp), %rax
movq 0x1f0(%rsp), %rax
movq 0x1e8(%rsp), %rax
movb 0x1e0(%rsp), %r10b
movl 0x1d8(%rsp), %eax
movb 0x1d0(%rsp), %r11b
movb 0x1c8(%rsp), %bl
movq 0x1c0(%rsp), %rax
movq 0x110(%rsp), %rax
movq %rax, 0x180(%rsp)
movb 0x11e(%rsp), %al
movq %rdi, 0x178(%rsp)
movb 0x11f(%rsp), %dil
movq %r13, 0x170(%rsp)
movl %ebp, 0x16c(%rsp)
movq %r12, 0x160(%rsp)
movq %r15, 0x158(%rsp)
movq %r14, 0x150(%rsp)
andb $0x1, %bl
movb %bl, 0x14f(%rsp)
andb $0x1, %r11b
movb %r11b, 0x14e(%rsp)
andb $0x1, %r10b
movb %r10b, 0x14d(%rsp)
movss %xmm0, 0x148(%rsp)
andb $0x1, %r9b
movb %r9b, 0x147(%rsp)
andb $0x1, %r8b
movb %r8b, 0x146(%rsp)
andb $0x1, %dil
movb %dil, 0x145(%rsp)
andb $0x1, %sil
movb %sil, 0x144(%rsp)
andb $0x1, %dl
movb %dl, 0x143(%rsp)
andb $0x1, %cl
movb %cl, 0x142(%rsp)
andb $0x1, %al
movb %al, 0x141(%rsp)
movss 0xfbd2(%rip), %xmm0     # 0x1e1b4
movss %xmm0, 0x13c(%rsp)
movss 0xfbc1(%rip), %xmm0     # 0x1e1b4
movss %xmm0, 0x138(%rsp)
movss 0xfbb0(%rip), %xmm0     # 0x1e1b4
movss %xmm0, 0x134(%rsp)
movb $0x0, 0x133(%rsp)
movb $0x0, 0x132(%rsp)
movb $0x0, 0x131(%rsp)
movl $0x0, 0x12c(%rsp)
movl 0x12c(%rsp), %eax
cmpl 0x16c(%rsp), %eax
jge 0xe7a5
movq 0x170(%rsp), %rax
movslq 0x12c(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x120(%rsp)
movq 0x120(%rsp), %rax
testb $0x1, 0xd(%rax)
je 0xe6db
movq 0x120(%rsp), %rax
testb $0x1, 0xe(%rax)
je 0xe6c4
testb $0x1, 0x133(%rsp)
je 0xe6a4
movss 0x13c(%rsp), %xmm1
movq 0x120(%rsp), %rax
movss 0x8(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xe6ba
movq 0x120(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x13c(%rsp)
movb $0x1, 0x133(%rsp)
jmp 0xe6d6
movq 0x1c0(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0xe78d
testb $0x1, 0x14f(%rsp)
je 0xe78b
testb $0x1, 0x133(%rsp)
jne 0xe78b
movq 0x120(%rsp), %rax
testb $0x1, 0xf(%rax)
je 0xe740
movss 0x138(%rsp), %xmm1
movq 0x120(%rsp), %rax
movss 0x8(%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0xe740
movq 0x120(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x138(%rsp)
movb $0x1, 0x132(%rsp)
jmp 0xe789
movq 0x120(%rsp), %rax
testb $0x1, 0xf(%rax)
jne 0xe787
movss 0x134(%rsp), %xmm1
movq 0x120(%rsp), %rax
movss 0x8(%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0xe787
movq 0x120(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x134(%rsp)
movb $0x1, 0x131(%rsp)
jmp 0xe789
jmp 0xe78b
jmp 0xe78d
jmp 0xe78f
movl 0x12c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x12c(%rsp)
jmp 0xe630
testb $0x1, 0x142(%rsp)
je 0xe949
movq 0x178(%rsp), %rdi
movq 0x170(%rsp), %rsi
movl 0x16c(%rsp), %edx
movb 0x133(%rsp), %cl
movb 0x14f(%rsp), %r8b
movb 0x132(%rsp), %r9b
movb 0x131(%rsp), %al
movb %al, 0xe7(%rsp)
movss 0x13c(%rsp), %xmm0
movss 0x138(%rsp), %xmm1
movss 0x134(%rsp), %xmm2
movss 0x148(%rsp), %xmm3
movq 0x258(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0x260(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x268(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x270(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x278(%rsp), %rbp
movq 0x280(%rsp), %r13
movq 0x288(%rsp), %r12
movq 0x290(%rsp), %r15
movq 0x298(%rsp), %r14
movq 0x2a0(%rsp), %rbx
movq 0x2a8(%rsp), %r11
movq 0x2b0(%rsp), %r10
movw 0x2b8(%rsp), %ax
movw %ax, 0x10e(%rsp)
movb 0xe7(%rsp), %al
andb $0x1, %cl
andb $0x1, %r8b
andb $0x1, %r9b
andb $0x1, %al
movzbl %cl, %ecx
movzbl %r8b, %r8d
movzbl %r9b, %r9d
movzbl %al, %eax
movl %eax, (%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0x20(%rsp)
movw 0x10e(%rsp), %ax
movq %rbp, 0x28(%rsp)
movq %r13, 0x30(%rsp)
movq %r12, 0x38(%rsp)
movq %r15, 0x40(%rsp)
movq %r14, 0x48(%rsp)
movq %rbx, 0x50(%rsp)
movq %r11, 0x58(%rsp)
movq %r10, 0x60(%rsp)
movzwl %ax, %eax
movl %eax, 0x68(%rsp)
movzwl 0x2c0(%rsp), %eax
movl %eax, 0x70(%rsp)
callq 0xd340
jmp 0xee1b
testb $0x1, 0x133(%rsp)
je 0xea4d
movq 0x178(%rsp), %rdi
movq 0x170(%rsp), %rsi
movl 0x16c(%rsp), %edx
movq 0x160(%rsp), %rcx
movss 0x13c(%rsp), %xmm0
movss 0x148(%rsp), %xmm1
movb 0x147(%rsp), %r8b
movl 0x210(%rsp), %r9d
movl 0x218(%rsp), %r13d
movb 0x146(%rsp), %r12b
movb 0x145(%rsp), %r14b
movb 0x144(%rsp), %bpl
movb 0x143(%rsp), %bl
movl 0x248(%rsp), %r11d
movq 0x2c8(%rsp), %r10
movb 0x141(%rsp), %al
movq 0x180(%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 0x158(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xee19
testb $0x1, 0x14f(%rsp)
je 0xee17
testb $0x1, 0x132(%rsp)
je 0xec32
movq 0x178(%rsp), %rdi
movq 0x170(%rsp), %rsi
movl 0x16c(%rsp), %edx
movb 0x14e(%rsp), %cl
movl 0x1d8(%rsp), %r8d
movb 0x14d(%rsp), %r9b
movq 0x1e8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x1f0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x1f8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x200(%rsp), %rax
movq %rax, 0xd0(%rsp)
movss 0x138(%rsp), %xmm0
movss 0x148(%rsp), %xmm1
movb 0x147(%rsp), %al
movl 0x210(%rsp), %r10d
movl %r10d, 0xe0(%rsp)
movl 0x218(%rsp), %r13d
movb 0x146(%rsp), %r12b
movb 0x145(%rsp), %r14b
movb 0x144(%rsp), %bpl
movb 0x143(%rsp), %bl
movl 0x248(%rsp), %r11d
movq 0x2c8(%rsp), %r10
movb 0x141(%rsp), %r15b
movb %r15b, 0xb7(%rsp)
movq 0x180(%rsp), %r15
andb $0x1, %cl
andb $0x1, %r9b
andb $0x1, %al
movb %al, 0xdf(%rsp)
movb 0xb7(%rsp), %al
andb $0x1, %r12b
andb $0x1, %r14b
andb $0x1, %bpl
andb $0x1, %bl
andb $0x1, %al
movb %al, 0xe6(%rsp)
movq 0xb8(%rsp), %rax
movzbl %cl, %ecx
movzbl %r9b, %r9d
movq %rax, (%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x18(%rsp)
movb 0xdf(%rsp), %al
movl $0x1, 0x20(%rsp)
movzbl %al, %eax
movl %eax, 0x28(%rsp)
movl 0xe0(%rsp), %eax
movl %eax, 0x30(%rsp)
movb 0xe6(%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 0x150(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
testb $0x1, 0x131(%rsp)
je 0xee15
movq 0x178(%rsp), %rdi
movq 0x170(%rsp), %rsi
movl 0x16c(%rsp), %edx
movb 0x14e(%rsp), %cl
movl 0x1d8(%rsp), %r8d
movb 0x14d(%rsp), %r9b
movq 0x1e8(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x1f0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x1f8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x200(%rsp), %rax
movq %rax, 0xa0(%rsp)
movss 0x134(%rsp), %xmm0
movss 0x148(%rsp), %xmm1
movb 0x147(%rsp), %al
movb %al, 0x86(%rsp)
movl 0x210(%rsp), %eax
movl %eax, 0xb0(%rsp)
movl 0x218(%rsp), %r13d
movb 0x146(%rsp), %r12b
movb 0x145(%rsp), %r14b
movb 0x144(%rsp), %bpl
movb 0x143(%rsp), %bl
movl 0x248(%rsp), %r11d
movq 0x2c8(%rsp), %r10
movb 0x141(%rsp), %al
movb %al, 0x87(%rsp)
movq 0x180(%rsp), %r15
xorl %eax, %eax
movb 0x86(%rsp), %al
andb $0x1, %cl
andb $0x1, %r9b
andb $0x1, %al
movb %al, 0xaf(%rsp)
movb 0x87(%rsp), %al
andb $0x1, %r12b
andb $0x1, %r14b
andb $0x1, %bpl
andb $0x1, %bl
andb $0x1, %al
movb %al, 0xb6(%rsp)
movq 0x88(%rsp), %rax
movzbl %cl, %ecx
movzbl %r9b, %r9d
movq %rax, (%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
movb 0xaf(%rsp), %al
movl $0x0, 0x20(%rsp)
movzbl %al, %eax
movl %eax, 0x28(%rsp)
movl 0xb0(%rsp), %eax
movl %eax, 0x30(%rsp)
movb 0xb6(%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 0x150(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xee17
jmp 0xee19
jmp 0xee1b
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)