// File: /workspace/github_cpp_makefile_star2_O3/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 0x1c73e(%rip), %r14     # 0x24fc0
leaq 0x12ee2(%rip), %r13     # 0x1b76b
leaq 0x12f08(%rip), %r12     # 0x1b798
movq 0x1c739(%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 0x1272b(%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 0x12e41(%rip), %rsi     # 0x1b7c8
callq 0x40d0
testl %eax, %eax
movq 0x20(%rsp), %rbx
je 0x89d7
movq %r13, %rdi
leaq 0x12e2c(%rip), %rsi     # 0x1b7cb
callq 0x40d0
testl %eax, %eax
je 0x89db
movq %r13, %rdi
leaq 0x12e1e(%rip), %rsi     # 0x1b7d0
callq 0x40d0
testl %eax, %eax
je 0x89e2
movq %r13, %rdi
leaq 0x12e10(%rip), %rsi     # 0x1b7d5
callq 0x40d0
cmpl $0x1, %eax
movl $0x4, %esi
sbbl $0x0, %esi
jmp 0x89e7
xorl %esi, %esi
jmp 0x89e7
movl $0x1, %esi
jmp 0x89e7
movl $0x2, %esi
movq %rbx, %rdi
callq 0x146b8
jmp 0x8a60
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x8c41
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 0x8a4f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42a0
leaq 0x10(%rsp), %rbp
leaq 0x12d10(%rip), %r13     # 0x1b76b
jmp 0x8897
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8a7b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x1353e
movq %rax, %rdi
callq 0x6692
testb %al, %al
je 0x8c17
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 0x12cf4(%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 0x1251f(%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 0x8b9a
movq (%rsp), %rbp
xorl %ebx, %ebx
movsbl (%rbp,%rbx), %edi
callq 0x4370
movb %al, (%rbp,%rbx)
incq %rbx
cmpq %rbx, %r13
jne 0x8b84
movq %r12, %rdi
leaq 0x125b7(%rip), %rsi     # 0x1b15b
callq 0x40d0
testl %eax, %eax
je 0x8bc4
movq %r12, %rdi
leaq 0x12d3a(%rip), %rsi     # 0x1b8f1
callq 0x40d0
testl %eax, %eax
jne 0x8aae
leaq 0x12590(%rip), %rsi     # 0x1b15b
movq %rsp, %rdi
callq 0x40d0
testl %eax, %eax
movq 0x20(%rsp), %rbx
jne 0x8bfc
callq 0x8e5f
movq %rbx, %rdi
callq 0x1353e
movq %rax, %rdi
callq 0x66b2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x15d08
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8c17
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 0x8c3e
movq %rax, %rbx
callq 0x4400
jmp 0x8c41
movq %rax, %rdi
callq 0x6daf
jmp 0x8c3e
jmp 0x8c3e
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x8c5c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x4430