97 honda civic Failed Smog?

I have a 97 honda civic dx.it failed the HC ppm and CO%…
Later my dad checked my car amd found a crack in the manifold. And the rotor had a piece broken and the oxygen sensor was not tight and and looked all messed up…
Do you guys think its because of these problems?
Help any advise would be really appreciated…
ALSO ANOTHER THING. The RPM was off…
15miles was like around 1945
25 miles was like 2376
The guy said that the 25 mile had to be in the same as the 15 mile one
Help…97 honda civic Failed Smog

Ideally the ones who fail it will also tell you why (in writing) if it is worth fixing it and how much it will cost to do the job.