// File: /workspace/github_cpp_makefile_star2_O2/angelapwen[P]text-based-game/game.cpp
// Function: Game::Game()
Game::Game() {
	satchel = nullptr; // Satchel will be allocated later
	map = new Map(); // Construct map immediately
	moves = 0;
	murder = discovery = false;
	maxMoves = 24; // Allow 24 moves before game ends

	// Allocate memory for and construct all rooms
	study = new Quiet("study","candlestick","a book of meditation");
	library = new Quiet("library", "rope", "a box of sleeping pills");
	conservatory = new Quiet("conservatory", "knife", "a pair of earmuffs");
	billiards = new Entertain("billiard room", "pipe", "a game of darts");
	ballroom = new Entertain("ballroom", "rope", "a record player");
	hall = new Entertain("hall", "wrench", "a doorbell");
	kitchen = new Eat("kitchen", "knife", "an apple");
	dining = new Eat("dining room", "revolver", "a pumpkin pastry");
	lounge = new Eat("lounge", "candlestick", "a block of cheese");

	// Link all rooms
	study->setCorner(kitchen);
	study->setRight(hall);
	study->setBottom(library);

	library->setTop(study);
	library->setBottom(billiards);

	billiards->setTop(library);
	billiards->setBottom(conservatory);

	conservatory->setTop(billiards);
	conservatory->setRight(ballroom);
	conservatory->setCorner(lounge);

	ballroom->setLeft(conservatory);
	ballroom->setRight(kitchen);

	kitchen->setLeft(ballroom);
	kitchen->setTop(dining);
	kitchen->setCorner(study);

	dining->setBottom(kitchen);
	dining->setTop(lounge);

	lounge->setBottom(dining);
	lounge->setLeft(hall);
	lounge->setCorner(conservatory);

	hall->setRight(lounge);
	hall->setLeft(study);

	character = ' ';
	current = nullptr; // Location of start depends on character choice

	// Set location of murder to a random room
	int murderLocation = (rand() % 9) + 1;
	switch (murderLocation) {
		case 1: {
			murderRoom = "study";
			break;
		}
		case 2: {
			murderRoom = "hall";
			break;
		}
		case 3: {
			murderRoom = "lounge";
			break;
		}
		case 4: {
			murderRoom = "dining room";
			break;
		}
		case 5: {
			murderRoom = "kitchen";
			break;
		}
		case 6: {
			murderRoom = "ballroom";
			break;
		}
		case 7: {
			murderRoom = "conservatory";
			break;
		}
		case 8: {
			murderRoom = "billiard room";
			break;
		}
		case 9: {
			murderRoom = "library";
			break;
		}
		default: {
			murderRoom = " ";
			break;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x370, %rsp            # imm = 0x370
movq %rdi, %r14
leaq 0x68(%rdi), %rbx
leaq 0x78(%rdi), %rax
movq %rax, 0x68(%rdi)
andq $0x0, 0x70(%rdi)
movb $0x0, 0x78(%rdi)
andq $0x0, 0x8(%rdi)
movl $0x591, %edi            # imm = 0x591
callq 0x21b0
movq %rax, %r15
movq %rax, %rdi
callq 0x5640
movq %r15, (%r14)
movabsq $0x1800000000, %rax     # imm = 0x1800000000
movq %rax, 0x10(%r14)
andw $0x0, 0x88(%r14)
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x6770(%rip), %rsi      # 0x96c4
leaq 0x350(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x65c9(%rip), %rsi      # 0x9536
leaq 0x330(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x6744(%rip), %rsi      # 0x96ca
leaq 0x310(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0x350(%rsp), %rsi
leaq 0x330(%rsp), %rdx
leaq 0x310(%rsp), %rcx
movq %r15, %rdi
callq 0x6f0c
movq %r15, 0x20(%r14)
leaq 0x310(%rsp), %rdi
callq 0x20b0
leaq 0x330(%rsp), %rdi
callq 0x20b0
leaq 0x350(%rsp), %rdi
callq 0x20b0
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x66e8(%rip), %rsi      # 0x96df
leaq 0x2f0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x6547(%rip), %rsi      # 0x9557
leaq 0x2d0(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x66be(%rip), %rsi      # 0x96e7
leaq 0x2b0(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0x2f0(%rsp), %rsi
leaq 0x2d0(%rsp), %rdx
leaq 0x2b0(%rsp), %rcx
movq %r15, %rdi
callq 0x6f0c
movq %r15, 0x28(%r14)
leaq 0x2b0(%rsp), %rdi
callq 0x20b0
leaq 0x2d0(%rsp), %rdi
callq 0x20b0
leaq 0x2f0(%rsp), %rdi
callq 0x20b0
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x6665(%rip), %rsi      # 0x96ff
leaq 0x290(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x6491(%rip), %rsi      # 0x9544
leaq 0x270(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x6640(%rip), %rsi      # 0x970c
leaq 0x250(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0x290(%rsp), %rsi
leaq 0x270(%rsp), %rdx
leaq 0x250(%rsp), %rcx
movq %r15, %rdi
callq 0x6f0c
movq %r15, 0x38(%r14)
leaq 0x250(%rsp), %rdi
callq 0x20b0
leaq 0x270(%rsp), %rdi
callq 0x20b0
leaq 0x290(%rsp), %rdi
callq 0x20b0
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x65e2(%rip), %rsi      # 0x971f
leaq 0x230(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x6411(%rip), %rsi      # 0x9567
leaq 0x210(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x65be(%rip), %rsi      # 0x972d
leaq 0x1f0(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0x230(%rsp), %rsi
leaq 0x210(%rsp), %rdx
leaq 0x1f0(%rsp), %rcx
movq %r15, %rdi
callq 0x2d48
movq %r15, 0x30(%r14)
leaq 0x1f0(%rsp), %rdi
callq 0x20b0
leaq 0x210(%rsp), %rdi
callq 0x20b0
leaq 0x230(%rsp), %rdi
callq 0x20b0
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x655d(%rip), %rsi      # 0x973d
leaq 0x1d0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x635e(%rip), %rsi      # 0x9557
leaq 0x1b0(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x6534(%rip), %rsi      # 0x9746
leaq 0x190(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0x1d0(%rsp), %rsi
leaq 0x1b0(%rsp), %rdx
leaq 0x190(%rsp), %rcx
movq %r15, %rdi
callq 0x2d48
movq %r15, 0x40(%r14)
leaq 0x190(%rsp), %rdi
callq 0x20b0
leaq 0x1b0(%rsp), %rdi
callq 0x20b0
leaq 0x1d0(%rsp), %rdi
callq 0x20b0
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x64d3(%rip), %rsi      # 0x9756
leaq 0x170(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x62c2(%rip), %rsi      # 0x955e
leaq 0x150(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x64a6(%rip), %rsi      # 0x975b
leaq 0x130(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0x170(%rsp), %rsi
leaq 0x150(%rsp), %rdx
leaq 0x130(%rsp), %rcx
movq %r15, %rdi
callq 0x2d48
movq %r15, 0x60(%r14)
leaq 0x130(%rsp), %rdi
callq 0x20b0
leaq 0x150(%rsp), %rdi
callq 0x20b0
leaq 0x170(%rsp), %rdi
callq 0x20b0
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x6440(%rip), %rsi      # 0x9766
leaq 0x110(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x6205(%rip), %rsi      # 0x9544
leaq 0xf0(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x6416(%rip), %rsi      # 0x976e
leaq 0xd0(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0x110(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
leaq 0xd0(%rsp), %rcx
movq %r15, %rdi
callq 0x2b3c
movq %r15, 0x48(%r14)
leaq 0xd0(%rsp), %rdi
callq 0x20b0
leaq 0xf0(%rsp), %rdi
callq 0x20b0
leaq 0x110(%rsp), %rdi
callq 0x20b0
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x63ae(%rip), %rsi      # 0x9777
leaq 0xb0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x616a(%rip), %rsi      # 0x954c
leaq 0x90(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x6388(%rip), %rsi      # 0x9783
leaq 0x70(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0xb0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %r15, %rdi
callq 0x2b3c
movq %r15, 0x50(%r14)
leaq 0x70(%rsp), %rdi
callq 0x20b0
leaq 0x90(%rsp), %rdi
callq 0x20b0
leaq 0xb0(%rsp), %rdi
callq 0x20b0
movl $0xa0, %edi
callq 0x21b0
movq %rax, %r15
leaq 0x6331(%rip), %rsi      # 0x9794
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5522
leaq 0x60bd(%rip), %rsi      # 0x9536
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x5522
leaq 0x630c(%rip), %rsi      # 0x979b
leaq 0x10(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x5522
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
callq 0x2b3c
movq %r15, 0x58(%r14)
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x30(%rsp), %rdi
callq 0x20b0
leaq 0x50(%rsp), %rdi
callq 0x20b0
movq 0x20(%r14), %rdi
movq 0x48(%r14), %rsi
callq 0x736e
movq 0x20(%r14), %rdi
movq 0x60(%r14), %rsi
callq 0x7368
movq 0x20(%r14), %rdi
movq 0x28(%r14), %rsi
callq 0x735c
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdi
callq 0x7356
movq 0x28(%r14), %rdi
movq 0x30(%r14), %rsi
callq 0x735c
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdi
callq 0x7356
movq 0x30(%r14), %rdi
movq 0x38(%r14), %rsi
callq 0x735c
movq 0x30(%r14), %rsi
movq 0x38(%r14), %rdi
callq 0x7356
movq 0x38(%r14), %rdi
movq 0x40(%r14), %rsi
callq 0x7368
movq 0x38(%r14), %rdi
movq 0x58(%r14), %rsi
callq 0x736e
movq 0x38(%r14), %rsi
movq 0x40(%r14), %rdi
callq 0x7362
movq 0x40(%r14), %rdi
movq 0x48(%r14), %rsi
callq 0x7368
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdi
callq 0x7362
movq 0x48(%r14), %rdi
movq 0x50(%r14), %rsi
callq 0x7356
movq 0x20(%r14), %rsi
movq 0x48(%r14), %rdi
callq 0x736e
movq 0x48(%r14), %rsi
movq 0x50(%r14), %rdi
callq 0x735c
movq 0x50(%r14), %rdi
movq 0x58(%r14), %rsi
callq 0x7356
movq 0x50(%r14), %rsi
movq 0x58(%r14), %rdi
callq 0x735c
movq 0x58(%r14), %rdi
movq 0x60(%r14), %rsi
callq 0x7362
movq 0x38(%r14), %rsi
movq 0x58(%r14), %rdi
callq 0x736e
movq 0x58(%r14), %rsi
movq 0x60(%r14), %rdi
callq 0x7368
movq 0x20(%r14), %rsi
movq 0x60(%r14), %rdi
callq 0x7362
movb $0x20, 0x8a(%r14)
andq $0x0, 0x18(%r14)
callq 0x2040
pushq $0x9
popq %rcx
cltd
idivl %ecx
cmpl $0x9, %edx
jae 0x3624
movl %edx, %eax
leaq 0x6085(%rip), %rcx      # 0x96a0
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x362b
leaq 0x81bc(%rip), %rsi      # 0xb7e7
movq %rbx, %rdi
callq 0x22b0
addq $0x370, %rsp            # imm = 0x370
popq %rbx
popq %r14
popq %r15
retq
jmp 0x3847
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x20b0
jmp 0x3657
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x20b0
jmp 0x3666
movq %rax, %r14
leaq 0x50(%rsp), %rdi
jmp 0x3824
jmp 0x382b
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x20b0
jmp 0x3687
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x20b0
jmp 0x3699
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
jmp 0x3824
jmp 0x382b
movq %rax, %r14
leaq 0xd0(%rsp), %rdi
callq 0x20b0
jmp 0x36c0
movq %rax, %r14
leaq 0xf0(%rsp), %rdi
callq 0x20b0
jmp 0x36d2
movq %rax, %r14
leaq 0x110(%rsp), %rdi
jmp 0x3824
jmp 0x382b
movq %rax, %r14
leaq 0x130(%rsp), %rdi
callq 0x20b0
jmp 0x36f9
movq %rax, %r14
leaq 0x150(%rsp), %rdi
callq 0x20b0
jmp 0x370b
movq %rax, %r14
leaq 0x170(%rsp), %rdi
jmp 0x3824
jmp 0x382b
movq %rax, %r14
leaq 0x190(%rsp), %rdi
callq 0x20b0
jmp 0x3732
movq %rax, %r14
leaq 0x1b0(%rsp), %rdi
callq 0x20b0
jmp 0x3744
movq %rax, %r14
leaq 0x1d0(%rsp), %rdi
jmp 0x3824
jmp 0x382b
movq %rax, %r14
leaq 0x1f0(%rsp), %rdi
callq 0x20b0
jmp 0x376b
movq %rax, %r14
leaq 0x210(%rsp), %rdi
callq 0x20b0
jmp 0x377d
movq %rax, %r14
leaq 0x230(%rsp), %rdi
jmp 0x3824
jmp 0x382b
movq %rax, %r14
leaq 0x250(%rsp), %rdi
callq 0x20b0
jmp 0x37a4
movq %rax, %r14
leaq 0x270(%rsp), %rdi
callq 0x20b0
jmp 0x37b6
movq %rax, %r14
leaq 0x290(%rsp), %rdi
jmp 0x3824
jmp 0x382b
movq %rax, %r14
leaq 0x2b0(%rsp), %rdi
callq 0x20b0
jmp 0x37d7
movq %rax, %r14
leaq 0x2d0(%rsp), %rdi
callq 0x20b0
jmp 0x37e9
movq %rax, %r14
leaq 0x2f0(%rsp), %rdi
jmp 0x3824
jmp 0x382b
movq %rax, %r14
leaq 0x310(%rsp), %rdi
callq 0x20b0
jmp 0x380a
movq %rax, %r14
leaq 0x330(%rsp), %rdi
callq 0x20b0
jmp 0x381c
movq %rax, %r14
leaq 0x350(%rsp), %rdi
callq 0x20b0
jmp 0x382e
movq %rax, %r14
movl $0xa0, %esi
movq %r15, %rdi
callq 0x21c0
jmp 0x384a
movq %rax, %r14
movl $0x591, %esi            # imm = 0x591
jmp 0x3833
movq %rax, %r14
movq %rbx, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x2290