All the elemental oxygen now in the earth's atmosphere was put there by photosynthetic plants and bacteria.
On a global scale, plants and other photosynthetic organisms have generated all of the oxygen in the air.