// File: /workspace/github_cpp_makefile_star2_O1/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 0x5ef8
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 0x6d4d
movq (%rax,%rsi,8), %r13
leaq 0x820(%rbx), %r14
leaq -0x40(%rbp), %r15
leaq -0x58(%rbp), %r12
movq %r13, %rdi
callq 0x536c
movq %rax, -0x58(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x51e2
movslq -0x3c(%rbp), %rax
movslq -0x40(%rbp), %rcx
imulq $0x4f, %rax, %rax
addq %r14, %rax
cmpb $0x2e, (%rcx,%rax)
jne 0x6be1
movsbl -0x44(%rbp), %eax
cmpl $0x67, %eax
jg 0x6c57
cmpl $0x64, %eax
je 0x6c95
cmpl $0x65, %eax
jne 0x6cfa
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 0xe666
jmp 0x6cf3
cmpl $0x6f, %eax
je 0x6cc5
cmpl $0x68, %eax
jne 0x6cfa
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 0xc1de
jmp 0x6cf3
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 0xf8be
jmp 0x6cf3
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 0xc3b2
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 0x6130
leaq -0x48(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6226
movl (%r14), %esi
movq %rbx, %rdi
callq 0x6948
movq %rbx, %rdi
callq 0x6aee
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16a7b(%rip), %rdi     # 0x1d7cf
xorl %eax, %eax
callq 0x41e0
jmp 0x6d61
jmp 0x6d61
jmp 0x6d61
movq %rax, %rbx
movl $0x50, %esi
movq %r12, %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x4250
nop