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

    // if header has @HD data
    if ( m_header.HasVersion() ) {

        // @HD VN:<Version>
        out << Constants::SAM_HD_BEGIN_TOKEN
            << FormatTag(Constants::SAM_HD_VERSION_TAG, m_header.Version);

        // SO:<SortOrder>
        if ( m_header.HasSortOrder() )
            out << FormatTag(Constants::SAM_HD_SORTORDER_TAG, m_header.SortOrder);

        // GO:<GroupOrder>
        if ( m_header.HasGroupOrder() )
            out << FormatTag(Constants::SAM_HD_GROUPORDER_TAG, m_header.GroupOrder);

        // custom tags
        if ( !m_header.CustomTags.empty() ) {
            for (size_t i = 0; i < m_header.CustomTags.size(); ++i) {
                const CustomHeaderTag& customTag = m_header.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, %r14
movq (%rdi), %rdi
callq 0x27cc0
testb %al, %al
je 0x5282d
addq $0x10, %rbx
movq 0x1b8eb(%rip), %rsi     # 0x6dfb0
movq 0x1b8ec(%rip), %rdx     # 0x6dfb8
movq %rbx, %rdi
callq 0x27a70
movq %rax, %r15
movq (%r14), %rdx
leaq 0x1b8ef(%rip), %rsi     # 0x6dfd0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x53278
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x27a70
leaq 0x18(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x52713
callq 0x27560
movq (%r14), %rdi
callq 0x28370
testb %al, %al
je 0x52758
movq (%r14), %rdx
addq $0x20, %rdx
leaq 0x1b8c3(%rip), %rsi     # 0x6dff0
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x53278
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x27a70
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x52758
callq 0x27560
movq (%r14), %rdi
callq 0x26cd0
testb %al, %al
je 0x5279d
movq (%r14), %rdx
addq $0x40, %rdx
leaq 0x1b89e(%rip), %rsi     # 0x6e010
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x53278
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x27a70
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5279d
callq 0x27560
movq (%r14), %rax
movq 0x60(%rax), %rsi
cmpq 0x68(%rax), %rsi
je 0x52806
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
xorl %ebp, %ebp
leaq (%rsi,%r13), %rdx
addq $0x20, %rdx
addq %r13, %rsi
movq %r15, %rdi
callq 0x53278
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x527e8
callq 0x27560
incq %rbp
movq (%r14), %rax
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rax
subq %rsi, %rax
sarq $0x6, %rax
addq $0x40, %r13
cmpq %rax, %rbp
jb 0x527b4
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 $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x52853
jmp 0x52853
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x52860
jmp 0x52865
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x52865
callq 0x27560
movq %rbx, %rdi
callq 0x28c10
nop