Use lookUpRegForValue here instead of duplicating the code.