Compiler Support For Long-Life, Low-Overhead Intermittent Computation On Energy Harvesting Flash-Based Devices