up to a store-passing bug, with a hack that assumes ptrs passed to prims