1. Contact your professor, you may have not done nearly as bad as you think. I recently did pretty bad on my immuno test ( I'm taking 7 classes) and I lost all sleep for a week because I thought I got like a 0 on a test and jepardized my acceptance. I got the exam back and got 73 ! Amazing what crazy things a severely sleep deprived mind can envision.
2. Contact the school, if you did indeed fail it. You need to be upfront, explain the situation to them and try to compromise - tell them why you failed it, what will you do about pre-req, such as retake and etc.
3. Good luck.