A way to force the compiler to correctly order the instructions is to use std.mem.doNotOptimizeAway but you must be sure that the CPU does not reorder them.
See: How to use std.mem.doNotOptimizeAway?
A way to force the compiler to correctly order the instructions is to use std.mem.doNotOptimizeAway but you must be sure that the CPU does not reorder them.
See: How to use std.mem.doNotOptimizeAway?