Evolution of how dinosaurs breathed at Near Events