// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq 0x15760(%rip), %rbx     # 0x20fd8
leaq 0xe8b2(%rip), %rsi      # 0x1a131
movl $0x27, %edx
movq %rbx, %rdi
callq 0x32f0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
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
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 0xb957
movq 0x156d6(%rip), %rdi     # 0x20fd8
leaq 0xe850(%rip), %rsi      # 0x1a159
movl $0x27, %edx
callq 0x32f0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x156b7(%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 0xbbba
leaq 0x40(%rsp), %rbp
leaq 0x60(%rsp), %r13
leaq 0xe561(%rip), %r15      # 0x19ec9
leaq 0x30(%rsp), %r12
movq %rbp, 0x30(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x16550
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, 0x38(%rsp)
movq 0x30(%rsp), %rdi
je 0xbb04
cmpb $0x23, (%rdi)
je 0xbb04
movb $0x9, 0x50(%rsp)
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
leaq 0x50(%rsp), %rdx
callq 0x188a8
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rcx
subq %rax, %rcx
cmpq $0x21, %rcx
jb 0xbaf5
leaq 0x20(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x164ba
movq 0x78(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x30d0
movq %rax, %rbx
movq %r13, 0x50(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rbp
movq %rbp, %rdi
callq 0x164ba
movq %rbx, 0x70(%rsp)
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x180fc
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
leaq 0x40(%rsp), %rbp
je 0xba72
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x15555(%rip), %rdi     # 0x20fd8
callq 0x32f0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0xe42e(%rip), %rsi      # 0x19ec8
callq 0x32f0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31a0
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
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xbaf0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x60(%rsp), %r13
leaq 0x78(%rsp), %rdi
callq 0x146d2
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0xbb16
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xb0(%rsp,%rax)
je 0xb96d
movq 0x8(%rsp), %rax
cmpq $0x0, 0x28(%rax)
je 0xbbdb
movq 0x15491(%rip), %rdi     # 0x20fd8
leaq 0xe667(%rip), %rsi      # 0x1a1b5
movl $0x9, %edx
callq 0x32f0
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rsi
movq 0x15470(%rip), %rdi     # 0x20fd8
callq 0x31a0
movq %rax, %rbx
leaq 0xe648(%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 0x153f6(%rip), %rbx     # 0x20fd8
leaq 0xe598(%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 0xb93d
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0xbc39
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0xbc39
jmp 0xbc36
movq %rax, %rbx
jmp 0xbc55
jmp 0xbc66
jmp 0xbc61
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xbc55
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x78(%rsp), %rdi
callq 0x146d2
jmp 0xbc69
movq %rax, %rbx
jmp 0xbc85
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xbc85
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x90(%rsp), %rdi
callq 0x3090
movq %rbx, %rdi
callq 0x3460