// File: malcolmyeh[P]CC3K/floor.cc
// Function: Floor::pickGold[abi:cxx11](Posn)
std::string Floor::pickGold(Posn p) {
	for (int i = 0; i < golds.size(); i++) {
		if (golds.at(i)->getPosition() == p) {
			Gold *tmp = golds.at(i);
			if (!(tmp->isGuarded())) {
				int value = tmp->getValue();
				golds.erase(golds.begin()+i);
				delete tmp;
				this->player->updateGold(value);
				return "You picked " + std::to_string(value) + " gold. ";
			}
		}
	}
	return "invalid";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0xc0(%rbp)
movq %rdi, %rax
movq %rax, -0xb8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0xb0(%rbp), %rdi
movslq -0x1c(%rbp), %rax
movq %rax, -0xc8(%rbp)
addq $0x7d8, %rdi            # imm = 0x7D8
callq 0xd230
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
jae 0xa140
movq -0xb0(%rbp), %rdi
addq $0x7d8, %rdi            # imm = 0x7D8
movslq -0x1c(%rbp), %rsi
callq 0xd250
movq (%rax), %rdi
callq 0x17b70
movq %rax, -0x24(%rbp)
leaq -0x24(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x53f0
testb $0x1, %al
jne 0x9fb4
jmp 0xa130
movq -0xb0(%rbp), %rdi
addq $0x7d8, %rdi            # imm = 0x7D8
movslq -0x1c(%rbp), %rsi
callq 0xd250
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x182f0
testb $0x1, %al
jne 0xa12e
movq -0x30(%rbp), %rdi
callq 0x182d0
movq -0xb0(%rbp), %rdi
movl %eax, -0x34(%rbp)
movq %rdi, %rax
addq $0x7d8, %rax            # imm = 0x7D8
movq %rax, -0xd8(%rbp)
addq $0x7d8, %rdi            # imm = 0x7D8
callq 0xd300
movq %rax, -0x50(%rbp)
movslq -0x1c(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0xd330
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xd370
movq -0xd8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xd290
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, %rax
je 0xa076
movq -0xd0(%rbp), %rdi
callq 0xd3b0
movq -0xd0(%rbp), %rdi
movl $0x38, %esi
callq 0x41e0
movq -0xb0(%rbp), %rax
movq 0xfe0(%rax), %rdi
movl -0x34(%rbp), %esi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl -0x34(%rbp), %esi
leaq -0x98(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0xdbe0
movq -0xe0(%rbp), %rdx
leaq 0x141f7(%rip), %rsi     # 0x1e2aa
leaq -0x78(%rbp), %rdi
callq 0xdb90
jmp 0xa0be
movq -0xc0(%rbp), %rdi
leaq 0x141ea(%rip), %rdx     # 0x1e2b6
leaq -0x78(%rbp), %rsi
callq 0xdb40
jmp 0xa0d7
leaq -0x78(%rbp), %rdi
callq 0x4130
leaq -0x98(%rbp), %rdi
callq 0x4130
jmp 0xa19d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0xa120
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4130
leaq -0x98(%rbp), %rdi
callq 0x4130
jmp 0xa1ad
jmp 0xa130
jmp 0xa132
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x9f4a
leaq -0xa5(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x4300
movq -0xc0(%rbp), %rdi
movq -0xe8(%rbp), %rdx
leaq 0x14104(%rip), %rsi     # 0x1e26c
callq 0x4270
jmp 0xa16f
leaq -0xa5(%rbp), %rdi
callq 0x4200
jmp 0xa19d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xa5(%rbp), %rdi
callq 0x4200
jmp 0xa1ad
movq -0xb8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x42f0
nopl (%rax)