// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/separate_kb_molecule.cpp
// Function: write_molecule_kbcov(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long, 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, unsigned long>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
bool write_molecule_kbcov(map<string, unsigned long> molecule_kbcov, string molfolder, string mollabel, int mlkey)
{
    // 1. molecule base coverage
    std::stringstream outMCovFile;
    outMCovFile.str(""); 
    outMCovFile << "./" << molfolder << "/" << mollabel << "_" << mlkey << "kb_moleCov_stat.txt";
    ofstream ofp;
    ofp.open( (outMCovFile.str()).c_str(), ios::out);
    if(!ofp.good())
    {
        cout << "   Error: cannot open " << outMCovFile.str() << " to write data. " << endl;
        return false;
    }
    map<string, unsigned long>::iterator mcitr;
    map<string, unsigned long>::iterator mcitr_end;
    mcitr     = molecule_kbcov.begin();
    mcitr_end = molecule_kbcov.end();
    ofp << "#molecule_base_cov\tmolecule_num_in_bin" << endl;
    while(mcitr != mcitr_end)
    {
        ofp << (*mcitr).first << "\t" << (*mcitr).second << endl;
        mcitr ++;
    }
    ofp.close();
    
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x3b0, %rsp            # imm = 0x3B0
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x228(%rsp), %rdi
callq 0x4250
leaq 0x8a15(%rip), %rsi      # 0x2db1a
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x4d3e
leaq 0x240(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x4490
leaq 0x28(%rsp), %rdi
callq 0x4638
leaq 0x238(%rsp), %rdi
leaq 0x8c27(%rip), %rsi      # 0x2dd69
callq 0x4330
movq %rax, %rdi
movq %r12, %rsi
callq 0x42e0
leaq 0x8c11(%rip), %rsi      # 0x2dd6a
movq %rax, %rdi
callq 0x4330
movq %rax, %rdi
movq %r15, %rsi
callq 0x42e0
leaq 0x5944(%rip), %rsi      # 0x2aab7
movq %rax, %rdi
callq 0x4330
movq %rax, %rdi
movl %ebp, %esi
callq 0x4580
leaq 0x88ec(%rip), %rsi      # 0x2da78
movq %rax, %rdi
callq 0x4330
leaq 0x28(%rsp), %rdi
callq 0x4570
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x44e0
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x4050
leaq 0x8(%rsp), %rdi
callq 0x4638
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x48(%rsp,%rax), %ebp
testl %ebp, %ebp
je 0x2522b
movq 0x17de9(%rip), %rdi     # 0x3cfc8
leaq 0x4932(%rip), %rsi      # 0x29b18
callq 0x4330
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x44e0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x42e0
leaq 0x4cbd(%rip), %rsi      # 0x29ecc
movq %rax, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
leaq 0x8(%rsp), %rdi
callq 0x4638
jmp 0x2529f
movq 0x18(%rbx), %r14
leaq 0x4ca7(%rip), %rsi      # 0x29edd
leaq 0x28(%rsp), %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
addq $0x8, %rbx
leaq 0x28(%rsp), %r15
leaq 0x88c1(%rip), %r12      # 0x2db19
cmpq %rbx, %r14
je 0x25295
leaq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x42e0
movq %rax, %rdi
movq %r12, %rsi
callq 0x4330
movq 0x40(%r14), %rsi
movq %rax, %rdi
callq 0x4230
movq %rax, %rdi
callq 0x41c0
movq %r14, %rdi
callq 0x4240
movq %rax, %r14
jmp 0x25258
leaq 0x28(%rsp), %rdi
callq 0x4430
testl %ebp, %ebp
sete %bl
leaq 0x28(%rsp), %rdi
callq 0x4480
leaq 0x228(%rsp), %rdi
callq 0x4280
movl %ebx, %eax
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x252fe
jmp 0x252fe
jmp 0x252ea
jmp 0x252fe
jmp 0x252f9
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4638
jmp 0x2530b
jmp 0x252f9
jmp 0x252fe
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4638
jmp 0x25301
movq %rax, %rbx
jmp 0x2530b
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4480
leaq 0x228(%rsp), %rdi
callq 0x4280
movq %rbx, %rdi
callq 0x45a0