// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %ecx
leaq 0x10(%rsp), %rsi
movl $0x64, %edx
movq %r15, %rdi
callq 0x2300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movb $0x1, %dl
testb $0x5, 0x20(%rax,%rcx)
jne 0x2c61
leaq 0x8(%r14), %rax
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0x10(%rsp), %r12
incl %ebx
movq %r12, %rdi
leaq 0x38d1(%rip), %rsi      # 0x6383
callq 0x2250
movl $0x1, %ebp
testq %rax, %rax
je 0x2bb1
cmpb $0x0, (%rax)
je 0x2bb1
movq %rax, %rdi
callq 0x2240
movl %eax, 0x4(%rsp)
movq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x2b0f
movq 0x8(%rsp), %rdx
xorl %esi, %esi
cmpl %eax, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x2ae8
cmpq 0x8(%rsp), %rdx
je 0x2b0f
cmpl 0x20(%rdx), %eax
jge 0x2c72
xorl %edi, %edi
leaq 0x386b(%rip), %rsi      # 0x6383
callq 0x2250
movl $0x2, %ebp
testq %rax, %rax
je 0x2bb1
movq %rax, %r13
cmpb $0x0, (%rax)
je 0x2bb1
movl $0x20, %edi
callq 0x21a0
movq %rax, %rbp
addq $0x10, %rax
movq %rax, (%rbp)
movq %r13, %rdi
callq 0x20c0
movq %r13, %rdx
addq %rax, %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x476c
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
callq 0x3fe2
movq %rbp, (%rax)
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %ecx
movl $0x64, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2300
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x2aa6
movb $0x1, %dl
jmp 0x2c61
movq 0x6438(%rip), %r14      # 0x8ff0
leaq 0x34a9(%rip), %rsi      # 0x6068
movl $0x1d, %edx
movq %r14, %rdi
callq 0x21e0
movq %r14, %rdi
movl %ebp, %esi
callq 0x22b0
movq %rax, %r14
leaq 0x34a6(%rip), %rsi      # 0x6086
movl $0x9, %edx
movq %rax, %rdi
callq 0x21e0
movq %r14, %rdi
movl %ebx, %esi
callq 0x22b0
movq %rax, %rbx
leaq 0x34d5(%rip), %rsi      # 0x60d6
movl $0x2e, %edx
movq %rax, %rdi
callq 0x21e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
xorl %edx, %edx
movl %edx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6377(%rip), %rbx      # 0x8ff0
leaq 0x3485(%rip), %rsi      # 0x6105
movl $0x4c, %edx
movq %rbx, %rdi
callq 0x21e0
leaq 0x34be(%rip), %rsi      # 0x6152
movl $0xb, %edx
movq %rbx, %rdi
callq 0x21e0
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x22b0
movq %rax, %rbx
leaq 0x34a7(%rip), %rsi      # 0x615e
movl $0x32, %edx
jmp 0x2c06
movq %rax, %rbx
movl $0x20, %esi
movq %rbp, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x22c0