// File: /workspace/github_cpp_makefile_star2_O2/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 0xb8de
movq %rax, %rdi
callq 0x4bf4
movq %rbx, %rdi
callq 0xb8de
movq (%rax), %rcx
movq %rax, %rdi
callq *(%rcx)
leaq 0x598c(%rip), %rsi      # 0x15f2e
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x578c
leaq 0x59b0(%rip), %rsi      # 0x15f68
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x578c
leaq 0x59d6(%rip), %rsi      # 0x15fa4
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x578c
leaq 0x577c(%rip), %rbp      # 0x15d60
movq 0x109d5(%rip), %r15     # 0x20fc0
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
callq 0xb8de
movq %rax, %rdi
callq 0x4c44
movl %eax, %r13d
testl %eax, %eax
je 0x10796
movq %rbx, %rdi
callq 0xb8de
movq %rax, %rdi
callq 0x4bf4
decl %r13d
cmpl $0x5, %r13d
ja 0x10771
movslq (%rbp,%r13,4), %rax
addq %rbp, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0xa384
testb %al, %al
jne 0x1064e
movq %rbx, %rdi
callq 0xa390
testb %al, %al
je 0x10741
movq %rbx, %rdi
callq 0xb738
jmp 0x10771
movq %rbx, %rdi
callq 0xa384
testb %al, %al
jne 0x10677
movq %rbx, %rdi
callq 0xa390
testb %al, %al
je 0x10752
movq %rbx, %rdi
callq 0xb738
movq %r12, %rdi
leaq 0x48(%rsp), %rdx
callq 0xffce
movq %r14, %rdi
movq %r12, %rsi
callq 0x103ac
jmp 0x10703
movq %rbx, %rdi
callq 0xa39c
testb %al, %al
je 0x10730
movq %rbx, %rdi
callq 0xb99a
movq %r12, %rdi
leaq 0x28(%rsp), %rdx
callq 0xffce
movq %r14, %rdi
movq %r12, %rsi
callq 0x10424
jmp 0x10703
movq %rbx, %rdi
callq 0xa384
testb %al, %al
jne 0x106e3
movq %rbx, %rdi
callq 0xa390
testb %al, %al
je 0x10741
movq %rbx, %rdi
callq 0xb738
movq %r12, %rdi
leaq 0x68(%rsp), %rdx
callq 0xffce
movq %r14, %rdi
movq %r12, %rsi
callq 0x10040
movq %r12, %rdi
callq 0x4470
jmp 0x10771
callq 0x7833
movq %rbx, %rdi
callq 0xb8de
movq %rax, %rdi
callq 0x4bf4
leaq 0x10b30(%rip), %rax     # 0x21259
cmpb $0x0, (%rax)
je 0x10771
jmp 0x10796
movq %r15, %rdi
callq 0x4120
leaq 0x58f1(%rip), %rsi      # 0x16030
jmp 0x10761
movq %r15, %rdi
callq 0x4120
leaq 0x5888(%rip), %rsi      # 0x15fd8
jmp 0x10761
movq %r15, %rdi
callq 0x4120
leaq 0x58a6(%rip), %rsi      # 0x16007
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4120
movq %rbx, %rdi
callq 0xb8de
movq (%rax), %rcx
movq %rax, %rdi
callq *(%rcx)
jmp 0x105f0
movq %rbx, %rdi
callq 0xb8de
movq %rax, %rdi
callq 0x4bf4
leaq 0x28(%rsp), %rdi
callq 0x4470
leaq 0x48(%rsp), %rdi
callq 0x4470
leaq 0x68(%rsp), %rdi
callq 0x4470
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x107eb
movq %rax, %rbx
jmp 0x107f8
movq %rax, %rbx
jmp 0x10802
jmp 0x107da
jmp 0x107eb
jmp 0x107da
jmp 0x107eb
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4470
jmp 0x107ee
jmp 0x107eb
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4470
leaq 0x48(%rsp), %rdi
callq 0x4470
leaq 0x68(%rsp), %rdi
callq 0x4470
movq %rbx, %rdi
callq 0x4410