Optimizing the Code Rate of Energy-Constrained Wireless Communications With HARQ