
Introduction
Super Mario 64 has a heavily overcomplicated RNG, ably explained here by Pannenkoek.
I thought it might be interesting to implement it.
Challenge
Implement the RNG function, except for the two special cases.
Input and output are both 16-bit integers.
The standard C implementation is ...