s3: convert registry and printing code to TYPESAFE_QSORT()