​Which stock to buy now, Pfizer or Allergan?

Wouldn't it be super if investors can find gems from an unexpected investment wreckage? The aborted merger of Pfizer (PFE) and Allergan (AGN) is one fiasco where real gems-amid-the-wreckage could be an attractive opportunity.

So, here's a viable Plan B idea for investors who bet -- and lost -- on the merger that would have created the world's largest pharmaceutical company but got unraveled when the U.S. Treasury threw a surprise monkey wrench: Buy shares in both Pfizer, already one of the biggest drug companies, and Allergan, a global specialty drug and generic-drug maker. Both stocks have become more attractive now, assert some analysts, because the companies are expected to reposition to pursue avenues that could result in even better shareholder returns.

Part of the fresh optimism is new speculation on Wall Street that both companies in fact have other potential deals that could prove more profitable and lead to a pathway of greater growth. Last Thursday, the day after Pfizer announced the dismantling of the Allergan merger, shares of both companies climbed. Pfizer's stock closed at nearly $33, up 5 percent, and Allergan closed at nearly $245, up 3.5 percent (after diving 14 percent the day before). Pfizer closed on Monday at $31.91, down 1.8 percent, and Allergan at 228.46, down 3.2 percent.

Close watchers of Pfizer are convinced it will be on the hunt again for another quarry, having tried and failed to capture previous targets, including AztraZeneca (AZN), before putting together its merger plan with Allergan. Pfizer isn't at all desperate to do another acquisition, as some analysts suggest, but it's true that it was rumored to have shown an interest in going after GlaxoSmithKline (GSK) and Valeant (VRX) before the Allergan deal.

And Pfizer is expected to refocus on the idea of splitting its brand-name drug business from its generic and nonpatented drug division. Analysts believe if Pfizer moves toward another acquisition, it will make sure that that prospect would be more a "shareholder-friendly" deal. Pfizer's growth since 2000 was largely augmented by acquisitions, including Warner Lambert in 2006 and Wyeth in 2009.

"Pfizer's portfolio is unmatched in terms of breadth and depth in the global drug market," said Jeffrey Loo, equity analyst at S&P Global Market Intelligence, who has retained his "buy" recommendation on the stock. Pfizer shares are "trading below its peers, at 13.6 times his 2016 earnings estimate," noted Loo, so he thinks they're "attractively valued." Loo has a 12-month price target for Pfizer of $40 a share.

He expects Pfizer will "continue to pursue other acquisitions to supplement growth." No doubt, Pfizer has the cash and resources to expand through acquisitions. As of the end of December 2015, it still had $16.4 billion remaining in its share-buyback program. Even without the Allergan merger, Pfizer should see modest organic sales and earnings growth, said Loo, but 2016 will represent annual sales growth for the first time since 2010. And now that the merger is off, Loo expects Pfizer to expedite the split of its established pharmaceutical unit from its "innovative products" unit.

Loo is also retaining his buy rating on Allergan, with a price target of $310 a share. He expects it to pay closer attention to the pending $40.5 billion sale of its generic unit to Teva Pharmaceuticals (TEVA), originally expected to be completed by June. Loo figures that deal should provide Allergan significant financial flexibility for capital deployment, including acquisitions or stock buybacks.

"We continue to believe that Allergan has attractive growth prospects across its seven therapeutic areas," said Loo, pointing to 750 generic products and branded specialty pharmaceuticals that it markets in 60 countries. They include treatments for prostate cancer, oncology, women's aesthetics and health disorders, oral emergency contraceptives and incontinence.

Even after the scotched merger, "Allergan remains attractively valued at 14 times estimated 2016 earnings," said Loo. The stock deserves premium valuation, added the analyst, because Allergan is growing faster than the industry average, with leading market positions in aesthetics, led by Botox, plus eyecare and markets within the Alzheimer's and gastrointestinal areas.

Treasury's new ruling for tax inversions "doesn't change our $38 (a share) Pfizer fair value estimate," and the breakup fee of $400 million Pfizer will pay Allergan for terminating the $160 billion merger "should not affect Pfizer's valuation," said Damien Conover, director of health care equity research and equity strategy at Morningstar. "We believe Pfizer's 'wide-moat' before the Allergan deal remains intact, and Pfizer will probably now move move quickly toward a split of the company," said Conover.

He also remains positive toward Allergan's valuation. "We continue to view the company as undervalued at its stand-alone price and think its moat is wide, buoyed by a strong and differentiated portfolio along with a solid pipeline," he added. Conover said his fair value estimate for Allergan will drop to $370 a share on a stand-alone basis, from $430 estimate with the merger.

Allergan CEO Brent Saunders said after the Pfizer merger's dismantling that Allergan is "well able to deliver sustainable growth on its own" and has strong brands and a promising drug pipeline. Originally named Watson Pharmaceuticals, which had acquired Swiss generic-drug maker Actavis in 2012, the company changed its name to Actavis in January 2013, and then changed it again in 2015, to Allergan.

It was then ranked the third largest in generics, with the added expertise in producing niche off-patent specialty drugs. Allergan has since made several acquisitions to expand its specially drug line, including Warner Chilcott in 2013 for $5 billion and Forest Labs in 2014 for about $25.4 billion.

Analysts believe Allergan will again pursue acquisitions to expand, particularly its branded products business. Numerous previous acquisitions have "significantly changed its product offerings from primarily generic products to a majority of branded drugs," noted Loo. Most analysts believe Allergan will continue on the merger path aggressively, without necessarily avoiding or turning down offers from bigger drug companies for mergers similar to the failed deal with Pfizer -- sans the inversion aspect.