Detection of CO_2, CO, and H_2 in the atmosphere of the warm sub-Saturn HAT-P-12 b