Profiling Driven Computation Reuse: An Embedded Software Synthesis Technique for Energy and Performance Optimization