// File: /workspace/github_cpp_makefile_star2_O2/malcolmyeh[P]CC3K/floor.cc
// Function: Floor::initNext(char, int, int, int, int, bool)
void Floor::initNext(char type, int HP, int gold, int Atk, int Def, bool hasBarrier) {
	int id;
	int dragons = 0;
	srand(time(NULL));
	generateChamber();

	id = rand() % 5 + 1;
	Chamber *c = chambers.at(id - 1);
	Posn p;
	do {
		p = c->getPosition();
	} while (!(this->displayGrid[p.y][p.x] == '.'));
	if (type == 'h') {
	 	this->player = new Human(HP, gold, p, Atk, Def, hasBarrier);
	} else if (type == 'o') {
		this->player = new Orc(HP, gold, p, Atk, Def, hasBarrier);
	} else if (type == 'e') {
		this->player = new Elf(HP, gold, p, Atk, Def, hasBarrier);
	} else if (type == 'd') {
		this->player = new Dwarf(HP, gold, p, Atk, Def, hasBarrier);
	}
	displayGrid[p.y][p.x] = '@';

	generateStair(id);
	generateItems(dragons);
	generateEnemies(dragons);
	assignCompass();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, -0x38(%rbp)
movl %r8d, -0x34(%rbp)
movl %ecx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
movl %esi, -0x48(%rbp)
movq %rdi, %rbx
andl $0x0, -0x4c(%rbp)
xorl %edi, %edi
callq 0x4160
movl %eax, %edi
callq 0x4170
movq %rbx, %rdi
callq 0x562c
callq 0x4070
pushq $0x5
popq %rcx
cltd
idivl %ecx
leaq 0x808(%rbx), %rdi
movl %edx, -0x44(%rbp)
movslq %edx, %rsi
callq 0x8380
movq (%rax), %r13
leaq 0x820(%rbx), %r14
leaq -0x40(%rbp), %r15
leaq -0x58(%rbp), %r12
movq %r13, %rdi
callq 0x4d88
movq %rax, -0x58(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4bfe
movslq -0x3c(%rbp), %rax
movslq -0x40(%rbp), %rcx
imulq $0x4f, %rax, %rax
addq %r14, %rax
cmpb $0x2e, (%rcx,%rax)
jne 0x5fe2
movsbl -0x48(%rbp), %eax
cmpl $0x64, %eax
je 0x60bb
cmpl $0x65, %eax
je 0x605f
cmpl $0x6f, %eax
je 0x608d
cmpl $0x68, %eax
jne 0x60ee
pushq $0x50
popq %rdi
callq 0x4190
movq %rax, %r12
movq -0x40(%rbp), %rcx
movzbl 0x10(%rbp), %eax
movl %eax, (%rsp)
movq %r12, %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x34(%rbp), %r8d
movl -0x38(%rbp), %r9d
callq 0x97a2
jmp 0x60e7
pushq $0x50
popq %rdi
callq 0x4190
movq %rax, %r12
movq -0x40(%rbp), %rcx
movzbl 0x10(%rbp), %eax
movl %eax, (%rsp)
movq %r12, %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x34(%rbp), %r8d
movl -0x38(%rbp), %r9d
callq 0xa33a
jmp 0x60e7
pushq $0x50
popq %rdi
callq 0x4190
movq %rax, %r12
movq -0x40(%rbp), %rcx
movzbl 0x10(%rbp), %eax
movl %eax, (%rsp)
movq %r12, %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x34(%rbp), %r8d
movl -0x38(%rbp), %r9d
callq 0x98de
jmp 0x60e7
pushq $0x50
popq %rdi
callq 0x4190
movq %rax, %r12
movq -0x40(%rbp), %rcx
movzbl 0x10(%rbp), %eax
movl %eax, (%rsp)
movq %r12, %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x34(%rbp), %r8d
movl -0x38(%rbp), %r9d
callq 0xa992
movq %r12, 0xfe0(%rbx)
movl -0x44(%rbp), %esi
incl %esi
movslq -0x3c(%rbp), %rax
movslq -0x40(%rbp), %rcx
imulq $0x4f, %rax, %rax
addq %rax, %r14
movb $0x40, (%rcx,%r14)
movq %rbx, %rdi
callq 0x5806
leaq -0x4c(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x58c2
movl (%r14), %esi
movq %rbx, %rdi
callq 0x5dc6
movq %rbx, %rdi
callq 0x5f2c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6146
jmp 0x6146
jmp 0x6146
movq %rax, %rbx
pushq $0x50
popq %rsi
movq %r12, %rdi
callq 0x41a0
movq %rbx, %rdi
callq 0x4280