public static uint[] zclip(uint[] r) { var n = r.Length; if (r[n - 1] != 0) return r; while (n > 1 && r[n - 1] == 0) n--; return r.Slice(0,n); }