Lam Research (LRCX 2.15%), a semiconductor processing equipment company, released its latest earnings on Oct. 19. There was some bad news in the report that could eventually weigh down the stock in 2023. However, the company also revealed several compelling reasons why this company should outperform the market over the long term.

Here are two reasons you might want to sell the stock, but two much better reasons to buy.

Sell reason No. 1: New U.S. sales restrictions to China

On Oct. 7, the U.S. Department of Commerce released new rules restricting U.S. companies from exporting semiconductor technology to China, including wafer fabrication equipment (WFE) and related parts and services.

Lam CEO Tim Archer estimated that the financial impact for 2023 from the China restrictions would be between $2 billion and $2.5 billion, or about 13% of Lam's annual revenue.

To add insult to injury, the loss of China's business will also negatively impact gross margin in the current quarter, as the region contained more profitable revenue than the current business mix.

Sell reason No. 2: Rapid deterioration in demand

Personal computer and smartphone manufacturers are building and shipping fewer products amid reduced demand and worsening consumer sentiment, creating a memory chip supply glut.

As a result, memory chip manufacturers like Micron sharply cut production and plan to significantly reduce capital spending in 2023. Since most chipmakers' capital spending goes toward WFE purchases, it is terrible news for Lam, as the memory segment was its most significant source of revenue at 52% of systems revenue in the third quarter.

During Lam's third-quarter earnings call, Archer gave preliminary estimates for 2023. The company expects the WFE market to be down more than 20%, with memory market woes responsible for a large portion of the decline. As a result, investors can expect the stock to be volatile in 2023, perhaps with an additional downside.

Buy reason No. 1: Service revenue from the installed base can soften sales declines

Lam's installed WFE base is approaching 80,000 chambers in the field; a large installed base is necessary for driving strong performance in its Customer Support Business Group (CSBG).

The CSBG provides maintenance and improvement solutions such as system uptime or availability optimization, throughput improvements, defect reduction, yield enhancement, and technology upgrades throughout the equipment lifecycle.

Lam's customers will often use chip downturns for maintenance or optimizing capital efficiency through upgrades to existing tools. And CSBG helps them accomplish those goals. So, in addition to benefiting its customers, the increased business for CSBG helps buffer Lam against WFE spending downturns. 

CSBG's business generated approximately $1.9 billion in revenue during the September quarter, or 37% of Lam's total revenue. The best part is that the more its installed base grows, the more resistant the company becomes to downturns in its WFE business.

Buy reason No. 2: Trends supporting Lam's long-term growth remain intact

Lam is a market leader in deposition and etch, two crucial and necessary processes for manufacturing smaller, faster, cheaper, and more power-efficient semiconductors. Many modern marvels like cloud computing, 5G, the Internet of Things, artificial intelligence, mobile devices, high-performance computing, self-driving cars, augmented reality, and more would be impossible without the improved performance from semiconductors that Lam's tools enable.

People's demand for the newest devices and the latest technology means more advanced logic and memory chips are needed, driving additional demand for Lam's services and growing its revenue.

Lam grew annual revenue by 18% to $17.2 billion at the end of June 2022, the end of its fiscal year. And according to management consultant McKinsey, the semiconductor market should grow 6% to 8% annually from $600 billion in 2021 to $1 trillion in 2030. So, the company is today outgrowing the overall semiconductor market.

Lam is an attractive pick for long-term investors

The stock trades at a price-to-earnings (P/E) ratio of 11.06 compared to the semiconductor equipment-wafer fabrication industry's P/E of 13.44, and below its median P/E ratio for the last 10 years of 18.98. As a result, most investors would consider the stock undervalued, especially since the company is coming off strong quarterly results that beat analysts' estimates on the top and bottom lines.

It might help your investment returns if you considered buying this stock with at least a three-to-five-year investing time horizon, although you should be prepared to weather some market turbulence over the short term.