Optimization of high-order harmonic generation by optimal control theory: Ascending a functional landscape in extreme conditions