Reduce indentation and fix the count of how many PHIs we have inserted.