// File: /workspace/github_cpp_makefile_star2_O3/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, -0x44(%rbp)
movq %rdi, %rbx
movl $0x0, -0x48(%rbp)
xorl %edi, %edi
callq 0x4130
movl %eax, %edi
callq 0x4140
movq %rbx, %rdi
callq 0x5f00
callq 0x4060
movslq %eax, %rdx
imulq $0x66666667, %rdx, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x21, %rax
addl %ecx, %eax
leal (%rax,%rax,4), %eax
subl %eax, %edx
movq %rdx, -0x50(%rbp)
movslq %edx, %rsi
movq 0x808(%rbx), %rax
movq 0x810(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x6d53
movq (%rax,%rsi,8), %r13
leaq 0x820(%rbx), %r14
leaq -0x40(%rbp), %r15
leaq -0x58(%rbp), %r12
movq %r13, %rdi
callq 0x5370
movq %rax, -0x58(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x51e6
movslq -0x3c(%rbp), %rax
movslq -0x40(%rbp), %rcx
imulq $0x4f, %rax, %rax
addq %r14, %rax
cmpb $0x2e, (%rcx,%rax)
jne 0x6be7
movsbl -0x44(%rbp), %eax
cmpl $0x67, %eax
jg 0x6c5d
cmpl $0x64, %eax
je 0x6c9b
cmpl $0x65, %eax
jne 0x6d00
movl $0x50, %edi
callq 0x4160
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 0xe562
jmp 0x6cf9
cmpl $0x6f, %eax
je 0x6ccb
cmpl $0x68, %eax
jne 0x6d00
movl $0x50, %edi
callq 0x4160
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 0xc0fe
jmp 0x6cf9
movl $0x50, %edi
callq 0x4160
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 0xf7ae
jmp 0x6cf9
movl $0x50, %edi
callq 0x4160
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 0xc2d2
movq %r12, 0xfe0(%rbx)
movq -0x50(%rbp), %rsi
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 0x6138
leaq -0x48(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x622e
movl (%r14), %esi
movq %rbx, %rdi
callq 0x694e
movq %rbx, %rdi
callq 0x6af4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16a75(%rip), %rdi     # 0x1d7cf
xorl %eax, %eax
callq 0x41e0
jmp 0x6d67
jmp 0x6d67
jmp 0x6d67
movq %rax, %rbx
movl $0x50, %esi
movq %r12, %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x4250
nop