David Nemecek and Scott Greenberg spent countless hours across the table from each other this year, battling over the fine print buried deep in junk-rated companies’ debt documents.

Kirkland & Ellis’s Nemecek was representing companies in distress. Greenberg, from rival law firm Gibson Dunn & Crutcher, was on the other side, banding together investors owed billions of dollars to form what are known as cooperation groups and fighting attempts to short-change them in a turnaround.

The two, both 47, are at the forefront of an elite group of white-shoe lawyers and Wall Street advisers who are reshaping a major corner of finance by changing up the playbook for companies struggling with crushing debt.