pc: Extract CPU lookup into a separate function