// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_resolve.cpp
// Function: BamTools::ResolveTool::StatsFileWriter::WriteReadGroups(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ReadGroupResolver, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, ReadGroupResolver>>> const&)
void ResolveTool::StatsFileWriter::WriteReadGroups(const map<string, ReadGroupResolver>& readGroups) {

    // [ReadGroups]
    // #<name> <medianFL> <minFL> <maxFL> <topModelID> <nextTopModelID> <isAmbiguous?>
    m_stream << READGROUPS_TOKEN << endl
             << RG_FIELD_DESCRIPTION << endl;

    // iterate over read groups
    map<string, ReadGroupResolver>::const_iterator rgIter = readGroups.begin();
    map<string, ReadGroupResolver>::const_iterator rgEnd  = readGroups.end();
    for ( ; rgIter != rgEnd; ++rgIter ) {
        const string& name = (*rgIter).first;
        const ReadGroupResolver& resolver = (*rgIter).second;

        // skip if read group has no data
        if ( !resolver.HasData )
            continue;

        // write read group data
        m_stream << name << TAB_CHAR
                 << resolver.MedianFragmentLength << TAB_CHAR
                 << resolver.MinFragmentLength << TAB_CHAR
                 << resolver.MaxFragmentLength << TAB_CHAR
                 << resolver.TopModelId << TAB_CHAR
                 << resolver.NextTopModelId << TAB_CHAR
                 << boolalpha << resolver.IsAmbiguous
                 << endl;
    }

    // extra newline at end
    m_stream << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x47e06(%rip), %rsi     # 0x8fb70
movq 0x47e07(%rip), %rdx     # 0x8fb78
callq 0x276b0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq %r15, %rdi
callq 0x27040
movq %rax, %rdi
callq 0x27410
movq 0x47e69(%rip), %rsi     # 0x8fc10
movq 0x47e6a(%rip), %rdx     # 0x8fc18
movq %rax, %rdi
callq 0x276b0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq %r15, %rdi
callq 0x27040
movq %rax, %rdi
callq 0x27410
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x47f31
movb $0x9, %r13b
leaq 0x7(%rsp), %rbp
cmpb $0x1, 0x51(%r15)
jne 0x47f1d
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq %rbx, %rdi
callq 0x276b0
movb %r13b, 0x2(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2(%rsp), %rsi
callq 0x276b0
movl 0x44(%r15), %esi
movq %rax, %rdi
callq 0x27ab0
movb %r13b, 0x3(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3(%rsp), %rsi
callq 0x276b0
movl 0x40(%r15), %esi
movq %rax, %rdi
callq 0x27ab0
movb %r13b, 0x4(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4(%rsp), %rsi
callq 0x276b0
movl 0x48(%r15), %esi
movq %rax, %rdi
callq 0x27ab0
movb %r13b, 0x5(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x5(%rsp), %rsi
callq 0x276b0
movzwl 0x4c(%r15), %esi
movq %rax, %rdi
callq 0x27400
movb %r13b, 0x6(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6(%rsp), %rsi
callq 0x276b0
movzwl 0x4e(%r15), %esi
movq %rax, %rdi
callq 0x27400
movb %r13b, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x276b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
orl $0x1, 0x18(%rax,%rcx)
movzbl 0x50(%r15), %esi
movq %rax, %rdi
callq 0x27a20
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq %r12, %rdi
callq 0x27040
movq %rax, %rdi
callq 0x27410
movq %r15, %rdi
callq 0x276c0
movq %rax, %r15
cmpq %r14, %rax
jne 0x47df9
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq %rbx, %rdi
callq 0x27040
movq %rax, %rdi
callq 0x27410
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop