Musk paid 44B for Twitter.
This was with some loans and some equity sold.
Generously, Twitter was worth half what he paid, 22B at the time he took over, given the decline in the market from when the Twitter tender offer was made.
$13B in loans $7.1B from equity investors (did they have a liquidation preference?)
How much has he degraded the value by scaring away all the advertisers?
You'd have to find some way of restructuring the company to pay the creditors. In the most simplified approach, the most likely the only way of doing that is to sell the company. If the company sold for more than 13Bn (perfectly possible, although not hugely likely given the damage he's done) then anything above that would go to Elon and his equity investors, but we'd be talking about them walking away with close to nothing. But it's also perfectly possible that Elon just steps in and buys the 13Bn debt and continues to run the company.