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

    // iterate over program record entries
    SamProgramConstIterator pgIter = m_header.Programs.ConstBegin();
    SamProgramConstIterator pgEnd  = m_header.Programs.ConstEnd();
    for ( ; pgIter != pgEnd; ++pgIter ) {
        const SamProgram& pg = (*pgIter);

        // @PG ID:<ID>
        out << Constants::SAM_PG_BEGIN_TOKEN
            << FormatTag(Constants::SAM_PG_ID_TAG, pg.ID);

        // PN:<Name>
        if ( pg.HasName() )
            out << FormatTag(Constants::SAM_PG_NAME_TAG, pg.Name);

        // CL:<CommandLine>
        if ( pg.HasCommandLine() )
            out << FormatTag(Constants::SAM_PG_COMMANDLINE_TAG, pg.CommandLine);

        // PP:<PreviousProgramID>
        if ( pg.HasPreviousProgramID() )
            out << FormatTag(Constants::SAM_PG_PREVIOUSPROGRAM_TAG, pg.PreviousProgramID);

        // VN:<Version>
        if ( pg.HasVersion() )
            out << FormatTag(Constants::SAM_PG_VERSION_TAG, pg.Version);

        // custom tags
        if ( !pg.CustomTags.empty() ) {
            for (size_t i = 0; i < pg.CustomTags.size(); ++i) {
                const CustomHeaderTag& customTag = pg.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 $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movl $0x108, %r12d           # imm = 0x108
movq (%rdi), %rdi
addq %r12, %rdi
callq 0x26a10
movq %rax, %r14
addq (%r15), %r12
movq %r12, %rdi
callq 0x291b0
movq %rax, 0x20(%rsp)
cmpq %rax, %r14
je 0x5326d
addq $0x10, %rbx
leaq 0x10(%rsp), %r12
movq %rsp, %r13
movq 0x1b23a(%rip), %rsi     # 0x6e2b8
movq 0x1b23b(%rip), %rdx     # 0x6e2c0
movq %rbx, %rdi
callq 0x27a70
movq %rax, %rbp
leaq 0x20(%r14), %rdx
movq %r13, %rdi
leaq 0x1b25a(%rip), %rsi     # 0x6e2f8
callq 0x5334c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbp, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x530c2
callq 0x27560
movq %r14, %rdi
callq 0x27dd0
testb %al, %al
je 0x53100
leaq 0x40(%r14), %rdx
movq %r13, %rdi
leaq 0x1b23c(%rip), %rsi     # 0x6e318
callq 0x5334c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x53100
callq 0x27560
movq %r14, %rdi
callq 0x27290
testb %al, %al
je 0x5313d
movq %r13, %rdi
leaq 0x1b1c2(%rip), %rsi     # 0x6e2d8
movq %r14, %rdx
callq 0x5334c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x5313d
callq 0x27560
movq %r14, %rdi
callq 0x28200
testb %al, %al
je 0x5317b
leaq 0x60(%r14), %rdx
movq %r13, %rdi
leaq 0x1b1e1(%rip), %rsi     # 0x6e338
callq 0x5334c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x5317b
callq 0x27560
movq %r14, %rdi
callq 0x27ba0
testb %al, %al
je 0x531bc
leaq 0x80(%r14), %rdx
movq %r13, %rdi
leaq 0x1b1c0(%rip), %rsi     # 0x6e358
callq 0x5334c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x531bc
callq 0x27560
movq 0xa0(%r14), %rax
cmpq 0xa8(%r14), %rax
je 0x53234
movq 0xa0(%r14), %rsi
cmpq %rsi, 0xa8(%r14)
je 0x53234
xorl %ebp, %ebp
xorl %r15d, %r15d
leaq (%rsi,%rbp), %rdx
addq $0x20, %rdx
addq %rbp, %rsi
movq %r13, %rdi
callq 0x5334c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x53213
callq 0x27560
incq %r15
movq 0xa0(%r14), %rsi
movq 0xa8(%r14), %rax
subq %rsi, %rax
sarq $0x6, %rax
addq $0x40, %rbp
cmpq %rax, %r15
jb 0x531e1
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x275a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x260a0
movq %rax, %rdi
callq 0x26fc0
addq $0xd8, %r14
cmpq 0x20(%rsp), %r14
jne 0x53077
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x53286
jmp 0x53286
jmp 0x53286
jmp 0x53286
jmp 0x53286
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x53297
callq 0x27560
movq %rbx, %rdi
callq 0x28c20
nop