// File: /workspace/github_cpp_makefile_star2_O3/kongrigoriou[P]Text-Based-RPG/src/Grid.cpp
// Function: Grid::enter_battle()
void Grid::enter_battle(){

    int BattleFlag = 0;
    string input;
    list <Monster*>::iterator mit;

    while(BattleFlag == 0){
        cout << "You are about to fight with monsters" << endl;
        cout << "Choose your next move!" << endl;
        cout << "1: display your teams' stats \n"
            << "2: display monsters stats \n" 
            << "3: to start the battle " << endl;
        
        cin >> input;

        if(input == "1"){
            team->display_myHeroes();
        }else if(input == "2"){
            for(mit = Monsters.begin(); mit != Monsters.end(); ++mit){
                (*mit)->display_stats();
            }
        }else if(input == "3"){
            BattleFlag = battle();
            BattleFlag = 1;
        }else{
            cout << "Wrong input. Try again" << endl;
        }
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rdi, -0x30(%rbp)
leaq 0x48(%rdi), %r12
movq 0x96b9(%rip), %r14      # 0x13fd0
leaq -0x50(%rbp), %r13
leaq 0x3d9b(%rip), %rbx      # 0xe6bd
movl $0x24, %edx
movq %r14, %rdi
leaq 0x41d9(%rip), %rsi      # 0xeb0a
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movl $0x16, %edx
movq %r14, %rdi
leaq 0x41c3(%rip), %rsi      # 0xeb2f
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movl $0x1e, %edx
movq %r14, %rdi
leaq 0x419f(%rip), %rsi      # 0xeb46
callq 0x31c0
movl $0x1b, %edx
movq %r14, %rdi
leaq 0x41aa(%rip), %rsi      # 0xeb65
callq 0x31c0
movl $0x17, %edx
movq %r14, %rdi
leaq 0x41b2(%rip), %rsi      # 0xeb81
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0x95de(%rip), %rdi      # 0x13fe0
movq %r13, %rsi
callq 0x31e0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x30a0
testl %eax, %eax
je 0xaa7f
movq %r13, %rdi
leaq 0x3c9c(%rip), %rsi      # 0xe6bf
callq 0x30a0
testl %eax, %eax
je 0xaa91
movq %r13, %rdi
leaq 0x3d2c(%rip), %rsi      # 0xe762
callq 0x30a0
testl %eax, %eax
je 0xaaab
movl $0x16, %edx
movq %r14, %rdi
leaq 0x414b(%rip), %rsi      # 0xeb99
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
jmp 0xa922
movq -0x30(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0xd8bc
jmp 0xa922
movq %r12, %r15
movq (%r15), %r15
cmpq %r12, %r15
je 0xa922
movq 0x10(%r15), %rdi
callq 0x7474
jmp 0xaa94
movq -0x30(%rbp), %rdi
callq 0xaadc
jmp 0xaab8
jmp 0xaab8
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x50(%rbp), %rdi
cmpq %rax, %rdi
je 0xaad4
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3190
movq %rbx, %rdi
callq 0x3220