(bind-func static swapi32
(lambda (x:i32)
(bor (bor (& (>> x 24) #xff) ;; move byte 3 to byte 0
(& (<< x 8) #xff0000)) ;; move byte 1 to byte 2
(bor (& (>> x 8) #xff00) ;; move byte 2 to byte 1
(& (<< x 24) #xff000000))))) ;; byte 0 to byte 3