History of Liao
Another, probably unrelated, early use of the word "Huihui" comes from the History of Liao Dynasty, which mentions Yelü Dashi, the 12th-century founder of the Kara-Khitan Khanate, defeating the "Huihui Dashibu" (回回大食部) people near Samarkand – apparently, referring to his defeat of the Khwarazm ruler Ahmed Sanjar in 1141. Khwarazm is referred to as "Huihuiguo" in the "Secret History of the Mongols" as well.