I question the assertion that there was no functioning government in Libya before Benghazi. Libya was a moderate Islam country and the people were rather prosperous enjoying a rather High comparative per capita income.
The attack at Benghazis CIA safe house was after America had bombed the country into rubble while our allies the Muslim Brotherhood/ISIS/AliKayda were the ground troops.