Algorithms for Low-Energy Code Compression in Performance and Memory Constrained Embedded Systems