Changed just 2 things in Binary Ninja's HLIL representation to get the Mersenne Twister initialize_state formula to match what's on Wikipedia:

seed = f * (seed ^ (seed >> (w-2))) + i;

w: word size (in number of bits). 32-2 = 30
f: is the constant 0x6c078965

Can you spot the 2 things? 🙂

#BinaryNinja #DynoWiper