tools: add a function to go through every IRoutines in a program