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

    // iterate over read group entries
    SamReadGroupConstIterator rgIter = m_header.ReadGroups.ConstBegin();
    SamReadGroupConstIterator rgEnd  = m_header.ReadGroups.ConstEnd();
    for ( ; rgIter != rgEnd; ++rgIter ) {
        const SamReadGroup& rg = (*rgIter);

        // @RG ID:<ID>
        out << Constants::SAM_RG_BEGIN_TOKEN
            << FormatTag(Constants::SAM_RG_ID_TAG, rg.ID);

        // CN:<SequencingCenter>
        if ( rg.HasSequencingCenter() )
            out << FormatTag(Constants::SAM_RG_SEQCENTER_TAG, rg.SequencingCenter);

        // DS:<Description>
        if ( rg.HasDescription() )
            out << FormatTag(Constants::SAM_RG_DESCRIPTION_TAG, rg.Description);

        // DT:<ProductionDate>
        if ( rg.HasProductionDate() )
            out << FormatTag(Constants::SAM_RG_PRODUCTIONDATE_TAG, rg.ProductionDate);

        // FO:<FlowOrder>
        if ( rg.HasFlowOrder() )
            out << FormatTag(Constants::SAM_RG_FLOWORDER_TAG, rg.FlowOrder);

        // KS:<KeySequence>
        if ( rg.HasKeySequence() )
            out << FormatTag(Constants::SAM_RG_KEYSEQUENCE_TAG, rg.KeySequence);

        // LB:<Library>
        if ( rg.HasLibrary() )
            out << FormatTag(Constants::SAM_RG_LIBRARY_TAG, rg.Library);

        // PG:<Program>
        if ( rg.HasProgram() )
            out << FormatTag(Constants::SAM_RG_PROGRAM_TAG, rg.Program);

        // PI:<PredictedInsertSize>
        if ( rg.HasPredictedInsertSize() )
            out << FormatTag(Constants::SAM_RG_PREDICTEDINSERTSIZE_TAG, rg.PredictedInsertSize);

        // PL:<SequencingTechnology>
        if ( rg.HasSequencingTechnology() )
            out << FormatTag(Constants::SAM_RG_SEQTECHNOLOGY_TAG, rg.SequencingTechnology);

        // PU:<PlatformUnit>
        if ( rg.HasPlatformUnit() )
            out << FormatTag(Constants::SAM_RG_PLATFORMUNIT_TAG, rg.PlatformUnit);

        // SM:<Sample>
        if ( rg.HasSample() )
            out << FormatTag(Constants::SAM_RG_SAMPLE_TAG, rg.Sample);

        // custom tags
        if ( !rg.CustomTags.empty() ) {
            for (size_t i = 0; i < rg.CustomTags.size(); ++i) {
                const CustomHeaderTag& customTag = rg.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 $0xc0, %r12d
movq (%rdi), %rdi
addq %r12, %rdi
callq 0x34a90
movq %rax, %r14
addq (%r15), %r12
movq %r12, %rdi
callq 0x35040
movq %rax, %r15
addq $0x10, %rbx
leaq 0x8(%rsp), %rbp
cmpq %r15, %r14
je 0x58e03
movq %rbx, %rdi
leaq 0x20096(%rip), %rsi     # 0x78bb8
callq 0x32d80
movq %rax, %r12
leaq 0x40(%r14), %rdx
movq %rbp, %rdi
leaq 0x200e0(%rip), %rsi     # 0x78c18
callq 0x5918e
movq %r12, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x33970
testb %al, %al
je 0x58b85
leaq 0x140(%r14), %rdx
movq %rbp, %rdi
leaq 0x201ab(%rip), %rsi     # 0x78d18
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x32d00
testb %al, %al
je 0x58bb6
movq %rbp, %rdi
leaq 0x2003d(%rip), %rsi     # 0x78bd8
movq %r14, %rdx
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x33200
testb %al, %al
je 0x58beb
leaq 0xe0(%r14), %rdx
movq %rbp, %rdi
leaq 0x200e5(%rip), %rsi     # 0x78cb8
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x34580
testb %al, %al
je 0x58c1d
leaq 0x20(%r14), %rdx
movq %rbp, %rdi
leaq 0x1fff3(%rip), %rsi     # 0x78bf8
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x32650
testb %al, %al
je 0x58c4f
leaq 0x60(%r14), %rdx
movq %rbp, %rdi
leaq 0x20001(%rip), %rsi     # 0x78c38
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x311f0
testb %al, %al
je 0x58c84
leaq 0x80(%r14), %rdx
movq %rbp, %rdi
leaq 0x1ffec(%rip), %rsi     # 0x78c58
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x353d0
testb %al, %al
je 0x58cb9
leaq 0x100(%r14), %rdx
movq %rbp, %rdi
leaq 0x20037(%rip), %rsi     # 0x78cd8
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x32ef0
testb %al, %al
je 0x58cee
leaq 0xc0(%r14), %rdx
movq %rbp, %rdi
leaq 0x1ffc2(%rip), %rsi     # 0x78c98
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x32410
testb %al, %al
je 0x58d23
leaq 0x160(%r14), %rdx
movq %rbp, %rdi
leaq 0x2002d(%rip), %rsi     # 0x78d38
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x34b50
testb %al, %al
je 0x58d58
leaq 0xa0(%r14), %rdx
movq %rbp, %rdi
leaq 0x1ff38(%rip), %rsi     # 0x78c78
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq %r14, %rdi
callq 0x33340
testb %al, %al
je 0x58d8d
leaq 0x120(%r14), %rdx
movq %rbp, %rdi
leaq 0x1ff83(%rip), %rsi     # 0x78cf8
callq 0x5918e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x32d80
movq %rbp, %rdi
callq 0x33a00
movq 0x180(%r14), %rsi
movq 0x188(%r14), %rax
cmpq %rax, %rsi
je 0x58def
xorl %r12d, %r12d
xorl %r13d, %r13d
subq %rsi, %rax
sarq $0x6, %rax
cmpq %rax, %r13
jae 0x58def
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 %r13
movq 0x180(%r14), %rsi
movq 0x188(%r14), %rax
addq $0x40, %r12
jmp 0x58da6
movq %rbx, %rdi
callq 0x31e60
addq $0x198, %r14            # imm = 0x198
jmp 0x58b0f
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
jmp 0x58edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop