Thermal decomposition of pyrite