// File: /workspace/github_cpp_makefile_star2_O2/isimplyexcel[P]text-based-game/Flick.cpp
// Function: Flick::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 Flick::findItem(std::vector<std::string>& container){

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

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

	switch(choice){
		//	add item
		case 1:
		{
			if(container.size() == 3) {
                //	print backpack content
                std::cout << "Backpack 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 << "2) No.\n";

                std::cout << "Enter your choice: " << std::endl;

                int dropItem = validate(1, 2);

                switch (dropItem) {
                    case 1: {
                        //	container should now have two items
                        container.pop_back();
                        std::cout << "You dropped the last item and now have enough room to add " << this->getItemName()
                                  << "." << std::endl;

                        container.push_back(this->getItemName());
                        std::cout << "You added " << this->getItemName() << " to your backpack!" << std::endl;
                        this->itemTaken = true;
                        break;
                    }
                        //	Do not drop last item
                    case 2: {
                        std::cout << "You chose not to add " << this->getItemName() << " to your backpack."
                                  << std::endl;
                        break;
                    }
                }
            }
			else{
				//	add the item to the backpack
				container.push_back(this->getItemName());
				std::cout << "You added " << this->getItemName() << " to your backpack!" << std::endl;
				this->itemTaken = true;
			}
			break;
		}
		//	do not add item
		case 2:
		{
			std::cout << "You chose not to add " << this->getItemName() << " to your backpack." << std::endl;
			break;
		}
		
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %r12
movq 0x45ad(%rip), %rdi      # 0x7fd0
leaq 0x1915(%rip), %rsi      # 0x533f
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 0x1ced(%rip), %rsi      # 0x573f
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
movq 0x455f(%rip), %rdi      # 0x7fd0
leaq 0x16f2(%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 0x16e1(%rip), %rsi      # 0x5181
movq %rax, %rdi
callq 0x2150
movq %rsp, %rdi
callq 0x2090
movq 0x4519(%rip), %rbx      # 0x7fd0
leaq 0x16d7(%rip), %rsi      # 0x5195
movq %rbx, %rdi
callq 0x2150
leaq 0x187d(%rip), %rsi      # 0x534a
movq %rbx, %rdi
callq 0x2150
leaq 0x1567(%rip), %rsi      # 0x5043
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
pushq $0x1
popq %r15
pushq $0x2
popq %rsi
movl %r15d, %edi
callq 0x4d50
cmpl $0x1, %eax
je 0x3b5c
cmpl $0x2, %eax
jne 0x3dfd
movq 0x44c0(%rip), %rdi      # 0x7fd0
leaq 0x189d(%rip), %rsi      # 0x53b4
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 0x188b(%rip), %rsi      # 0x53ca
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
jmp 0x3dfd
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq $0x60, %rax
jne 0x3cc1
movq %r12, 0x20(%rsp)
movq 0x4457(%rip), %r12      # 0x7fd0
leaq 0x161f(%rip), %rsi      # 0x519f
movq %r12, %rdi
callq 0x2150
leaq 0x1624(%rip), %r13      # 0x51b3
leaq 0x1623(%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 0x3bea
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 0x3b96
movq 0x43df(%rip), %rbx      # 0x7fd0
leaq 0x15c5(%rip), %rsi      # 0x51bd
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
leaq 0x15e9(%rip), %rsi      # 0x51f8
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
leaq 0x156f(%rip), %rsi      # 0x5195
movq %rbx, %rdi
callq 0x2150
leaq 0x1715(%rip), %rsi      # 0x534a
movq %rbx, %rdi
callq 0x2150
leaq 0x13ff(%rip), %rsi      # 0x5043
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
pushq $0x1
popq %rdi
pushq $0x2
popq %rsi
callq 0x4d50
cmpl $0x1, %eax
je 0x3d2d
cmpl $0x2, %eax
movq 0x20(%rsp), %r15
jne 0x3dfd
movq 0x4353(%rip), %rdi      # 0x7fd0
leaq 0x1730(%rip), %rsi      # 0x53b4
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 0x171e(%rip), %rsi      # 0x53ca
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
jmp 0x3b4f
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 0x42e7(%rip), %rdi      # 0x7fd0
leaq 0x152f(%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 0x1512(%rip), %rsi      # 0x522a
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
jmp 0x3def
movq %r14, %rdi
callq 0x2ba4
movq 0x4294(%rip), %rdi      # 0x7fd0
leaq 0x1636(%rip), %rsi      # 0x5379
callq 0x2150
movq %rax, %rbx
movq %rsp, %r15
movq %r15, %rdi
movq 0x20(%rsp), %r12
movq %r12, %rsi
callq 0x4d3c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2140
leaq 0x1552(%rip), %rsi      # 0x52c2
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
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 0x4220(%rip), %rdi      # 0x7fd0
leaq 0x1468(%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 0x144b(%rip), %rsi      # 0x522a
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
movb $0x1, 0x29(%r12)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3e1c
jmp 0x3e1c
jmp 0x3e1c
jmp 0x3e1c
jmp 0x3e1c
jmp 0x3e1c
jmp 0x3e1c
jmp 0x3e1c
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x21e0
nop