llvm-mc incorrectly encodes and decodes "msr pan, #imm" instructions. Only 1-bit immediate values should be valid. Currently 4-bit immediates are accepted.
echo "0x9f 0x42 0x00 0xd5" | llvm-mc -disassemble -triple=aarch64 -mattr=+v8.1a .text msr PAN, #2 $ echo "msr pan, #2" | llvm-mc -triple=aarch64 -mattr=+v8.1a .text msr PAN, #2