Prime Minister Zakaria Mohieddin (Mohi-al-Din)
https://en.wikipedia.org/wiki/Zakaria_Mohieddin was often spoken of as Nasser's likely successor at the time; indeed, Nasser would later name his as his successor at the time of his short-lived "resignation" in 1967. But Mohieddin was considered the most pro-Western of the leading officlals around Nasser, and this might have caused him some trouble--as indeed it did in 1967. ("As in 1956, many of Nasser's left-wing opponents now rallied behind him. The anti-imperialist slogans on the demonstrations were also a warning to Nasser's designated successor, Zakaria Mohi-al-Din, seen by many in Egypt as the most pro-American member of the government."
https://books.google.com/books?id=RbCBUzeq4ScC&pg=RA1-PA142 But of course in 1967 hard-core Nasserites and leftists had Nasser himself to rally to in opposition to Mohieddin; it is not clear to me who they would coalesce behind in the event of Nasser's death in 1965.)
Indeed, late 1965 looks like the ideal time for Mohiedden: in OTL he was at the height of his powers then. "After the muddled socialism of Ali Sabri led to economic chaos while the drift towards Russia had alienated potential Western donors, Mohieddin was appointed Prime Minister in September 1965. He called for sacrifices and rejuvenation of the economy; he purged the bureaucracy, raised taxes and prices, cut subsidies, encouraged private investment and stopped the move towards socialism. He negotiated with the oil companies and the formerly despised Gulf Rulers, obtained a preliminary deal with the US by which Egypt secured cheap grain and advocated devaluation at the behest of the IMF. He rejected numerous pleas to commute the death sentence onthe Muslim Brother leader Saiyidd Qutb and introduced the death penalty for drug trafficking. Putting Egyptian interests above Arab nationalism, Mohieddin realised that the Yemen War was the cause of both economic trouble and Western and conservative Arab hostility; even before coming to office he had persuaded Nasser to sign the Jiddah Agreement with King Faysal. His efforts to end the Yemen War infuriated Field Marshal Amer who joined Moheiddin's left-wing enemies and in September 1966 he was dismissed from the Premiership although he remained Vice President..." Robin Bidwell, *Dictionary of Modern Arab History,*, p. 276.
https://books.google.com/books?id=3CstBgAAQBAJ&pg=PA276 If Mohieddin was already somewhat in eclipse by late 1966, why did Nasser briefly name him his successor in 1967? Basically, it was because Nasser in a moment of dejection over the outcome of the war said, "Zacharia Mohieddin always wanted to compromise with America...If it now has come to that, he had better take over from me. He has my blessing."
https://books.google.com/books?id=piC6BwAAQBAJ&pg=PT281 If Nasser really felt that way, he soon changed his mind.)
Alternatives to Mohieddin and Sadat would be Ali Sabri--but he may have been seen as too left-wing--and Abdel Hakim Amer.
https://en.wikipedia.org/wiki/Abdel_Hakim_Amer Amer was later to be disgraced by his failure in the Six Day War, but as of 1965 he was considered very close to Nasser.
Sadat as president adopted many of the policies of Mohieddin but considered him a potential rival and kept him under surveillance. Mohieddin for his part opposed Sadat's opening to Israel, but that may just have been bitterness over Sadat having ascended to the office that once seemed within Mohiedden's grasp...
It is certainly plausible that *if* Zakaria Mohieddin had come to power in late 1965 and *if* he was able to consolidate it, he could have avoided the Six Day War, and perhaps set Egypt on a pro-Western course well before Sadat did in OTL. But those are big "ifs."