// File: /workspace/github_c_makefile_star2_O2/jsh58[P]Genrich/Genrich.c
// Function: saveAlns
void saveAlns(char* qname, Aln* aln, int alnLen, bool pair,
    bool singleOpt, bool singleR1, bool singleR2,
    float scorePr, float scoreR1, float scoreR2,
    float asDiff, 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) {
  if (pair) {
    // properly paired alignment(s)
    Read* r = createRead(readPr, readIdxPr, readLenPr,
      readMemPr);
    saveAlnsPair(qname, aln, alnLen, scorePr, asDiff, r,
      qualR1, qualR2);
  } else if (singleOpt) {
    if (singleR1 && singleR2) {
      // both reads aligned (discordant)
      Read* r = createRead(readDc, readIdxDc, readLenDc,
        readMemDc);
      saveAlnsDiscord(qname, aln, alnLen, scoreR1,
        scoreR2, asDiff, r, qualR1, qualR2);
    } else if (singleR1) {
      // only R1 read aligned
      Read* r = createRead(readSn, readIdxSn, readLenSn,
        readMemSn);
      saveAlnsSingle(qname, aln, alnLen, scoreR1, asDiff,
        true, r, qualR1);
    } else if (singleR2) {
      // only R2 read aligned
      Read* r = createRead(readSn, readIdxSn, readLenSn,
        readMemSn);
      saveAlnsSingle(qname, aln, alnLen, scoreR2, asDiff,
        false, r, qualR2);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movzwl 0xb0(%rsp), %ebp
movzwl 0xa8(%rsp), %r12d
testl %ecx, %ecx
je 0x81f3
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %rdx
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdi
movss %xmm3, 0x4(%rsp)
movss %xmm0, 0x8(%rsp)
callq 0x7d90
movzwl %r12w, %r8d
movzwl %bp, %r9d
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
movss 0x8(%rsp), %xmm0
movss 0x4(%rsp), %xmm1
movq %rax, %rcx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8023
testb %r8b, %r8b
je 0x8304
movb 0x40(%rsp), %al
movl %r9d, %ecx
andb %al, %cl
cmpb $0x1, %cl
jne 0x826e
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdi
movss %xmm3, 0x4(%rsp)
movss %xmm2, 0xc(%rsp)
movss %xmm1, 0x8(%rsp)
callq 0x7d90
movzwl %r12w, %r8d
movzwl %bp, %r9d
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
movss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
movss 0x4(%rsp), %xmm2
movq %rax, %rcx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7fa0
movq 0xa0(%rsp), %rcx
movq 0x98(%rsp), %rdx
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdi
testb %r9b, %r9b
je 0x82c1
movss %xmm3, 0x4(%rsp)
movss %xmm1, 0x8(%rsp)
callq 0x7d90
movzwl %r12w, %r9d
pushq $0x1
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
movss 0x8(%rsp), %xmm0
movss 0x4(%rsp), %xmm1
jmp 0x82f0
testb %al, %al
je 0x8304
movss %xmm3, 0x4(%rsp)
movss %xmm2, 0xc(%rsp)
callq 0x7d90
movzwl %bp, %r9d
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
movss 0xc(%rsp), %xmm0
movss 0x4(%rsp), %xmm1
xorl %ecx, %ecx
movq %rax, %r8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7f1e
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq