// File: malcolmyeh[P]CC3K/game.cc
// Function: Controller::newFloor()
void Controller::newFloor() {
	Floor *tmpf = this->floor;
	Display *tmpd = this->display;
	Player *play = tmpf->player;
	int level = tmpf->getLevel() + 1;
	bool hostile = tmpf->getHostile();
	bool spawned = tmpf->getSpawned();
	char type;
	int HP = play->getHP();
	int gold = play->getGold();
	int Atk = play->getPlayer()->getAtk();
	int Def = play->getPlayer()->getDef();
	bool hasBarrier = play->barrier();

	if (play->getRace() == "Human") { type = 'h'; }
	if (play->getRace() == "Orc") { type = 'o'; }
	if (play->getRace() == "Elf") { type = 'e'; }
	if (play->getRace() == "Dwarf") { type = 'd'; }

	this->floor = new Floor(level, hostile, spawned);
	this->display = new Display();
	this->display->readFloor("map.txt");
	for (int i = 0; i < 25; i++) {
		for (int j = 0; j < 79; j++) {
			char c = this->display->getChar(i, j);
			floor->displayGrid[i][j] = c;
			floor->defaultGrid[i][j] = c;
		}
	}

	this->floor->initNext(type, HP, gold, Atk, Def, hasBarrier);
	this->display->updateDisplay(floor);
	delete tmpf;
	delete tmpd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movq (%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0xfe0(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xcff0
incl %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8d70
movb %al, -0x25(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd000
movb %al, -0x26(%rbp)
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
callq *%rax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movq %rax, %rdi
movq (%rdi), %rax
movq 0x8(%rax), %rax
callq *%rax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movq %rax, %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x11700
movb %al, -0x39(%rbp)
movq -0x20(%rbp), %rsi
movq (%rsi), %rax
movq 0x28(%rax), %rax
leaq -0x60(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq *%rax
movq -0x108(%rbp), %rdi
leaq 0x3f28(%rip), %rsi      # 0x1e900
callq 0x5210
movb %al, -0xfe(%rbp)
jmp 0x1a9e5
leaq -0x60(%rbp), %rdi
callq 0x4130
movb -0xfe(%rbp), %al
testb $0x1, %al
jne 0x1a9fa
jmp 0x1aa1a
movb $0x68, -0x27(%rbp)
jmp 0x1aa1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4130
jmp 0x1ae16
movq -0x20(%rbp), %rsi
movq (%rsi), %rax
movq 0x28(%rax), %rax
leaq -0x90(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq *%rax
movq -0x120(%rbp), %rdi
leaq 0x3edd(%rip), %rsi      # 0x1e920
callq 0x5210
movb %al, -0x111(%rbp)
jmp 0x1aa50
leaq -0x90(%rbp), %rdi
callq 0x4130
movb -0x111(%rbp), %al
testb $0x1, %al
jne 0x1aa68
jmp 0x1aa8b
movb $0x6f, -0x27(%rbp)
jmp 0x1aa8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x4130
jmp 0x1ae16
movq -0x20(%rbp), %rsi
movq (%rsi), %rax
movq 0x28(%rax), %rax
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq *%rax
movq -0x130(%rbp), %rdi
leaq 0x3b06(%rip), %rsi      # 0x1e5ba
callq 0x5210
movb %al, -0x121(%rbp)
jmp 0x1aac1
leaq -0xb0(%rbp), %rdi
callq 0x4130
movb -0x121(%rbp), %al
testb $0x1, %al
jne 0x1aad9
jmp 0x1aafc
movb $0x65, -0x27(%rbp)
jmp 0x1aafc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x4130
jmp 0x1ae16
movq -0x20(%rbp), %rsi
movq (%rsi), %rax
movq 0x28(%rax), %rax
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq *%rax
movq -0x140(%rbp), %rdi
leaq 0x3e88(%rip), %rsi      # 0x1e9ad
callq 0x5210
movb %al, -0x131(%rbp)
jmp 0x1ab32
leaq -0xd0(%rbp), %rdi
callq 0x4130
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0x1ab4a
jmp 0x1ab6d
movb $0x64, -0x27(%rbp)
jmp 0x1ab6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x4130
jmp 0x1ae16
movl $0xff8, %edi            # imm = 0xFF8
callq 0x41d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x148(%rbp)
movl -0x24(%rbp), %esi
movzbl -0x26(%rbp), %ecx
movzbl -0x25(%rbp), %edx
andl $0x1, %edx
andl $0x1, %ecx
callq 0x5d00
jmp 0x1ab9c
movq -0x110(%rbp), %rax
movq -0x148(%rbp), %rcx
movq %rcx, (%rax)
movl $0x7b7, %edi            # imm = 0x7B7
movq %rdi, -0x168(%rbp)
callq 0x41d0
movq -0x168(%rbp), %rdx
movq %rax, %rdi
movq %rdi, -0x160(%rbp)
xorl %esi, %esi
callq 0x4110
movq -0x160(%rbp), %rcx
movq -0x110(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rax
movq %rax, -0x158(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x4300
movq -0x150(%rbp), %rdx
leaq 0x4146(%rip), %rsi      # 0x1ed5a
leaq -0xf0(%rbp), %rdi
callq 0x4270
jmp 0x1ac22
movq -0x158(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x5840
jmp 0x1ac37
leaq -0xf0(%rbp), %rdi
callq 0x4130
leaq -0xf1(%rbp), %rdi
callq 0x4200
movl $0x0, -0xf8(%rbp)
cmpl $0x19, -0xf8(%rbp)
jge 0x1ad7a
movl $0x0, -0xfc(%rbp)
cmpl $0x4f, -0xfc(%rbp)
jge 0x1ad64
movq -0x110(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xf8(%rbp), %esi
movl -0xfc(%rbp), %edx
callq 0x5cd0
movb %al, %cl
movq -0x110(%rbp), %rax
movb %cl, -0xfd(%rbp)
movb -0xfd(%rbp), %sil
movq (%rax), %rcx
addq $0x820, %rcx            # imm = 0x820
movslq -0xf8(%rbp), %rdx
imulq $0x4f, %rdx, %rdx
addq %rdx, %rcx
movslq -0xfc(%rbp), %rdx
movb %sil, (%rcx,%rdx)
movb -0xfd(%rbp), %dl
movq (%rax), %rax
addq $0x6, %rax
movslq -0xf8(%rbp), %rcx
imulq $0x4f, %rcx, %rcx
addq %rcx, %rax
movslq -0xfc(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x1ac70
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
movl $0xff8, %esi            # imm = 0xFF8
callq 0x41e0
jmp 0x1ae16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x1ad53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x4130
leaq -0xf1(%rbp), %rdi
callq 0x4200
jmp 0x1ae16
jmp 0x1ad66
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0x1ac59
movq -0x110(%rbp), %rax
movq (%rax), %rdi
movb -0x27(%rbp), %sil
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x34(%rbp), %r8d
movl -0x38(%rbp), %r9d
movb -0x39(%rbp), %al
andb $0x1, %al
movsbl %sil, %esi
movzbl %al, %eax
movl %eax, (%rsp)
callq 0x7ec0
movq -0x110(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rax), %rsi
callq 0x5c50
movq -0x10(%rbp), %rax
movq %rax, -0x170(%rbp)
cmpq $0x0, %rax
je 0x1adeb
movq -0x170(%rbp), %rdi
callq 0x5dd0
movq -0x170(%rbp), %rdi
movl $0xff8, %esi            # imm = 0xFF8
callq 0x41e0
movq -0x18(%rbp), %rax
movq %rax, -0x178(%rbp)
cmpq $0x0, %rax
je 0x1ae0d
movq -0x178(%rbp), %rdi
movl $0x7b7, %esi            # imm = 0x7B7
callq 0x41e0
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x42f0
nop