"Progenitor" of the Kyrgyz Ethnicity of the 12th Century

Ibrahim ibn Ahmed and Anal-Hakk
Thus, the "progenitor" of the Kyrgyz ethnicity of the 12th century was evidently Ibrahim ibn Ahmed. Subsequently, he likely transformed into Anal-Hakk. According to the earliest reports, the progenitor of the Kyrgyz people was Anal-Hakk. Legends and traditions about this have survived to this day. The leader of the Kyrgyz right wing and, accordingly, the son of Anal-Hakk was Lur-khan. Only after him comes Ughuz-Kara-khan, who was at one time the head of the Kyrgyz right wing (kara-kyrgyz). This is logical, since in the newly formed ethnic community, the "progenitor" became the historical figure who created it. This was reflected in the genealogy — the sanzhira, and the "progenitors" of separate parts of this ethnic community were introduced into the genealogy as his sons.
Apparently, the "Majmu at-tavarikh," at least in the version known today, was created based on records of folk legends and traditions recorded at various times. The legend of Imam Ibrahim ibn Ahmed likely transformed into the legend of Anal-Hakk, as they are very similar to the same folk tradition, having only undergone elements of development. If Imam Ibrahim ibn Ahmed created the Kyrgyz unions of the right (Ong) and left (Sol) wings and appointed Lur-khan as the commander of the right wing and Lur-Buzurg as the commander of the left wing, then Anal-Hakk appears as the progenitor of the Kyrgyz ethnicity, while Lur-khan and Lur-Buzurg are depicted as his sons.
The defeated parts of the Kara-Kitans likely fled to the valley of the Emel River. Here they could have joined their brethren and other tribes that had settled here even before, as well as the numerous local Turks. The Kara-Kitans soon seized the city of Balasagun in the Chuy Valley. Then, the Gurkhan of the Kara-Kitans set out on a campaign to Kashgar, and success accompanied him. The Kara-Kitans then managed to conquer Hotan as well. After this, as reported by the 13th-century Persian author Juvayni, the Gurkhan of the Kara-Kitans "...sent an army to the borders of the Kyrgyz to take revenge for the disturbances caused by them, and took Beshbalyk." According to this information, the "Central Asian" Kyrgyz at that time possibly inhabited somewhere near Beshbalyk. Alternatively, the Kyrgyz could have owned both Kashgar and Beijun. After the Kara-Kitans seized Kashgar, the Kyrgyz tribes might have migrated to Beijun (Beshbalyk). There, the armies of the Kara-Kitans were sent, which moved "to the borders of the Kyrgyz" and took Beshbalyk.