Intel CEO Brian Krzanich sold about half his stock months after he learned about critical flaws in billions of his company's microchips.

Krzanich now holds only the minimum number of shares he's required to own.

Intel says there's nothing to see here: Krzanich remains confident about the company's future, and his massive stock sale was unrelated to the security issue that sent shares down about 6% over the past two days.

"Brian's sale is unrelated," the company said in a statement. "It was made pursuant to a pre-arranged stock sale plan ... with an automated sale schedule. He continues to hold shares in-line with corporate guidelines."

Related or not, it doesn't exactly give investors the warm fuzzies about Intel's stock prospects.

"He's an engineer; he can do math," said Stacy Rasgon, an Intel analyst at Sanford Bernstein. "This is not an incredibly bullish statement regardless of the security stuff."

The funny thing is Intel (INTC) seemed to be in the middle of a turnaround. The company had a wildly successful 2017. The stock soared 27% after a solid summer quarter. Analysts are bullish: More than half call Intel a "buy," and just one in eight holds a negative outlook for the stock.

Krzanich himself was optimistic in his year-end message to employees. He said 2017 would be a record year and 2018 would mark the year Intel put the slumping PC market in the rearview mirror, according to Intel spokeswoman Cara Walker.

Yet on October 30, just three days before Intel's stock reached its 2017 peak, Krzanich announced a plan to sell 245,000 of his own shares by November 29. That left him with just 250,000 -- the fewest he's allowed to hold under his contract with Intel.

Krzanich had been selling stock all year. Bit by bit, he sold shares 21 times during 2017, but his largest sale by far was his last, when he dumped $50 million worth of stock: $28 million in just-vested options plus $22 million worth of Intel shares he had previously owned.

CEOs sell stock for all kinds of reasons: diversification, liquidity, financing a big purchase. But that's a massive amount of stock that Krzanich dumped, and holding the minimum isn't a great look.

"In all the years I've been at this and of all the companies I've covered, I can't recall another single massive sale on this scale," Rasgon said.

Krzanich sold stock 18 times in 2016, but none of those sales approached the size of his 2017 year-end cash-out. He ended 2016 with 18,000 more shares than he started.

The timing of the November sale doesn't look great either.

Related: Update your software today. Seriously.

Intel's Walker confirmed that security analysts informed the company in June of the security holes in its PC and phone microchips. (Intel made the public aware on Wednesday.) It's not clear how severe the problem will ultimately be for Intel -- it may have to pay to replace some customers' chips, but that's far from certain.

Walker says the company doesn't expect the security flaw will cost a lot of money to fix, and it is already taking steps to solve the problem.

But the CEO's stock sale still violates rule No. 1 for CEOs: Don't do anything that gives you front-page headlines for the wrong reasons.