In the summer of 2012, five American technology companies bid on a project for a demanding new client: the CIA. The spy agency was collecting so much information, its computers couldn't keep up. To deal with the onslaught of data, the CIA wanted to build its own private cloud computing system—an internal version of the vast fleets of efficient, adaptable servers that run technically complex commercial services such as Netflix (NFLX). For the agency, the power of the cloud was tantalizing. "It is nearly within our grasp to compute on all human-generated information," the CIA's chief technology officer, Ira "Gus" Hunt, told a gathering of industry leaders earlier that year, calling it "high noon in the Information Age." For the bidders, more was at stake than a piece of the lucrative federal IT market. Whoever won the 10-year, $600 million contract could boast that its technology met the highest standards, with the tightest security, at the most competitive prices, at a time when customers of all kinds were beginning to spend more on data and analytics.

Behind this week's coverBehind this week's coverIBM (IBM) was one of two finalists. The company would have been a logical, even obvious, choice. Big Blue had a decades-long history of contracting with the federal government, and many of the breakthroughs in distributed computing can be traced back to its labs. The cloud was a priority and a point of pride. In 2012, IBM's new chief executive officer, Virginia Rometty, used her first speech to shareholders to describe big data as a "vast new natural resource" that would fuel the company's growth for a decade.

On Feb. 14, 2013, the CIA awarded the contract to (AMZN). The e-commerce company, a pioneer in offering cloud computing services to corporate customers from Nokia (NOK) to Pfizer (PFE), had persuaded the spymasters that its public cloud could be replicated within the CIA's walls. Amazon had been bleeding IBM for years—its rent-a-server-with-your-credit-card model was a direct threat to IBM's IT outsourcing business—but this was different. Amazon beat IBM for a plum contract on something like its home turf, and it hadn't done so simply by undercutting IBM on price. IBM learned that its bid was more than a third cheaper than Amazon's and officially protested the CIA decision.

It would have been better to walk away. As the Government Accountability Office reviewed the award, documents showed the CIA's opinion of IBM was tepid at best. The agency had "grave" concerns about the ability of IBM technology to scale up and down in response to usage spikes, and it rated the company's technical demo as "marginal." Overall, the CIA concluded, IBM was a high-risk choice. In a court filing, Amazon blasted the elder company as a "late entrant to the cloud computing market" with an "uncompetitive, materially deficient proposal." A federal judge agreed, ruling in October that with the "overall inferiority of its proposal," IBM "lacked any chance of winning" the contract. The corporate cliché of the 1970s and '80s, that no one ever got fired for buying IBM, had never seemed less true. IBM withdrew its challenge.

No single deal encapsulates a 103-year-old company with a market capitalization of $185 billion. But the CIA butt kicking is a microcosm of larger problems IBM is having as it struggles to adapt to the cloud era, in which clients large and small rent technology cheaply over the Internet instead of buying costly fixed arrays. Under Rometty's leadership, revenue has declined for eight consecutive quarters, a period when most of corporate America has flourished. In January, after a year in which IBM was the only company in the Dow Jones industrial average whose shares lost value, Rometty and her top executives turned down their annual bonuses, worth in her case as much as $8 million. (Rometty, 56, who goes by Ginni, declined to be interviewed for this article.)

IBM has three core businesses: services, software, and hardware. When times are good, they work in concert. When, for example, it recommends that a customer of its consulting business enter a foreign market, it supplies the servers and the applications that run on them and charges for the system's upkeep. In the same way, a decline in one of these businesses can hobble the whole company, a destructive spiral IBM is fighting to break. As more customers get their computing done cheaply in the cloud, IBM is selling less hardware, which imperils its high-margin software products. And any perception that IBM is adrift threatens its ability to advise clients on anything at all.

Much of what is wrong stems from something IBM is doing "right": steadily increasing its adjusted earnings per share, a measurement Wall Street adores. In 2010, Rometty's predecessor, Sam Palmisano, pledged that per-share earnings would reach $20 in five years, a plan called Roadmap 2015. In interviews, and even in public Internet posts, employees refer to the plan bitterly as Roadkill 2015. To make earnings rise while revenue is falling, Rometty has cut costs, sold business lines, fired workers, figured out ways to lower IBM's tax rate, bought back shares, and taken on debt. Of the 25 analysts tracked by Bloomberg, nine predict that IBM will indeed hit the $20 target. The question is what type of company Rometty will have left when she gets there.
A technology company doesn't survive for a century without an ability to reinvent itself—sometimes with foresight, sometimes on the brink. Founded in 1911 as the Computing-Tabulating-Recording Co., the outfit that would become IBM sold accounting machines and punch-card systems and survived the Great Depression by servicing the growing federal government. IBM was bold, willing to take huge bets on the future. It became a behemoth by creating and dominating the mainframe computing market in the 1960s, and then, in 1981, it ignited the desktop revolution with the introduction of the IBM PC.

By 1990 the Armonk (N.Y.) company had almost 400,000 employees—and acted like it, reacting lethargically as nimbler competitors commodified the industry. Near bankruptcy and losing $8 billion a year, it brought in its first outside CEO, Louis Gerstner Jr., a former American Express and RJR Nabisco executive, to orchestrate a turnaround. Rejecting calls to dismantle the IBM empire, Gerstner shed declining products, slashed tens of thousands of jobs, and built a consulting unit within IBM. Gerstner titled his memoir of the time Who Says Elephants Can't Dance?

On retiring in 2002, Gerstner handed the top job to Palmisano, an IBM lifer who dramatically expanded the bet on software and services and against personal computers. (Palmisano is currently an adviser to Bloomberg LP, which owns Bloomberg Businessweek.) With margins on desktops and laptops melting away, Palmisano sold the PC business to China's Lenovo, shortly after buying the consulting division of PricewaterhouseCoopers for $3.5 billion. The job of integrating the acquisition into IBM's bureaucracy fell to an up-and-coming executive: Rometty, a Chicago native who'd joined IBM in 1981, two years out of Northwestern University. She was credited with making the operation thrive, as corporate customers overwhelmed with the Internet were only too happy to sign fat, recurring contracts with IBM to take IT problems off their hands. Over the next decade software and services would grow to a full 80 percent of revenue. The hardware division (whose chief, Robert Moffat, pleaded guilty to insider-trading charges in 2010) was understood to form a smaller but still essential arc in the IBM circle of businesses.

That was the IBM Rometty inherited in October 2011, when Palmisano named her the company's first female CEO. It seemed like a golden moment. IBM was celebrating its centennial with record sales, record profits, and a record share price. An artificial-intelligence project called Watson hit the publicity jackpot by beating human champions on Jeopardy! And in November, IBM received the ultimate financial benediction: Warren Buffett revealed he had broken his rule of not investing in technology stocks with the purchase of a 5.5 percent stake in IBM for more than $10 billion. Buffett liked how entrenched the company had become in the world's IT departments; he said Big Blue was like an auditor or a law firm—really difficult to break up with. He especially liked the road map Palmisano had pledged before stepping down. "They have this terrific reverence for the shareholder, which I think is very, very important," Buffett said on CNBC.

The honeymoon proved short-lived. Rometty is by many accounts a smart, vigorous CEO—who turned out to have inherited a far more dire position than she, or much of Wall Street, may have realized. The megatrend is corporate America's move to the cloud. It's not just Amazon that IBM needs to worry about: In an August 2013 study of 15 cloud infrastructure providers, research firm Gartner (IT) rated IBM worst, behind Microsoft (MSFT), Rackspace (RAX), and Verizon (VZ).

Hardware sales have plummeted 24 percent in two years, turning a manageable decline into a full-on implosion. As a rule, new companies are not buying their own servers and mainframes, and larger corporations, instead of ordering new machines when they reach an upgrade point, are moving their workloads to the cloud, too. Rometty, keeping with Gerstner and Palmisano's practice of selling businesses with shrinking profit margins, agreed in January to sell IBM's low-end server business to Lenovo for $2.3 billion. (The deal awaits U.S. government approval.) IBM will attempt to resurrect its hardware sales with a new line of high-end servers unveiled in April called Power8, which it says can churn through massive data sets at record rates.

To capture and make sense of big data, corporate customers are asking for new kinds of software, another change to which IBM is racing to adjust. The software unit's revenue growth is slowing, from 8.7 percent in 2011 to 2.9 percent last year. Rometty has made more than a dozen acquisitions to boost IBM's offerings, including Aspera, which helps clients move large volumes of data quickly; Cloudant, a service for mobile and Web apps; and TeaLeaf, a tool for retail marketers. The acquisitions come despite a $6 billion annual budget for research and development.

Rometty's most significant investment has been SoftLayer Technologies, a smaller rival to Amazon in selling cloud computing to companies. IBM paid $2 billion for SoftLayer last summer, in the middle of its bruising CIA fight with Amazon, and afterward began to wind down its own corporate cloud product. SoftLayer had attracted startups such as Tumblr (YHOO) and WhatsApp (FB), which grew to require humongous power—and which never would have considered hiring IBM. A respectable player in the cloud business, SoftLayer had multiple suitors. Lance Crosby, SoftLayer's CEO, picked Rometty. "She was the only one who truly grasped what the cloud was and the impact it was going to have on enterprise and governments worldwide," Crosby says. "Ginni's whole take on it is the entire IT industry is going to be transformed in the cloud, and this is going to be the future of all IT for the next couple decades."

"IBM has had a history of successfully dealing with industry changes and making the right investment for the long-term," Palmisano said in an e-mail. "I'm glad to see that continuing under Ginni."

Rometty gets that this is an urgent moment for IBM. "Cloud is going to change the way IT operates," she told an audience of a few dozen employees last fall at an internal "Think Academy" lecture that was recorded for IBM's 431,000 employees. "And our strategic imperative is absolutely that we will remake enterprise IT for the era of cloud." Rometty has sought out other CEOs, including JPMorgan Chase's (JPM) Jamie Dimon, to ask their advice on reinvigorating a company's culture at a time of disruption. Last year she began distributing black plastic cards bearing the phrase "One Purpose: Be essential" to IBM's roughly 50,000 managers and has been known to demand to see them as she walks the halls. At IBM, even clarity is complicated—on the back of the cards are three values and nine instructions for making customers happy, including "Unite to get it done now" and "Treasure wild ducks."

In February, during an onstage interview at a mobile technology conference in Barcelona, Rometty was asked whether business leaders understood just how rapidly their industries are being disrupted. "If you try to compare today to the past," Rometty said, "the speed of change is much faster. And you should not be dissuaded by that, meaning, that is all the more reason to push forward with things."

The cold-sweat scenario for IBM is that it does catch up to Amazon and other cloud providers—only to find that competition has driven margins toward zero. In March a price war broke out among Amazon, Google (GOOG), and Microsoft, as each announced cuts of as much as 35 percent on computing; 65 percent on storage; and 85 percent on other services. Rometty has made two promises to investors: to lead corporate IT into the cloud and to deliver lustrously thick margins. Those goals may be irreconcilable, as long as IBM faces competitors willing to make the cloud a place of ever-diminishing returns. In a March 25 blog post that surely sent shivers through Armonk, Google declared that cloud pricing should follow Moore's law, falling as the cost of hardware inevitably declines.
On April 16, as IBM reported its first-quarter earnings, Bill Fleckenstein was waiting. A Seattle hedge fund manager famous among investors for predicting bubbles, Fleckenstein had been shorting IBM off and on for years. This quarter he'd planned to be on the sidelines. IBM's brand-new chief financial officer, Martin Schroeter, had told Wall Street to expect "very weak" performance, and Fleckenstein figured the company would easily meet the softened consensus.

As the results flashed onto his screen, Fleckenstein saw they were worse than he had imagined. IBM had barely made its numbers and, in forecasting the rest of the year, said it expected to set aside less in taxes while producing the same profit. That meant, logically, that pretax income would otherwise decline. "I thought, 'There's no way this thing can rally—too many people are starting to understand that something's not quite right here,'" he says. He shorted the stock again that night.

It would be hard enough for Rometty to bring IBM into the cloud era. Doing so while yoked to her predecessor's $20-per-share earnings promise is almost impossible, says Fleckenstein. Short interest in IBM has increased from 15 million shares at the start of Rometty's tenure to 30 million at the end of April.

"You ask anyone who follows balance sheets—tell me this is not a scary prospect," says Fred Hickey, another IBM short seller, who edits a cult Wall Street newsletter called High-Tech Strategist. "I look at Accenture (ACN), I see tangible assets growing. Oracle (ORCL), Microsoft, others. I don't see anything like this anywhere. OK? Anywhere. It is the poster child for financial engineering, in my world."

That phrase, financial engineering, is a catchall used by critics for the variety of ways IBM has made earnings per share go up even as revenue goes down. The spectrum of maneuvers starts with common practices like dividend increases and share buybacks, and extends to more esoteric tactics like designating major costs as "extraordinary" and devising ways to pay lower tax rates. The most transparent companies present their performance according to generally accepted accounting principles, or GAAP. IBM's 2009 annual report didn't use the phrase "non-GAAP" at all; the 2013 report used it 125 times.

IBM's income statement creativity may get labeled as financial engineering, says Steven Mills, IBM's senior vice president for software and systems, "but think about it the other way: You'd be criticized for not doing a good job of managing your tax rate or not doing a good job with disposition of your cash and managing how you most effectively use it to deliver shareholder value."

Wall Street analysts have been warning, louder and louder, that IBM can't keep cutting its way to profits forever. In May 2013, by Bloomberg's count, half the analysts covering the stock rated it a buy. Today the rate is less than one in four. The rising chorus against IBM as an investment has created one of the more fascinating showdowns in finance, given that its largest shareholder is none other than the Oracle of Omaha. Since his initial purchase became public in 2011, Buffett has added to his stake and now owns 6.75 percent of the company. It's the worst-performing of his "big four" investments, which include Wells Fargo (WFC), Coca-Cola (KO), and American Express (AXP). Buffett's chief of staff did not respond to an interview request.

"The most shocking thing to me is, Warren Buffett, who professes many, many times not to buy technology stocks, has picked the one that's got the single funkiest financial statements, and that's his area of expertise," says Fleckenstein. "I find that quite curious. He's Warren Buffett, and I'm not, but I don't see how you could look at this and feel anything other than uncomfortable."
Like an upright coffin, a black metal server rack big enough to hold a man was parked in the middle of a Las Vegas convention hall. One of IBM's new Power8 servers lay on a slab next to it. It was late April, and 9,000 customers and partners had come to the company's annual Impact conference for keynote speeches and workshops on cloud services. As IBM pitched the future, it celebrated the past. Banners heralded the 50th anniversary of IBM's System/360 mainframe.

On footpaths between the vendor booths, IBM had stuck a series of corporate koans to the carpet. "How do I know what I don't know?" read one. "What can I accomplish with real-time analytics?" "Can I really predict the future with big data?" The idea was to stimulate customers to pay IBM for answers. But the questions were obviously ones the company could have asked itself, before its CEO guaranteed a doubling in earnings per share five years out and during a disruptive transition to its industry. IBM's failure to foresee the changes in its own future makes it less plausible that it can accurately guide customers to theirs. "You have to time your steps into these markets," says Michael Rhodin, senior vice president for IBM's Watson Group, in a conference room off the convention floor. "I think we've entered mobile at the right time. I think we've entered cloud at a perfect time."

In mid-May, Rometty addressed a group of analysts in New York at IBM's annual investor briefing. The researchers peppered her with questions: Why were IBM's growth markets, notably China, shrinking? Did existing businesses or acquisitions deserve more blame for IBM being $20 billion below the revenue level it had predicted in 2010? Was Big Blue actually two companies—Good IBM and Bad IBM?

"Let me start with this idea that we are going to lead the IT industry through this change," Rometty said. "I'm very clear with my words in that this industry is going to reorder. It will not look the same 10 years from now. And we will be the leader in this industry." Cloud sales delivered as a service, she said, were growing rapidly, on pace for $2.3 billion in 2014. IBM's total revenue is $100 billion. "Look, this is not the first time we've transformed," Rometty said. "This will not be the last time." The $20-per-share target for 2015, she confirmed, is still the plan. No one asked her if there would be a Roadmap 2020.