// File: dnegovan[P]Intruder-On-Donnar-V/Space.cpp
// Function: Space::takeItem(Player&, int)
void Space::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);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
callq 0x131d0
testb $0x1, %al
jne 0x1dab0
jmp 0x1daf5
movq 0xb511(%rip), %rdi      # 0x28fc8
leaq 0x1f05(%rip), %rsi      # 0x1f9c3
callq 0x3210
movq %rax, %rdi
leaq 0x27a6(%rip), %rsi      # 0x20273
callq 0x3210
movq %rax, %rdi
leaq 0x15f7(%rip), %rsi      # 0x1f0d3
callq 0x3210
movq %rax, %rdi
movq 0xb4c5(%rip), %rsi      # 0x28fb0
callq 0x3240
jmp 0x1dcca
movq 0xb4cc(%rip), %rdi      # 0x28fc8
leaq 0x15b5(%rip), %rsi      # 0x1f0b8
callq 0x3210
movq %rax, %rdi
leaq 0x1e32(%rip), %rsi      # 0x1f944
callq 0x3210
movq -0x98(%rbp), %rdi
movq %rax, -0xb8(%rbp)
addq $0x30, %rdi
movq %rdi, -0xb0(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x134b0
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
callq 0x31e0
movq %rax, %rdi
leaq 0x274f(%rip), %rsi      # 0x202a5
callq 0x3210
movq %rax, %rdi
leaq 0x156e(%rip), %rsi      # 0x1f0d3
callq 0x3210
movq %rax, %rdi
movq 0xb43c(%rip), %rsi      # 0x28fb0
callq 0x3240
movq -0xb0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x134b0
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x30f0
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x13220
jmp 0x1dbc0
leaq -0x38(%rbp), %rdi
callq 0x3448
movq -0x98(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
addq $0x30, %rdi
movl -0x14(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x134b0
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x30f0
movq -0x98(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0x1dce0
jmp 0x1dc1b
leaq -0x68(%rbp), %rdi
callq 0x3448
movq -0x98(%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 -0x98(%rbp), %rax
movq %rcx, -0x70(%rbp)
addq $0x30, %rax
movq %rax, -0xd0(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x136e0
movq -0xd0(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x13670
movq %rax, -0x90(%rbp)
jmp 0x1dcca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3448
jmp 0x1dcd3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3448
jmp 0x1dcd3
addq $0xd0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x33c0
nopl (%rax)