mem: mark all functions as PURE