                        (\m i -> if m == 'X' then i else charIntToBool m)
                        mask
                        (intToBits val)
                    )
           in run (Map.insert mem newVal acc) mask as
        True ->
          let msk = a =~ "[X,0-9]+" :: String
           in run acc (replicate 28 'X' <> msk) as

    runV2 acc mask = \case
      [] -> acc
      (a : as) -> case matchTest (mkRegex "^mask") a of
