Start of code that does top sort on dependencies for loop with loop carried reps.