The famous story of the 13 Shaolin staff wielding monks
Li Yuan was not rescued, nor was Li Shimin trapped. The one who actually fought the Shaolin monks was Wang Shichong's nephew, Wang Renzhe. The Shaolin monks did participate in the battle, but the story of rescuing the Tang emperor is a legend embellished by later generations based on historical facts.