Pyrolysis of flame retardants and fire protected polymers