// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_sdl.cpp
// Function: ImGui_ImplSDL2_ProcessEvent(SDL_Event const*)
bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
{
    ImGuiIO& io = ImGui::GetIO();
    switch (event->type)
    {
    case SDL_MOUSEWHEEL:
        {
            if (event->wheel.x > 0) io.MouseWheelH += 1;
            if (event->wheel.x < 0) io.MouseWheelH -= 1;
            if (event->wheel.y > 0) io.MouseWheel += 1;
            if (event->wheel.y < 0) io.MouseWheel -= 1;
            return true;
        }
    case SDL_MOUSEBUTTONDOWN:
        {
            if (event->button.button == SDL_BUTTON_LEFT) g_MousePressed[0] = true;
            if (event->button.button == SDL_BUTTON_RIGHT) g_MousePressed[1] = true;
            if (event->button.button == SDL_BUTTON_MIDDLE) g_MousePressed[2] = true;
            return true;
        }
    case SDL_TEXTINPUT:
        {
            io.AddInputCharactersUTF8(event->text.text);
            return true;
        }
    case SDL_KEYDOWN:
    case SDL_KEYUP:
        {
            int key = event->key.keysym.scancode;
            IM_ASSERT(key >= 0 && key < IM_ARRAYSIZE(io.KeysDown));
            io.KeysDown[key] = (event->type == SDL_KEYDOWN);
            io.KeyShift = ((SDL_GetModState() & KMOD_SHIFT) != 0);
            io.KeyCtrl = ((SDL_GetModState() & KMOD_CTRL) != 0);
            io.KeyAlt = ((SDL_GetModState() & KMOD_ALT) != 0);
#ifdef _WIN32
            io.KeySuper = false;
#else
            io.KeySuper = ((SDL_GetModState() & KMOD_GUI) != 0);
#endif
            return true;
        }
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
callq 0xcb1a0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
addl $0xfffffd00, %eax       # imm = 0xFFFFFD00
subl $0x2, %eax
jb 0x168066
jmp 0x167f2e
movl -0x20(%rbp), %eax
subl $0x303, %eax            # imm = 0x303
je 0x16804c
jmp 0x167f3e
movl -0x20(%rbp), %eax
subl $0x401, %eax            # imm = 0x401
je 0x168007
jmp 0x167f4e
movl -0x20(%rbp), %eax
subl $0x403, %eax            # imm = 0x403
jne 0x168149
jmp 0x167f5e
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jle 0x167f84
movq -0x18(%rbp), %rax
movss 0x8cc8(%rip), %xmm0     # 0x170c3c
addss 0x134(%rax), %xmm0
movss %xmm0, 0x134(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jge 0x167fae
movq -0x18(%rbp), %rax
movss 0x134(%rax), %xmm0
movss 0x8c9a(%rip), %xmm1     # 0x170c3c
subss %xmm1, %xmm0
movss %xmm0, 0x134(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jle 0x167fd4
movq -0x18(%rbp), %rax
movss 0x8c78(%rip), %xmm0     # 0x170c3c
addss 0x130(%rax), %xmm0
movss %xmm0, 0x130(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jge 0x167ffe
movq -0x18(%rbp), %rax
movss 0x130(%rax), %xmm0
movss 0x8c4a(%rip), %xmm1     # 0x170c3c
subss %xmm1, %xmm0
movss %xmm0, 0x130(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x16814d
movq -0x10(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x16801b
movb $0x1, 0xb1bd5(%rip)     # 0x219bf0
movq -0x10(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x3, %eax
jne 0x16802f
movb $0x1, 0xb1bc2(%rip)     # 0x219bf1
movq -0x10(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x2, %eax
jne 0x168043
movb $0x1, 0xb1baf(%rip)     # 0x219bf2
movb $0x1, -0x1(%rbp)
jmp 0x16814d
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0xc3650
movb $0x1, -0x1(%rbp)
jmp 0x16814d
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x1c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x21(%rbp)
jl 0x168088
cmpl $0x200, -0x1c(%rbp)     # imm = 0x200
setl %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x168091
jmp 0x168093
jmp 0x1680b2
leaq 0x2897e(%rip), %rdi     # 0x190a18
leaq 0x289bf(%rip), %rsi     # 0x190a60
movl $0x73, %edx
leaq 0x289dd(%rip), %rcx     # 0x190a8a
callq 0xd180
movq -0x10(%rbp), %rax
cmpl $0x300, (%rax)          # imm = 0x300
sete %dl
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
andb $0x1, %dl
movb %dl, 0x13c(%rax,%rcx)
callq 0xd8b0
andl $0x3, %eax
cmpl $0x0, %eax
setne %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x139(%rax)
callq 0xd8b0
andl $0xc0, %eax
cmpl $0x0, %eax
setne %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x138(%rax)
callq 0xd8b0
andl $0x300, %eax            # imm = 0x300
cmpl $0x0, %eax
setne %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x13a(%rax)
callq 0xd8b0
andl $0xc00, %eax            # imm = 0xC00
cmpl $0x0, %eax
setne %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x13b(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x16814d
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)