// File: /workspace/github_cpp_makefile_star2_O2/Altius[P]hotspot2/src/hotspot2_part2.cpp
// Function: buildIntToChromNameMap(std::basic_ifstream<char, std::char_traits<char>>&, std::map<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::less<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*>>>&)
bool buildIntToChromNameMap(ifstream& infile, map<int, string*>& mapOut)
{
  const int BUFSIZE(100);
  char buf[BUFSIZE], *p;
  int ID;
  map<int, string*>::const_iterator it;
  int linenum(0), fieldnum;

  while (infile.getline(buf, BUFSIZE))
    {
      linenum++;
      fieldnum = 1;
      if (!(p = strtok(buf, "\t")) || !*p)
	{
	MissingField:
	  cerr << "Error:  Failed to find field " << fieldnum
	       << " on line " << linenum
	       << " of the number-to-chromosomeName mapping file."
	       << endl << endl;
	  return false;
	}
      ID = atoi(p);
      it = mapOut.find(ID);
      if (it != mapOut.end())
	{
	  cerr << "Error:  Multiple entries found in the number-to-chromosomeName mapping file\n"
	       << "with value " << ID << " in the first column; each mapping must be unique."
	       << endl << endl;
	  return false;
	}
      fieldnum++;
      if (!(p = strtok(NULL, "\t")) || !*p)
	goto MissingField;
      mapOut[ID] = new string(p);
    }
  
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
leaq 0x8(%rsi), %rax
movq %rax, 0x10(%rsp)
pushq $0x1
popq %rbx
leaq 0x20(%rsp), %r15
leaq 0x2bc2(%rip), %rbp      # 0x5383
movq 0x18(%rsp), %rdi
movq %r15, %rsi
pushq $0x64
popq %rdx
callq 0x2070
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %r13d
testb $0x5, %r13b
jne 0x28cb
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2240
testq %rax, %rax
je 0x286f
cmpb $0x0, (%rax)
je 0x286f
movq %rax, %rdi
callq 0x2230
movl %eax, 0x8(%rsp)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3cbc
cmpq 0x10(%rsp), %rax
jne 0x28e4
xorl %edi, %edi
movq %rbp, %r12
movq %rbp, %rsi
callq 0x2240
testq %rax, %rax
je 0x2873
movq %rax, %rbp
cmpb $0x0, (%rax)
je 0x2873
pushq $0x20
popq %rdi
callq 0x21a0
movq %rax, %r13
movq %rax, %rdi
movq %rbp, %rsi
leaq 0xf(%rsp), %rdx
callq 0x3664
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x36a0
movq %r13, (%rax)
incl %ebx
movq %r12, %rbp
jmp 0x27c1
pushq $0x1
jmp 0x2875
pushq $0x2
popq %rbp
movq 0x5773(%rip), %rdi      # 0x7ff0
leaq 0x27e4(%rip), %rsi      # 0x5068
callq 0x2190
movq %rax, %rdi
movl %ebp, %esi
callq 0x2290
leaq 0x27ec(%rip), %rsi      # 0x5086
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
movl %ebx, %esi
callq 0x2290
leaq 0x2823(%rip), %rsi      # 0x50d6
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x20d0
testb $0x5, %r13b
setne %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5705(%rip), %rdi      # 0x7ff0
leaq 0x2813(%rip), %rsi      # 0x5105
callq 0x2190
leaq 0x2854(%rip), %rsi      # 0x5152
movq %rax, %rdi
callq 0x2190
movl 0x8(%rsp), %esi
movq %rax, %rdi
callq 0x2290
leaq 0x2845(%rip), %rsi      # 0x515e
jmp 0x28b3
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r13, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x22a0