Octane does not affect potential energy level of gasoline. Octane affects how quickly the flame front propagates through the combustion chamber. Burning fuel raises the temperature of the gasses in the combustion chamber, increasing the temperature of the gasses in the combustion chamber increases the pressure those gasses exert on the walls of the combustion chamber (which includes the top of the piston), and it is the pressure on the top of the piston that pushes the piston down, which pushes on the rod, which pushes on the crank, etc. Since the flame front propagates slower, the maximum cylinder pressure may not be generated until well after the piston passes top dead center on the power stroke, which means the push on the top of the piston does not begin until after top dead center. Best power is delivered when the push begins just after the piston passes top dead center. If the push doesn't begin until 20* after top dead center, no power is generated for that 20* arc of crankshaft revolution. That is why higher octane fuels require advanced ignition timing to make power--the flame front needs more time to generate heat and pressure. In some engines, higher octane fuels simply don't burn as efficiently as lower octane fuels. It is the lower efficiency that results in lower engine output, not lower energy content of the fuel.