As its financial problems worsened, the Weinstein Company desperately unloaded films throughout the winter and fall. The beleaguered indie studio sold three movies — “The Six Billion Dollar Man,” “Paddington 2,” and “The War With Grandpa” — for a combined $38.5 million, bankruptcy filings reveal. That cash was used by the studio to meet payroll obligations and keep the lights on while the Weinstein Company’s board of directors struggled to close a sale to a group of investors led by billionaire Ron Burkle and former Small Business Administration chief Maria Contreras-Sweet.

However, that deal collapsed this month and the Weinstein Company filed for bankruptcy on Monday, citing nearly $500 million in secured debt and unsecured obligations. Despite the sales, the company has less than $500,000 in cash. It has lined up a $25 million debtor-in-possession loan from Union Bank, and has lined up a $424.5 million stalking horse bid from Lantern Capital. That’s less than the $500 million that Contreras-Sweet and Burkle’s group were originally going to pay for the company.

The Weinstein Company has been teetering on the verge of collapse since October when bombshell reports in the New Yorker and the New York Times claimed that its co-founder Harvey Weinstein had abused and harassed dozens of women for decades. He has been fired from the company, but in the wake of the reports, producers scrambled to get their projects out of the studio.

“The Six Billion Dollar Man,” a sci-fi action movie with Mark Wahlberg, was sold to Warner Bros. in January for $7.2 million, filings reveal. “War With Grandpa,” a comedy with Robert De Niro, was picked up by its producer Marro WWG for $2.5 million in November. And “Paddington 2’s” domestic rights were sold to Warner Bros. for $28.8 million last fall, but the Weinstein Company only received $13 million of that figure. The rest went to its producer StudioCanal. Producers of films such as “Mary Magdalene” have tried to wrest their projects out of the studio, but have so far been unsuccessful. “Mary Magdalene,” a religious epic with Joaquin Phoenix, is listed as one of the Weinstein Company’s top unreleased pictures along with “Current War,” a Benedict Cumberbatch drama; “The Upside,” a Kevin Hart and Bryan Cranston dramedy; and “Hotel Mumbai.”