import struct import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).parents[1] / 'tools')) from a64_lift import Compiler, UnsupportedInstruction for words, reason in [([0x14000000, 0xd65f03c0], 'loop with unreachable return'), ([0x94000000, 0xd65f03c0], 'undeclared host call'), ([0x91000400], 'missing return'), ([0xd65f03c0, 0xd503201f], 'code after return'), ([0x9a010000, 0xd65f03c0], 'unsupported carry arithmetic'), ([0x9a810000, 0xd65f03c0], 'conditional select without defined flags'), ([0x3cc18020, 0xd65f03c0], '128-bit load without adjacent store'), ([0x3d800000, 0xd65f03c0], '128-bit store without adjacent load'), ([0x14000002, 0x3cc18020, 0x3d800000, 0xd65f03c0], 'branch into middle of copy')]: try: Compiler().compile(b''.join(struct.pack('