// File: /workspace/github_cpp_makefile_star2_O2/arisKoutsou[P]oopproj/./src/game_utils.cpp
// Function: handleMoveCase(Hero*)
void handleMoveCase(Hero* currentHero) {
  bool moved = false;
  while (!moved) {
    cout << endl
	 << "Please enter the direction you want to move "
	 << "(possible directions are up, down, left, right)"
	 << endl << endl << "> ";
    string answer;
    getline(cin, answer);
    Hero :: directions direction;
    if (answer == "up") direction = Hero :: UP;
    else if (answer == "down") direction = Hero :: DOWN;
    else if (answer == "left") direction = Hero :: LEFT;
    else if (answer == "right") direction = Hero :: RIGHT;
    else direction = Hero :: UNKNOWN;
    try {
      currentHero->move(direction);
      moved = true;
    }
    catch (HeroMoveException& e) {
      cout << endl << e.what() << endl;
      moved = false;
    }
  }

  if (currentHero->getTile().hasMarket()) {
    string answer;
    do {
      cout << endl << "It seems that you found a market... Do you want to enter?(Y|n)"
	   << endl << endl << "> ";
      getline(cin, answer);
      transform(answer.begin(), answer.end(), answer.begin(), :: tolower);
    } while (answer != "y" && answer != "n");
    if (answer == "y") {
      clearScreen();
      currentHero->enterMarket(currentHero->getTile().getMarket());
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
leaq 0x10(%rsp), %r14
movq 0x19a28(%rip), %rdi     # 0x20fc0
leaq 0xe1bc(%rip), %r12      # 0x1575b
leaq 0xe1e2(%rip), %r15      # 0x15788
leaq 0xda8f(%rip), %r13      # 0x1503c
movq 0x19a1c(%rip), %rbp     # 0x20fd0
movq %rsp, %rbx
callq 0x4120
movq %rax, %rdi
movq %r12, %rsi
callq 0x4250
movq %rax, %rdi
movq %r15, %rsi
callq 0x4250
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
movq %r13, %rsi
callq 0x4250
movq %r14, (%rsp)
andq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4060
movq %r14, %r15
movq %rbx, %rdi
leaq 0xe1a4(%rip), %rsi      # 0x157b8
callq 0x5b02
xorl %esi, %esi
testb %al, %al
jne 0x7662
movq %rbx, %rdi
leaq 0xe192(%rip), %rsi      # 0x157bb
callq 0x5b02
pushq $0x1
popq %rsi
testb %al, %al
jne 0x7662
movq %rbx, %rdi
leaq 0xe181(%rip), %rsi      # 0x157c0
callq 0x5b02
pushq $0x2
popq %rsi
testb %al, %al
jne 0x7662
movq %rbx, %rdi
leaq 0xe170(%rip), %rsi      # 0x157c5
callq 0x5b02
movzbl %al, %eax
pushq $0x4
popq %rsi
subl %eax, %esi
movq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0xff0a
jmp 0x76ec
movq %rbx, %r14
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7823
movq %rbx, %rdi
callq 0x40f0
movq %rax, %rbx
movq 0x1992e(%rip), %rdi     # 0x20fc0
callq 0x4120
movq %rax, %r15
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x4250
movq %rax, %rdi
callq 0x4120
callq 0x43e0
movq %r14, %rbx
movq %r14, %rdi
callq 0x4470
movq 0x198f3(%rip), %rdi     # 0x20fc0
leaq 0xe087(%rip), %r12      # 0x1575b
leaq 0xe0ad(%rip), %r15      # 0x15788
leaq 0x10(%rsp), %r14
leaq 0xd955(%rip), %r13      # 0x1503c
jmp 0x75b7
movq %rsp, %rdi
callq 0x4470
movq %r12, %rdi
callq 0xf07e
movq %rax, %rdi
callq 0x5b92
testb %al, %al
je 0x77f9
movq %rsp, %r14
movq %r15, (%r14)
andq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq 0x198ad(%rip), %rbp     # 0x20fd0
leaq 0xda01(%rip), %rbx      # 0x1512b
movq 0x1988f(%rip), %rdi     # 0x20fc0
callq 0x4120
movq %rax, %rdi
leaq 0xe08b(%rip), %rsi      # 0x157cb
callq 0x4250
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0xd8dd(%rip), %rsi      # 0x1503c
callq 0x4250
movq %rbp, %rdi
movq %r14, %rsi
callq 0x4060
movq (%rsp), %r12
movq 0x8(%rsp), %r15
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x7793
movsbl (%r12,%r13), %edi
callq 0x4350
movb %al, (%r12,%r13)
incq %r13
jmp 0x777b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5808
testb %al, %al
je 0x77b9
movq %r14, %rdi
leaq 0xe135(%rip), %rsi      # 0x158e1
callq 0x5808
testb %al, %al
jne 0x772a
leaq 0xd96b(%rip), %rsi      # 0x1512b
movq %rsp, %rdi
callq 0x5b02
testb %al, %al
movq 0x20(%rsp), %rbx
je 0x77f1
callq 0x7951
movq %rbx, %rdi
callq 0xf07e
movq %rax, %rdi
callq 0x5bb2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x10cec
movq %rsp, %rdi
callq 0x4470
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7820
movq %rax, %rbx
callq 0x43e0
jmp 0x7823
movq %rax, %rdi
callq 0x5833
jmp 0x7820
jmp 0x7820
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4470
movq %rbx, %rdi
callq 0x4410