How do i generate IR when building an executable

The answer is in my first linked topic:

For the full explanation take a look at the linked answer.

There is no step that generates something that looks like Zig source code again, because it would be an unnecessary step / going backwards, it may even be difficult to generate such a thing without creating something that is a bit of a lie (In the sense that abstractions lie), it might be possible to generate the “monomorphized” version, but still that would probably result in an explosion of code size and ultimately the AIR is always more faithful towards what is going on, because it’s the representation that is actually used.

Personally I think @compileLog together with assertions is already sufficient to gain the necessary insight into what is happening at comptime. So basically I would say use programming to ensure that the things you wanted to happen, do happen. Via checking types and using @compileError if they are wrong.