The last option.
Plants absorb carbon dioxide from the atmosphere, water from the soil and other nutrients also from the soil - salts containing nitrogene, potassium, sulphur, etc. They use water and carbon dioxide to produce sugar through photosyntesis.
Decomposition is the reaction that converts any organic compound back into inorganic compounds - water, carbon dioxide and salts containing nitrogene, potassium, sulphur, etc. So it's basically the opposite.
So photosyntesis uses carbon dioxide as a reactive and take it from the atmosphere, whereas decomposition generates carbon dioxide as a product and releases it to the atmosphere.