// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]GameteBinning/asPollinator_1.0.cpp
// Function: collect_contig_size(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 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>>>*)
bool collect_contig_size(string sizefile, map<string, unsigned long>* contigsize)
{
    cout << "   Info: reading contig size info from " << sizefile << endl;
    ifstream ifp;
    ifp.open(sizefile.c_str(), ios::in);
    if(!ifp.good())
    {
        cout << "   Error: cannot open contig size file " << sizefile << endl;
        return false;
    }
    while(ifp.good())
    {
        string line("");
        getline(ifp, line);
        if(line.size() == 0) continue;
        if(line[0]=='#')     continue;
        vector<string> lineinfo = split_string(line, '\t');
        if(lineinfo.size()<2) continue;
        string        ctgid   = lineinfo[0];
        unsigned long ctgsize = strtoul(lineinfo[1].c_str(), NULL, 0);
        (*contigsize).insert(std::pair<string, unsigned long>(ctgid, ctgsize));
        cout << ctgid << "\t" << ctgsize << endl;
    }
    if((*contigsize).size() == 0)
    {
        cout << "   Erorr: no info collected from contig size file. " << endl;
        return false;
    }else
    {
        cout << "   Info: " << (*contigsize).size() << " contig size info collected. " << endl;
    }
    ifp.close();
    //
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
movq 0x13789(%rip), %rdi     # 0x1bfd8
leaq 0xb8d9(%rip), %rsi      # 0x1412f
callq 0x3260
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3240
movq %rax, %rdi
callq 0x3140
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x32b0
movq (%rbx), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x3180
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xb0(%rsp,%rax)
je 0x88cf
movq 0x1372f(%rip), %rdi     # 0x1bfd8
leaq 0xb8a7(%rip), %rsi      # 0x14157
callq 0x3260
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3240
movq %rax, %rdi
callq 0x3140
xorl %ebx, %ebx
jmp 0x8a4a
leaq 0xb5f1(%rip), %r14      # 0x13ec7
leaq 0x28(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0x90(%rsp), %r13
leaq 0x70(%rsp), %rbx
cmpl $0x0, 0xb0(%rsp,%rax)
jne 0x89f4
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0xe174
movq %r13, %rdi
movq %r15, %rsi
callq 0x3070
cmpq $0x0, 0x30(%rsp)
je 0x89db
movq 0x28(%rsp), %rax
cmpb $0x23, (%rax)
je 0x89db
movb $0x9, 0x48(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x11fdc
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
cmpq $0x21, %rax
jb 0x89d1
movq %rbx, %rdi
callq 0x3300
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x30d0
movq %rax, %rbp
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3300
movq %rbp, 0x68(%rsp)
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x1194c
movq %r12, %rdi
callq 0x3120
movq 0x13639(%rip), %rdi     # 0x1bfd8
movq %rbx, %rsi
callq 0x3240
movq %rax, %rdi
leaq 0xb515(%rip), %rsi      # 0x13ec6
callq 0x3260
movq %rax, %rdi
movq %rbp, %rsi
callq 0x31b0
movq %rax, %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x3120
leaq 0x10(%rsp), %rdi
callq 0xe2d8
movq %r15, %rdi
callq 0x3120
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
jmp 0x88ed
movq 0x8(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0x8a6b
movq 0x135d1(%rip), %rdi     # 0x1bfd8
leaq 0xb7a5(%rip), %rsi      # 0x141b3
callq 0x3260
movq 0x8(%rsp), %rcx
movq 0x28(%rcx), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0xb792(%rip), %rsi      # 0x141bd
movq %rax, %rdi
callq 0x3260
movq %rax, %rdi
callq 0x3140
movb $0x1, %bl
leaq 0x90(%rsp), %rdi
callq 0x3080
leaq 0x90(%rsp), %rdi
callq 0x30a0
movl %ebx, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x13566(%rip), %rdi     # 0x1bfd8
leaq 0xb706(%rip), %rsi      # 0x1417f
callq 0x3260
jmp 0x88c0
jmp 0x8a9d
movq %rax, %rbx
jmp 0x8aaa
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3120
jmp 0x8aa0
jmp 0x8abb
jmp 0x8ab6
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x3120
leaq 0x10(%rsp), %rdi
callq 0xe2d8
jmp 0x8abe
movq %rax, %rbx
jmp 0x8ac8
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3120
leaq 0x90(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3410