// File: /workspace/github_cpp_makefile_star2_O1/schneebergerlab[P]DrLink/detect_recombsite.cpp
// Function: output_real_molecule_len_distribution(std::map<int, unsigned long, std::less<int>, std::allocator<std::pair<int const, unsigned long>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool output_real_molecule_len_distribution(map<int, unsigned long> molecule_len_control, string outPrefix)
{
    // all "real" molecule passing checkings on ML, RN and HET
    // among which COs were reported.
    string outMLenFile = outPrefix + "_realMoLen_stat.txt";    
    ofstream ofp;
    ofp.open(outMLenFile.c_str(), ios::out);
    if(!ofp.good())
    {
        cout << "   Error: cannot open " << outMLenFile << " to write data. " << endl;
        return false;
    }
    map<int, unsigned long>::iterator mlitr;
    map<int, unsigned long>::iterator mlitr_end;
    mlitr     = molecule_len_control.begin();
    mlitr_end = molecule_len_control.end();
    ofp << "#molecule_len_kb\tmolecule_num_in_bin" << endl;
    while(mlitr != mlitr_end)
    {
        ofp << (*mlitr).first  << "\t" 
            << (*mlitr).second << endl;
        mlitr ++;
    }
    ofp.close(); 
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0xda32
leaq 0x1e123(%rip), %rsi     # 0x3c591
movq %r14, %rdi
callq 0x45e0
leaq 0x28(%rsp), %rdi
callq 0x4570
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movl $0x10, %edx
callq 0x4060
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x48(%rsp,%rax), %ebp
testl %ebp, %ebp
je 0x1e516
movq 0x2db1c(%rip), %rdi     # 0x4bfc8
leaq 0x1c67d(%rip), %rsi     # 0x3ab30
movl $0x16, %edx
callq 0x43a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x2dafa(%rip), %rdi     # 0x4bfc8
callq 0x43a0
movq %rax, %rbx
leaq 0x1ca07(%rip), %rsi     # 0x3aee4
movl $0x10, %edx
movq %rax, %rdi
callq 0x43a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
jmp 0x1e5e7
movq 0x18(%rbx), %r14
leaq 0x1e084(%rip), %rsi     # 0x3c5a5
leaq 0x28(%rsp), %r15
movl $0x24, %edx
movq %r15, %rdi
callq 0x43a0
movq 0x28(%rsp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
leaq 0x28(%rsp), %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
addq $0x8, %rbx
cmpq %rbx, %r14
je 0x1e5d8
leaq 0x28(%rsp), %r15
leaq 0x205ae(%rip), %r12     # 0x3eb21
movl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x4580
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x43a0
movq 0x28(%r14), %rsi
movq %r13, %rdi
callq 0x4210
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x4310
movsbl %al, %esi
movq %r13, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4220
movq %r14, %rdi
callq 0x4230
movq %rax, %r14
cmpq %rbx, %rax
jne 0x1e573
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %r15
callq 0x4440
movq 0x2d9d2(%rip), %rax     # 0x4bfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x42a0
leaq 0x120(%rsp), %rdi
callq 0x4140
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e630
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
testl %ebp, %ebp
sete %al
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1e66c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x1e67b
jmp 0x1e688
jmp 0x1e65f
jmp 0x1e65f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4480
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1e688
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq %rbx, %rdi
callq 0x45a0