// File: /workspace/github_cpp_makefile_star2_O3/arisKoutsou[P]oopproj/./src/livings/Hero.cpp
// Function: Hero::handleAttackCase(std::__cxx11::list<Monster*, std::allocator<Monster*>>&)
void Hero :: handleAttackCase(list<Monster*>& monsters) {
  Monster* monsterToAttack;

  if (monsters.size() == 1) {
    monsterToAttack = *monsters.begin();

    cout << endl
	 << "Attacking the only monster here: "
	 << monsterToAttack->getName() << endl;

    this->attack(monsterToAttack);

    if (monsterToAttack->getHealthPower() == 0) {
      ++this->monstersKilled;
      monsters.remove(monsterToAttack);
      delete monsterToAttack;
    }
  } else {

    monsterToAttack = NULL;
    cout << endl
	 << "Please enter the name of the monster you want to attack"
	 << endl << endl << "> ";
    string name;
    list<Monster*> :: iterator it = monsters.begin();
    getline(cin, name);      
    for (it = monsters.begin() ; it != monsters.end(); ++it) {
      if ((*it)->getName() == name) {
	monsterToAttack = (*it);
	break;
      }
    }

    if (monsterToAttack != NULL) {

      cout << endl << "Attacking Monster " << monsterToAttack->getName() << endl;

      this->attack(monsterToAttack);

      if (monsterToAttack->getHealthPower() == 0) {
	++this->monstersKilled;
	monsters.remove(monsterToAttack);
	delete monsterToAttack;            
      }
    } else {

      cout << endl << "There is no such Monster here..." << endl;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x1, 0x10(%rsi)
jne 0x16ca0
movq (%rbx), %rax
movq 0x10(%rax), %r15
movq %r15, 0x8(%rsp)
movq 0xe3e9(%rip), %r12      # 0x24fc0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %r12
leaq 0x565d(%rip), %rsi      # 0x1c266
movl $0x21, %edx
movq %rax, %rdi
callq 0x42f0
movq %r15, %rdi
callq 0x186fc
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r12, %rdi
callq 0x42f0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %r14, %rdi
movq %r15, %rsi
callq 0x16730
movq %r15, %rdi
callq 0x186f0
testl %eax, %eax
jne 0x16f28
incl 0xb4(%r14)
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x185e6
movq (%r14), %rdi
testq %rdi, %rdi
je 0x16f28
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x16f28
xorl %r13d, %r13d
movq %r13, 0x8(%rsp)
movq 0xe311(%rip), %r15      # 0x24fc0
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, %r12
leaq 0x55a8(%rip), %rsi      # 0x1c288
movl $0x37, %edx
movq %rax, %rdi
callq 0x42f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
leaq 0x4326(%rip), %rsi      # 0x1b06c
movl $0x2, %edx
movq %rax, %rdi
callq 0x42f0
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq %r13, -0x8(%r12)
movb $0x0, (%r12)
movq 0xe262(%rip), %rdi      # 0x24fd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %edx
movq 0xe247(%rip), %rdi      # 0x24fd0
leaq 0x10(%rsp), %rsi
callq 0x4460
movq (%rbx), %r13
cmpq %rbx, %r13
je 0x16dcb
movq 0x10(%r13), %rdi
callq 0x186fc
movq 0x8(%rax), %rdx
cmpq 0x18(%rsp), %rdx
jne 0x16dc5
testq %rdx, %rdx
je 0x16dd2
movq 0x10(%rsp), %rsi
movq (%rax), %rdi
callq 0x42b0
testl %eax, %eax
je 0x16dd2
movq (%r13), %r13
jmp 0x16d96
movq 0x8(%rsp), %rax
jmp 0x16ddb
movq 0x10(%r13), %rax
movq %rax, 0x8(%rsp)
movq (%r15), %rcx
addq -0x18(%rcx), %r15
testq %rax, %rax
je 0x16eaf
movq %r15, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq 0xe1be(%rip), %rdi      # 0x24fc0
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %r15
leaq 0x54a7(%rip), %rsi      # 0x1c2c0
movl $0x12, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x8(%rsp), %rdi
callq 0x186fc
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x42f0
movq %rax, %r15
movq (%rax), %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 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x16730
movq 0x8(%rsp), %rdi
callq 0x186f0
testl %eax, %eax
jne 0x16f11
incl 0xb4(%r14)
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x185e6
movq (%r14), %rdi
testq %rdi, %rdi
je 0x16f11
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x16f11
movq %r15, %rdi
movl $0xa, %esi
callq 0x4270
movsbl %al, %esi
movq 0xe0fa(%rip), %rdi      # 0x24fc0
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %rax, %rbx
leaq 0x53f6(%rip), %rsi      # 0x1c2d3
movl $0x20, %edx
movq %rax, %rdi
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 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16f28
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42a0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x16f38
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x16f52
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42a0
movq %rbx, %rdi
callq 0x4430