// File: /workspace/github_cpp_makefile_star2_O3/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 0xed5c
movq %rax, %rdi
callq 0x4f7c
movq %rbx, %rdi
callq 0xed5c
movq (%rax), %rcx
movq %rax, %rdi
callq *(%rcx)
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x6f07(%rip), %rsi      # 0x1bf3e
leaq 0x6f39(%rip), %rdx      # 0x1bf77
leaq 0x28(%rsp), %rdi
callq 0x654a
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6f20(%rip), %rsi      # 0x1bf78
leaq 0x6f54(%rip), %rdx      # 0x1bfb3
leaq 0x68(%rsp), %rdi
callq 0x654a
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6f3b(%rip), %rsi      # 0x1bfb4
leaq 0x6f67(%rip), %rdx      # 0x1bfe7
leaq 0x48(%rsp), %rdi
callq 0x654a
leaq 0x6cdf(%rip), %r12      # 0x1bd70
movq 0xff28(%rip), %r15      # 0x24fc0
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
callq 0xed5c
movq %rax, %rdi
callq 0x4ff8
movl %eax, %ebp
testl %eax, %eax
je 0x1538f
movq %rbx, %rdi
callq 0xed5c
movq %rax, %rdi
callq 0x4f7c
decl %ebp
cmpl $0x5, %ebp
ja 0x1536a
movslq (%r12,%rbp,4), %rax
addq %r12, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0xca6a
testb %al, %al
jne 0x150f7
movq %rbx, %rdi
callq 0xca76
testb %al, %al
je 0x152af
movq %rbx, %rdi
callq 0xea6a
jmp 0x1536a
movq %rbx, %rdi
callq 0xca6a
testb %al, %al
jne 0x15120
movq %rbx, %rdi
callq 0xca76
testb %al, %al
je 0x15257
movq %rbx, %rdi
callq 0xea6a
movq %r13, %rdi
leaq 0x68(%rsp), %rdx
callq 0x147a0
movq %r14, %rdi
movq %r13, %rsi
callq 0x14d58
jmp 0x151b0
movq %rbx, %rdi
callq 0xca82
testb %al, %al
je 0x151ff
movq %rbx, %rdi
callq 0xee68
movq %r13, %rdi
leaq 0x48(%rsp), %rdx
callq 0x147a0
movq %r14, %rdi
movq %r13, %rsi
callq 0x14e18
jmp 0x151b0
movq %rbx, %rdi
callq 0xca6a
testb %al, %al
jne 0x15190
movq %rbx, %rdi
callq 0xca76
testb %al, %al
je 0x15304
movq %rbx, %rdi
callq 0xea6a
movq %r13, %rdi
leaq 0x28(%rsp), %rdx
callq 0x147a0
movq %r14, %rdi
movq %r13, %rsi
callq 0x14888
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1536a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x1536a
callq 0x8c64
movq %rbx, %rdi
callq 0xed5c
movq %rax, %rdi
callq 0x4f7c
leaq 0x10078(%rip), %rax     # 0x25269
cmpb $0x0, (%rax)
je 0x1536a
jmp 0x1538f
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 0x6e08(%rip), %rsi      # 0x1c040
callq 0x42f0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4270
jmp 0x15357
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 0x6d87(%rip), %rsi      # 0x1c017
callq 0x42f0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4270
jmp 0x15357
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 0x6d00(%rip), %rsi      # 0x1bfe8
callq 0x42f0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4270
jmp 0x15357
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 0x6cab(%rip), %rsi      # 0x1bfe8
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 0xed5c
movq (%rax), %rcx
movq %rax, %rdi
callq *(%rcx)
jmp 0x1509d
movq %rbx, %rdi
callq 0xed5c
movq %rax, %rdi
callq 0x4f7c
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %rbx
je 0x153b0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x153cc
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x153e3
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 0x15431
movq %rax, %rbx
leaq 0x38(%rsp), %r15
jmp 0x15455
movq %rax, %rbx
jmp 0x15471
jmp 0x1540e
jmp 0x15431
jmp 0x1540e
jmp 0x15431
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x15434
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x15434
jmp 0x15431
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
leaq 0x38(%rsp), %r15
je 0x15455
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x15471
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x15488
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x4430