[PATCH 2/5] reg: Group resource IDs by source location