In July 2008, SemGroup went bankrupt after it incurred a $3.2 billion trading loss on futures contracts tied to the then-rising energy market. When lenders found out about the loss, they pulled key credit facilities to the company's energy trading accounts, precipitating a bankruptcy.

Last year, the company's CEO Thomas Kivisto settled a complaint with the Securities and Exchange Commission on the firm's disclosure during its waning days, paying a $1.3 million fine without admitting any wrongdoing.

After entering bankruptcy and shuttering its trading unit, SemGroup received multiple takeover offers from Plains All American Pipeline.

The first hostile takeover bid for SemGroup came from Plains in March 2010 at a value of $17 a share. At that time, SemGroup was intent on using an initial public offering to continue its post-bankruptcy recovery and its board rejected Plains' offer. The company instead went public in November 2010, pricing shares at over $24 on the first day of trading.

Plains continued its hostile efforts for SemGroup in a series of takeover attempts in 2011, all rebuffed by SemGroup as "opportunistic" and "undervalued."

As some investors waited for a takeover offer from Plains All American that shareholders couldn't refuse, management upped earnings expectations for the company, forecasting 2012 earnings before interest, taxes, depreciation and amortization at up to $135 million.

For more on oil and gas M&A, see 5 energy deals not to be forgotten in 2012 and Chesapeake Energy's flurry of asset sales.

See 10 once bankrupt companies primed for a turnaround for other recovering companies like SemGroup.

-- Written by Antoine Gara in New York

If you liked this article you might like

AK Steel Holdings, Cara Therapeutics, Nucor, Smart and Final: 'Mad Money' Lightning Round

Bull's Death Is Greatly Exaggerated: Cramer's 'Mad Money' Recap (Tuesday 6/20/17)

Scotts Miracle-Gro, AMN Healthcare Services, SemGroup: 'Mad Money' Lightning Round

Bank Earnings Are at a Critical Turning Point: Cramer's 'Mad Money' Recap (Wednesday 4/12/17)

Perilous Reversal Stock: Semgroup (SEMG)