// File: /workspace/github_cpp_makefile_star2_O1/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 0x9380(%rip), %rsi      # 0x1036d
leaq -0x488(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x3570
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x468(%rbp,%rax)
je 0x7075
movq 0xefcf(%rip), %rdi      # 0x15fe8
leaq 0x9283(%rip), %rsi      # 0x102a3
movl $0x1b, %edx
callq 0x3370
movq 0xefb7(%rip), %rbx      # 0x15fe8
leaq 0x9335(%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 0xef85(%rip), %rdi      # 0x15fe8
callq 0x3030
movq %rax, %rdi
callq 0x3220
jmp 0x768b
leaq -0x58(%rbp), %r15
leaq -0x280(%rbp), %r14
movq -0x488(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x468(%rbp,%rax)
jne 0x768b
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x31e0
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %rbx, %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 %rbx, %rdi
movl $0xa, %esi
callq 0x32d0
movsbl %al, %edx
movq %rbx, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3580
cmpl $0x0, -0x2c(%rbp)
sete %al
cmpq $0x0, -0x98(%rbp)
sete %bl
orb %al, %bl
jne 0x765a
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 0xf6b1(%rip), %rdi      # 0x16828
leaq -0x2c(%rbp), %rsi
callq 0x7a34
cmpq $0x0, (%rax)
je 0x71f1
movl $0x5, %edx
movq 0xee56(%rip), %rdi      # 0x15fe8
leaq 0x9126(%rip), %rsi      # 0x102bf
callq 0x3370
movl -0x2c(%rbp), %esi
movq 0xee40(%rip), %rdi      # 0x15fe8
callq 0x3510
movq %rax, %r12
movl $0x24, %edx
movq %rax, %rdi
leaq 0x9106(%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 0x7638
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 0x9082(%rip), %rsi      # 0x102a0
leaq 0x907d(%rip), %rdx      # 0x102a2
callq 0x4bc4
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0x100(%rbp), %r15
movq %r15, %rdi
leaq 0x8e83(%rip), %rsi      # 0x100cc
leaq 0x8e7d(%rip), %rdx      # 0x100cd
callq 0x4bc4
movq %r12, %r13
movq %r12, %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
movq %r15, %rcx
callq 0x4c60
movq %r13, %rdi
leaq 0x8e51(%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 0x72b3
movq %rdx, -0x280(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x270(%rbp)
jmp 0x72b9
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 0x5192
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 0x7338
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x7351
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x7373
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x7395
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x32f0
leaq 0xf48c(%rip), %rdi      # 0x16828
leaq -0x2c(%rbp), %rsi
callq 0x7a34
movq -0x38(%rbp), %r13
movq %r13, (%rax)
movq %r14, %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 0x761d
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x33b0
movq %r14, %rdi
leaq -0x5c(%rbp), %rsi
callq 0x31e0
movq -0x280(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x260(%rbp,%rax)
je 0x7518
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 %r14, %rdi
leaq -0x80(%rbp), %rsi
callq 0x33b0
movl $0xa, %edx
movq 0xeb85(%rip), %rdi      # 0x15fe8
leaq 0x8e80(%rip), %rsi      # 0x102ea
callq 0x3370
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq 0xeb6a(%rip), %rdi      # 0x15fe8
callq 0x3370
movq %rax, %r13
movl $0xb, %edx
movq %rax, %rdi
leaq 0x8e60(%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 0x8e45(%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 0x75f5
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x75f5
leaq 0xf3c9(%rip), %rdi      # 0x168e8
movq %r15, %rsi
callq 0x695c
leaq 0xf3ba(%rip), %rcx      # 0x168e8
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x7568
cmpq $0x0, -0x50(%rbp)
sete %al
movl -0x5c(%rbp), %r15d
testl %r15d, %r15d
sete %cl
orb %al, %cl
movb $0x1, %r13b
jne 0x75f8
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x7a9c
movl %r15d, (%rax)
jmp 0x75f5
movl $0xa, %edx
movq 0xea74(%rip), %rdi      # 0x15fe8
leaq 0x8d91(%rip), %rsi      # 0x1030c
callq 0x3370
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq 0xea59(%rip), %rdi      # 0x15fe8
callq 0x3370
movq %rax, %r13
movl $0xa, %edx
movq %rax, %rdi
leaq 0x8d5b(%rip), %rsi      # 0x10301
callq 0x3370
movl -0x2c(%rbp), %esi
movq %r13, %rdi
callq 0x3510
movq %rax, %r13
movl $0x2a, %edx
movq %rax, %rdi
leaq 0x8d4f(%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 0x7611
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32f0
testb %r13b, %r13b
movq %r12, %r15
je 0x73c8
movq %r14, %rdi
movq 0xe981(%rip), %rsi      # 0x15fa8
callq 0x33f0
leaq -0x208(%rbp), %rdi
callq 0x3110
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x765a
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x767c
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x32f0
testb %bl, %bl
leaq -0x488(%rbp), %rbx
je 0x7080
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 0x7768
movq %rax, %rbx
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x76d8
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x76d8
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x76f6
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x76f6
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x771d
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x771d
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x7744
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x32f0
jmp 0x7744
movq %rax, %rbx
movl $0x50, %esi
movq -0x38(%rbp), %rdi
callq 0x32f0
jmp 0x77c8
jmp 0x7768
jmp 0x7758
movq %rax, %rbx
jmp 0x780c
movq %rax, %rbx
jmp 0x77ea
movq %rax, %rbx
jmp 0x77c8
jmp 0x776f
movq %rax, %rbx
jmp 0x7790
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x7790
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x77a9
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x32f0
movq 0xe7f8(%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 0x77ea
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x32f0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x780c
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x32f0
leaq -0x488(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3530