That's right - the secular (socialist) Arab nations were often pro-Soviet (though Iraq was also a US ally during the Iran-Iraq war), the Islamist states (with the exception of Iran) tended to side with the US during the Cold War, largely because they saw the Christianity of Americans as a lesser blasphemy than the atheism of the Soviets.
Or more like they saw the US as bigger suckers than the Soviets....the Soviets didn’t mess around with Muzzie terrorists.