// File: /workspace/github_cpp_makefile_star2_O1/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), %rbp
movq 0x1c787(%rip), %r14     # 0x24fc0
leaq 0x12f2b(%rip), %r13     # 0x1b76b
leaq 0x12f51(%rip), %r12     # 0x1b798
movq 0x1c782(%rip), %r15     # 0x24fd0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %rbx
movl $0x2c, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x42f0
movl $0x2f, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x42f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x12774(%rip), %rsi     # 0x1b06c
callq 0x42f0
movq %rbp, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4270
movq %rsp, %r13
movsbl %al, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x4460
movq %r13, %rdi
leaq 0x12e8a(%rip), %rsi     # 0x1b7c8
callq 0x40d0
testl %eax, %eax
movq 0x20(%rsp), %rbx
je 0x898e
movq %r13, %rdi
leaq 0x12e75(%rip), %rsi     # 0x1b7cb
callq 0x40d0
testl %eax, %eax
je 0x8992
movq %r13, %rdi
leaq 0x12e67(%rip), %rsi     # 0x1b7d0
callq 0x40d0
testl %eax, %eax
je 0x8999
movq %r13, %rdi
leaq 0x12e59(%rip), %rsi     # 0x1b7d5
callq 0x40d0
cmpl $0x1, %eax
movl $0x4, %esi
sbbl $0x0, %esi
jmp 0x899e
xorl %esi, %esi
jmp 0x899e
movl $0x1, %esi
jmp 0x899e
movl $0x2, %esi
movq %rbx, %rdi
callq 0x1464a
jmp 0x8a17
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x8bf8
movq %rbx, %rdi
callq 0x4110
movq %rax, %rbx
movq %r14, %rdi
callq 0x4120
movq %rax, %r13
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r13, %rdi
movq %rax, %rsi
callq 0x4280
movq %rax, %rdi
callq 0x4120
callq 0x4400
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8a06
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x10(%rsp), %rbp
leaq 0x12d59(%rip), %r13     # 0x1b76b
jmp 0x884e
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8a32
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x134d6
movq %rax, %rdi
callq 0x6662
testb %al, %al
je 0x8bce
movq %rsp, %r12
leaq 0x10(%rsp), %rax
movq %rax, (%r12)
movq $0x0, 0x8(%r12)
movb $0x0, 0x10(%r12)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r14, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %r13
movl $0x3e, %edx
movq %rax, %rdi
leaq 0x12d3d(%rip), %rsi     # 0x1b7db
callq 0x42f0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r13, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r13, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x12568(%rip), %rsi     # 0x1b06c
callq 0x42f0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x4460
movq 0x8(%rsp), %r13
testq %r13, %r13
je 0x8b51
movq (%rsp), %rbp
xorl %ebx, %ebx
movsbl (%rbp,%rbx), %edi
callq 0x4370
movb %al, (%rbp,%rbx)
incq %rbx
cmpq %rbx, %r13
jne 0x8b3b
movq %r12, %rdi
leaq 0x12600(%rip), %rsi     # 0x1b15b
callq 0x40d0
testl %eax, %eax
je 0x8b7b
movq %r12, %rdi
leaq 0x12d83(%rip), %rsi     # 0x1b8f1
callq 0x40d0
testl %eax, %eax
jne 0x8a65
leaq 0x125d9(%rip), %rsi     # 0x1b15b
movq %rsp, %rdi
callq 0x40d0
testl %eax, %eax
movq 0x20(%rsp), %rbx
jne 0x8bb3
callq 0x8e16
movq %rbx, %rdi
callq 0x134d6
movq %rax, %rdi
callq 0x6682
movq %rbx, %rdi
movq %rax, %rsi
callq 0x15caa
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8bce
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8bf5
movq %rax, %rbx
callq 0x4400
jmp 0x8bf8
movq %rax, %rdi
callq 0x6d3d
jmp 0x8bf5
jmp 0x8bf5
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8c13
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x4430