fn breakPatterns(a: usize, b: usize, context: anytype) void
fn breakPatterns(a: usize, b: usize, context: anytype) void { @branchHint(.cold); const len = b - a; if (len < 8) return; var rand = @as(u64, @intCast(len)); const modulus = math.ceilPowerOfTwoAssert(u64, len); var i = a + (len / 4) * 2 - 1; while (i <= a + (len / 4) * 2 + 1) : (i += 1) { // xorshift64 rand ^= rand << 13; rand ^= rand >> 7; rand ^= rand << 17; var other = @as(usize, @intCast(rand & (modulus - 1))); if (other >= len) other -= len; context.swap(i, a + other); } }