Fix reversed logic in getRegsUsed. Rename RegStates to RegsAvailable to