// File: 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
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movq 0xa24b(%rip), %rdi      # 0xcfd0
leaq 0x63d7(%rip), %rsi      # 0x9163
callq 0x21a0
movq -0x110(%rbp), %rsi
movq %rax, -0x108(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x7ee0
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x2190
movq %rax, -0xf8(%rbp)
jmp 0x2dcb
movq -0xf8(%rbp), %rdi
leaq 0x6976(%rip), %rsi      # 0x974f
callq 0x21a0
movq %rax, -0x118(%rbp)
jmp 0x2de7
movq -0x118(%rbp), %rdi
movq 0xa1cb(%rip), %rsi      # 0xcfc0
callq 0x21d0
jmp 0x2dfc
leaq -0x30(%rbp), %rdi
callq 0x2100
movq 0xa1c4(%rip), %rdi      # 0xcfd0
leaq 0x6367(%rip), %rsi      # 0x917a
callq 0x21a0
movq -0x110(%rbp), %rsi
movq %rax, -0x130(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x7ee0
movq -0x130(%rbp), %rdi
movq -0x128(%rbp), %rsi
callq 0x2190
movq %rax, -0x120(%rbp)
jmp 0x2e52
movq -0x120(%rbp), %rdi
leaq 0x6331(%rip), %rsi      # 0x9191
callq 0x21a0
jmp 0x2e67
leaq -0x60(%rbp), %rdi
callq 0x2100
movq 0xa159(%rip), %rdi      # 0xcfd0
leaq 0x6327(%rip), %rsi      # 0x91a5
callq 0x21a0
movq 0xa146(%rip), %rdi      # 0xcfd0
leaq 0x61b2(%rip), %rsi      # 0x9043
callq 0x21a0
movq %rax, %rdi
movq 0xa120(%rip), %rsi      # 0xcfc0
callq 0x21d0
movl $0x1, %esi
movl %esi, %edi
callq 0x7f10
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3340
cmpq $0x3, %rax
jne 0x316c
movq 0xa102(%rip), %rdi      # 0xcfd0
leaq 0x62d9(%rip), %rsi      # 0x91ae
callq 0x21a0
movq %rax, %rdi
movq 0xa0dc(%rip), %rsi      # 0xcfc0
callq 0x21d0
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
movq %rax, -0x138(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3340
movq %rax, %rcx
movq -0x138(%rbp), %rax
cmpq %rcx, %rax
jae 0x2fbb
movq 0xa0b3(%rip), %rdi      # 0xcfd0
leaq 0x629f(%rip), %rsi      # 0x91c3
callq 0x21a0
movq %rax, %rdi
movl -0x68(%rbp), %esi
addl $0x1, %esi
callq 0x2250
movq %rax, %rdi
leaq 0x6288(%rip), %rsi      # 0x91c9
callq 0x21a0
movq %rax, -0x140(%rbp)
movq -0x10(%rbp), %rdi
movl -0x68(%rbp), %eax
movl %eax, %esi
callq 0x3360
movq -0x140(%rbp), %rdi
movq %rax, %rsi
callq 0x2190
movq %rax, %rdi
movq 0xa04c(%rip), %rsi      # 0xcfc0
callq 0x21d0
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x2ef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2100
jmp 0x327e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2100
jmp 0x327e
movq 0xa00e(%rip), %rdi      # 0xcfd0
movq %rdi, -0x160(%rbp)
leaq 0x61fd(%rip), %rsi      # 0x91cd
callq 0x21a0
movq %rax, %rdi
movq 0x9fe1(%rip), %rsi      # 0xcfc0
movq %rsi, -0x158(%rbp)
callq 0x21d0
movq -0x160(%rbp), %rdi
leaq 0x620f(%rip), %rsi      # 0x9208
callq 0x21a0
movq -0x158(%rbp), %rsi
movq %rax, %rdi
callq 0x21d0
movq -0x160(%rbp), %rdi
leaq 0x618a(%rip), %rsi      # 0x91a5
callq 0x21a0
movq -0x160(%rbp), %rdi
leaq 0x6015(%rip), %rsi      # 0x9043
callq 0x21a0
movq -0x158(%rbp), %rsi
movq %rax, %rdi
callq 0x21d0
movl $0x1, %esi
movl %esi, %edi
callq 0x7f10
movl %eax, -0x6c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3380
movq -0x110(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x7ee0
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x33b0
jmp 0x3094
leaq -0x90(%rbp), %rdi
callq 0x2100
movq 0x9f29(%rip), %rdi      # 0xcfd0
leaq 0x6180(%rip), %rsi      # 0x922e
callq 0x21a0
movq -0x110(%rbp), %rsi
movq %rax, -0x178(%rbp)
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x7ee0
movq -0x178(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0x2190
movq %rax, -0x168(%rbp)
jmp 0x30f0
movq -0x168(%rbp), %rdi
leaq 0x613c(%rip), %rsi      # 0x923a
callq 0x21a0
movq %rax, -0x180(%rbp)
jmp 0x310c
movq -0x180(%rbp), %rdi
movq 0x9ea6(%rip), %rsi      # 0xcfc0
callq 0x21d0
jmp 0x3121
leaq -0xb0(%rbp), %rdi
callq 0x2100
jmp 0x3275
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x2100
jmp 0x327e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x2100
jmp 0x327e
movq -0x110(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x190(%rbp)
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x7ee0
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rsi
callq 0x33b0
jmp 0x31a6
leaq -0xd0(%rbp), %rdi
callq 0x2100
movq 0x9e17(%rip), %rdi      # 0xcfd0
leaq 0x606f(%rip), %rsi      # 0x922f
callq 0x21a0
movq -0x110(%rbp), %rsi
movq %rax, -0x1a8(%rbp)
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x7ee0
movq -0x1a8(%rbp), %rdi
movq -0x1a0(%rbp), %rsi
callq 0x2190
movq %rax, -0x198(%rbp)
jmp 0x3202
movq -0x198(%rbp), %rdi
leaq 0x602a(%rip), %rsi      # 0x923a
callq 0x21a0
movq %rax, -0x1b0(%rbp)
jmp 0x321e
movq -0x1b0(%rbp), %rdi
movq 0x9d94(%rip), %rsi      # 0xcfc0
callq 0x21d0
jmp 0x3233
leaq -0xf0(%rbp), %rdi
callq 0x2100
jmp 0x3275
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x2100
jmp 0x327e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x2100
jmp 0x327e
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x22c0
nopw (%rax,%rax)