// File: /workspace/github_cpp_makefile_star2_O2/angelapwen[P]text-based-game/vectorSatchel.cpp
// Function: VectorSatchel::addWeapon(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void VectorSatchel::addWeapon(std::string weapon) {
	cout << "\nCongratulations! You have found a " << weapon << "." << endl;

	// If vector is at capacity, call randomDrop
	if (satchel.size() == capacity) {
		cout << "Oops! Your Silver Satchel is already full with " << capacity <<
		     " weapons." << endl;
		cout << "Before adding your new " << weapon << ", you will have to "
				 "randomly drop one of your existing weapons." << endl;
		randomDrop();
	}

	// Now vector should have maximum four weapons
	satchel.push_back(weapon);

	// Update bool variables to true if the new weapon was not a repeat
	if (weapon == "knife") {
		knife = true;
	}
	else if (weapon == "wrench") {
		wrench = true;
	}
	else if (weapon == "rope") {
		rope = true;
	}
	else if (weapon == "pipe") {
		pipe = true;
	}
	else if (weapon == "revolver") {
		revolver = true;
	}
	else if (weapon == "candlestick") {
		candlestick = true;
	}

	cout << "\nYour new " << weapon << " has been added to the Silver Satchel."
												<< endl;

	// Print total weapons, list, and number of unique weapons
	cout << "Your total weapon count is: " << satchel.size() << "." <<
	     endl;
	cout << "Your current weapon list is:" << endl;
	printWeapons();
	cout << "The number of unique weapons in your Silver Satchel is: " <<
	     getNumUniqueWeapons() << "." << endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x94cf(%rip), %rdi      # 0x10fd0
leaq 0x45a8(%rip), %rsi      # 0xc0b0
callq 0x21a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
leaq 0x24e1(%rip), %rsi      # 0xa000
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
movq 0x20(%rbx), %rax
subq 0x18(%rbx), %rax
leaq 0x18(%rbx), %r15
sarq $0x5, %rax
movl 0x8(%rbx), %ecx
cmpq %rcx, %rax
jne 0x7bb8
movq 0x9482(%rip), %r12      # 0x10fd0
leaq 0x4b28(%rip), %rsi      # 0xc67d
movq %r12, %rdi
callq 0x21a0
movl 0x8(%rbx), %esi
movq %rax, %rdi
callq 0x2110
leaq 0x3627(%rip), %rsi      # 0xb196
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq 0x457c(%rip), %rsi      # 0xc102
movq %r12, %rdi
callq 0x21a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
leaq 0x4b0d(%rip), %rsi      # 0xc6ad
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x7d30
movq %r15, %rdi
movq %r14, %rsi
callq 0x7ee2
leaq 0x197a(%rip), %rsi      # 0x9544
movq %r14, %rdi
callq 0x2aab
testb %al, %al
je 0x7bdc
movb $0x1, 0x10(%rbx)
jmp 0x7c57
leaq 0x197b(%rip), %rsi      # 0x955e
movq %r14, %rdi
callq 0x2aab
testb %al, %al
je 0x7bf5
movb $0x1, 0x13(%rbx)
jmp 0x7c57
leaq 0x195b(%rip), %rsi      # 0x9557
movq %r14, %rdi
callq 0x2aab
testb %al, %al
je 0x7c0e
movb $0x1, 0x11(%rbx)
jmp 0x7c57
leaq 0x1952(%rip), %rsi      # 0x9567
movq %r14, %rdi
callq 0x2aab
testb %al, %al
je 0x7c27
movb $0x1, 0x15(%rbx)
jmp 0x7c57
leaq 0x191e(%rip), %rsi      # 0x954c
movq %r14, %rdi
callq 0x2aab
testb %al, %al
je 0x7c40
movb $0x1, 0x12(%rbx)
jmp 0x7c57
leaq 0x18ef(%rip), %rsi      # 0x9536
movq %r14, %rdi
callq 0x2aab
testb %al, %al
je 0x7c57
movb $0x1, 0x14(%rbx)
movq 0x9372(%rip), %r15      # 0x10fd0
leaq 0x452d(%rip), %rsi      # 0xc192
movq %r15, %rdi
callq 0x21a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
leaq 0x4a6d(%rip), %rsi      # 0xc6ec
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq 0x1859(%rip), %rsi      # 0x94ef
movq %r15, %rdi
callq 0x21a0
movq 0x20(%rbx), %rsi
subq 0x18(%rbx), %rsi
sarq $0x5, %rsi
movq %rax, %rdi
callq 0x2110
leaq 0x2347(%rip), %r14      # 0xa000
movq %rax, %rdi
movq %r14, %rsi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
leaq 0x44a2(%rip), %rsi      # 0xc175
movq %r15, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20c0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
leaq 0x4a20(%rip), %rsi      # 0xc713
movq %r15, %rdi
callq 0x21a0
movq %rax, %r15
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq %r15, %rdi
movl %eax, %esi
callq 0x2280
movq %rax, %rdi
movq %r14, %rsi
callq 0x21a0
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x20c0
nop