// File: 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
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x131d0
testb $0x1, %al
jne 0x1c610
jmp 0x1c655
movq 0xc9b1(%rip), %rdi      # 0x28fc8
leaq 0x33a5(%rip), %rsi      # 0x1f9c3
callq 0x3210
movq %rax, %rdi
leaq 0x3c46(%rip), %rsi      # 0x20273
callq 0x3210
movq %rax, %rdi
leaq 0x2a97(%rip), %rsi      # 0x1f0d3
callq 0x3210
movq %rax, %rdi
movq 0xc965(%rip), %rsi      # 0x28fb0
callq 0x3240
jmp 0x1c8fe
movq 0xc96c(%rip), %rdi      # 0x28fc8
leaq 0x2a55(%rip), %rsi      # 0x1f0b8
callq 0x3210
movq %rax, %rdi
leaq 0x32d2(%rip), %rsi      # 0x1f944
callq 0x3210
movq -0xc8(%rbp), %rdi
movq %rax, -0xe8(%rbp)
addq $0x30, %rdi
movq %rdi, -0xe0(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x134b0
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x31e0
movq %rax, %rdi
leaq 0x3bef(%rip), %rsi      # 0x202a5
callq 0x3210
movq %rax, %rdi
leaq 0x2a0e(%rip), %rsi      # 0x1f0d3
callq 0x3210
movq %rax, %rdi
movq 0xc8dc(%rip), %rsi      # 0x28fb0
callq 0x3240
movq -0xe0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x134b0
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x30f0
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
callq 0x13220
jmp 0x1c720
leaq -0x38(%rbp), %rdi
callq 0x3448
movq -0xc8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
addq $0x30, %rdi
movl -0x14(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x134b0
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x30f0
movq -0xc8(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
callq 0x1dce0
jmp 0x1c77b
leaq -0x68(%rbp), %rdi
callq 0x3448
movq -0xc8(%rbp), %rdi
addq $0x30, %rdi
callq 0x134d0
movq %rax, -0x80(%rbp)
movslq -0x14(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x13500
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %rdi
movl $0x1, %esi
callq 0x13540
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, -0x70(%rbp)
addq $0x30, %rax
movq %rax, -0x100(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x136e0
movq -0x100(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x13670
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x5, 0x1c(%rax)
jne 0x1c8fc
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x33d0
movq -0x108(%rbp), %rdx
leaq 0x3a22(%rip), %rsi      # 0x2024b
leaq -0xb8(%rbp), %rdi
callq 0x32f0
jmp 0x1c837
leaq -0xb8(%rbp), %rdi
callq 0x174b0
movb %al, -0x109(%rbp)
jmp 0x1c84b
leaq -0xb8(%rbp), %rdi
callq 0x3448
leaq -0xb9(%rbp), %rdi
callq 0x3250
movb -0x109(%rbp), %al
movb %al, -0x91(%rbp)
movsbl -0x91(%rbp), %eax
cmpl $0x59, %eax
jne 0x1c8fa
movq -0xc8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1c340
movq -0x10(%rbp), %rax
movl $0x0, 0x1c(%rax)
jmp 0x1c8fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3448
jmp 0x1c907
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3448
jmp 0x1c907
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1c8ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x3448
leaq -0xb9(%rbp), %rdi
callq 0x3250
jmp 0x1c907
jmp 0x1c8fc
jmp 0x1c8fe
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x33c0