As to why llvm didn't optimize out the variable and its corresponding function call completely I can only guess.
But a good one might be that due to the fact that llvm otimizes on a basis that the a code section is "inconsequential code" we can defere that the code has meaning,
atleast to llvm, and that optimzing it out would change the functionalty of the program (and also what it effects).
One guess on what that effect might be is that llvm has picked up on that our code can generate an overflow error, which in-turn generates a interrupt in the cpu.
Getting rid of this would change what the program actually does and is there not allowed to be removed.
*/
*/
//
//
// B) Fix the code so that you don't get an error.
// B) Fix the code so that you don't get an error.