See e.g., this prior work in semmc: https://github.com/GaloisInc/semmc/blob/ac51247300a89023dfb5d9f5ef2c68201641a430/semmc/src/SemMC/Util.hs#L264-L284