// File: /workspace/github_c_makefile_star2_O0/jsh58[P]Genrich/Genrich.c
// Function: processPair
int processPair(char* qname, Aln* aln, int alnLen,
    double* totalLen, float score, float asDiff,
    bool atacOpt, int atacLen5, int atacLen3, bool atacAdj,
    File bed, bool bedOpt, bool gzOut, bool ctrl,
    int sample, uint64_t* errCount, bool verbose) {

  // adjust AS tolerance for secondary alns
  if (score != NOSCORE)
    score -= asDiff;

  // determine number of valid paired alignments
  //   (within score threshold and not to skipped chrom)
  uint8_t count = 0;
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (a->paired && a->full && a->score >= score
        && a->chrom->save && ! a->chrom->skip)
      count++;
  }
  if (! count)
    return 0;

  // adjust score so that num alns is OK (1/2/3/4/5/6/8/10)
  if (count > 10 || count == 7 || count == 9)
    subsamplePair(aln, alnLen, &count, &score);

  // find full fragments to save
  uint64_t fragLen = 0;     // local sum of fragment lengths
  uint8_t saved = 0;
  for (int i = 0; i < alnLen; i++) {
    Aln* a = aln + i;
    if (a->paired && a->full && a->score >= score
        && a->chrom->save && ! a->chrom->skip) {

      // save full fragment
      fragLen += saveFragment(qname, a, count,
        atacOpt, atacLen5, atacLen3, atacAdj, bed, bedOpt,
        gzOut, ctrl, sample, errCount, verbose);

      if (++saved == count)
        break;  // in case of AS ties
    }
  }

  // check for error saving alignments
  if (saved != count) {
    char msg[MAX_ALNS];
    sprintf(msg, "Saved %d alignments for read %s; should have been %d",
      saved, qname, count);
    exit(error(msg, ERRISSUE));
  }

  *totalLen += (double) fragLen / count;
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movq %rcx, %r10
movl %edx, %r11d
movq %rsi, %rbx
movq %rdi, %r14
movb 0x1a0(%rsp), %al
movq 0x198(%rsp), %rcx
movl 0x190(%rsp), %ecx
movb 0x188(%rsp), %cl
movb 0x180(%rsp), %dl
movb 0x178(%rsp), %sil
movq 0x170(%rsp), %r15
movb 0x168(%rsp), %dil
movl 0x160(%rsp), %ebp
movq %r15, 0x120(%rsp)
movq %r14, 0x118(%rsp)
movq %rbx, 0x110(%rsp)
movl %r11d, 0x10c(%rsp)
movq %r10, 0x100(%rsp)
movss %xmm0, 0xfc(%rsp)
movss %xmm1, 0xf8(%rsp)
andb $0x1, %r8b
movb %r8b, 0xf7(%rsp)
movl %r9d, 0xf0(%rsp)
andb $0x1, %dil
movb %dil, 0xef(%rsp)
andb $0x1, %sil
movb %sil, 0xee(%rsp)
andb $0x1, %dl
movb %dl, 0xed(%rsp)
andb $0x1, %cl
movb %cl, 0xec(%rsp)
andb $0x1, %al
movb %al, 0xeb(%rsp)
movss 0xfc(%rsp), %xmm0
movss 0x101d2(%rip), %xmm1    # 0x1e1b4
ucomiss %xmm1, %xmm0
jne 0xdfeb
jp 0xdfeb
jmp 0xe00a
movss 0xf8(%rsp), %xmm1
movss 0xfc(%rsp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0xfc(%rsp)
movb $0x0, 0xea(%rsp)
movl $0x0, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
cmpl 0x10c(%rsp), %eax
jge 0xe0cf
movq 0x110(%rsp), %rax
movslq 0xe4(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rax
testb $0x1, 0xd(%rax)
je 0xe0b7
movq 0xd8(%rsp), %rax
testb $0x1, 0xe(%rax)
je 0xe0b7
movq 0xd8(%rsp), %rax
movss 0x8(%rax), %xmm0
ucomiss 0xfc(%rsp), %xmm0
jb 0xe0b7
movq 0xd8(%rsp), %rax
movq 0x20(%rax), %rax
testb $0x1, 0xd(%rax)
je 0xe0b7
movq 0xd8(%rsp), %rax
movq 0x20(%rax), %rax
testb $0x1, 0xc(%rax)
jne 0xe0b7
movb 0xea(%rsp), %al
addb $0x1, %al
movb %al, 0xea(%rsp)
jmp 0xe0b9
movl 0xe4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe4(%rsp)
jmp 0xe01d
cmpb $0x0, 0xea(%rsp)
jne 0xe0e9
movl $0x0, 0x12c(%rsp)
jmp 0xe3ab
movzbl 0xea(%rsp), %eax
cmpl $0xa, %eax
jg 0xe110
movzbl 0xea(%rsp), %eax
cmpl $0x7, %eax
je 0xe110
movzbl 0xea(%rsp), %eax
cmpl $0x9, %eax
jne 0xe134
movq 0x110(%rsp), %rdi
movl 0x10c(%rsp), %esi
leaq 0xea(%rsp), %rdx
leaq 0xfc(%rsp), %rcx
callq 0xdd30
movq $0x0, 0xd0(%rsp)
movb $0x0, 0xcf(%rsp)
movl $0x0, 0xc8(%rsp)
movl 0xc8(%rsp), %eax
cmpl 0x10c(%rsp), %eax
jge 0xe2ff
movq 0x110(%rsp), %rax
movslq 0xc8(%rsp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
testb $0x1, 0xd(%rax)
je 0xe2e7
movq 0xc0(%rsp), %rax
testb $0x1, 0xe(%rax)
je 0xe2e7
movq 0xc0(%rsp), %rax
movss 0x8(%rax), %xmm0
ucomiss 0xfc(%rsp), %xmm0
jb 0xe2e7
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rax
testb $0x1, 0xd(%rax)
je 0xe2e7
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rax
testb $0x1, 0xc(%rax)
jne 0xe2e7
movq 0x118(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movb 0xea(%rsp), %dl
movb 0xf7(%rsp), %cl
movl 0xf0(%rsp), %r8d
movl 0x160(%rsp), %r9d
movb 0xef(%rsp), %r12b
movb 0xee(%rsp), %r14b
movb 0xed(%rsp), %bpl
movb 0xec(%rsp), %bl
movl 0x190(%rsp), %r11d
movq 0x198(%rsp), %r10
movb 0xeb(%rsp), %al
movq 0x120(%rsp), %r15
andb $0x1, %cl
andb $0x1, %r12b
andb $0x1, %r14b
andb $0x1, %bpl
andb $0x1, %bl
andb $0x1, %al
movzbl %dl, %edx
movzbl %cl, %ecx
movzbl %r12b, %r12d
movl %r12d, (%rsp)
movq %r15, 0x8(%rsp)
movzbl %r14b, %r14d
movl %r14d, 0x10(%rsp)
movzbl %bpl, %ebp
movl %ebp, 0x18(%rsp)
movzbl %bl, %ebx
movl %ebx, 0x20(%rsp)
movl %r11d, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movzbl %al, %eax
movl %eax, 0x38(%rsp)
callq 0xc870
movl %eax, %eax
addq 0xd0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movb 0xcf(%rsp), %al
addb $0x1, %al
movb %al, 0xcf(%rsp)
movzbl %al, %eax
movzbl 0xea(%rsp), %ecx
cmpl %ecx, %eax
jne 0xe2e5
jmp 0xe2ff
jmp 0xe2e7
jmp 0xe2e9
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc8(%rsp)
jmp 0xe153
movzbl 0xcf(%rsp), %eax
movzbl 0xea(%rsp), %ecx
cmpl %ecx, %eax
je 0xe355
leaq 0x40(%rsp), %rdi
movzbl 0xcf(%rsp), %edx
movq 0x118(%rsp), %rcx
movzbl 0xea(%rsp), %r8d
leaq 0x11945(%rip), %rsi     # 0x1fc7d
movb $0x0, %al
callq 0x22a0
leaq 0x40(%rsp), %rdi
movl $0x21, %esi
callq 0x2840
movl %eax, %edi
callq 0x22b0
movaps 0xfe84(%rip), %xmm1     # 0x1e1e0
movq 0xd0(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xfe7f(%rip), %xmm1     # 0x1e1f0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movzbl 0xea(%rsp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movq 0x100(%rsp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movl $0x1, 0x12c(%rsp)
movl 0x12c(%rsp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)