// File: /workspace/github_c_makefile_star2_O0/adelciotto[P]scg/examples/../scg.h
// Function: scg_app_process_events
bool scg_app_process_events(scg_app_t *app) {
    // Handle events that need to be polled. This may include
    // text input, mouse events, and game controller events.
    {
        SDL_Event event;
        while (SDL_PollEvent(&event)) {
            switch (event.type) {
            case SDL_QUIT:
                app->running = false;
                return false;
            case SDL_KEYDOWN:
                app->keyboard->current_key_states[event.key.keysym.scancode] =
                    true;
                break;
            case SDL_KEYUP:
                app->keyboard->current_key_states[event.key.keysym.scancode] =
                    false;
                break;
            case SDL_MOUSEBUTTONUP:
            case SDL_MOUSEBUTTONDOWN:
            case SDL_MOUSEMOTION:
                scg__mouse_update(app->mouse, app->draw_target->width,
                                  app->draw_target->height,
                                  app->screen->window_width,
                                  app->screen->window_height);
                break;
            }
        }
    }

    if (scg_keyboard_is_key_triggered(app->keyboard, SCG_KEY_ESCAPE)) {
        app->running = false;
        return false;
    }

    // Calculate the delta time and elapsed time in seconds.
    // This is useful for apps that want some quick consistent animation
    // and don't care about fixed updates.
    {
        uint64_t now = scg_get_performance_counter();
        app->delta_time =
            scg_get_elapsed_time_secs(now, app->delta_time_counter);
        app->delta_time_counter = now;

        app->elapsed_time += app->delta_time;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x2120
cmpl $0x0, %eax
je 0x5773
movl -0x48(%rbp), %eax
movl %eax, -0x54(%rbp)
subl $0x100, %eax            # imm = 0x100
je 0x5704
jmp 0x56dd
movl -0x54(%rbp), %eax
subl $0x300, %eax            # imm = 0x300
je 0x5714
jmp 0x56e9
movl -0x54(%rbp), %eax
subl $0x301, %eax            # imm = 0x301
je 0x5725
jmp 0x56f5
movl -0x54(%rbp), %eax
addl $0xfffffc00, %eax       # imm = 0xFFFFFC00
subl $0x3, %eax
jb 0x5736
jmp 0x576e
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x57e6
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x38(%rbp), %ecx
movb $0x1, (%rax,%rcx)
jmp 0x576e
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x38(%rbp), %ecx
movb $0x0, (%rax,%rcx)
jmp 0x576e
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl (%rax), %esi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x4(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x4(%rax), %r8d
callq 0x54e0
jmp 0x56bc
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
movl $0x29, %esi
callq 0x4700
testb $0x1, %al
jne 0x578b
jmp 0x5798
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x57e6
callq 0x2660
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rsi
callq 0x2680
cvtsd2ss %xmm0, %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x50(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0x8(%rax), %xmm0
movss %xmm0, 0x8(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)