// File: /workspace/github_cpp_makefile_star2_O3/malcolmyeh[P]CC3K/floor.cc
// Function: Floor::generateItems(int&)
void Floor::generateItems(int &dragons) {
	for (int j = 0; j < 10; j++) {

		int num = rand() % 6 + 1;
		int id;
		Posn pos;
		generatePosition(id, pos);

		Potion *i;
		if (num == 1) {
			i = new Potion(pos, "RH");
			this->potions.push_back(i);
		} else if (num == 2) {
			i = new Potion(pos, "BA");
			this->potions.push_back(i);
		} else if (num == 3) {
			i = new Potion(pos, "BD");
			this->potions.push_back(i);
		} else if (num == 4) {
			i = new Potion(pos, "PH");
			this->potions.push_back(i);
		} else if (num == 5) {
			i = new Potion(pos, "WA");
			this->potions.push_back(i);
		} else if (num == 6) {
			i = new Potion(pos, "WD");
			this->potions.push_back(i);		}

		displayGrid[pos.y][pos.x] = i->getSymbol();
	}
	for (int j = 0; j < 6; j++) {

		int num = rand() % 8 + 1;
		int id;
		Posn pos;
		generatePosition(id, pos);
		Gold *i;
		if (num <= 5) {
			i = new normalHoard(pos);
			this->golds.push_back(i);
		} else if (num <= 7) {
			i = new smallHoard(pos);
			this->golds.push_back(i);
		} else if (num == 8) {
			i = new dragonHoard(pos);
			this->golds.push_back(i);
			Posn dpos = dragonPosition(pos);
			Enemy *e = new Dragon(dpos, i, NULL, id);
			this->enemies.push_back(e);
			
			++dragons;
			displayGrid[dpos.y][dpos.x] = e->getSymbol();
		}
		displayGrid[pos.y][pos.x] = i->getSymbol();
	}
	int num = rand() % (6 - this->level);
	if (num == 0 && !this->barrierSpawned) {

		int id;
		Posn pos;
		generatePosition(id, pos);
		this->suit = new barrierSuit(pos);
		this->barrierSpawned = true;
		displayGrid[pos.y][pos.x] = this->suit->getSymbol();
		Posn dpos = dragonPosition(pos);
		Enemy *e = new Dragon(dpos, NULL, this->suit, id);
		this->enemies.push_back(e);
		++dragons;
		displayGrid[dpos.y][dpos.x] = e->getSymbol();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, -0x60(%rbp)
movq %rdi, %r14
leaq 0x7f0(%rdi), %rax
movq %rax, -0x40(%rbp)
leaq 0x820(%rdi), %rax
movq %rax, -0x48(%rbp)
movl $0xa, %r13d
callq 0x4060
movslq %eax, %rbx
imulq $0x2aaaaaab, %rbx, %rax # imm = 0x2AAAAAAB
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
addl %eax, %eax
leal (%rax,%rax,2), %eax
subl %eax, %ebx
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x5a80
cmpl $0x5, %ebx
ja 0x656b
leaq 0x16ff8(%rip), %rcx     # 0x1d2a0
movslq (%rcx,%rbx,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x30, %edi
callq 0x4160
movq %rax, %rbx
movq -0x38(%rbp), %r15
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x120(%rbp), %r12
movq %r12, %rdi
leaq 0x16fd7(%rip), %rsi     # 0x1d2b8
leaq 0x16fd2(%rip), %rdx     # 0x1d2ba
callq 0x501a
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x170ec
movq %rbx, -0x30(%rbp)
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x653d
movq -0x110(%rbp), %rsi
jmp 0x6535
movl $0x30, %edi
callq 0x4160
movq %rax, %rbx
movq -0x38(%rbp), %r15
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
leaq 0x16f72(%rip), %rsi     # 0x1d2c4
leaq 0x16f6d(%rip), %rdx     # 0x1d2c6
callq 0x501a
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x170ec
movq %rbx, -0x30(%rbp)
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x653d
movq -0x90(%rbp), %rsi
jmp 0x6535
movl $0x30, %edi
callq 0x4160
movq %rax, %rbx
movq -0x38(%rbp), %r15
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %r12
movq %r12, %rdi
leaq 0x16efb(%rip), %rsi     # 0x1d2be
leaq 0x16ef6(%rip), %rdx     # 0x1d2c0
callq 0x501a
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x170ec
movq %rbx, -0x30(%rbp)
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x653d
movq -0xd0(%rbp), %rsi
jmp 0x6535
movl $0x30, %edi
callq 0x4160
movq %rax, %rbx
movq -0x38(%rbp), %r15
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %r12
movq %r12, %rdi
leaq 0x16e8d(%rip), %rsi     # 0x1d2c1
leaq 0x16e88(%rip), %rdx     # 0x1d2c3
callq 0x501a
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x170ec
movq %rbx, -0x30(%rbp)
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x653d
movq -0xb0(%rbp), %rsi
jmp 0x6535
movl $0x30, %edi
callq 0x4160
movq %rax, %rbx
movq -0x38(%rbp), %r15
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0x100(%rbp), %r12
movq %r12, %rdi
leaq 0x16e16(%rip), %rsi     # 0x1d2bb
leaq 0x16e11(%rip), %rdx     # 0x1d2bd
callq 0x501a
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x170ec
movq %rbx, -0x30(%rbp)
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x653d
movq -0xf0(%rbp), %rsi
jmp 0x6535
movl $0x30, %edi
callq 0x4160
movq %rax, %rbx
movq -0x38(%rbp), %r15
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %r12
movq %r12, %rdi
leaq 0x16dc1(%rip), %rsi     # 0x1d2c7
leaq 0x16dbc(%rip), %rdx     # 0x1d2c9
callq 0x501a
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x170ec
movq %rbx, -0x30(%rbp)
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x653d
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x4170
movq 0x7f8(%r14), %rsi
cmpq 0x800(%r14), %rsi
je 0x655e
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x7f8(%r14)
jmp 0x656b
movq -0x40(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0xa7dc
movq -0x30(%rbp), %rdi
callq 0x15c24
movslq -0x34(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x4f, %rcx, %rcx
addq -0x48(%rbp), %rcx
movb %al, (%rdx,%rcx)
decl %r13d
jne 0x6265
leaq 0x7d8(%r14), %rax
movq %rax, -0x40(%rbp)
leaq 0x7c0(%r14), %r12
movl $0x6, %r13d
callq 0x4060
movl %eax, %r15d
leal 0x7(%r15), %eax
testl %r15d, %r15d
cmovnsl %r15d, %eax
andl $-0x8, %eax
subl %eax, %r15d
movq %r14, %rdi
leaq -0x54(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x5a80
movl $0x38, %edi
cmpl $0x4, %r15d
jg 0x65f2
callq 0x4160
movq %rax, %rbx
movq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x15eec
jmp 0x660c
callq 0x4160
movq %rax, %rbx
movq -0x38(%rbp), %rsi
cmpl $0x6, %r15d
ja 0x6642
movq %rbx, %rdi
callq 0x15f76
movq %rbx, -0x30(%rbp)
movq 0x7e0(%r14), %rsi
cmpq 0x7e8(%r14), %rsi
je 0x6630
movq %rbx, (%rsi)
addq $0x8, 0x7e0(%r14)
jmp 0x66fb
movq -0x40(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0xa91c
jmp 0x66fb
movq %rbx, %rdi
callq 0x16000
movq %rbx, -0x30(%rbp)
movq 0x7e0(%r14), %rsi
cmpq 0x7e8(%r14), %rsi
je 0x666b
movq %rbx, (%rsi)
addq $0x8, 0x7e0(%r14)
jmp 0x6678
movq -0x40(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0xa91c
movq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0x5b88
movq %rax, %rbx
movl $0x60, %edi
callq 0x4160
movq %rax, %r15
movq -0x30(%rbp), %rdx
movl -0x54(%rbp), %r8d
movq %rax, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x16120
movq %r15, -0x50(%rbp)
movq 0x7c8(%r14), %rsi
cmpq 0x7d0(%r14), %rsi
je 0x66ca
movq %r15, (%rsi)
addq $0x8, 0x7c8(%r14)
jmp 0x66d6
movq %r12, %rdi
leaq -0x50(%rbp), %rdx
callq 0xa69c
movq -0x60(%rbp), %rax
incl (%rax)
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
movq %rbx, %rcx
sarq $0x20, %rcx
movslq %ebx, %rdx
imulq $0x4f, %rcx, %rcx
addq -0x48(%rbp), %rcx
movb %al, (%rdx,%rcx)
movq -0x30(%rbp), %rdi
callq 0x15c24
movslq -0x34(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x4f, %rcx, %rcx
addq -0x48(%rbp), %rcx
movb %al, (%rdx,%rcx)
decl %r13d
jne 0x65a8
callq 0x4060
movl $0x6, %ecx
subl (%r14), %ecx
cltd
idivl %ecx
testl %edx, %edx
jne 0x6823
cmpb $0x0, 0x5(%r14)
jne 0x6823
leaq -0x50(%rbp), %rsi
leaq -0x38(%rbp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x5a80
movl $0x10, %edi
callq 0x4160
movq %rax, %rbx
movq (%r15), %rsi
movq %rax, %rdi
callq 0x160e0
movq %rbx, 0xfe8(%r14)
movb $0x1, 0x5(%r14)
movq %rbx, %rdi
callq 0x15c24
movslq -0x34(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x4f, %rcx, %rcx
addq -0x48(%rbp), %rcx
movb %al, (%rdx,%rcx)
movq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0x5b88
movq %rax, %rbx
movl $0x60, %edi
callq 0x4160
movq %rax, %r15
movq 0xfe8(%r14), %rcx
movl -0x50(%rbp), %r8d
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x16120
movq %r15, -0x30(%rbp)
movq 0x7c8(%r14), %rsi
cmpq 0x7d0(%r14), %rsi
je 0x67ea
movq %r15, (%rsi)
addq $0x8, 0x7c8(%r14)
jmp 0x67fc
leaq -0x30(%rbp), %r14
movq %r12, %rdi
movq %r14, %rdx
callq 0xa69c
movq (%r14), %r15
movq -0x60(%rbp), %rax
incl (%rax)
movq (%r15), %rax
movq %r15, %rdi
callq *0x30(%rax)
movq %rbx, %rcx
sarq $0x20, %rcx
movslq %ebx, %rdx
imulq $0x4f, %rcx, %rcx
movq -0x48(%rbp), %rsi
addq %rcx, %rsi
movb %al, (%rdx,%rsi)
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6929
movq %rax, %r14
movl $0x10, %esi
jmp 0x693e
movq %rax, %r14
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x691e
movq -0x110(%rbp), %rsi
jmp 0x6911
jmp 0x691b
movq %rax, %r14
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x691e
movq -0xf0(%rbp), %rsi
jmp 0x6911
jmp 0x691b
movq %rax, %r14
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x691e
movq -0xd0(%rbp), %rsi
jmp 0x6911
jmp 0x691b
movq %rax, %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x691e
movq -0xb0(%rbp), %rsi
jmp 0x6911
jmp 0x691b
movq %rax, %r14
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x691e
movq -0x90(%rbp), %rsi
jmp 0x6911
jmp 0x691b
movq %rax, %r14
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x691e
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0x691e
movq %rax, %r14
movl $0x30, %esi
jmp 0x693e
jmp 0x6936
jmp 0x6936
movq %rax, %r14
movl $0x60, %esi
movq %r15, %rdi
jmp 0x6941
movq %rax, %r14
movl $0x38, %esi
movq %rbx, %rdi
callq 0x4170
movq %r14, %rdi
callq 0x4250