What is the main function of cellular respiration?

to produce water
to gain energy for the cell
to produce carbon dioxide
to make oxygen for the cell