the gov't "loans" should be the same as the amount of equity obtained. For example, if the book value of the company is $100 , and the debt is $80 (so they need a loan of $80 to cover their debts), then the bailout will dilute all existing shareholders 80%.
Additionally, I think the government should be buying equity at a steep discount - something reasonable but not disastrous like 67%.