[PATCH 48/67] upl: Factor out part of decode_reg() to new function