// File: /workspace/github_cpp_makefile_star2_O1/arisKoutsou[P]oopproj/./src/livings/Hero.cpp
// Function: Hero::checkInventory()
void Hero :: checkInventory() {
  inventory.getMenu().clearMenu();
  inventory.getMenu().displayMenu();
  int selection;
  string equipPrompt = "Please enter the name of the item/spell you want to equip";
  string discardPrompt = "Please enter the name of the item/spell you want to discard";
  string usePotionPrompt = "Please enter the name of the potion you want to use";

  while ((selection = this->inventory.getMenu().getSelection())) {
    inventory.getMenu().clearMenu();
    switch (selection) {
    case 1: {
      if (!getInventory().hasItems() && !getInventory().hasSpells()) {
	cout << endl << "You have no Items or Spells in your Inventory." << endl;
      } else {
	inventory.printInfo();
      }      
      break;
    }
    case 2: {      
      if (!getInventory().hasItems() && !getInventory().hasSpells()) {
	cout << endl << "You have no Items or Spells in your Inventory." << endl;
      } else {
	inventory.printInfo();
	string input = getUserInput(equipPrompt);
	equip(input);
      }
      break;
    }
    case 3: {
      if (!getInventory().hasItems() && !getInventory().hasSpells()) {
	cout << endl << "There are no Items or Spells to discard." << endl;
      } else {
	inventory.printInfo();
	string input = getUserInput(discardPrompt);
	discard(input);
      }
      break;      
    }
    case 4: {
      if (!getInventory().hasPotions()) {
	cout << endl << "You have no Potions in your Inventory." << endl;
      } else {
        inventory.printPotions();
	string input = getUserInput(usePotionPrompt);
	use(input);
      }
      break;
    } 
    case 5: {
      inventory.getMenu().clearMenu();
      return;
    }
    case 6: {
      handleQuitCase();
      inventory.getMenu().clearMenu();
      if (quitGame) return;      
      break;
    }
    }    
    inventory.getMenu().displayMenu();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r14
leaq 0xc0(%rdi), %rbx
movq %rbx, %rdi
callq 0xed28
movq %rax, %rdi
callq 0x4f74
movq %rbx, %rdi
callq 0xed28
movq (%rax), %rcx
movq %rax, %rdi
callq *(%rcx)
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x6f63(%rip), %rsi      # 0x1bf2e
leaq 0x6f95(%rip), %rdx      # 0x1bf67
leaq 0x28(%rsp), %rdi
callq 0x6520
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6f7c(%rip), %rsi      # 0x1bf68
leaq 0x6fb0(%rip), %rdx      # 0x1bfa3
leaq 0x68(%rsp), %rdi
callq 0x6520
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6f97(%rip), %rsi      # 0x1bfa4
leaq 0x6fc3(%rip), %rdx      # 0x1bfd7
leaq 0x48(%rsp), %rdi
callq 0x6520
leaq 0x6d3b(%rip), %r12      # 0x1bd60
movq 0xff94(%rip), %r15      # 0x24fc0
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
callq 0xed28
movq %rax, %rdi
callq 0x4ff0
movl %eax, %ebp
testl %eax, %eax
je 0x15323
movq %rbx, %rdi
callq 0xed28
movq %rax, %rdi
callq 0x4f74
decl %ebp
cmpl $0x5, %ebp
ja 0x152fe
movslq (%r12,%rbp,4), %rax
addq %r12, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0xca36
testb %al, %al
jne 0x1508b
movq %rbx, %rdi
callq 0xca42
testb %al, %al
je 0x15243
movq %rbx, %rdi
callq 0xea36
jmp 0x152fe
movq %rbx, %rdi
callq 0xca36
testb %al, %al
jne 0x150b4
movq %rbx, %rdi
callq 0xca42
testb %al, %al
je 0x151eb
movq %rbx, %rdi
callq 0xea36
movq %r13, %rdi
leaq 0x68(%rsp), %rdx
callq 0x14734
movq %r14, %rdi
movq %r13, %rsi
callq 0x14cec
jmp 0x15144
movq %rbx, %rdi
callq 0xca4e
testb %al, %al
je 0x15193
movq %rbx, %rdi
callq 0xee2c
movq %r13, %rdi
leaq 0x48(%rsp), %rdx
callq 0x14734
movq %r14, %rdi
movq %r13, %rsi
callq 0x14dac
jmp 0x15144
movq %rbx, %rdi
callq 0xca36
testb %al, %al
jne 0x15124
movq %rbx, %rdi
callq 0xca42
testb %al, %al
je 0x15298
movq %rbx, %rdi
callq 0xea36
movq %r13, %rdi
leaq 0x28(%rsp), %rdx
callq 0x14734
movq %r14, %rdi
movq %r13, %rsi
callq 0x1481c
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x152fe
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x152fe
callq 0x8c1b
movq %rbx, %rdi
callq 0xed28
movq %rax, %rdi
callq 0x4f74
leaq 0x100e4(%rip), %rax     # 0x25269
cmpb $0x0, (%rax)
je 0x152fe
jmp 0x15323
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %rbp
movl $0x26, %edx
movq %rax, %rdi
leaq 0x6e64(%rip), %rsi      # 0x1c030
callq 0x42f0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4270
jmp 0x152eb
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %rbp
movl $0x28, %edx
movq %rax, %rdi
leaq 0x6de3(%rip), %rsi      # 0x1c007
callq 0x42f0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4270
jmp 0x152eb
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %rbp
movl $0x2e, %edx
movq %rax, %rdi
leaq 0x6d5c(%rip), %rsi      # 0x1bfd8
callq 0x42f0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4270
jmp 0x152eb
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %rbp
movl $0x2e, %edx
movq %rax, %rdi
leaq 0x6d07(%rip), %rsi      # 0x1bfd8
callq 0x42f0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %rbp, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0xed28
movq (%rax), %rcx
movq %rax, %rdi
callq *(%rcx)
jmp 0x15031
movq %rbx, %rdi
callq 0xed28
movq %rax, %rdi
callq 0x4f74
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %rbx
je 0x15344
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x15360
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x15377
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x42a0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x153c5
movq %rax, %rbx
leaq 0x38(%rsp), %r15
jmp 0x153e9
movq %rax, %rbx
jmp 0x15405
jmp 0x153a2
jmp 0x153c5
jmp 0x153a2
jmp 0x153c5
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x153c8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x153c8
jmp 0x153c5
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %r15
je 0x153e9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x15405
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1541c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x4430