// File: /workspace/github_cpp_makefile_star2_O2/Serfati[P]Heroes-of-Might-and-Magic-3/GameUnit.cpp
// Function: GameUnit::attackMenu(Hero*)
bool GameUnit::attackMenu(Hero *me) {
    Hero *ptr = nullptr;
    string heroToAttack = "",index;
    while ( true ) {
        cout << "‫‪1. Show me my opponents" << endl;
        cout << "2. Attack Hero";
        std::cin.ignore();
        if ( std::cin.peek() != '\n' )
            cin >> index;
        else {
            std::cin.ignore();
            return 0;
        }

        int choice = atoi(index.c_str());
        switch ( choice ) {
            case 1:    /*	Show me my opponents	*/
                showHeroes();
                return 1;
            case 2:    /*  Attack Hero by name	   */
                try {
                    cout << "Please insert your opponent name:" << endl;
                    std::cin.ignore();
                    if ( std::cin.peek() != '\n' )
                        cin >> heroToAttack;
                    ptr = getHeroByName(heroToAttack);
                    if ( NULL == ptr )
                        throw std::invalid_argument("Hero not found!");

                } catch( std::invalid_argument &e ) {
                    cout << e.what() << endl;
                    return 1;
                }
                me->showHeroFight();
                ptr->showHeroFight();
                me->attackEnemy(*ptr);
                eraseKilled();
                return 1;
            default:
                return 0;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x469f(%rip), %rsi      # 0x952b
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x38f0
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x9110(%rip), %rdi      # 0xdfc0
leaq 0x4456(%rip), %rsi      # 0x930d
callq 0x3270
movq %rax, %rdi
callq 0x3150
movq 0x90f5(%rip), %rdi      # 0xdfc0
leaq 0x4459(%rip), %rsi      # 0x932b
callq 0x3270
movq 0x9102(%rip), %rdi      # 0xdfe0
callq 0x3410
movq 0x90f6(%rip), %rdi      # 0xdfe0
callq 0x30f0
cmpl $0xa, %eax
jne 0x4f02
movq 0x90e5(%rip), %rdi      # 0xdfe0
callq 0x3410
jmp 0x4f32
movq 0x90d7(%rip), %rdi      # 0xdfe0
leaq -0x38(%rbp), %rsi
callq 0x32d0
movq -0x38(%rbp), %rdi
callq 0x3340
cmpl $0x2, %eax
je 0x4f55
cmpl $0x1, %eax
jne 0x4f32
movb $0x1, %r14b
movq %rbx, %rdi
callq 0x544e
jmp 0x4f35
xorl %r14d, %r14d
leaq -0x38(%rbp), %rdi
callq 0x3130
leaq -0x58(%rbp), %rdi
callq 0x3130
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x9064(%rip), %rdi      # 0xdfc0
leaq 0x43d7(%rip), %rsi      # 0x933a
callq 0x3270
movq %rax, %rdi
callq 0x3150
movq 0x9069(%rip), %rdi      # 0xdfe0
callq 0x3410
movq 0x905d(%rip), %rdi      # 0xdfe0
callq 0x30f0
cmpl $0xa, %eax
je 0x4f9d
movq 0x904c(%rip), %rdi      # 0xdfe0
leaq -0x58(%rbp), %rsi
callq 0x32d0
leaq -0x78(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x32f0
leaq -0x78(%rbp), %rsi
movq %rbx, %rdi
callq 0x53a4
movq %rax, %r15
leaq -0x78(%rbp), %rdi
callq 0x3130
testq %r15, %r15
je 0x4ff2
movq %r14, %rdi
callq 0x73a6
movq %r15, %rdi
callq 0x73a6
movq %r14, %rdi
movq %r15, %rsi
callq 0x74c6
movb $0x1, %r14b
movq %rbx, %rdi
callq 0x5556
jmp 0x4f35
pushq $0x10
popq %rdi
callq 0x3160
movq %rax, %r15
leaq 0x4358(%rip), %rsi      # 0x935c
movq %rax, %rdi
callq 0x3440
movq 0x8fc5(%rip), %rsi      # 0xdfd8
movq 0x8fae(%rip), %rdx      # 0xdfc8
movq %r15, %rdi
callq 0x33d0
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x31e0
jmp 0x504b
movq %rdx, %r14
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3130
jmp 0x504b
jmp 0x509f
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0x50a2
movq %rbx, %rdi
callq 0x3100
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0x8f57(%rip), %rdi      # 0xdfc0
movq %rax, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3150
movb $0x1, %r14b
callq 0x3390
jmp 0x4f35
jmp 0x509f
movq %rax, %rbx
callq 0x3390
jmp 0x50a2
movq %rax, %rdi
callq 0x5858
movq %rax, %rbx
jmp 0x50b4
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x3130
leaq -0x58(%rbp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x33f0