// File: /workspace/github_cpp_makefile_star2_O2/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 $0x458, %rsp            # imm = 0x458
leaq 0x7190(%rip), %rsi      # 0xd35b
leaq -0x480(%rbp), %rbx
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x3540
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x460(%rbp,%rax)
je 0x621d
movq 0xddf3(%rip), %rdi      # 0x13fe8
leaq 0x7095(%rip), %rsi      # 0xd291
callq 0x3310
leaq 0x7153(%rip), %rsi      # 0xd35b
movq %rax, %rdi
callq 0x3310
movq %rax, %rdi
callq 0x31a0
jmp 0x65aa
leaq -0xb8(%rbp), %r15
leaq -0x78(%rbp), %r14
leaq -0x278(%rbp), %r12
leaq 0xe6b2(%rip), %rax      # 0x148e8
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movq -0x480(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x460(%rbp,%rax)
jne 0x65aa
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x3210
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %rdi
pushq $0xa
popq %rdx
callq 0x3230
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
callq 0x3090
cmpl $0x0, -0x2c(%rbp)
je 0x65a1
cmpq $0x0, -0x48(%rbp)
je 0x65a1
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
andq $0x0, -0x90(%rbp)
movb $0x0, -0x88(%rbp)
leaq -0x480(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3090
leaq 0xe54c(%rip), %rdi      # 0x14828
leaq -0x2c(%rbp), %rsi
callq 0x6800
cmpq $0x0, (%rax)
je 0x6325
movq 0xdcf6(%rip), %rdi      # 0x13fe8
leaq 0x6fb4(%rip), %rsi      # 0xd2ad
callq 0x3310
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x34f0
movq %rax, %rdi
leaq 0x6fa0(%rip), %rsi      # 0xd2b3
callq 0x3310
movq %rax, %rdi
callq 0x31a0
jmp 0x6580
pushq $0x50
popq %rdi
callq 0x3320
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
leaq 0x6f50(%rip), %rsi      # 0xd28e
movq %r15, %rdx
callq 0x43b6
leaq -0xf8(%rbp), %r13
movq %r13, %rdi
leaq 0x6d7d(%rip), %rsi      # 0xd0d4
leaq -0x30(%rbp), %rdx
callq 0x43b6
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
movq %r13, %rcx
callq 0x4490
movq %r12, %rdi
movq %r14, %rsi
leaq 0x6d51(%rip), %rdx      # 0xd0d4
callq 0x6851
movq %rbx, %rdi
movq %r12, %rsi
callq 0x687a
movq %r12, %rdi
callq 0x35c8
movq %r14, %rdi
callq 0x35c8
leaq -0xf8(%rbp), %rdi
callq 0x35c8
leaq -0xd8(%rbp), %rdi
callq 0x35c8
leaq 0xe466(%rip), %rdi      # 0x14828
leaq -0x2c(%rbp), %rsi
callq 0x6800
movq %rbx, (%rax)
movq %r12, %rdi
leaq -0x98(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x34c0
addq $0x20, %rbx
movq -0x278(%rbp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, -0x258(%rbp,%rax)
jne 0x6578
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
andq $0x0, -0x70(%rbp)
movb $0x0, -0x68(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x33c0
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3210
movq -0x278(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x258(%rbp,%rax)
je 0x64df
leaq (%rax,%rbp), %rdi
addq $-0x278, %rdi           # imm = 0xFD88
xorl %esi, %esi
callq 0x34d0
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
andq $0x0, -0xb0(%rbp)
movb $0x0, -0xa8(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x33c0
movq 0xdb69(%rip), %rdi      # 0x13fe8
leaq 0x6e52(%rip), %rsi      # 0xd2d8
callq 0x3310
movq %rax, %rdi
movq %r15, %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x6e43(%rip), %rsi      # 0xd2e3
callq 0x3310
movq %rax, %rdi
movq %r14, %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x6e35(%rip), %rsi      # 0xd2ef
callq 0x3310
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x34f0
movq %rax, %rdi
callq 0x31a0
movq %r15, %rdi
callq 0x35c8
jmp 0x6563
leaq 0xe402(%rip), %rdi      # 0x148e8
movq %r14, %rsi
callq 0x5c3e
cmpq -0x58(%rbp), %rax
je 0x6514
cmpq $0x0, -0x70(%rbp)
je 0x6570
movl -0x30(%rbp), %r13d
testl %r13d, %r13d
je 0x6570
movq %rbx, %rdi
movq %r14, %rsi
callq 0x68aa
movl %r13d, (%rax)
jmp 0x6563
movq 0xdacd(%rip), %rdi      # 0x13fe8
leaq 0x6dd8(%rip), %rsi      # 0xd2fa
callq 0x3310
movq %rax, %rdi
movq %r14, %rsi
callq 0x32e0
movq %rax, %rdi
leaq 0x6db3(%rip), %rsi      # 0xd2ef
callq 0x3310
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x34f0
movq %rax, %rdi
leaq 0x6daf(%rip), %rsi      # 0xd305
callq 0x3310
movq %rax, %rdi
callq 0x31a0
movq %r14, %rdi
callq 0x35c8
jmp 0x63e4
movq %r14, %rdi
callq 0x35c8
movq %r12, %rdi
callq 0x3190
leaq -0x98(%rbp), %rdi
callq 0x35c8
leaq -0x50(%rbp), %rdi
callq 0x35c8
leaq -0x480(%rbp), %rbx
jmp 0x623e
leaq -0x50(%rbp), %rdi
callq 0x35c8
leaq -0x480(%rbp), %rdi
callq 0x30d0
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6624
jmp 0x6629
movq %rax, %r14
leaq -0x278(%rbp), %rdi
callq 0x35c8
jmp 0x65e0
movq %rax, %r14
leaq -0x78(%rbp), %rdi
callq 0x35c8
jmp 0x65ee
movq %rax, %r14
leaq -0xf8(%rbp), %rdi
callq 0x35c8
jmp 0x65ff
movq %rax, %r14
leaq -0xd8(%rbp), %rdi
callq 0x35c8
jmp 0x6610
movq %rax, %r14
pushq $0x50
popq %rsi
movq %rbx, %rdi
callq 0x3330
jmp 0x6659
jmp 0x6629
movq %rax, %r14
jmp 0x6665
movq %rax, %r14
jmp 0x666e
movq %rax, %r14
jmp 0x6659
jmp 0x6630
movq %rax, %r14
jmp 0x6644
movq %rax, %r14
leaq -0xb8(%rbp), %rdi
callq 0x35c8
leaq -0x78(%rbp), %rdi
callq 0x35c8
leaq -0x278(%rbp), %rdi
callq 0x3190
leaq -0x98(%rbp), %rdi
callq 0x35c8
leaq -0x50(%rbp), %rdi
callq 0x35c8
leaq -0x480(%rbp), %rdi
callq 0x30d0
movq %r14, %rdi
callq 0x3500