Formation and decomposition of nitrides under ion bombardment