// File: /workspace/github_cpp_makefile_star2_O1/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, %rbp
movq %rdi, %r15
movq 0x156b7(%rip), %r14     # 0x20fd8
leaq 0xe809(%rip), %rsi      # 0x1a131
movl $0x27, %edx
movq %r14, %rdi
callq 0x32f0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x32f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x32e0
movq (%r15), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x3170
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xb0(%rsp,%rax)
je 0xba00
movq 0x1562d(%rip), %rdi     # 0x20fd8
leaq 0xe7a7(%rip), %rsi      # 0x1a159
movl $0x27, %edx
callq 0x32f0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x1560e(%rip), %rdi     # 0x20fd8
callq 0x32f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
xorl %ebx, %ebx
jmp 0xbc7b
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xb0(%rsp,%rax)
jne 0xbbfb
leaq 0x38(%rsp), %rbx
leaq 0xe4a3(%rip), %r15      # 0x19ec9
leaq 0x28(%rsp), %r12
movq %rbp, 0x70(%rsp)
movq %rbx, 0x28(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x16622
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3480
cmpq $0x0, 0x30(%rsp)
je 0xbbca
movq 0x28(%rsp), %rax
cmpb $0x23, (%rax)
je 0xbbca
movb $0x9, 0x48(%rsp)
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
leaq 0x48(%rsp), %rdx
callq 0x189c0
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rcx
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0xbbc0
leaq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x16592
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x30d0
movq %rax, %r13
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x16592
movq %r13, 0x68(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x181de
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %rbx
je 0xbb3d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x1548a(%rip), %rdi     # 0x20fd8
callq 0x32f0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0xe363(%rip), %rsi      # 0x19ec8
callq 0x32f0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x31a0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbbbb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x70(%rsp), %rbp
leaq 0x78(%rsp), %rdi
callq 0x147aa
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0xbbe1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xb0(%rsp,%rax)
je 0xba30
cmpq $0x0, 0x28(%rbp)
je 0xbc9c
movq 0x153cb(%rip), %rdi     # 0x20fd8
leaq 0xe5a1(%rip), %rsi      # 0x1a1b5
movl $0x9, %edx
callq 0x32f0
movq 0x28(%rbp), %rsi
movq 0x153af(%rip), %rdi     # 0x20fd8
callq 0x31a0
movq %rax, %rbx
leaq 0xe587(%rip), %rsi      # 0x1a1bf
movl $0x1d, %edx
movq %rax, %rdi
callq 0x32f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31b0
movb $0x1, %bl
leaq 0x90(%rsp), %rdi
callq 0x3080
leaq 0x90(%rsp), %rdi
callq 0x3090
movl %ebx, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x15335(%rip), %rbx     # 0x20fd8
leaq 0xe4d7(%rip), %rsi      # 0x1a181
movl $0x33, %edx
movq %rbx, %rdi
callq 0x32f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
jmp 0xb9e6
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xbcfd
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0xbcfd
jmp 0xbcfa
movq %rax, %r14
jmp 0xbd19
jmp 0xbd2c
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbd19
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x78(%rsp), %rdi
callq 0x147aa
jmp 0xbd2f
jmp 0xbd27
movq %rax, %r14
jmp 0xbd4b
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xbd4b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x90(%rsp), %rdi
callq 0x3090
movq %r14, %rdi
callq 0x3460