// File: zeeev[P]DASVC/bamtools/src/toolkit/bamtools_resolve.cpp
// Function: BamTools::ResolveTool::ReadNamesFileReader::Read(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ReadGroupResolver, 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, ReadGroupResolver>>>&)
bool ResolveTool::ReadNamesFileReader::Read(map<string, ReadGroupResolver>& readGroups) {

    // up-front sanity check
    if ( !m_stream.is_open() ) return false;

    // parse read names file
    string line;
    vector<string> fields;
    map<string, ReadGroupResolver>::iterator rgIter;
    map<string, ReadGroupResolver>::iterator rgEnd = readGroups.end();
    while ( getline(m_stream, line) ) {

        // skip if empty line
        if ( line.empty() ) continue;

        // split line on '\t'
        fields = Utilities::Split(line, TAB_CHAR);
        if ( fields.size() != 2 ) continue;

        // look up resolver for read group
        rgIter = readGroups.find( fields[0] );
        if ( rgIter == rgEnd ) return false;
        ReadGroupResolver& resolver = (*rgIter).second;

        // store read name with resolver
        resolver.ReadNames.insert( make_pair<string,bool>(fields[1], true) ) ;
    }

    // if here, return success
    return true;
}

// Assembly:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x188(%rsp)
movq %rsi, 0x180(%rsp)
movq 0x188(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x86c10
testb $0x1, %al
jne 0xc830a
movb $0x0, 0x197(%rsp)
jmp 0xc86cd
leaq 0x160(%rsp), %rdi
callq 0x86a30
leaq 0x148(%rsp), %rdi
callq 0x92a40
jmp 0xc8326
leaq 0x130(%rsp), %rdi
callq 0xcf460
jmp 0xc8335
movq 0x180(%rsp), %rdi
callq 0xcf480
movq %rax, 0x68(%rsp)
jmp 0xc8349
movq 0x68(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x70(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x86140
movq %rax, 0x60(%rsp)
jmp 0xc836f
movq 0x60(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x86b60
movq %rax, 0x58(%rsp)
jmp 0xc838a
movq 0x58(%rsp), %rax
cmpq $0x0, %rax
je 0xc867a
leaq 0x160(%rsp), %rdi
callq 0x86c90
movb %al, 0x57(%rsp)
jmp 0xc83ac
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0xc83b6
jmp 0xc83ea
jmp 0xc8356
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0xc86bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0xc86ab
leaq 0x110(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movl $0x9, %edx
callq 0x115cd0
jmp 0xc8406
leaq 0x148(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0xcf4b0
jmp 0xc841d
leaq 0x110(%rsp), %rdi
callq 0x92a50
jmp 0xc842c
leaq 0x148(%rsp), %rdi
callq 0x936f0
movq %rax, 0x48(%rsp)
jmp 0xc8440
movq 0x48(%rsp), %rax
cmpq $0x2, %rax
je 0xc8478
jmp 0xc8356
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x92a50
jmp 0xc8473
jmp 0xc86ab
movq 0x180(%rsp), %rax
movq %rax, 0x38(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x148(%rsp), %rdi
callq 0xcf7a0
movq %rax, 0x40(%rsp)
jmp 0xc849d
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0xcf770
movq %rax, 0x30(%rsp)
jmp 0xc84b3
movq 0x30(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0x108(%rsp), %rax
movq %rax, 0x130(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0xcf7c0
movb %al, 0x2f(%rsp)
jmp 0xc84eb
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0xc84f5
jmp 0xc850d
movb $0x0, 0x197(%rsp)
movl $0x1, 0x104(%rsp)
jmp 0xc868d
leaq 0x130(%rsp), %rdi
callq 0xcf7e0
movq %rax, 0x20(%rsp)
jmp 0xc8521
movq 0x20(%rsp), %rax
addq $0x20, %rax
movq %rax, 0xf8(%rsp)
movq 0xf8(%rsp), %rax
addq $0x30, %rax
movq %rax, 0x10(%rsp)
leaq 0x148(%rsp), %rdi
movl $0x1, %esi
callq 0xcf7a0
movq %rax, 0x18(%rsp)
jmp 0xc855c
movq 0x18(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x86350
jmp 0xc8570
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
movl $0x1, %edx
callq 0xcf850
jmp 0xc858c
leaq 0xd0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xcf890
jmp 0xc85a3
movq 0x10(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xcf800
movb %dl, 0x7(%rsp)
movq %rax, 0x8(%rsp)
jmp 0xc85c0
movb 0x7(%rsp), %al
movq 0x8(%rsp), %rcx
movq %rcx, 0x78(%rsp)
movb %al, 0x80(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xcf8d0
jmp 0xc85e4
leaq 0xa8(%rsp), %rdi
callq 0xcf8e0
jmp 0xc85f3
leaq 0x88(%rsp), %rdi
callq 0x86f68
jmp 0xc8602
jmp 0xc8356
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0xc8669
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0xc8658
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xcf8d0
jmp 0xc8656
jmp 0xc8658
leaq 0xa8(%rsp), %rdi
callq 0xcf8e0
jmp 0xc8667
jmp 0xc8669
leaq 0x88(%rsp), %rdi
callq 0x86f68
jmp 0xc8678
jmp 0xc86ab
movb $0x1, 0x197(%rsp)
movl $0x1, 0x104(%rsp)
leaq 0x148(%rsp), %rdi
callq 0x92a50
jmp 0xc869c
leaq 0x160(%rsp), %rdi
callq 0x86f68
jmp 0xc86cd
leaq 0x148(%rsp), %rdi
callq 0x92a50
jmp 0xc86ba
jmp 0xc86bc
leaq 0x160(%rsp), %rdi
callq 0x86f68
jmp 0xc86cb
jmp 0xc86de
movb 0x197(%rsp), %al
andb $0x1, %al
addq $0x198, %rsp            # imm = 0x198
retq
movq 0x140(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nopw %cs:(%rax,%rax)