// File: /workspace/github_cpp_makefile_star2_O2/dnegovan[P]Intruder-On-Donnar-V/Lab.cpp
// Function: Lab::takeItem(Player&, int)
void Lab::takeItem(Player& markNelson, int input)
{
    if (markNelson.pack.isFull())
    {
        std::cout << RED
                  << "\nYour pack is full. Discard items you don't need."
                  << RESET << std::endl;
        //won't be able to take anything else, exit search menu
        return;
    }
    else
    {
        std::cout << NARRATOR_COLOR << "\n" << roomItems[input-1]
                  << " added to pack." << RESET << std::endl;
        //add item to pack
        markNelson.pack.addItem(roomItems[input-1]);

        //update ingredient counter if necessary
        checkForIngredient(markNelson, roomItems[input-1]);

        //remove item from room
        auto iterator = roomItems.begin() + input - 1;
        roomItems.erase(iterator);

        //if player has all ingredients, give option to make compound
        if (markNelson.ingredientsFound == TOTAL_INGREDIENTS)
        {
            char answer = getYesNo("Create Neutralization Compound? [y/n]: ");
            if (answer == 'Y')
            {
                makeCompound(markNelson);
                //reset this so this option isn't triggered next time you enter
                //the room
                markNelson.ingredientsFound = 0;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x96d8
movq 0x81ef(%rip), %rdi      # 0x15fc8
testb %al, %al
je 0xde1d
leaq 0x2bbf(%rip), %rsi      # 0x109a3
callq 0x31d0
leaq 0x3463(%rip), %rsi      # 0x11253
movq %rax, %rdi
callq 0x31d0
leaq 0x22b4(%rip), %rsi      # 0x100b3
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30f0
leaq 0x2274(%rip), %rsi      # 0x10098
callq 0x31d0
leaq 0x2af4(%rip), %rsi      # 0x10924
movq %rax, %rdi
callq 0x31d0
movslq %r15d, %r13
leaq -0x1(%r13), %r15
shlq $0x5, %r15
movq 0x30(%r14), %rsi
addq %r15, %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x342c(%rip), %rsi      # 0x11285
movq %rax, %rdi
callq 0x31d0
leaq 0x224b(%rip), %rsi      # 0x100b3
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
callq 0x30f0
movq 0x30(%r14), %rsi
addq %r15, %rsi
leaq -0x90(%rbp), %r12
movq %r12, %rdi
callq 0x3250
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9700
leaq -0x90(%rbp), %rdi
callq 0x3368
addq 0x30(%r14), %r15
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3250
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0xeba2
addq $0x30, %r14
leaq -0x70(%rbp), %rdi
callq 0x3368
movq (%r14), %rax
shlq $0x5, %r13
leaq (%rax,%r13), %rsi
addq $-0x20, %rsi
movq %r14, %rdi
callq 0x97c0
cmpl $0x5, 0x1c(%rbx)
jne 0xdf2b
leaq 0x3334(%rip), %rsi      # 0x1122b
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x30b0
leaq -0x50(%rbp), %rdi
callq 0xae36
movl %eax, %r14d
leaq -0x50(%rbp), %rdi
callq 0x3368
cmpb $0x59, %r14b
jne 0xdf2b
movq %rbx, %rsi
callq 0xdc2e
andl $0x0, 0x1c(%rbx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
jmp 0xdf5b
movq %rax, %rbx
jmp 0xdf60
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
jmp 0xdf5b
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x3368
movq %rbx, %rdi
callq 0x3300