An automated branch-assignment algorithm for rovibrational spectra of asymmetric-top molecules