So, the for loop will increase i by 1. If the comparator didn't changed, we decrease i by one so we stay in the same place. In this way, till the comparator output is the same, we stay in that loop. Once the comaprator ACSR changed, we don't decrease i anymore so after 10 loops we go to next step!