Semgroup (SEMG - Get Report), one of the less likely victims of the credit crisis has emerged from a 2008 bankruptcy, posting strong stock gains that are fueled by takeover speculation and an energy sector rally.In July 2008, the energy trader and pipeline transporter 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 credit facilities that were key for the company's trading accounts, precipitating a bankruptcy. Last year, the company's chief executive Thomas Kivisto settled a complaint with the Securities and Exchange Comission on the firms 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 competitor pipeline player Plains All American Pipeline (PAA). 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. In 2011, Plains continued its hostile efforts for SemGroup in a series of takeover attempts rebuffed as "opportunistic" and "undervalued." In November, SemGroup rejected a $24 a share hostile bid by Plains, rebuffing an over $1 billion bid. Instead, the company has focused on asset spins as a way to raise capital and boost the value of its shares. In August, SemGroup announced it would raise $181 million by doing a public offering of Rose Rock Midstream (RRMS), which it IPO'ed a 41% stake of in December at $19 a share, raising $140 million. SemGroup also announced a sale of its SemStream businesses to NGL Energy (NGL) for $279 million in cash in November 2011. SemGroup has followed its post-bankruptcy planning on its own terms - but to be seen is whether spins and continued obstinacy to a takeover will curtail Plains from making a bid that SemGroup or its shareholders can't refuse. Since its November 2010 IPO, SemGroup shares have rallied nearly 14% to $28.40, bolstered by a near 10% year-to-date gain. However, after a series of spins, SemGroup may finally have gotten a full valution of its businesses, notes Deutsche Bank analyst Curt Launer in a Mar. 1 note. Based on M&A speculation and the company's expected earnings, Launer boosted his price target for SemGroup shares to $30, while maintaining a "hold" rating.