// File: /workspace/github_cpp_makefile_star2_O1/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 0x27cd0
testb %al, %al
je 0x528d2
addq $0x10, %rbx
movq 0x1b85b(%rip), %rsi     # 0x6dfb8
movq 0x1b85c(%rip), %rdx     # 0x6dfc0
movq %rbx, %rdi
callq 0x27a70
movq %rax, %r15
movq (%r14), %rdx
leaq 0x1b85f(%rip), %rsi     # 0x6dfd8
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x5334c
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x27a70
leaq 0x18(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x527ab
callq 0x27560
movq (%r14), %rdi
callq 0x28380
testb %al, %al
je 0x527f0
movq (%r14), %rdx
addq $0x20, %rdx
leaq 0x1b833(%rip), %rsi     # 0x6dff8
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x5334c
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x27a70
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x527f0
callq 0x27560
movq (%r14), %rdi
callq 0x26cd0
testb %al, %al
je 0x52835
movq (%r14), %rdx
addq $0x40, %rdx
leaq 0x1b80e(%rip), %rsi     # 0x6e018
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x5334c
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x27a70
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x52835
callq 0x27560
movq (%r14), %rax
movq 0x60(%rax), %rcx
cmpq 0x68(%rax), %rcx
je 0x528ab
movq (%r14), %rax
movq 0x60(%rax), %rsi
cmpq %rsi, 0x68(%rax)
je 0x528ab
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
xorl %ebp, %ebp
leaq (%rsi,%r13), %rdx
addq $0x20, %rdx
addq %r13, %rsi
movq %r15, %rdi
callq 0x5334c
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a70
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5288d
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 0x52859
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 0x528f8
jmp 0x528f8
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x52905
jmp 0x5290a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5290a
callq 0x27560
movq %rbx, %rdi
callq 0x28c20