(module

  (func (export "trailing0") (param $num i32) (result i32)
    ;; load  number onto the stack
    local.get $num

    ;; check how many trailing zeros and return the result
    i32.ctz
  )

)
var url = "{%wasm-url%}";
await WebAssembly.instantiateStreaming(fetch(url), { console }).then(
  (result) => {
    const trailing0 = result.instance.exports.trailing0;

    console.log("Ttrailing zeros: " + trailing0(0b00000000_10000000_00000000_00000000));
  }
);

Wat Demo: ctz