If they're casting to unsigned long as you wrote, there's nothing unspecified. The result of the cast is implementation-defined, and the resulting integer obeys the laws of integer comparison. LLVM's IR is just broken and unable to represent this right, so it applies ptr rules.
This Tweet was deleted by the Tweet author. Learn more

