Taiwan Semiconductor Manufacturing (TSM -0.34%), popularly known as TSMC, has been in fine form on the stock market in the new year. In fact, shares of the semiconductor foundry giant have surged 27% year-to-date despite concerns that a slowdown in chip demand is likely to weigh on the company's performance, which its recent results have confirmed.

TSMC released its fourth-quarter 2022 earnings report on Jan. 12, 2023. The semiconductor bellwether reported robust year-over-year growth, but a closer look at the company's outlook suggests it is about to hit a major speedbump.

TSMC's results were mixed, but investors aren't worried

TSMC's revenue increased 27% year over year during the quarter to $19.9 billion, which was at the lower end of the company's guidance range. Earnings also jumped an impressive 58% year over year to $1.82 per share last quarter, which was better than Wall Street's expectations of $1.80 per share.

The Taiwanese giant expects revenue of $17.1 billion in the current quarter at the midpoint of its range. That points toward a decline over the prior-year period's revenue of $17.6 billion. The company's bottom line could also take a hit, as TSMC expects an operating margin of 42.5% this quarter, which would be lower than the year-ago period's figure of 45.6%.

CFO Wendell Huang said on the latest earnings conference call that TSMC's business was impacted by "end-market demand softness and customers' inventory adjustment." Management also added that the company's revenue is expected to decline in "mid to high single-digit percent over the same period last year in U.S. dollar terms" in the first half of 2023.

Surprisingly, TSMC stock shot up following its earnings report despite management's warnings of an imminent slowdown, and it is still heading north. The Taiwan-based foundry giant's outlook wasn't surprising, as customers were reportedly cutting orders amid weak demand for smartphones and personal computers. But it looks like investors aren't worried about the company's near-term performance. That may be attributed to management's observation that there are "initial signs of demand stabilization." More specifically, TSMC sees its revenue increasing year-over-year in the second half of 2023 on the back of a "healthy" recovery in the semiconductor industry.

Also, the fact that TSMC stock trades at just 14 times trailing earnings may have given investors another reason not to hit the panic button. The semiconductor bellwether isn't expensive despite its impressive growth, and appears to be a good value considering that it is cheaper than the S&P 500's price-to-earnings ratio of 19. Additionally, the company remains focused on the right area to ensure long-term growth.

The slowdown should be temporary

TSMC sees solid demand for chips made using its 3-nanometer (nm) process over the next three years. The company's 3nm chip supply remains fully utilized for 2023, as these chips will find their way into data centers and smartphones from its top customers, which include AMD and Apple.

Apple, for instance, will be using TSMC's 3nm chips in its 2023 iPhone models. Meanwhile, AMD's 3nm data center processors could go into volume production later this year based on the chipmaker's product roadmap. This explains why TSMC will be spending most of its capital expenditure on its advanced process nodes in 2023.

More specifically, the company has allocated 70% of its 2023 capital expenditure budget of $32 billion to $36 billion on advanced chip nodes (which are 7nm or smaller in size). These advanced nodes produced 54% of TSMC's total revenue in 2022, and they are likely to contribute a bigger chunk once customers start deploying 3nm chips, leading toward an acceleration in the company's growth.

Analysts anticipate TSMC will regain its mojo in 2024 with a 22% jump in revenue to $91 billion, following a flat performance in the current year. Moreover, its earnings are expected to increase by 21.5% a year for the next five years. So it would be a good idea for investors to continue holding shares of TSMC despite the near-term headwinds.

Also, accumulating TSMC could turn out to be a prudent long-term move given the company's attractive valuation -- this semiconductor stock is built for long-term growth thanks to the secular opportunity in its end market.