Optimize away unused functions and registers