global main
extern init_wayland
extern run_window
extern wait_for_windows
extern destroy_wayland

section .text
main:
    enter 0, 0

    call init_wayland
    cmp eax, 0
    jl .shutdown

    ; Launch the first window thread (duplicate calls for more windows)
    call run_window
    call run_window
    call run_window

    call wait_for_windows

.shutdown:
    call destroy_wayland
    leave
    ret
