def uint64n_pick
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
159def uint64n_pick(~S: Data, ~next: S -> W.U64 & S, s: S, +n: W.U64, pow2: Bool) -> W.U64 & S:
160 match pow2:
161 case True{}:
162 mask(S, n, next(s))
163 case False{}:
164 lemire_first(~S, ~next, n, draw(S, n, next(s)))