// File: mshabbirhasan[P]ups-indel/include/seqan/bam_io/write_sam.h
// Function: int seqan::write2<std::ostream, seqan::StringSet<seqan::String<char, seqan::Alloc<void>>, seqan::Owner<seqan::Tag<seqan::Default_>>>, seqan::NameStoreCache<seqan::StringSet<seqan::String<char, seqan::Alloc<void>>, seqan::Owner<seqan::Tag<seqan::Default_>>>, seqan::String<char, seqan::Alloc<void>>>>(std::ostream&, seqan::BamHeaderRecord const&, seqan::BamIOContext<seqan::StringSet<seqan::String<char, seqan::Alloc<void>>, seqan::Owner<seqan::Tag<seqan::Default_>>>, seqan::NameStoreCache<seqan::StringSet<seqan::String<char, seqan::Alloc<void>>, seqan::Owner<seqan::Tag<seqan::Default_>>>, seqan::String<char, seqan::Alloc<void>>>> const&, seqan::Tag<seqan::Sam_> const&)
int write2(TStream & stream,
           BamHeaderRecord const & header,
           BamIOContext<TNameStore, TNameStoreCache> const & /*context*/,
           Sam const & /*tag*/)
{
    char const * headerTypes[] = {"@HD", "@SQ", "@RG", "@PG", "@CO"};
    streamPut(stream, headerTypes[header.type]);
    if (header.type == BAM_HEADER_COMMENT)
    {
        streamPut(stream, '\t');
        streamPut(stream, header.tags[0].i2);
    }
    else
    {
        for (unsigned i = 0; i < length(header.tags); ++i)
        {
            streamPut(stream, '\t');
            streamPut(stream, header.tags[i].i1);
            streamPut(stream, ':');
            streamPut(stream, header.tags[i].i2);
        }
    }

    int res = streamPut(stream, '\n');
    if (res != 0)
        return res;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1619a(%rip), %rsi     # 0x37d60
movl $0x28, %edx
callq 0x4370
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq -0x50(%rbp,%rax,8), %rsi
callq 0x21dd0
movq -0x18(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x21c27
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
callq 0x22a00
movq -0x60(%rbp), %rdi
movq %rax, %rsi
addq $0x18, %rsi
callq 0x21e30
jmp 0x21cc6
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x19da0
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
jae 0x21cc4
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x11ba0
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movl -0x54(%rbp), %esi
callq 0x21b20
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x21e30
movq -0x10(%rbp), %rdi
movl $0x3a, %esi
callq 0x11ba0
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movl -0x54(%rbp), %esi
callq 0x21b20
movq -0x70(%rbp), %rdi
movq %rax, %rsi
addq $0x18, %rsi
callq 0x21e30
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x21c2e
jmp 0x21cc6
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x11ba0
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
je 0x21ce5
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x21cec
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)