-extern void init_rand(struct frand_state *);
-extern void init_rand_seed(struct frand_state *, unsigned int seed);
+static inline uint64_t __rand64(struct taus258_state *state)
+{
+ uint64_t xval;
+
+ xval = ((state->s1 << 1) ^ state->s1) >> 53;
+ state->s1 = ((state->s1 & 18446744073709551614ULL) << 10) ^ xval;
+
+ xval = ((state->s2 << 24) ^ state->s2) >> 50;
+ state->s2 = ((state->s2 & 18446744073709551104ULL) << 5) ^ xval;
+
+ xval = ((state->s3 << 3) ^ state->s3) >> 23;
+ state->s3 = ((state->s3 & 18446744073709547520ULL) << 29) ^ xval;
+
+ xval = ((state->s4 << 5) ^ state->s4) >> 24;
+ state->s4 = ((state->s4 & 18446744073709420544ULL) << 23) ^ xval;
+
+ xval = ((state->s5 << 3) ^ state->s5) >> 33;
+ state->s5 = ((state->s5 & 18446744073701163008ULL) << 8) ^ xval;
+
+ return (state->s1 ^ state->s2 ^ state->s3 ^ state->s4 ^ state->s5);
+}
+
+static inline uint64_t __rand(struct frand_state *state)
+{
+ if (state->use64)
+ return __rand64(&state->state64);
+ else
+ return __rand32(&state->state32);
+}
+
+extern void init_rand(struct frand_state *, int);
+extern void init_rand_seed(struct frand_state *, unsigned int seed, int);