// File: /workspace/github_cpp_makefile_star2_O2/isimplyexcel[P]text-based-game/Engine.cpp
// Function: Engine::findItem(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void Engine::findItem(std::vector<std::string>& container){

    //	You find an item
    std::cout << "You have been awarded " << this->getItemName() << "!" << std::endl;
    std::cout << "Would you like to add " << this->getItemName() <<  " to your backpack?\n";
    std::cout << "1) Yes.\n";

    std::cout << "Enter your choice: " << std::endl;
    int choice = validate(1,1);


	if(container.size() == 3){
        //	print backpack content
        std::cout << "\nBackpack contents: " << std::endl;

        for(unsigned int i = 0; i < container.size(); i++) {
            std::cout << "item " << i + 1 << " - " << container[i] << std::endl;
        }

		std::cout << "\nYou already have 3 items. You cannot carry anymore items." << std::endl;

		std::cout << "Would you like to drop the last item?" << std::endl;
		std::cout << "1) Yes.\n";

		std::cout << "Enter your choice: " << std::endl;
		int dropItem = validate(1,1);

		//	container should now have two items
		container.pop_back();

		container.push_back(this->getItemName());
		std::cout << "\nYou added " << this->getItemName() << " to your backpack!" << std::endl;

	}
	else{
		//	add the item to the backpack
		container.push_back(this->getItemName());
		std::cout << "You added " << this->getItemName() << " to your backpack!" << std::endl;
	}	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %r12
movq 0x5735(%rip), %rdi      # 0x7fd0
leaq 0x28b1(%rip), %rsi      # 0x5153
callq 0x2150
movq %rax, %rbx
movq %rsp, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x4d3c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2140
leaq 0x2e75(%rip), %rsi      # 0x573f
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
movq 0x56e7(%rip), %rdi      # 0x7fd0
leaq 0x287a(%rip), %rsi      # 0x516a
callq 0x2150
movq %rax, %rbx
movq %rsp, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x4d3c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2140
leaq 0x2869(%rip), %rsi      # 0x5181
movq %rax, %rdi
callq 0x2150
movq %rsp, %rdi
callq 0x2090
movq 0x56a1(%rip), %rbx      # 0x7fd0
leaq 0x285f(%rip), %rsi      # 0x5195
movq %rbx, %rdi
callq 0x2150
leaq 0x26fe(%rip), %rsi      # 0x5043
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
pushq $0x1
popq %r15
movl %r15d, %edi
movl %r15d, %esi
callq 0x4d50
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x60, %rax
jne 0x2acd
movq %r12, 0x20(%rsp)
movq 0x564f(%rip), %r12      # 0x7fd0
leaq 0x2816(%rip), %rsi      # 0x519e
movq %r12, %rdi
callq 0x2150
leaq 0x281c(%rip), %r13      # 0x51b3
leaq 0x281b(%rip), %rbp      # 0x51b9
leal -0x1(%r15), %ebx
movq %rax, %rdi
callq 0x20a0
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x5, %rax
cmpq %rbx, %rax
jbe 0x29f2
movq %r12, %rdi
movq %r13, %rsi
callq 0x2150
movl %r15d, %esi
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2150
shlq $0x5, %rbx
addq (%r14), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2140
incl %r15d
jmp 0x299e
movq 0x55d7(%rip), %rbx      # 0x7fd0
leaq 0x27bd(%rip), %rsi      # 0x51bd
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
leaq 0x27e1(%rip), %rsi      # 0x51f8
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
leaq 0x2767(%rip), %rsi      # 0x5195
movq %rbx, %rdi
callq 0x2150
leaq 0x2606(%rip), %rsi      # 0x5043
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x4d50
movq %r14, %rdi
callq 0x2ba4
movq %rsp, %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %r15
movq %r15, %rsi
callq 0x4d3c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ca2
movq %rsp, %rdi
callq 0x2090
movq 0x5544(%rip), %rdi      # 0x7fd0
leaq 0x278b(%rip), %rsi      # 0x521e
callq 0x2150
movq %rax, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x4d3c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
leaq 0x276f(%rip), %rsi      # 0x522a
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
jmp 0x2b34
movq %rsp, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4d3c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ca2
movq %rsp, %rdi
callq 0x2090
movq 0x54db(%rip), %rdi      # 0x7fd0
leaq 0x2723(%rip), %rsi      # 0x521f
callq 0x2150
movq %rax, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x4d3c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
leaq 0x2706(%rip), %rsi      # 0x522a
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2b55
jmp 0x2b55
jmp 0x2b55
jmp 0x2b55
jmp 0x2b55
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x21e0