// File: zeeev[P]DASVC/bamtools/src/toolkit/bamtools_convert.cpp
// Function: BamTools::ConvertTool::ConvertToolPrivate::PrintFastq(BamTools::BamAlignment const&)
void ConvertTool::ConvertToolPrivate::PrintFastq(const BamAlignment& a) { 
  
    // @BamAlignment.Name
    // BamAlignment.QueryBases
    // +
    // BamAlignment.Qualities
    //
    // N.B. - QueryBases are reverse-complemented (& Qualities reversed) if aligned to reverse strand .
    //        Name is appended "/1" or "/2" if paired-end, to reflect which mate this entry is.
  
    // handle paired-end alignments
    string name = a.Name;
    if ( a.IsPaired() )
        name.append( (a.IsFirstMate() ? "/1" : "/2") );
  
    // handle reverse strand alignment - bases & qualities
    string qualities = a.Qualities;
    string sequence  = a.QueryBases;
    if ( a.IsReverseStrand() ) {
        Utilities::Reverse(qualities);
        Utilities::ReverseComplement(sequence);
    }
  
    // write to output stream
    m_out << "@" << name << endl
          << sequence    << endl
          << "+"         << endl
          << qualities   << endl;
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xd8(%rsp), %rsi
leaq 0xb8(%rsp), %rdi
callq 0x86350
movq 0xd8(%rsp), %rdi
callq 0x863d0
movb %al, 0x67(%rsp)
jmp 0x8c95c
movb 0x67(%rsp), %al
testb $0x1, %al
jne 0x8c966
jmp 0x8c9ce
movq 0xd8(%rsp), %rdi
callq 0x86340
movb %al, 0x57(%rsp)
jmp 0x8c979
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0x8c983
jmp 0x8c991
leaq 0xa1ac2(%rip), %rax     # 0x12e44c
movq %rax, 0x48(%rsp)
jmp 0x8c99f
leaq 0xa1ab7(%rip), %rax     # 0x12e44f
movq %rax, 0x48(%rsp)
jmp 0x8c99f
movq 0x48(%rsp), %rsi
leaq 0xb8(%rsp), %rdi
callq 0x86ed0
jmp 0x8c9b3
jmp 0x8c9ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x8cb8f
movq 0xd8(%rsp), %rsi
addq $0x68, %rsi
leaq 0x88(%rsp), %rdi
callq 0x86350
jmp 0x8c9e9
movq 0xd8(%rsp), %rsi
addq $0x28, %rsi
leaq 0x68(%rsp), %rdi
callq 0x86350
jmp 0x8ca01
movq 0xd8(%rsp), %rdi
callq 0x86a40
movb %al, 0x47(%rsp)
jmp 0x8ca14
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x8ca1e
jmp 0x8ca77
leaq 0x88(%rsp), %rdi
callq 0x115bf0
jmp 0x8ca2d
leaq 0x68(%rsp), %rdi
callq 0x115c30
jmp 0x8ca39
jmp 0x8ca77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x8cb7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x86f68
jmp 0x8cb7c
movq 0x58(%rsp), %rdi
addq $0x20, %rdi
leaq 0xa19cb(%rip), %rsi     # 0x12e452
callq 0x86700
movq %rax, 0x38(%rsp)
jmp 0x8ca93
movq 0x38(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x86640
movq %rax, 0x30(%rsp)
jmp 0x8caac
movq 0x30(%rsp), %rdi
movq 0xd84b8(%rip), %rsi     # 0x164f70
callq 0x86770
movq %rax, 0x28(%rsp)
jmp 0x8cac4
movq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x86640
movq %rax, 0x20(%rsp)
jmp 0x8cada
movq 0x20(%rsp), %rdi
movq 0xd848a(%rip), %rsi     # 0x164f70
callq 0x86770
movq %rax, 0x18(%rsp)
jmp 0x8caf2
movq 0x18(%rsp), %rdi
leaq 0xa194c(%rip), %rsi     # 0x12e44a
callq 0x86700
movq %rax, 0x10(%rsp)
jmp 0x8cb0a
movq 0x10(%rsp), %rdi
movq 0xd845a(%rip), %rsi     # 0x164f70
callq 0x86770
movq %rax, 0x8(%rsp)
jmp 0x8cb22
movq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x86640
movq %rax, (%rsp)
jmp 0x8cb3a
movq (%rsp), %rdi
movq 0xd842b(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8cb4c
leaq 0x68(%rsp), %rdi
callq 0x86f68
jmp 0x8cb58
leaq 0x88(%rsp), %rdi
callq 0x86f68
jmp 0x8cb67
leaq 0xb8(%rsp), %rdi
callq 0x86f68
addq $0xe8, %rsp
retq
jmp 0x8cb7e
leaq 0x88(%rsp), %rdi
callq 0x86f68
jmp 0x8cb8d
jmp 0x8cb8f
leaq 0xb8(%rsp), %rdi
callq 0x86f68
jmp 0x8cb9e
jmp 0x8cba0
movq 0xb0(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nopw %cs:(%rax,%rax)