JP Morgan devoted $9.3 billion to legal expenses last quarter, driving its net loss of $380 million. Its legal troubles took up 39% of its total revenue in the same period, by far the company’s largest single expense.

That’s right: The largest bank in the United States spends more money fighting and paying off legal and regulatory challenges than it does paying its staff, buying securities or paying rent on its 5,600 Chase retail bank branches.

What does your largest expense say about your business? Ideally, the biggest cost should get at the heart of what the firm does. Goldman Sachs’ largest expense was compensation and benefits for its (in)famous talent. Apple’s largest expense in its most recent quarterly report was on sales, largely new stores and employees. General Motors’ largest expense is building cars.

For the first time, the bank revealed its total expenditures on legal costs. Since 2010, JP Morgan has devoted $31 billion to legal problems, spending $8 billion on settlements and reserving $23 billion for future costs. That’s almost half of its net earnings ($57.5 billion) in the same period, keeping in mind some of those reserves can be returned to stockholders if settlements and legal fees turn out to be less than expected. The exhaustive list of all the civil and criminal investigations JP Morgan is dealing with—from Libor to the London Whale to the Madoff ponzi scheme—could lead to the largest bank fine in history, some $11 billion. That would be on top of the the $3.7 billion the company has already paid this year. Settlement talks are ongoing.

The bank avoided reporting losses of $932 million by saving $542 million less this quarter to cover the costs of future defaulted loans. This reflects an improving US economy—fewer people are defaulting on loans—but it also reflects a scramble at the bank to cover the costs of its near-constant run-ins with regulators and prosecutors. Those are costs its normal businesses just can’t cover. The financial industry has been more than happy to overlook JP Morgan’s law-breaking under Jamie Dimon as long as it has been profitable, but it may not take too many quarters of losses to change that tune.