private void initialize() {
		List<String> registerNameList = new ArrayList<String>();
		List<Register> contextRegisterList = new ArrayList<Register>();
		ArrayList<Register> registerListSortedBySize = new ArrayList<>(registers); // copy for sorting
		Collections.sort(registerListSortedBySize, registerSizeComparator);
		for (Register reg : registerListSortedBySize) {
			String regName = reg.getName();
			registerNameList.add(regName);
			if (reg.isProcessorContext()) {
				contextRegisterList.add(reg);
				if (reg.isBaseRegister()) {
					contextBaseRegister = reg;
				}
			}

			Address addr = reg.getAddress();
			List<Register> list = registerAddressMap.get(addr);
			if (list == null) {
				list = new ArrayList<Register>();
				registerAddressMap.put(addr, list);
			}
			list.add(reg);
			addRegisterAddresses(reg);
			if (reg.isProcessorContext()) {
				continue;
			}

			if (reg.isBigEndian()) {
				populateSizeMapBigEndian(reg);
			}
			else {
				populateSizeMapLittleEndian(reg);
			}
		}
		// if there is no context register, force a default one
		if (contextBaseRegister == null) {
			contextBaseRegister = Register.NO_CONTEXT;
		}
		// handle the register size 0 case;
		Collections.reverse(registerListSortedBySize);
		for (Register register : registerListSortedBySize) {
			sizeMap.put(new RegisterSizeKey(register.getAddress(), 0), register);
		}
		contextRegisters = Collections.unmodifiableList(contextRegisterList);
		Collections.sort(registerNameList);
		registerNames = Collections.unmodifiableList(registerNameList);
	}
Construct RegisterManager

@param registers all defined registers with appropriate parent-child relationships properly
           established.
@param registerNameMap a complete name-to-register map including all register aliases and
           alternate spellings (e.g., case-variations)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/RegisterManager.java