It's both. What Sharia does is codify tribal practices that existed in the middle-east for thousands of years. If you want to live like ancient tribesmen, Islam is for you.
>>>”What Sharia does is codify tribal practices that existed in the middle-east for thousands of years. If you want to live like ancient tribesmen, Islam is for you.”<<<
It is a tribal practice, you’re right. But I would also presume it was originally more of a nomadic or Marsh Arab or perhaps more broadly a semite or semitic ‘cultural’ practice. After Islam was introduced, at first in today’s KSA and Jordan, and then spread to other Islamic lands the practice became codified in Islam/Sharia.
Male circumcision is done for hygiene reasons, typically at a very young age. FGM has totally different reasoning behind it and is very sick.
However, neither male circumcision nor FGM were part of pre-Islamic, Zoroastrian culture in Iran, for example. So, it didn’t apply to the entire middle east. To date, Zoroastrians in Iran and elsewhere do not practice it, and there is nothing in Zoroastrian religion and scripture to make it obligatory or even desirable.