// File: /workspace/github_cpp_makefile_star2_O2/tkaczenko[P]asteroids-clone/src/App.cpp
// Function: App::inputs()
void App::inputs()
{
    while (SDL_PollEvent(&event)) {
        if (event.type == SDL_QUIT) {
            this->exit();
        } else if (event.type == SDL_WINDOWEVENT) {
            if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) {
                SDL_Event focus;
                focus.type = SDL_WINDOWEVENT;
                focus.window.event = SDL_WINDOWEVENT_FOCUS_GAINED;
                SDL_WaitEvent(&focus);
            }
        }
        if (event.type == SDL_KEYDOWN) {
            if (event.key.keysym.scancode == SDL_SCANCODE_UP ||
                event.key.keysym.scancode == SDL_SCANCODE_W) {
                game.actionShip(GameEngine::UP, true);
            }
            if (event.key.keysym.scancode == SDL_SCANCODE_LEFT ||
                event.key.keysym.scancode == SDL_SCANCODE_A) {
                game.actionShip(GameEngine::LEFT, true);
            } else if (event.key.keysym.scancode == SDL_SCANCODE_RIGHT ||
                        event.key.keysym.scancode == SDL_SCANCODE_D) {
                game.actionShip(GameEngine::RIGHT, true);
            }
            if (event.key.keysym.scancode == SDL_SCANCODE_SPACE) {
                game.actionShip(GameEngine::FIRE, true);
            }
        }
        if (event.type == SDL_KEYUP) {
            if (event.key.keysym.scancode == SDL_SCANCODE_UP ||
                event.key.keysym.scancode == SDL_SCANCODE_W) {
                game.actionShip(GameEngine::UP, false);
            }
            if (event.key.keysym.scancode == SDL_SCANCODE_LEFT ||
                event.key.keysym.scancode == SDL_SCANCODE_RIGHT ||
                event.key.keysym.scancode == SDL_SCANCODE_A ||
                event.key.keysym.scancode == SDL_SCANCODE_D) {
                game.actionShip(GameEngine::LEFT, false);
            }
            if (event.key.keysym.scancode == SDL_SCANCODE_R) {
                game.actionShip(GameEngine::ALIVE, false);
            }
            if (event.key.keysym.scancode == SDL_SCANCODE_SPACE) {
                game.actionShip(GameEngine::FIRE, false);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0xe0(%rdi), %r14
leaq 0x10(%rdi), %r15
leaq -0x60(%rbp), %r12
pushq $0x1
popq %r13
movq %r14, %rdi
callq 0x21a0
testl %eax, %eax
je 0x2aa4
movl (%r14), %eax
cmpl $0x200, %eax            # imm = 0x200
je 0x2965
cmpl $0x100, %eax            # imm = 0x100
jne 0x2984
movb $0x0, 0xd8(%rbx)
jmp 0x293b
cmpb $0xd, 0xec(%rbx)
jne 0x293b
movl $0x200, -0x60(%rbp)     # imm = 0x200
movb $0xc, -0x54(%rbp)
movq %r12, %rdi
callq 0x2360
movl (%r14), %eax
cmpl $0x300, %eax            # imm = 0x300
jne 0x2a03
movl 0xf0(%rbx), %eax
cmpl $0x52, %eax
je 0x299b
cmpl $0x1a, %eax
jne 0x29b3
andl $0x0, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x2ff2
movl 0xf0(%rbx), %eax
cmpl $0x50, %eax
je 0x29c7
cmpl $0x7, %eax
je 0x29d0
cmpl $0x4f, %eax
je 0x29d0
cmpl $0x4, %eax
jne 0x29e5
movl $0x1, -0x60(%rbp)
jmp 0x29d7
movl $0x2, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x2ff2
cmpl $0x2c, 0xf0(%rbx)
jne 0x2a03
movl $0x3, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x2ff2
cmpl $0x301, (%r14)          # imm = 0x301
jne 0x293b
movl 0xf0(%rbx), %eax
cmpl $0x52, %eax
je 0x2a20
cmpl $0x1a, %eax
jne 0x2a37
andl $0x0, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2ff2
movl 0xf0(%rbx), %eax
leal -0x4f(%rax), %ecx
cmpl $0x2, %ecx
jb 0x2a49
cmpl $0x7, %eax
je 0x2a49
cmpl $0x4, %eax
jne 0x2a63
movl $0x1, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2ff2
movl 0xf0(%rbx), %eax
cmpl $0x15, %eax
jne 0x2a82
movl $0x4, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2ff2
movl 0xf0(%rbx), %eax
cmpl $0x2c, %eax
jne 0x293b
movl $0x3, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2ff2
jmp 0x293b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop