// File: readmapping[P]alfalfa/src/mapper.h
// Function: read_t::printPairedAlignments[abi:cxx11](int, bool)
std::string printPairedAlignments(int i, bool firstMate){
        std::stringstream ss;
        alignment_t * a = alignments[i];
        if(a->paired()){
            //flag has to be changed
            ss << qname << "\t" << (a->flag.to_ulong() |a->mate.flag.to_ulong())  << "\t"
            << a->rname << "\t" << a->pos << "\t" << 
            a->mapq << "\t" << a->cigar << "\t" << 
            (a->rname == a->mate.rnext ? "=" : a->mate.rnext) << "\t" << a->mate.pnext << "\t" << 
            a->mate.tLength << "\t" << (a->flag.test(4) ? rcSequence : sequence) <<
            "\t" << (a->flag.test(4) ? rQual : qual) << "\tAS:i:" << 
            a->alignmentScore+a->mate.alignmentScore << "\tNM:i:" << a->editDist << "\tX0:Z:" << 
            a->NMtag << std::endl;
            return ss.str();
        }
        else{
            a->setUnPaired(firstMate);
            return printUnpairedAlignment(i);
        }
    }

// Assembly:
subq $0x308, %rsp            # imm = 0x308
movq %rdi, 0x108(%rsp)
movb %cl, %al
movq %rdi, %rcx
movq %rcx, 0x110(%rsp)
movq %rdi, 0x300(%rsp)
movq %rsi, 0x2f8(%rsp)
movl %edx, 0x2f4(%rsp)
andb $0x1, %al
movb %al, 0x2f3(%rsp)
movq 0x2f8(%rsp), %rax
movq %rax, 0x118(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x8260
movq 0x118(%rsp), %rdi
addq $0xb0, %rdi
movslq 0x2f4(%rsp), %rsi
callq 0xdae0
movq (%rax), %rax
movq %rax, 0x160(%rsp)
movq 0x160(%rsp), %rdi
callq 0xe470
movb %al, 0x127(%rsp)
jmp 0xc6e6
movb 0x127(%rsp), %al
testb $0x1, %al
jne 0xc6f6
jmp 0xcc2f
movq 0x118(%rsp), %rsi
leaq 0x178(%rsp), %rdi
callq 0x8330
movq %rax, 0x100(%rsp)
jmp 0xc715
movq 0x100(%rsp), %rdi
leaq 0x6d339(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0xf8(%rsp)
jmp 0xc733
movq 0x160(%rsp), %rdi
addq $0x40, %rdi
callq 0xe330
movq %rax, 0xe8(%rsp)
movq 0x160(%rsp), %rdi
addq $0xa0, %rdi
callq 0xe330
movq 0xe8(%rsp), %rsi
movq 0xf8(%rsp), %rdi
orq %rax, %rsi
callq 0x8100
movq %rax, 0xf0(%rsp)
jmp 0xc782
movq 0xf0(%rsp), %rdi
leaq 0x6d2cc(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0xe0(%rsp)
jmp 0xc7a0
movq 0xe0(%rsp), %rdi
movq 0x160(%rsp), %rsi
addq $0x48, %rsi
callq 0x8330
movq %rax, 0xd8(%rsp)
jmp 0xc7c3
movq 0xd8(%rsp), %rdi
leaq 0x6d28b(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0xd0(%rsp)
jmp 0xc7e1
movq 0xd0(%rsp), %rdi
movq 0x160(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x8790
movq %rax, 0xc8(%rsp)
jmp 0xc804
movq 0xc8(%rsp), %rdi
leaq 0x6d24a(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0xc0(%rsp)
jmp 0xc822
movq 0xc0(%rsp), %rdi
movq 0x160(%rsp), %rax
movl 0x68(%rax), %esi
callq 0x8710
movq %rax, 0xb8(%rsp)
jmp 0xc844
movq 0xb8(%rsp), %rdi
leaq 0x6d20a(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0xb0(%rsp)
jmp 0xc862
movq 0xb0(%rsp), %rdi
movq 0x160(%rsp), %rsi
addq $0x20, %rsi
callq 0x8330
movq %rax, 0xa8(%rsp)
jmp 0xc885
movq 0xa8(%rsp), %rdi
leaq 0x6d1c9(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0xa0(%rsp)
jmp 0xc8a3
movq 0x160(%rsp), %rdi
addq $0x48, %rdi
movq 0x160(%rsp), %rsi
addq $0xa0, %rsi
addq $0x8, %rsi
callq 0xe490
movb $0x0, 0x12e(%rsp)
testb $0x1, %al
jne 0xc8d5
jmp 0xc912
leaq 0x12f(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x8750
movq 0x98(%rsp), %rdx
movb $0x1, 0x12e(%rsp)
leaq 0x6cbc8(%rip), %rsi     # 0x794c9
leaq 0x130(%rsp), %rdi
callq 0xb8b0
jmp 0xc910
jmp 0xc932
movq 0x160(%rsp), %rsi
addq $0xa8, %rsi
leaq 0x130(%rsp), %rdi
callq 0x8180
jmp 0xc930
jmp 0xc932
movq 0xa0(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x8330
movq %rax, 0x90(%rsp)
jmp 0xc951
movq 0x90(%rsp), %rdi
leaq 0x6d0fd(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0x88(%rsp)
jmp 0xc96f
movq 0x88(%rsp), %rdi
movq 0x160(%rsp), %rax
movq 0xc8(%rax), %rsi
callq 0x8790
movq %rax, 0x80(%rsp)
jmp 0xc995
movq 0x80(%rsp), %rdi
leaq 0x6d0b9(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0x78(%rsp)
jmp 0xc9b0
movq 0x78(%rsp), %rdi
movq 0x160(%rsp), %rax
movl 0xd8(%rax), %esi
callq 0x8710
movq %rax, 0x70(%rsp)
jmp 0xc9cf
movq 0x70(%rsp), %rdi
leaq 0x6d082(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0x68(%rsp)
jmp 0xc9e7
movq 0x160(%rsp), %rdi
addq $0x40, %rdi
movl $0x4, %esi
callq 0xe340
movb %al, 0x67(%rsp)
jmp 0xca03
movb 0x67(%rsp), %al
testb $0x1, %al
jne 0xca0d
jmp 0xca20
movq 0x118(%rsp), %rax
addq $0x60, %rax
movq %rax, 0x58(%rsp)
jmp 0xca31
movq 0x118(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x58(%rsp)
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x8330
movq %rax, 0x50(%rsp)
jmp 0xca47
movq 0x50(%rsp), %rdi
leaq 0x6d00a(%rip), %rsi     # 0x79a5d
callq 0x8360
movq %rax, 0x48(%rsp)
jmp 0xca5f
movq 0x160(%rsp), %rdi
addq $0x40, %rdi
movl $0x4, %esi
callq 0xe340
movb %al, 0x47(%rsp)
jmp 0xca7b
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0xca85
jmp 0xca9a
movq 0x118(%rsp), %rax
addq $0x80, %rax
movq %rax, 0x38(%rsp)
jmp 0xcaab
movq 0x118(%rsp), %rax
addq $0x40, %rax
movq %rax, 0x38(%rsp)
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x8330
movq %rax, 0x30(%rsp)
jmp 0xcac1
movq 0x30(%rsp), %rdi
leaq 0x6c997(%rip), %rsi     # 0x79464
callq 0x8360
movq %rax, 0x28(%rsp)
jmp 0xcad9
movq 0x28(%rsp), %rdi
movq 0x160(%rsp), %rax
movl 0x70(%rax), %esi
movl 0xe0(%rax), %eax
addl %eax, %esi
callq 0x8710
movq %rax, 0x20(%rsp)
jmp 0xcafd
movq 0x20(%rsp), %rdi
leaq 0x6c962(%rip), %rsi     # 0x7946b
callq 0x8360
movq %rax, 0x18(%rsp)
jmp 0xcb15
movq 0x18(%rsp), %rdi
movq 0x160(%rsp), %rax
movl 0x6c(%rax), %esi
callq 0x8710
movq %rax, 0x10(%rsp)
jmp 0xcb31
movq 0x10(%rsp), %rdi
leaq 0x6c935(%rip), %rsi     # 0x79472
callq 0x8360
movq %rax, 0x8(%rsp)
jmp 0xcb49
movq 0x8(%rsp), %rdi
movq 0x160(%rsp), %rsi
addq $0x78, %rsi
callq 0x8330
movq %rax, (%rsp)
jmp 0xcb65
movq (%rsp), %rdi
movq 0x8a440(%rip), %rsi     # 0x96fb0
callq 0x83b0
jmp 0xcb77
leaq 0x130(%rsp), %rdi
callq 0x8858
testb $0x1, 0x12e(%rsp)
jne 0xcb90
jmp 0xcb9d
leaq 0x12f(%rsp), %rdi
callq 0x83e0
movq 0x108(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x8350
jmp 0xcbb4
movl $0x1, 0x128(%rsp)
jmp 0xcc72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0xcc8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0xcc14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
leaq 0x130(%rsp), %rdi
callq 0x8858
testb $0x1, 0x12e(%rsp)
jne 0xcc20
jmp 0xcc2d
leaq 0x12f(%rsp), %rdi
callq 0x83e0
jmp 0xcc8f
movq 0x160(%rsp), %rdi
movzbl 0x2f3(%rsp), %esi
andl $0x1, %esi
callq 0xe530
jmp 0xcc49
movq 0x118(%rsp), %rsi
movq 0x108(%rsp), %rdi
movl 0x2f4(%rsp), %edx
callq 0xc0e0
jmp 0xcc67
movl $0x1, 0x128(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x8290
movq 0x110(%rsp), %rax
addq $0x308, %rsp            # imm = 0x308
retq
leaq 0x168(%rsp), %rdi
callq 0x8290
movq 0x158(%rsp), %rdi
callq 0x8730
nopl (%rax)