After a contentious eight-month process that involved settlements with lenders, creditors and the U.S. Department of Justice, as well as more than 1,600 lawsuits suing the pharmacy for its role in the opioid crisis, Rite Aid is slated to exit Chapter 11 bankruptcy protection soon after a New Jersey bankruptcy judge approved the company’s bankruptcy plan in late June.

The case netted Kirkland & Ellis more than $40 million in legal fees through the end of April, according to fee applications filed by the law firm. The sum represents an above-average haul for Kirkland, which handles both complex, mega-bankruptcies as well as smaller, pre-packaged Chapter 11s that generate less than $10 million in fees. In the Rite Aid bankruptcy, the firm’s blended rate for April was $1,172 hourly for attorneys.