bkramer added a comment. can we just use support::endian::read32le and support::endian::read32be instead of the casting magic? They do the same thing but should have no problem with implicit conversions in a ternary expression. https://reviews.llvm.org/D28669