// File: /workspace/github_cpp_makefile_star2_O2/arisKoutsou[P]oopproj/./src/game_utils.cpp
// Function: createHeroes(int)
void createHeroes(int numberOfHeroes) {
  bool warriorSelected = false;
  bool sorcererSelected = false;
  bool paladinSelected = false;
  for (int i = 0; i != numberOfHeroes; ++i) {
    cout << "Please enter a class for hero " << i + 1
	 << " ( possible classes are ";
    if (!warriorSelected) cout << "Warrior ";
    if (!sorcererSelected) cout << "Sorcerer ";
    if (!paladinSelected) cout << "Paladin ";
    cout << ")" << endl << endl << "> ";
    string heroClass;
    getline(cin, heroClass);
    transform(heroClass.begin(), heroClass.end(),
	      heroClass.begin(), :: tolower);
    if (!(heroClass == "warrior"
	  || heroClass == "paladin"
	  || heroClass == "sorcerer")
	) {
      cout << endl <<  "That's not a valid class!" << endl << endl;
      --i;
      continue;
    }

    if (heroClass == "warrior" && warriorSelected) {
      cout << endl
	   << "Warrior is already selected. Please select one of the "
	   << "available classes" << endl << endl;
      --i;
      continue;
    }
    if (heroClass == "sorcerer" && sorcererSelected) {
      cout << endl
	   << "Sorcerer is already selected. Please selecet one of the "
	   << "available classes" << endl << endl;
      --i;
      continue;
    }
    if (heroClass == "paladin" && paladinSelected) {
      cout << endl
	   << "Paladin is already selected. Please select one of the "
	   << "available classes" << endl << endl;
      --i;
      continue;
    }

    cout << endl << "Please enter a name for your hero"
	 << endl << endl << "> ";
    string name;
    getline(cin, name);
    cout << endl;
    Hero* hero;
    if (heroClass == "warrior") {
      warriorSelected = true;
      hero = new Warrior(gameGrid, name);
    } else if (heroClass == "sorcerer") {
      sorcererSelected = true;
      hero = new Sorcerer(gameGrid, name);
    } else if (heroClass == "paladin") {
      paladinSelected = true;
      hero = new Paladin(gameGrid, name);
    }

    heroes.push_back(hero);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %edi, 0x20(%rsp)
xorl %r15d, %r15d
movq 0x18be0(%rip), %r14     # 0x20fc0
leaq 0x48(%rsp), %r12
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
cmpl 0x20(%rsp), %r15d
je 0x888a
movq %r14, %rdi
leaq 0xd46b(%rip), %rsi      # 0x1587f
callq 0x4250
leal 0x1(%r15), %esi
movq %rax, %rdi
movl %esi, 0x24(%rsp)
callq 0x4400
movq %rax, %rdi
leaq 0xd46b(%rip), %rsi      # 0x1589e
callq 0x4250
testb $0x1, 0x10(%rsp)
jne 0x844e
movq %r14, %rdi
leaq 0xd46e(%rip), %rsi      # 0x158b7
callq 0x4250
testb $0x1, 0x8(%rsp)
jne 0x8464
movq %r14, %rdi
leaq 0xd461(%rip), %rsi      # 0x158c0
callq 0x4250
testb $0x1, (%rsp)
jne 0x8479
movq %r14, %rdi
leaq 0xd456(%rip), %rsi      # 0x158ca
callq 0x4250
movq %r14, %rdi
leaq 0xd138(%rip), %rsi      # 0x155bb
callq 0x4250
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0xcb9a(%rip), %rsi      # 0x1503c
callq 0x4250
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
andq $0x0, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
movq 0x18b0d(%rip), %rdi     # 0x20fd0
movq %r12, %rsi
callq 0x4060
movq %r12, %r13
movq %r14, %rbp
movq 0x48(%rsp), %r14
movq 0x50(%rsp), %rbx
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x84f6
movsbl (%r14,%r12), %edi
callq 0x4350
movb %al, (%r14,%r12)
incq %r12
jmp 0x84de
movq %r13, %r12
movq %r13, %rdi
leaq 0xd3d0(%rip), %rsi      # 0x158d3
callq 0x5b02
testb %al, %al
jne 0x8536
movq %r12, %rdi
leaq 0xd3c5(%rip), %rsi      # 0x158db
callq 0x5b02
testb %al, %al
jne 0x8536
movq %r12, %rdi
leaq 0xd3ba(%rip), %rsi      # 0x158e3
callq 0x5b02
testb %al, %al
je 0x8642
movq %r12, %rdi
leaq 0xd393(%rip), %rsi      # 0x158d3
callq 0x5b02
andb 0x10(%rsp), %al
cmpb $0x1, %al
movq %rbp, %r14
jne 0x8592
movq %r14, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0xd3a4(%rip), %rsi      # 0x15906
callq 0x4250
movq %rax, %rdi
leaq 0xd3cc(%rip), %rsi      # 0x1593d
callq 0x4250
movq %rax, %rdi
callq 0x4120
movb $0x1, %cl
movq %rcx, 0x10(%rsp)
movq %rax, %rdi
callq 0x4120
jmp 0x8801
movq %r12, %rdi
leaq 0xd347(%rip), %rsi      # 0x158e3
callq 0x5b02
andb 0x8(%rsp), %al
cmpb $0x1, %al
jne 0x85eb
movq %r14, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0xd394(%rip), %rsi      # 0x1594f
callq 0x4250
movq %rax, %rdi
leaq 0xd373(%rip), %rsi      # 0x1593d
callq 0x4250
movq %rax, %rdi
callq 0x4120
movb $0x1, %cl
movq %rcx, 0x8(%rsp)
movq %rax, %rdi
callq 0x4120
jmp 0x8801
movq %r12, %rdi
leaq 0xd2e6(%rip), %rsi      # 0x158db
callq 0x5b02
andb (%rsp), %al
cmpb $0x1, %al
jne 0x8671
movq %r14, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0xd375(%rip), %rsi      # 0x15988
callq 0x4250
movq %rax, %rdi
leaq 0xd31b(%rip), %rsi      # 0x1593d
callq 0x4250
movq %rax, %rdi
callq 0x4120
movb $0x1, %cl
movq %rcx, (%rsp)
movq %rax, %rdi
callq 0x4120
jmp 0x8801
movq %rbp, %r14
movq %rbp, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0xd295(%rip), %rsi      # 0x158ec
callq 0x4250
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
callq 0x4120
jmp 0x8801
movq %r14, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0xd33c(%rip), %rsi      # 0x159bf
callq 0x4250
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
callq 0x4120
movq %rax, %rdi
leaq 0xc99a(%rip), %rsi      # 0x1503c
callq 0x4250
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq 0x1890d(%rip), %rdi     # 0x20fd0
leaq 0x28(%rsp), %rsi
callq 0x4060
movq %r14, %rdi
callq 0x4120
movq %r12, %rdi
leaq 0xd1f4(%rip), %rsi      # 0x158d3
callq 0x5b02
testb %al, %al
je 0x8758
movl $0x168, %edi            # imm = 0x168
callq 0x4260
movq %rax, %r15
movq 0x18e34(%rip), %r13     # 0x21530
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4330
subq $0x8, %rsp
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1f4, %r9d            # imm = 0x1F4
movsd 0xcce7(%rip), %xmm0     # 0x15418
pushq $0x64
popq %rax
pushq %rax
pushq %rax
pushq $0xc8
callq 0x13670
addq $0x20, %rsp
movq %r15, 0x18(%rsp)
movb $0x1, %al
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
jmp 0x87da
movq %r12, %rdi
leaq 0xd181(%rip), %rsi      # 0x158e3
callq 0x5b02
testb %al, %al
je 0x880e
movl $0x168, %edi            # imm = 0x168
callq 0x4260
movq %rax, %rbx
movq 0x18dad(%rip), %r13     # 0x21530
leaq 0x88(%rsp), %rbp
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4330
subq $0x8, %rsp
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1f4, %r9d            # imm = 0x1F4
movsd 0xcc60(%rip), %xmm0     # 0x15418
pushq $0x64
popq %rax
pushq %rax
pushq %rax
pushq $0xc8
callq 0x134d4
addq $0x20, %rsp
movq %rbx, 0x18(%rsp)
movb $0x1, %al
movq %rax, 0x8(%rsp)
movq %rbp, %rdi
callq 0x4470
leaq 0x18a9a(%rip), %rdi     # 0x21280
leaq 0x18(%rsp), %rsi
callq 0x9ed6
leaq 0x28(%rsp), %rdi
callq 0x4470
movl 0x24(%rsp), %eax
movl %eax, %r15d
movq %r12, %rdi
callq 0x4470
jmp 0x83ff
movq %r12, %rdi
leaq 0xd0c3(%rip), %rsi      # 0x158db
callq 0x5b02
testb %al, %al
je 0x87df
movl $0x168, %edi            # imm = 0x168
callq 0x4260
movq %rax, %r15
movq 0x18cfb(%rip), %r13     # 0x21530
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4330
subq $0x8, %rsp
movq %r15, %rdi
movq %r13, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1f4, %r9d            # imm = 0x1F4
movsd 0xcbb1(%rip), %xmm0     # 0x15418
pushq $0x64
popq %rax
pushq %rax
pushq %rax
pushq $0xc8
callq 0x1381c
addq $0x20, %rsp
movq %r15, 0x18(%rsp)
movb $0x1, %al
movq %rax, (%rsp)
jmp 0x8750
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x4470
jmp 0x88e4
movq %rax, %r14
jmp 0x88e4
movq %rax, %r14
leaq 0x88(%rsp), %rdi
callq 0x4470
jmp 0x88c5
movq %rax, %r14
movl $0x168, %esi            # imm = 0x168
movq %rbx, %rdi
jmp 0x88ec
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x4470
jmp 0x88e4
movq %rax, %r14
movl $0x168, %esi            # imm = 0x168
movq %r15, %rdi
callq 0x4270
jmp 0x88f8
jmp 0x88f5
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x4470
jmp 0x8907
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x4470
movq %r14, %rdi
callq 0x4410