// File: /workspace/github_c_makefile_star2_O0/kieselsteini[P]PiXL-old/pixl.c
// Function: px_handle_keys
static void px_handle_keys(const SDL_Event *ev) {
  int button;
  // handle special keys
  if (ev->type == SDL_KEYDOWN) {
    switch (ev->key.keysym.sym) {
    case SDLK_ESCAPE:
      running = SDL_FALSE;
      return;
    case SDLK_F12:
      fullscreen = !fullscreen;
      SDL_SetWindowFullscreen(window, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
      if (!fullscreen) SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
      return;
    }
  }
  // handle normal keys
  switch (ev->key.keysym.sym) {
  case SDLK_UP: button = PX_BUTTON_UP; break;
  case SDLK_DOWN: button = PX_BUTTON_DOWN; break;
  case SDLK_LEFT: button = PX_BUTTON_LEFT; break;
  case SDLK_RIGHT: button = PX_BUTTON_RIGHT; break;
  case SDLK_y: case SDLK_z: button = PX_BUTTON_A; break;
  case SDLK_x: button = PX_BUTTON_B; break;
  case SDLK_a: button = PX_BUTTON_X; break;
  case SDLK_s: button = PX_BUTTON_Y; break;
  case SDLK_SPACE: case SDLK_RETURN: button = PX_BUTTON_START; break;
  default: return;
  }
  px_set_button(0, button, ev->type == SDL_KEYDOWN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x300, (%rax)          # imm = 0x300
jne 0x52e51
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x10(%rbp)
subl $0x1b, %eax
je 0x52de9
jmp 0x52ddd
movl -0x10(%rbp), %eax
subl $0x40000045, %eax       # imm = 0x40000045
je 0x52df8
jmp 0x52e4f
movl $0x0, 0x111d5d(%rip)    # 0x164b50
jmp 0x52f46
cmpl $0x0, 0x111d55(%rip)    # 0x164b54
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x111d45(%rip)    # 0x164b54
movq 0x116ca(%rip), %rdi     # 0x644e0
movl 0x111d38(%rip), %ecx    # 0x164b54
xorl %esi, %esi
movl $0x1001, %eax           # imm = 0x1001
cmpl $0x0, %ecx
cmovnel %eax, %esi
callq 0x6540
cmpl $0x0, 0x111d1f(%rip)    # 0x164b54
jne 0x52e4a
movq 0x116a2(%rip), %rdi     # 0x644e0
movl $0x2fff0000, %edx       # imm = 0x2FFF0000
movl %edx, %esi
callq 0x6090
jmp 0x52f46
jmp 0x52e51
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x14(%rbp)
subl $0xd, %eax
je 0x52f1f
jmp 0x52e66
movl -0x14(%rbp), %eax
subl $0x20, %eax
je 0x52f1f
jmp 0x52e74
movl -0x14(%rbp), %eax
subl $0x61, %eax
je 0x52f0d
jmp 0x52e82
movl -0x14(%rbp), %eax
subl $0x73, %eax
je 0x52f16
jmp 0x52e90
movl -0x14(%rbp), %eax
subl $0x78, %eax
je 0x52f04
jmp 0x52e9a
movl -0x14(%rbp), %eax
addl $-0x79, %eax
subl $0x2, %eax
jb 0x52efb
jmp 0x52ea7
movl -0x14(%rbp), %eax
subl $0x4000004f, %eax       # imm = 0x4000004F
je 0x52ef2
jmp 0x52eb3
movl -0x14(%rbp), %eax
subl $0x40000050, %eax       # imm = 0x40000050
je 0x52ee9
jmp 0x52ebf
movl -0x14(%rbp), %eax
subl $0x40000051, %eax       # imm = 0x40000051
je 0x52ee0
jmp 0x52ecb
movl -0x14(%rbp), %eax
subl $0x40000052, %eax       # imm = 0x40000052
jne 0x52f28
jmp 0x52ed7
movl $0x6, -0xc(%rbp)
jmp 0x52f2a
movl $0x7, -0xc(%rbp)
jmp 0x52f2a
movl $0x4, -0xc(%rbp)
jmp 0x52f2a
movl $0x5, -0xc(%rbp)
jmp 0x52f2a
movl $0x0, -0xc(%rbp)
jmp 0x52f2a
movl $0x1, -0xc(%rbp)
jmp 0x52f2a
movl $0x2, -0xc(%rbp)
jmp 0x52f2a
movl $0x3, -0xc(%rbp)
jmp 0x52f2a
movl $0x8, -0xc(%rbp)
jmp 0x52f2a
jmp 0x52f46
movl -0xc(%rbp), %esi
movq -0x8(%rbp), %rax
cmpl $0x300, (%rax)          # imm = 0x300
sete %al
andb $0x1, %al
movzbl %al, %edx
xorl %edi, %edi
callq 0x532f0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)