// File: /workspace/github_cpp_makefile_star2_O3/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 0x28890
movq %rax, %r14
addq (%r15), %r12
movq %r12, %rdi
callq 0x28d30
movq %rax, 0x20(%rsp)
cmpq %rax, %r14
je 0x52f26
addq $0x10, %rbx
leaq 0x10(%rsp), %r12
movq %rsp, %r13
movq 0x1b590(%rip), %rsi     # 0x6e110
movq 0x1b591(%rip), %rdx     # 0x6e118
movq %rbx, %rdi
callq 0x27a70
movq %rax, %rbp
leaq 0x40(%r14), %rdx
movq %r13, %rdi
leaq 0x1b5d0(%rip), %rsi     # 0x6e170
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbp, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52bc4
callq 0x27560
movq %r14, %rdi
callq 0x27c30
testb %al, %al
je 0x52c05
leaq 0x140(%r14), %rdx
movq %r13, %rdi
leaq 0x1b68f(%rip), %rsi     # 0x6e270
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52c05
callq 0x27560
movq %r14, %rdi
callq 0x27380
testb %al, %al
je 0x52c42
movq %r13, %rdi
leaq 0x1b515(%rip), %rsi     # 0x6e130
movq %r14, %rdx
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52c42
callq 0x27560
movq %r14, %rdi
callq 0x27770
testb %al, %al
je 0x52c83
leaq 0xe0(%r14), %rdx
movq %r13, %rdi
leaq 0x1b5b1(%rip), %rsi     # 0x6e210
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52c83
callq 0x27560
movq %r14, %rdi
callq 0x28500
testb %al, %al
je 0x52cc1
leaq 0x20(%r14), %rdx
movq %r13, %rdi
leaq 0x1b4b3(%rip), %rsi     # 0x6e150
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52cc1
callq 0x27560
movq %r14, %rdi
callq 0x26f60
testb %al, %al
je 0x52cff
leaq 0x60(%r14), %rdx
movq %r13, %rdi
leaq 0x1b4b5(%rip), %rsi     # 0x6e190
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52cff
callq 0x27560
movq %r14, %rdi
callq 0x26190
testb %al, %al
je 0x52d40
leaq 0x80(%r14), %rdx
movq %r13, %rdi
leaq 0x1b494(%rip), %rsi     # 0x6e1b0
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52d40
callq 0x27560
movq %r14, %rdi
callq 0x28fb0
testb %al, %al
je 0x52d81
leaq 0x100(%r14), %rdx
movq %r13, %rdi
leaq 0x1b4d3(%rip), %rsi     # 0x6e230
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52d81
callq 0x27560
movq %r14, %rdi
callq 0x274d0
testb %al, %al
je 0x52dc2
leaq 0xc0(%r14), %rdx
movq %r13, %rdi
leaq 0x1b452(%rip), %rsi     # 0x6e1f0
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52dc2
callq 0x27560
movq %r14, %rdi
callq 0x26dc0
testb %al, %al
je 0x52e03
leaq 0x160(%r14), %rdx
movq %r13, %rdi
leaq 0x1b4b1(%rip), %rsi     # 0x6e290
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52e03
callq 0x27560
movq %r14, %rdi
callq 0x28930
testb %al, %al
je 0x52e44
leaq 0xa0(%r14), %rdx
movq %r13, %rdi
leaq 0x1b3b0(%rip), %rsi     # 0x6e1d0
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52e44
callq 0x27560
movq %r14, %rdi
callq 0x27870
testb %al, %al
je 0x52e85
leaq 0x120(%r14), %rdx
movq %r13, %rdi
leaq 0x1b3ef(%rip), %rsi     # 0x6e250
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52e85
callq 0x27560
movq 0x180(%r14), %rsi
cmpq 0x188(%r14), %rsi
je 0x52eed
xorl %ebp, %ebp
xorl %r15d, %r15d
leaq (%rsi,%rbp), %rdx
addq $0x20, %rdx
addq %rbp, %rsi
movq %r13, %rdi
callq 0x53278
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52ecc
callq 0x27560
incq %r15
movq 0x180(%r14), %rsi
movq 0x188(%r14), %rax
subq %rsi, %rax
sarq $0x6, %rax
addq $0x40, %rbp
cmpq %rax, %r15
jb 0x52e9a
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 $0x198, %r14            # imm = 0x198
cmpq 0x20(%rsp), %r14
jne 0x52b79
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
jmp 0x52f4d
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x52f5e
callq 0x27560
movq %rbx, %rdi
callq 0x28c10