// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/sam/SamFormatPrinter_p.cpp
// Function: BamTools::Internal::SamFormatPrinter::PrintSQ(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&) const
void SamFormatPrinter::PrintSQ(std::stringstream& out) const {

    // iterate over sequence entries
    SamSequenceConstIterator seqIter = m_header.Sequences.ConstBegin();
    SamSequenceConstIterator seqEnd  = m_header.Sequences.ConstEnd();
    for ( ; seqIter != seqEnd; ++seqIter ) {
        const SamSequence& seq = (*seqIter);

        // @SQ SN:<Name> LN:<Length>
        out << Constants::SAM_SQ_BEGIN_TOKEN
            << FormatTag(Constants::SAM_SQ_NAME_TAG, seq.Name)
            << FormatTag(Constants::SAM_SQ_LENGTH_TAG, seq.Length);

        // AS:<AssemblyID>
        if ( seq.HasAssemblyID() )
            out << FormatTag(Constants::SAM_SQ_ASSEMBLYID_TAG, seq.AssemblyID);

        // M5:<Checksum>
        if ( seq.HasChecksum() )
            out << FormatTag(Constants::SAM_SQ_CHECKSUM_TAG, seq.Checksum);

        // SP:<Species>
        if ( seq.HasSpecies() )
            out << FormatTag(Constants::SAM_SQ_SPECIES_TAG, seq.Species);

        // UR:<URI>
        if ( seq.HasURI() )
            out << FormatTag(Constants::SAM_SQ_URI_TAG, seq.URI);

        // custom tags
        if ( !seq.CustomTags.empty() ) {
            for (size_t i = 0; i < seq.CustomTags.size(); ++i) {
                const CustomHeaderTag& customTag = seq.CustomTags[i];
                out << FormatTag(customTag.TagName, customTag.TagValue);
            }
        }

        // newline
        out << endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdi), %rdi
addq $0x78, %rdi
callq 0x344e0
movq %rax, %r14
movq (%r15), %rdi
addq $0x78, %rdi
callq 0x35350
movq %rax, (%rsp)
addq $0x10, %rbx
leaq 0x8(%rsp), %rbp
leaq 0x28(%rsp), %r13
cmpq (%rsp), %r14
je 0x58a47
movq %rbx, %rdi
leaq 0x2022b(%rip), %rsi     # 0x78ad8
callq 0x32d80
movq %rax, %r12
leaq 0x60(%r14), %rdx
movq %rbp, %rdi
leaq 0x20295(%rip), %rsi     # 0x78b58
callq 0x5918e
movq %r12, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rax, %r12
leaq 0x40(%r14), %rdx
movq %r13, %rdi
leaq 0x20254(%rip), %rsi     # 0x78b38
callq 0x5918e
movq %r12, %rdi
movq %r13, %rsi
callq 0x32d80
movq %r13, %rdi
callq 0x33a00
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x33790
testb %al, %al
je 0x58935
movq %rbp, %rdi
leaq 0x201de(%rip), %rsi     # 0x78af8
movq %r14, %rdx
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x32320
testb %al, %al
je 0x58967
leaq 0x20(%r14), %rdx
movq %rbp, %rdi
leaq 0x201c9(%rip), %rsi     # 0x78b18
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x33a90
testb %al, %al
je 0x5899c
leaq 0x80(%r14), %rdx
movq %rbp, %rdi
leaq 0x201f4(%rip), %rsi     # 0x78b78
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x35460
testb %al, %al
je 0x589d1
leaq 0xa0(%r14), %rdx
movq %rbp, %rdi
leaq 0x201df(%rip), %rsi     # 0x78b98
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq 0xc0(%r14), %rsi
movq 0xc8(%r14), %rax
cmpq %rax, %rsi
je 0x58a33
xorl %r12d, %r12d
xorl %r15d, %r15d
subq %rsi, %rax
sarq $0x6, %rax
cmpq %rax, %r15
jae 0x58a33
leaq (%rsi,%r12), %rdx
addq $0x20, %rdx
addq %r12, %rsi
movq %rbp, %rdi
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
incq %r15
movq 0xc0(%r14), %rsi
movq 0xc8(%r14), %rax
addq $0x40, %r12
jmp 0x589ea
movq %rbx, %rdi
callq 0x31e60
addq $0xd8, %r14
jmp 0x58899
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58abf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58abf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58abf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58abf
jmp 0x58aa3
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33a00
jmp 0x58aa6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58abf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop