Are you using a buyer's agent to assist with your purchase, or are you buying a For Sale By Owner without the help of an agent?
If you have an agent, they should have used one of the FAR or FAR-BAR purchase contracts, which do allow for contingencies for inspections, financing, appraisals (if you included the appraisal addendum).
Did you write the offer As Is with Right to Inspect or is there a repair limit set in your contract for repair issues?
If you are working with an agent, talk to him/her as most of your questions will most likely be covered in your contract terms.
If you wrote up on offer on a big box store purchase form without the assistance of an agent, I would suggest consulting with a local real estate attorney asap to determine what your options are at this point in time.