// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %r15
movq (%rdi), %r14
movq 0x8(%rdi), %rax
movq %rax, -0x50(%rbp)
movq 0xfe0(%r14), %rbx
movq %r14, %rdi
callq 0x824c
incl %eax
movl %eax, -0x44(%rbp)
movq %r14, %rdi
callq 0x6584
movb %al, -0x2d(%rbp)
movq %r14, %rdi
callq 0x8254
movl %eax, %r13d
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movl %eax, -0x40(%rbp)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movl %eax, -0x3c(%rbp)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x68(%rax)
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
movl %eax, -0x38(%rbp)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x68(%rax)
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movl %eax, -0x34(%rbp)
movq %rbx, %rdi
callq 0x8dea
movb %al, -0x2c(%rbp)
movq (%rbx), %rax
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
leaq 0x26c3(%rip), %rsi      # 0x10980
movq %r12, %rdi
callq 0x4ac7
movq %r12, %rdi
callq 0x40e0
movq (%rbx), %rax
movq %r12, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
leaq 0x26c0(%rip), %rsi      # 0x109a0
movq %r12, %rdi
callq 0x4ac7
movb %al, -0x2b(%rbp)
movq %r12, %rdi
callq 0x40e0
movq (%rbx), %rax
movq %r12, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
leaq 0x2334(%rip), %rsi      # 0x1063a
movq %r12, %rdi
callq 0x4ac7
movb %al, -0x2a(%rbp)
movq %r12, %rdi
callq 0x40e0
movq (%rbx), %rax
movq %r12, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
leaq 0x2701(%rip), %rsi      # 0x10a2d
movq %r12, %rdi
callq 0x4ac7
movb %al, -0x29(%rbp)
movq %r12, %rdi
callq 0x40e0
movl $0xff8, %edi            # imm = 0xFF8
callq 0x4190
movq %rax, %rbx
movzbl -0x2d(%rbp), %edx
movzbl %r13b, %ecx
movq %rax, %rdi
movl -0x44(%rbp), %esi
callq 0x50b4
movq %rbx, (%r15)
movl $0x7b7, %edi            # imm = 0x7B7
callq 0x4190
movq %rax, %r12
movl $0x7b7, %edx            # imm = 0x7B7
movq %rax, %rdi
xorl %esi, %esi
callq 0x4120
movq %r12, 0x8(%r15)
leaq 0x2ae1(%rip), %rsi      # 0x10e6a
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x40b0
leaq -0x90(%rbp), %rsi
movq %r12, %rdi
callq 0x4dd4
leaq -0x90(%rbp), %rdi
callq 0x40e0
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq $0x19, %r12
je 0xe3fe
xorl %r13d, %r13d
cmpq $0x4f, %r13
je 0xe3f5
movq 0x8(%r15), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x509e
movq (%r15), %rcx
addq %rbx, %rcx
movb %al, 0x820(%r13,%rcx)
movq (%r15), %rcx
addq %rbx, %rcx
movb %al, 0x6(%r13,%rcx)
incq %r13
jmp 0xe3c2
incq %r12
addq $0x4f, %rbx
jmp 0xe3b9
cmpb $0x0, -0x2b(%rbp)
pushq $0x6f
popq %rax
pushq $0x68
popq %rcx
cmovnel %eax, %ecx
cmpb $0x0, -0x2a(%rbp)
pushq $0x65
popq %rax
cmovel %ecx, %eax
cmpb $0x0, -0x29(%rbp)
pushq $0x64
popq %rsi
cmovel %eax, %esi
movq (%r15), %rdi
movzbl -0x2c(%rbp), %eax
movl %eax, (%rsp)
movl -0x40(%rbp), %edx
movl -0x3c(%rbp), %ecx
movl -0x38(%rbp), %r8d
movl -0x34(%rbp), %r9d
callq 0x5f74
movq (%r15), %rsi
movq 0x8(%r15), %rdi
callq 0x5068
movq %r14, %rdi
callq 0x511a
movl $0xff8, %esi            # imm = 0xFF8
movq %r14, %rdi
callq 0x41a0
movl $0x7b7, %esi            # imm = 0x7B7
movq -0x50(%rbp), %rdi
callq 0x41a0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x90(%rbp), %rdi
callq 0x40e0
jmp 0xe4a0
movq %rax, %r14
jmp 0xe4a0
movq %rax, %r14
movl $0xff8, %esi            # imm = 0xFF8
movq %rbx, %rdi
callq 0x41a0
movq %r14, %rdi
callq 0x4280