Please notice that the implementation of std.mem.doNotOptimizeAway uses an asm block, contrary to your comment above.