// File: Teris45[P]Maze-Game/Engine.cpp
// Function: Engine::GetInput()
void Engine::GetInput() {
    bool flag = true;
    Point oldPoter = poterakos.getPoint();
    while(flag) {
        int ch = getch();
        switch (ch) {
            bool n;
            case KEY_UP:
                n = MyMoving::checkMove(poterakos,maze,ch);
                if(n){
                    flag = false;
                    this->moveCheck(oldPoter.getY()-1,oldPoter.getX());
                    this->maze[oldPoter.getY()][oldPoter.getX()] = DIADROMOS;
                }
                break;
            case KEY_DOWN:
                n = MyMoving::checkMove(poterakos,maze,ch);
                if(n) {
                    flag = false;
                    this->moveCheck(oldPoter.getY() + 1, oldPoter.getX());
                    this->maze[oldPoter.getY()][oldPoter.getX()] = DIADROMOS;

                }
                break;
            case KEY_RIGHT:
                n = MyMoving::checkMove(poterakos,maze,ch);
                if(n){
                    flag = false;
                    this->moveCheck(oldPoter.getY(), oldPoter.getX()+1);
                    this->maze[oldPoter.getY()][oldPoter.getX()] = DIADROMOS;

                }
                break;
            case KEY_LEFT:
                n = MyMoving::checkMove(poterakos,maze,ch);
                if(n){
                    flag = false;
                    this->moveCheck(oldPoter.getY(), oldPoter.getX()-1);
                    this->maze[oldPoter.getY()][oldPoter.getX()] = DIADROMOS;
                }
                break;
            case 27: //ESCAPE
                this->poterAlive = false;
//                cout<<"MPika edw?\n";
                flag = false;
                break;
            case ' ':
                flag = false;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x40(%rbp)
movb $0x1, -0x9(%rbp)
addq $0x38, %rsi
leaq -0x20(%rbp), %rdi
callq 0xa840
testb $0x1, -0x9(%rbp)
je 0x5297
movq 0xf117(%rip), %rax      # 0x13fd0
movq (%rax), %rdi
callq 0x30e0
movl %eax, -0x44(%rbp)
jmp 0x4ec6
movl -0x44(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x48(%rbp)
subl $0x1b, %eax
je 0x527d
jmp 0x4edd
movl -0x48(%rbp), %eax
subl $0x20, %eax
je 0x528e
jmp 0x4eeb
movl -0x48(%rbp), %eax
subl $0x102, %eax            # imm = 0x102
je 0x4ff8
jmp 0x4efb
movl -0x48(%rbp), %eax
subl $0x103, %eax            # imm = 0x103
je 0x4f44
jmp 0x4f07
movl -0x48(%rbp), %eax
subl $0x104, %eax            # imm = 0x104
je 0x51a8
jmp 0x4f17
movl -0x48(%rbp), %eax
subl $0x105, %eax            # imm = 0x105
je 0x50d0
jmp 0x5292
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa900
jmp 0x52a9
movq -0x40(%rbp), %rsi
movq %rsi, %rdi
addq $0x38, %rdi
movl -0x24(%rbp), %edx
callq 0xbb10
movb %al, -0x49(%rbp)
jmp 0x4f5c
movb -0x49(%rbp), %al
andb $0x1, %al
movb %al, -0x35(%rbp)
testb $0x1, -0x35(%rbp)
je 0x4ff3
movb $0x0, -0x9(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa5b0
movl %eax, -0x50(%rbp)
jmp 0x4f80
movl -0x50(%rbp), %eax
decl %eax
movl %eax, -0x58(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa570
movl %eax, -0x54(%rbp)
jmp 0x4f96
movl -0x54(%rbp), %edx
movl -0x58(%rbp), %esi
movq -0x40(%rbp), %rdi
callq 0x53a0
jmp 0x4fa7
movq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa5b0
movl %eax, -0x5c(%rbp)
jmp 0x4fbd
movq -0x68(%rbp), %rdi
movl -0x5c(%rbp), %eax
movslq %eax, %rsi
callq 0x58b0
movq %rax, -0x78(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa570
movl %eax, -0x6c(%rbp)
jmp 0x4fde
movq -0x78(%rbp), %rdi
movl -0x6c(%rbp), %eax
movslq %eax, %rsi
callq 0x58d0
movl $0x2, (%rax)
jmp 0x5292
movq -0x40(%rbp), %rsi
movq %rsi, %rdi
addq $0x38, %rdi
movl -0x24(%rbp), %edx
callq 0xbb10
movb %al, -0x79(%rbp)
jmp 0x5010
movb -0x79(%rbp), %al
andb $0x1, %al
movb %al, -0x35(%rbp)
testb $0x1, -0x35(%rbp)
je 0x50cb
movb $0x0, -0x9(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa5b0
movl %eax, -0x80(%rbp)
jmp 0x5034
movl -0x80(%rbp), %eax
incl %eax
movl %eax, -0x88(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa570
movl %eax, -0x84(%rbp)
jmp 0x5050
movl -0x84(%rbp), %edx
movl -0x88(%rbp), %esi
movq -0x40(%rbp), %rdi
callq 0x53a0
jmp 0x5067
movq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa5b0
movl %eax, -0x8c(%rbp)
jmp 0x5083
movq -0x98(%rbp), %rdi
movl -0x8c(%rbp), %eax
movslq %eax, %rsi
callq 0x58b0
movq %rax, -0xa8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa570
movl %eax, -0x9c(%rbp)
jmp 0x50b0
movq -0xa8(%rbp), %rdi
movl -0x9c(%rbp), %eax
movslq %eax, %rsi
callq 0x58d0
movl $0x2, (%rax)
jmp 0x5292
movq -0x40(%rbp), %rsi
movq %rsi, %rdi
addq $0x38, %rdi
movl -0x24(%rbp), %edx
callq 0xbb10
movb %al, -0xa9(%rbp)
jmp 0x50eb
movb -0xa9(%rbp), %al
andb $0x1, %al
movb %al, -0x35(%rbp)
testb $0x1, -0x35(%rbp)
je 0x51a3
movb $0x0, -0x9(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa5b0
movl %eax, -0xb0(%rbp)
jmp 0x5115
leaq -0x20(%rbp), %rdi
callq 0xa570
movl %eax, -0xb4(%rbp)
jmp 0x5126
movl -0xb0(%rbp), %esi
movq -0x40(%rbp), %rdi
movl -0xb4(%rbp), %edx
incl %edx
callq 0x53a0
jmp 0x513f
movq -0x40(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa5b0
movl %eax, -0xb8(%rbp)
jmp 0x515b
movq -0xc0(%rbp), %rdi
movl -0xb8(%rbp), %eax
movslq %eax, %rsi
callq 0x58b0
movq %rax, -0xd0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa570
movl %eax, -0xc4(%rbp)
jmp 0x5188
movq -0xd0(%rbp), %rdi
movl -0xc4(%rbp), %eax
movslq %eax, %rsi
callq 0x58d0
movl $0x2, (%rax)
jmp 0x5292
movq -0x40(%rbp), %rsi
movq %rsi, %rdi
addq $0x38, %rdi
movl -0x24(%rbp), %edx
callq 0xbb10
movb %al, -0xd1(%rbp)
jmp 0x51c3
movb -0xd1(%rbp), %al
andb $0x1, %al
movb %al, -0x35(%rbp)
testb $0x1, -0x35(%rbp)
je 0x527b
movb $0x0, -0x9(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa5b0
movl %eax, -0xd8(%rbp)
jmp 0x51ed
leaq -0x20(%rbp), %rdi
callq 0xa570
movl %eax, -0xdc(%rbp)
jmp 0x51fe
movl -0xd8(%rbp), %esi
movq -0x40(%rbp), %rdi
movl -0xdc(%rbp), %edx
decl %edx
callq 0x53a0
jmp 0x5217
movq -0x40(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa5b0
movl %eax, -0xe0(%rbp)
jmp 0x5233
movq -0xe8(%rbp), %rdi
movl -0xe0(%rbp), %eax
movslq %eax, %rsi
callq 0x58b0
movq %rax, -0xf8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xa570
movl %eax, -0xec(%rbp)
jmp 0x5260
movq -0xf8(%rbp), %rdi
movl -0xec(%rbp), %eax
movslq %eax, %rsi
callq 0x58d0
movl $0x2, (%rax)
jmp 0x5292
movq -0x40(%rbp), %rax
movb $0x0, 0x19c(%rax)
movb $0x0, -0x9(%rbp)
jmp 0x5292
movb $0x0, -0x9(%rbp)
jmp 0x4ea8
leaq -0x20(%rbp), %rdi
callq 0xa900
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x3430
nopw %cs:(%rax,%rax)