to make it more complicated....during my 2 years stay in Morocco 1980/81, I travelled along the Atlantic coast from Tanger to Agadir ( also an Amizigh/Berber city) and noticed that all fortresses had canons with either Portugese or Dutch VOC marks on them....
Root cause: what Russia and the US is doing know, was done by the Dutch and Portugese since 1600/1700: biggest guntraders to the local sultans of the Magreb.
And also later by the English French rivalery, weapons of these two "culprits" can be found; whatever and by whomever was available, was sold and bought in the Magreb
Next to the plural dynasties
https://www.youtube.com/watch?v=6etYtGtD1rM
To add... as Spain occupied the North; the Riff , France made the rest of the country a protectorate since 1912 , locals joined the French army
https://en.wikipedia.org/wiki/Moroccan_Goumier
This resulted in a huge variety of weapons...
when visiting Morocco, I can recommend to visit these fortresses and local museums like the Borj Nord Arms Museum in Fez
https://safarway.com/en/property/borj-nord_13752