def top31
import bend-collections@1.0.0.0/src/math/random/rand.bend as Randimport Base
import bend-collections@1.0.0.0/src/math/u64.bend as W
import bend-collections@1.0.0.0/src/math/w64.bend as X
83def top31(-S: Data, p: W.U64 & S) -> U32 & S:
84 (x, s) = p
85 (U32.shr(X.hi(x)), s)