The good news is that if you file bankruptcy, you will, most always, not lose your retirement savings.  The federal bankruptcy exemption laws, and most state exemption laws,  protect your retirement savings from going to pay your creditors. A few years ago, the United States Supreme Court ruled that the retirement exemption is very broad and applies to most all types of retirement plans. This was great news for consumers. When you meet with an attorney, be sure to disclose all types of retirement plans that you currently have. If you are considering bankruptcy, before you withdraw any funds from a pension plan or 401k, you should always consult with an attorney.
As with any issue involving bankruptcy or your finances that you are concerned about, I urge you to contact the nearest, well qualified bankruptcy attorney to answer your questions.