// File: /workspace/github_cpp_makefile_star2_O1/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 0x740f(%rip), %rbx      # 0x9fd0
leaq 0x458b(%rip), %rsi      # 0x7153
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2160
movq %rsp, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x6606
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x2160
movq %rax, %rbx
leaq 0x4b43(%rip), %rsi      # 0x773f
movl $0x1, %edx
movq %rax, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x10(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x2c4b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x737e(%rip), %r13      # 0x9fd0
leaq 0x4511(%rip), %rsi      # 0x716a
movl $0x16, %edx
movq %r13, %rdi
callq 0x2160
movq %rsp, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6606
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r13, %rdi
callq 0x2160
leaq 0x44f7(%rip), %rsi      # 0x7181
movl $0x13, %edx
movq %rax, %rdi
callq 0x2160
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2cad
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2140
leaq 0x44e1(%rip), %rsi      # 0x7195
movl $0x8, %edx
movq %r13, %rdi
callq 0x2160
leaq 0x437b(%rip), %rsi      # 0x7043
movl $0x13, %edx
movq %r13, %rdi
callq 0x2160
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl $0x1, %edi
movl $0x1, %esi
callq 0x662c
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x60, %rax
jne 0x2fc2
movq %r12, 0x20(%rsp)
leaq 0x4475(%rip), %rsi      # 0x719e
movl $0x14, %edx
movq %r13, %rdi
callq 0x2160
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq 0x8(%r14), %rax
cmpq (%r14), %rax
je 0x2e0f
movl $0x1, %r13d
xorl %ebx, %ebx
movq 0x7256(%rip), %r12      # 0x9fd0
movl $0x5, %edx
movq %r12, %rdi
leaq 0x442a(%rip), %rsi      # 0x71b3
callq 0x2160
movl %r13d, %ebp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x20c0
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
leaq 0x440b(%rip), %rsi      # 0x71b9
callq 0x2160
movq (%r14), %rax
shlq $0x5, %rbx
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
movq %r15, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x5, %rax
incl %r13d
movq %rbp, %rbx
cmpq %rbp, %rax
ja 0x2d7a
leaq 0x43a7(%rip), %rsi      # 0x71bd
movl $0x3a, %edx
movq 0x71ae(%rip), %rbx      # 0x9fd0
movq %rbx, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x43a0(%rip), %rsi      # 0x71f8
movl $0x25, %edx
movq %rbx, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x4302(%rip), %rsi      # 0x7195
movl $0x8, %edx
movq %rbx, %rdi
callq 0x2160
leaq 0x419c(%rip), %rsi      # 0x7043
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl $0x1, %edi
movl $0x1, %esi
callq 0x662c
movq 0x8(%r14), %rax
leaq -0x20(%rax), %rcx
movq %rcx, 0x8(%r14)
movq -0x20(%rax), %rdi
addq $-0x10, %rax
cmpq %rax, %rdi
je 0x2f0e
movq (%rax), %rsi
incq %rsi
callq 0x2140
movq %rsp, %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %r12
movq %r12, %rsi
callq 0x6606
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x10(%rsp), %r15
callq 0x325c
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2f47
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x7082(%rip), %rbx      # 0x9fd0
leaq 0x42c9(%rip), %rsi      # 0x721e
movl $0xb, %edx
movq %rbx, %rdi
callq 0x2160
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x6606
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
movq %rax, %rbx
leaq 0x42a1(%rip), %rsi      # 0x722a
movl $0x12, %edx
movq %rax, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
jmp 0x3067
movq %rsp, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6606
movq %r14, %rdi
movq %rbx, %rsi
callq 0x325c
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2ff1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2140
movq 0x6fd8(%rip), %rbx      # 0x9fd0
leaq 0x4220(%rip), %rsi      # 0x721f
movl $0xa, %edx
movq %rbx, %rdi
callq 0x2160
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x6606
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
movq %rax, %rbx
leaq 0x41f7(%rip), %rsi      # 0x722a
movl $0x12, %edx
movq %rax, %rdi
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x307d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2140
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3094
jmp 0x3094
jmp 0x3094
jmp 0x3094
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x30ad
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x30a0
jmp 0x30ad