Can a zombie studio such as MGM be brought back to life? The answer is yes if Wall Street is willing to provide fresh money.

MGM, which only emerged from bankruptcy on Dec. 20, is now scheduling a new installment in its James Bond franchise for November 2012. Its newly appointed co-CEOs, Gary Barber and Roger Birnbaum, who also own Spyglass Entertainment (which, with a deal with Fox, competes with MGM), already have made a deal with Sony to distribute — and put up half the financing for Bond 23.

Raising the balance of the money is no problem because after a NewYork bankruptcy court wiped out all of MGM’s nearly $4 billion in debt, JPMorgan Chase stepped in and arranged for a fee a new $500-million line of credit for MGM. The bank can well afford to do so because it earned over $100 million in the fees it charged other banks for placing the earlier $3.7 billion loan that MGM had effectively defaulted on.

MGM’s financing roller-coaster ride over the past decade, if nothing else, illustrates how the insiders in Hollywood still manage to enchant outsiders on Wall Street. The MGM follies began in 2004, when its owner, Kirk Kerkorian, who had made a fortune buying and selling MGM, decided the time was ripe to sell it yet again. The principal asset he offered was its legendary library of 4,100 motion pictures and 10,600 television episodes. By licensing these titles over and over again to Pay-TV, cable networks, and television stations around the world, and selling DVDs from it, it had brought in roughly $600 million in 2003.

Extrapolating future library revenue in Hollywood requires more than simple math. For example, in the case of MGM, each of the 4,100 titles had its own contractual terms governing payments to partners, talent, guilds, and other parties. For example, the single most valuable component, the James Bond films, is half owned by the holding company of the Broccoli family. Just making these payments entailed issuing more than 15,000 checks per quarter. Not only did titles have different pay-out requisites, but their future revenue stream depended on factors specific to each movie, such as the age of its stars, its topicality, and its genre.

Sony had a strategic reason for wanting to control, if not own this library. It was engaged in a take-no-prisoners format war with Toshiba and Microsoft for the future of high-definition storage. Sony had its Blu-ray disc; Microsoft and Toshiba, had the competing HD-DVD format. Since its rivals had deep pockets and were offering huge cash inducements to studios — Paramount and Dreamworks got $136 million — to put their titles exclusively on the HD-DVD format, Sony needed a coup. It correctly calculated that by getting all the titles in the huge MGM library, together with its own library on its Blu-ray format, would give it a decisive edge. The problem was that Kerkorian wanted about $5 billion for MGM.

To accomplish this coup without risking much of its own capital , Sony put together a consortium of investors to do a leveraged buy out. Most of the equity financing came from Wall Street private equity funds. Sony itself, the insider, invested only $300 million of its own funds. Another $300 million came from the Comcast Corporation. For both these industry insiders, it was a no-lose situation. Aside from using the MGM titles to win the format war for Blu-Ray, Sony would get back all of its $300 million investment from the rights it was given to distribute MGM’s next two James Bond movies. Comcast would get back its investment because it was given the rights to show the library on its cable Pay Per View.

The outsiders did not fare so well. The four savvy Wall Street funds, Providence Equity Partners, Texas Pacific Group, DLJ Merchant Banking Partners, and Quadrangle Group, invested a billion dollars but they got only shares in MGM. The remaining $3.7 billion was borrowed from 200 banks in September 2004.

As it turned out, DVD revenues plummeted as Wal-Mart and other major retailers cut the price they were willing to pay on older titles after 2005. In the U.S. alone, MGM’s net receipts from DVDs fell from $140 million in its 2007 fiscal year (which ended March 31, 2008) to just $30.4 million in 2010. In addition, the revenue from the licensing to television, which is even larger than DVD sales, also fell as cable networks and television did not renew their multi-year output deals or cut the price.

As a result, MGM’s operating cash flow catastrophically fell from $418.4 million in 2007 to minus $54.2 million in 2010. In addition, it owed Fox Home Video $60 million for an "adjustment" in the DVD distribution contract it had taken over from Sony. And by Oct. 31, 2009, MGM, sinking in a sea of red ink, found itself unable to make its mandated interest payments on the $3.7 billion it stilled owed the banks.

As a result, MGM was heading towards bankruptcy. Sony and Comcast achieved their objectives and lost little, if any, money, but the Wall Street players lost almost all of their billion-dollar investment. For the banks, it was a disaster and they began unloading the frozen debt to hedge funds at 50 cents on the dollar or less. The hedge funds bought the debt, betting MGM could sell itself to another movie studios. They also lost that bet because as the library kept deteriorating in value, no studio would offer a satisfactory price.

Finally, in December 2010, the hedge funds and other creditors, with no hope of repayment, swapped their debt for shares in the bankrupt company. So MGM was once again debt-free and able to borrow money. Now thanks to its rescue by Wall Street, and half-billion dollar line of credit, it can produce James Bond movies again under its Ars Gratia Aris (Art for Art’s sake) motto — at least until it again runs out of money.