It seems International Business Machines (NYSE:IBM) is the technology stock everyone loves to hate. The company is under intense scrutiny from analysts and investors for its prolonged revenue declines and lack of a meaningful turnaround. For several quarters, management has pointed to the progress being made in core segments and how the company is steadily shedding its underperforming hardware businesses like semiconductors. However, the market still seems unconvinced.

After its recent earnings report, IBM confirmed its quarterly revenue dropped for a 13th consecutive quarter. It is not hard to realize why shares of IBM are down over 18% in the past two years.

IBM Chart

IBM data by YCharts

But the news is not all bad. Short-term traders may not have the patience to ride out this turnaround, but long-term investors have plenty of reason to believe there is light at the end of the tunnel.

First, the quarterly details
It is certainly true that quarterly numbers looked weak. IBM reported operating earnings of $3.84 per share on revenue of $20.81 billion. Both figures represent 13% year-over-year declines. Analyst forecasts called for $3.78 earnings per share and $20.95 billion in revenue. The reason why IBM was able to beat earnings expectations but miss on revenue is through it cost cutting and share buybacks.

Separately, the slowdown in emerging markets took its toll on IBM. Last quarter, revenue from the BRIC nations (Brazil, Russia, India, and China) declined 35%, or 18% adjusting for currency and divestments.

With these alarming declines, it is no surprise why IBM shares fell after reporting earnings. But here is what the market is missing.

Context is key
First, investors should recognize that IBM's declining revenue was due largely to the rising U.S. dollar and divestments. The negative impact of the strong dollar is a familiar theme being echoed by many global companies this earnings season. Moreover, IBM has sold off significant non-critical businesses -- recall that last year, the company sold its x86 server business to Lenovo for $2.1 billion, and its semiconductor business to GlobalFoundries.

Excluding these items, IBM revenue would have declined just 1% year-over-year for the quarter. At the very least, this indicates the company's core business is close to returning to growth.

This growth is within reach because of what the company calls its "strategic imperatives" -- high growth businesses like the cloud, data, and security. Collectively, the strategic imperatives grew revenue by more than 30% over the first two quarters of the year excluding the effects of currency and divestments. Cloud revenue, for example, soared more than 70% and reached an $8.7 billion annualized rate.

Cash flow and returns keep me in the stock
While the headline revenue and earnings numbers look bad, underneath the surface, IBM continues to do a very good job of generating cash flow. Free cash flow grew 23% through the first half of 2015 versus the same period last year. IBM expects full-year free cash flow to grow modestly from last year. This is a good sign that its shift to key businesses is working. Free cash flow growth will be critical to the company maintaining its aggressive cash returns.

IBM returned $4.7 billion to investors during the last quarter through $2.4 billion of dividends and $2.3 billion of share repurchases. As you can see, IBM has effectively reduced its shares outstanding over a long period of time.

IBM Average Diluted Shares Outstanding (Annual) Chart

IBM Average Diluted Shares Outstanding (Annual) data by YCharts

The stock pays a hefty 3.2% dividend yield and increased its dividend by 18% earlier this year. If it continues to grow its free cash flow, there should be plenty of room for future payout increases.

To me, the key takeaway is that while headline figures are disappointing, there is a long-term turnaround that remains on track. That is why I will continue to hold my IBM shares, happy to reinvest those growing dividends along the way.