&gt; Apparently a (uint32_t) shifted by 32 is license to become completely insane.<p>That&#x27;s easy to explain. The optimizer replaced the instruction with an undef [1], which has no live range. So it printed the value of some random register, which happened to be 0, 0x5a788cb0, or 0x54049be8.<p>[1]: <a href="http:&#x2F;&#x2F;llvm.org&#x2F;docs&#x2F;LangRef.html#undefined-values" rel="nofollow">http:&#x2F;&#x2F;llvm.org&#x2F;docs&#x2F;LangRef.html#undefined-values</a>