// File: /workspace/github_cpp_makefile_star2_O3/nickgammon[P]tinymudserver/load.cpp
// Function: LoadRooms()
void LoadRooms ()
{
  // load rooms file
  ifstream fRooms (ROOMS_FILE, ios::in);
  if (!fRooms)
    {
    cerr << "Could not open rooms file: " << ROOMS_FILE << endl;
    return;
    }

  while (!(fRooms.eof ()))
    {
    int vnum;
    fRooms >> vnum;
    fRooms.ignore (numeric_limits<int>::max(), '\n'); // skip rest of this line
    string description;
    getline (fRooms, description);

    // give up if no vnum or description
    if (vnum == 0 || description.empty ())
      break;

    // get exits
    string sLine;
    getline (fRooms, sLine);

    // don't have duplicate rooms
    if (roommap [vnum] != 0)
      {
      cerr << "Room " << vnum << " appears more than once in room file" << endl;
      continue;
      }

    tRoom * room = new tRoom (FindAndReplace (description, "%r", "\n") + "\n");
    roommap [vnum] = room;

    // read exits from line (format is: <dir> <vnum> ...  eg. n 1234 s 5678)
    istringstream is (sLine);
    while (is.good ())
      {
      string dir;
      int dir_vnum;

      is >> dir;  // direction, eg. n
      is >> dir_vnum; // vnum, eg. 1234

      if (is.fail ())
        {
        is.clear ();
        string dummy;
        is >> dummy;
        cerr << "Bad vnum '" << dummy << "' for exit " << dir << " for room " << vnum << endl;
        continue;
        }

      // direction must be valid (eg. n, s, e, w) or it won't be recognised
      set<string>::const_iterator direction_iter = directionset.find (dir);
      if (direction_iter == directionset.end ())
        {
        cerr << "Direction " << dir << " for room " << vnum
             << " not in list of directions in control file" << endl;
        continue;
        }

      // stop if nonsense
      if (dir.empty () || dir_vnum == 0)
        break;

      room->exits [dir] = dir_vnum;   // add exit

      } // end of getting each direction
    } // end of read loop

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
leaq 0x93cc(%rip), %rsi      # 0x1036d
leaq -0x488(%rbp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x3570
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x468(%rbp,%rax)
je 0x7029
movq 0xf01b(%rip), %rdi      # 0x15fe8
leaq 0x92cf(%rip), %rsi      # 0x102a3
movl $0x1b, %edx
callq 0x3370
movq 0xf003(%rip), %rbx      # 0x15fe8
leaq 0x9381(%rip), %rsi      # 0x1036d
movl $0x11, %edx
movq %rbx, %rdi
callq 0x3370
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq 0xefd1(%rip), %rdi      # 0x15fe8
callq 0x3030
movq %rax, %rdi
callq 0x3220
jmp 0x7642
leaq -0x58(%rbp), %r15
leaq -0x280(%rbp), %rbx
movq -0x488(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x468(%rbp,%rax)
jne 0x7642
movq %r14, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x31e0
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %r14, %rdi
movl $0xa, %edx
callq 0x3200
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq $0x0, -0x98(%rbp)
movb $0x0, -0x90(%rbp)
movq -0x488(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %edx
movq %r14, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3580
cmpl $0x0, -0x2c(%rbp)
sete %al
cmpq $0x0, -0x98(%rbp)
sete %r14b
orb %al, %r14b
jne 0x7610
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq $0x0, -0xb8(%rbp)
movb $0x0, -0xb0(%rbp)
movq -0x488(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x488(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %edx
leaq -0x488(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3580
leaq 0xf6fb(%rip), %rdi      # 0x16828
leaq -0x2c(%rbp), %rsi
callq 0x79ec
cmpq $0x0, (%rax)
je 0x71a7
movl $0x5, %edx
movq 0xeea0(%rip), %rdi      # 0x15fe8
leaq 0x9170(%rip), %rsi      # 0x102bf
callq 0x3370
movl -0x2c(%rbp), %esi
movq 0xee8a(%rip), %rdi      # 0x15fe8
callq 0x3510
movq %rax, %r12
movl $0x24, %edx
movq %rax, %rdi
leaq 0x9150(%rip), %rsi      # 0x102c5
callq 0x3370
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3220
jmp 0x75ee
movl $0x50, %edi
callq 0x32e0
movq %rax, -0x38(%rbp)
movq %r15, %r12
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rdi
leaq 0x90cc(%rip), %rsi      # 0x102a0
leaq 0x90c7(%rip), %rdx      # 0x102a2
callq 0x4bc4
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0x100(%rbp), %r15
movq %r15, %rdi
leaq 0x8ecd(%rip), %rsi      # 0x100cc
leaq 0x8ec7(%rip), %rdx      # 0x100cd
callq 0x4bc4
movq %r12, %r13
movq %r12, %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
movq %r15, %rcx
callq 0x4c64
movq %r13, %rdi
leaq 0x8e9b(%rip), %rsi      # 0x100cc
callq 0x35a0
movq %r13, %r15
leaq -0x270(%rbp), %rsi
movq %rsi, -0x280(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7269
movq %rdx, -0x280(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x270(%rbp)
jmp 0x726f
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x278(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x38(%rbp), %r13
leaq 0x10(%r13), %rax
movq %rax, (%r13)
movq -0x280(%rbp), %rsi
movq -0x278(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x5170
leaq 0x28(%r13), %rax
movl $0x0, 0x28(%r13)
xorl %ecx, %ecx
movq %rcx, 0x30(%r13)
movq %rax, 0x38(%r13)
movq %rax, 0x40(%r13)
movq %rcx, 0x48(%r13)
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x72ee
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x7307
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x7329
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x734b
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x32f0
leaq 0xf4d6(%rip), %rdi      # 0x16828
leaq -0x2c(%rbp), %rsi
callq 0x79ec
movq -0x38(%rbp), %r13
movq %r13, (%rax)
movq %rbx, %rdi
leaq -0xc0(%rbp), %rsi
movl $0x8, %edx
callq 0x34d0
addq $0x20, %r13
movq %r13, -0x38(%rbp)
movq -0x280(%rbp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, -0x260(%rbp,%rax)
jne 0x75d3
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x33b0
movq %rbx, %rdi
leaq -0x5c(%rbp), %rsi
callq 0x31e0
movq -0x280(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x260(%rbp,%rax)
je 0x74ce
leaq (%rax,%rbp), %rdi
addq $-0x280, %rdi           # imm = 0xFD80
xorl %esi, %esi
callq 0x34f0
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq $0x0, -0x78(%rbp)
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
leaq -0x80(%rbp), %rsi
callq 0x33b0
movl $0xa, %edx
movq 0xebcf(%rip), %rdi      # 0x15fe8
leaq 0x8eca(%rip), %rsi      # 0x102ea
callq 0x3370
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq 0xebb4(%rip), %rdi      # 0x15fe8
callq 0x3370
movq %rax, %r13
movl $0xb, %edx
movq %rax, %rdi
leaq 0x8eaa(%rip), %rsi      # 0x102f5
callq 0x3370
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r13, %rdi
callq 0x3370
movq %rax, %r13
movl $0xa, %edx
movq %rax, %rdi
leaq 0x8e8f(%rip), %rsi      # 0x10301
callq 0x3370
movl -0x2c(%rbp), %esi
movq %r13, %rdi
callq 0x3510
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3220
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x75ab
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x75ab
leaq 0xf413(%rip), %rdi      # 0x168e8
movq %r15, %rsi
callq 0x6922
leaq 0xf404(%rip), %rcx      # 0x168e8
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x751e
cmpq $0x0, -0x50(%rbp)
sete %al
movl -0x5c(%rbp), %r15d
testl %r15d, %r15d
sete %cl
orb %al, %cl
movb $0x1, %r13b
jne 0x75ae
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x7a54
movl %r15d, (%rax)
jmp 0x75ab
movl $0xa, %edx
movq 0xeabe(%rip), %rdi      # 0x15fe8
leaq 0x8ddb(%rip), %rsi      # 0x1030c
callq 0x3370
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq 0xeaa3(%rip), %rdi      # 0x15fe8
callq 0x3370
movq %rax, %r13
movl $0xa, %edx
movq %rax, %rdi
leaq 0x8da5(%rip), %rsi      # 0x10301
callq 0x3370
movl -0x2c(%rbp), %esi
movq %r13, %rdi
callq 0x3510
movq %rax, %r13
movl $0x2a, %edx
movq %rax, %rdi
leaq 0x8d99(%rip), %rsi      # 0x10317
callq 0x3370
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3220
xorl %r13d, %r13d
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x75c7
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32f0
testb %r13b, %r13b
movq %r12, %r15
je 0x737e
movq %rbx, %rdi
movq 0xe9cb(%rip), %rsi      # 0x15fa8
callq 0x33f0
leaq -0x208(%rbp), %rdi
callq 0x3110
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x7610
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x7632
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x32f0
testb %r14b, %r14b
leaq -0x488(%rbp), %r14
je 0x7034
leaq -0x488(%rbp), %rdi
callq 0x30c0
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x771f
movq %rax, %rbx
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x768f
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x768f
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x76ad
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x76ad
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x76d4
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x76d4
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x76fb
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x76fb
movq %rax, %rbx
movl $0x50, %esi
movq -0x38(%rbp), %rdi
callq 0x32f0
jmp 0x777f
jmp 0x771f
jmp 0x770f
movq %rax, %rbx
jmp 0x77c3
movq %rax, %rbx
jmp 0x77a1
movq %rax, %rbx
jmp 0x777f
jmp 0x7726
movq %rax, %rbx
jmp 0x7747
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x7747
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x7760
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32f0
movq 0xe841(%rip), %rsi      # 0x15fa8
leaq -0x280(%rbp), %rdi
callq 0x33f0
leaq -0x208(%rbp), %rdi
callq 0x3110
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x77a1
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x77c3
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x32f0
leaq -0x488(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3530