Complex sentence: Malik Ayaz's same-sex relationship with Mahmud inspired poems and stories, which are however unclear and contested because local Muslim historians and Sufi's commemorate Malik Ayaz due to his unwavering feudalistic loyalty to Mahmud Ghaznavi.
Split into simpler sentences: Malik Ayaz's same-sex relationship with Mahmud inspired poems and stories. However Muslim historians and Sufi's commemorate Malik Ayaz due to his unfavorings feudalistic loyalty to Mahmud Ghaznavi.