// File: /workspace/github_cpp_makefile_star2_O1/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 0x973b(%rip), %r14      # 0x13fd0
leaq -0x50(%rbp), %r13
leaq 0x3e1d(%rip), %rbx      # 0xe6bd
movl $0x24, %edx
movq %r14, %rdi
leaq 0x425b(%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 0x4245(%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 0x4221(%rip), %rsi      # 0xeb46
callq 0x31c0
movl $0x1b, %edx
movq %r14, %rdi
leaq 0x422c(%rip), %rsi      # 0xeb65
callq 0x31c0
movl $0x17, %edx
movq %r14, %rdi
leaq 0x4234(%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 0x9660(%rip), %rdi      # 0x13fe0
movq %r13, %rsi
callq 0x31e0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x30a0
testl %eax, %eax
je 0xa9fd
movq %r13, %rdi
leaq 0x3d1e(%rip), %rsi      # 0xe6bf
callq 0x30a0
testl %eax, %eax
je 0xaa0f
movq %r13, %rdi
leaq 0x3dae(%rip), %rsi      # 0xe762
callq 0x30a0
testl %eax, %eax
je 0xaa29
movl $0x16, %edx
movq %r14, %rdi
leaq 0x41cd(%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 0xa8a0
movq -0x30(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0xd84c
jmp 0xa8a0
movq %r12, %r15
movq (%r15), %r15
cmpq %r12, %r15
je 0xa8a0
movq 0x10(%r15), %rdi
callq 0x746c
jmp 0xaa12
movq -0x30(%rbp), %rdi
callq 0xaa5a
jmp 0xaa36
jmp 0xaa36
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x50(%rbp), %rdi
cmpq %rax, %rdi
je 0xaa52
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3190
movq %rbx, %rdi
callq 0x3220