Greatest Energy Output Reaction to Atmosphere Air
this is a way too generalized question. you certainly need experimental data or extensive screening to make sure you are on the top of the volcano plot. have you heard the term adiabatic flame temperature? The ratio of inert to gasoline/fuel is a determining factor to get high combustion energy. For example the adiabatic flame temperature for methane is higher for a mixture of methane and air with 5-15 mol% methane. 5-15 mol% methane can ignite without any external source of fire.

Please see the attached link to compare fuels according to their energy density:  http://en.wikipedia.org/wiki/Energy_density

And for your question you can't have two variables to optimized with one equation, either you have to specify the chemical X or you have to specify what is the output energy of this process. If you know the chemical X with it's thermodynamic property than using basic heat balance equation you can calculate the output energy.