Change
// Initial state
// s0 should be s1, s0 from CS
// s1 should be s3, s2 from CS
ulong s0 = 0x0123456789ABCDEF;
ulong s1 = 0x0123456789ABCDEF;
to
// Initial state
string ram = "0123456789ABCDEF0123456789ABCDEF";
string str0 = ram.Substring(16).Trim();
string str1 = ram.Substring(0, 16);
ulong s0 = Convert.ToUInt64(str0, 16);
ulong s1 = Convert.ToUInt64(str1, 16);
in any of my LINQ scripts