Taiwan Semiconductor Manufacturing Company (NYSE:TSM) and Qualcomm (NASDAQ:QCOM) are two of the largest publicly traded chip companies in the market. TSMC, the larger of the two with a market capitalization of nearly $200 billion, serves as a contract manufacturer for a wide range of customers -- including Qualcomm. 

Qualcomm, the smaller of the two, is both a chip designer as well as the owner of a large set of wireless patents that it licenses out and has, historically, profited handsomely from. 

QCOM Chart

Data source: QCOM data by YCharts.

Year-to-date, shares of both TSMC and Qualcomm are down, though Qualcomm's 21.1% decline handily outpaces TSMC's. Given the downturns in each, investors might be wondering which of the two stocks is the better buy today. Let's compare them.

Broader markets

TSMC serves a wide range of end markets (though the manufacture of smartphone chips for its clients is its largest business), while Qualcomm's business depends almost entirely on the smartphone market. Both companies, in addition to trying to strengthen their positioning in the smartphone market, are trying to diversify beyond that market.

TSMC's advantage is that it's a contract chip manufacturer, and the world's largest and most successful one at that. This means that many companies looking to compete for the same growth opportunities (e.g. high performance computing, graphics processors, Internet of Things) will likely ask TSMC to build their chips and TSMC doesn't have to care which ones are successful as long as the successful ones are TSMC customers. 

Qualcomm, on the other hand, designs its own chips and is responsible for selling them to customers. If Qualcomm is successful, then it potentially stands to profit more from any one segment than TSMC does because it'll get paid more for its chips than TSMC would as a contract manufacturer. If Qualcomm isn't successful, though, then it's just burned a lot of research and development and marketing efforts for a disappointing return. 

Moreover, while both TSMC and Qualcomm are going after increasingly diverse markets, TSMC has the edge here as it can go after many more markets than Qualcomm could hope to by virtue of its business model of building chips for everyone. 

If you're looking for the more diversified/less risky chip manufacturer, I'd say that the winner here is TSMC.

Growth rates and profitability

Over the last few years, TSMC's growth rate has handily outpaced Qualcomm's: 

QCOM Revenue (Annual YoY Growth) Chart

Data source: QCOM Revenue (Annual YoY Growth) data by YCharts.

TSMC's financial performance has, for the most part, outperformed the broader chip industry thanks to market share gains, while Qualcomm's business has struggled mightily. 

Now, to be fair to Qualcomm, its chip business has actually done quite well. During its last fiscal year, Qualcomm's chip business actually enjoyed 15% year-over-year revenue growth as well as a 400 basis point growth in earnings before tax. Unfortunately, while Qualcomm's chip business enjoyed significant growth, its wireless technology licensing revenue plummeted 36% as major customers stopped paying pending the resolution of the bitter legal battle between Qualcomm and Apple (NASDAQ:AAPL), more than offsetting the good news for Qualcomm's chip business. 

But, since Qualcomm operates in both the chip business and the wireless technology licensing business, TSMC has delivered superior revenue growth. 

In terms of profitability, it's not even close. TSMC's operating income over the last 12 months has come out to nearly three times Qualcomm's: 

QCOM Operating Income (TTM) Chart

Data source: QCOM Operating Income (TTM) data by YCharts.

In terms of pure chip profitability, TSMC wins hands down, something that's becoming plainer as Qualcomm's highly lucrative licensing business comes under pressure. So, if we're looking at profitability today and in the near-future (since it's unclear when Qualcomm's wireless technology licensing business will get back on track -- if it ever does), then TSMC is the clear winner.

Stock price appreciation opportunity

While it's obvious that TSMC is, today, the much more profitable company with better growth rates, I think that for investors willing to gamble a little, Qualcomm stock could have significantly better upside.

Things are, for the most part, going right for TSMC; its future business and stock price performance depends on it continuing to execute as it has in terms of technology development and customer acquisition as well as on the underlying growth of the markets that it participates in. 

TSMC's story is pleasantly straightforward and as long as it doesn't really mess up or the overall chip market doesn't implode, the trend should be up for TSMC. 

Qualcomm, on the other hand, could go either way. If Qualcomm wins its legal battle against Apple and Apple is forced to pay Qualcomm back all the money that it hasn't been paying and is forced to pay Qualcomm near what it was paying before, then Qualcomm's revenue growth will accelerate and investors should see a substantial step up in the company's profitability.

More importantly, a successful outcome for Qualcomm would cement, once and for all, the viability of Qualcomm's highly lucrative licensing business. Not only would Qualcomm's profitability surge, but investors may be willing to pay an even richer multiple for the stock now than they were previously because of the peace of mind that they'd now feel. 

On the flip side, if Qualcomm's licensing business is as some fear, destroyed, and Qualcomm winds up entitled to a mere fraction of what it had once been entitled to from Apple and other smartphone makers, then that'd probably mean even lower profitability for Qualcomm and, yes, an even lower stock price from here. 

So, if you're looking for the safer stock, TSMC is the way to go, but if you're willing to take a significant risk for a potentially significant reward, then Qualcomm is the way to go. Which stock you choose from these two, then, depends entirely on your personal risk profile.

Ashraf Eassa owns shares of Qualcomm. The Motley Fool owns shares of and recommends Apple. The Motley Fool owns shares of Qualcomm and has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool has a disclosure policy.