The stock market fared terribly in the first half of 2022 thanks to multiple headwinds that seem to have become stronger as the year has progressed.

From Russia's war on Ukraine to rising interest rates to surging inflation and now the possibility of a recession, investors have had several reasons to flee the stock market so far this year. The S&P 500 has declined 20%, while the tech-laden Nasdaq-100 Technology Sector index has witnessed a severe drop of 33%. But investors shouldn't forget that the stock market has delivered solid average returns over the past decade.

As such, it would be a good idea to buy some top stocks before they start taking off in the second half of the year thanks to some solid catalysts.

A new iPhone could give Apple a nice boost

Smartphone sales may be dwindling this year, but that hasn't kept Apple (AAPL 0.56%) from increasing its sales thanks to healthy demand for its latest iPhones. The tech giant had shipped 56.5 million iPhones in the first quarter of 2022, a year-over-year increase of 8% as per market research firm Canalys.

Apple grew even though global smartphone shipments contracted 11% during the quarter. What's more, the company increased its share of the global smartphone market to 18% in Q1 from 15% in the prior-year period. It now looks like Apple is expecting robust iPhone sales growth in the second half of the year.

Contract electronics manufacturer Foxconn, which assembles the iPhones, recently raised its full-year outlook, citing healthy smartphone demand. The Taiwanese company pointed out that its sales in June were up 31% year-over-year on account of improving demand, and added that its third-quarter revenue could witness significant year-over-year growth.

The developments at Foxconn aren't surprising, as Apple is about to start the production of its next iPhone soon. Apple usually refreshes the iPhone lineup in September, and the trend is expected to continue in 2022. This explains why Foxconn is confident of delivering robust growth in the third quarter, and that indicates that Apple may be looking at increasing its production.

A bump in iPhone production isn't out of the picture. Daniel Ives of Wedbush Securities estimates that there are 240 million iPhones that are around three and a half years old now, so the next iPhone could set the sales registers ringing and give Apple a nice boost. With the stock trading at 22 times trailing earnings following its 20% drop in 2022, now looks like a good time to buy Apple -- it is cheaper than the Nasdaq-100 index, which has an average earnings multiple of 24.6.

AMD has a new ace up its sleeve

Advanced Micro Devices (AMD 2.30%) stock has shed half of its value in 2022. But investors looking for a top growth stock on the cheap have a great opportunity to buy AMD right now, as it is trading at just 27 times trailing earnings, compared to its five-year average earnings multiple of 104. Even better, the forward earnings multiple of 17 suggests that its earnings could grow impressively over the next year.

A big reason why AMD's growth could pick up the pace in the second half of the year and beyond is the launch of its new data center server processors. AMD's fourth-generation EPYC server processors, based on a 5-nanometer (nm) manufacturing process codenamed Genoa, will hit the market in the fourth quarter.

AMD claims that these new server processors should deliver strong performance gains over the current-generation chips. For instance, the top-of-the-line Genoa processor is expected to be at least 75% faster than the current-generation chip as far as enterprise performance while running Java applications is concerned.

More importantly, AMD's new server processors should help it take more market share away from Intel (INTC -11.31%), which is the dominant player in this space. A big reason why that could be the case is that Intel's next-generation Sapphire Rapids server processors have been delayed once again. Chipzilla was originally supposed to release its 10nm Sapphire Rapids server chips last year, but it has run into a couple of delays.

Had Intel released its 10nm server chips on time, it would have kept AMD from extending its technology lead in the server processor market. But that's not going to be the case, as the Sapphire Rapids processors will witness a ramp in volume production in 2023. So AMD could continue stealing server market share from Intel.

Mercury Research estimates that it controlled 11.6% of the server CPU (central processing unit) market in the first quarter of 2022. That number is expected to increase to 19% this year, as per Bank of America, and head toward 35% in the long run.

Success in data centers is going to be a critical growth driver for AMD in the long run, and it is one of the reasons why analysts expect its earnings to grow at an annual rate of 28% for the next five years. That's why buying the stock right now looks like a no-brainer, as it could step on the gas in the second half and sustain that momentum in the long run.