private Register getRegister(Address addr, int opIndex, int subOpIndex) {
		if (addr == null) {
			return null;
		}

		Instruction instr = currentProgram.getListing().getInstructionContaining(addr);
		if (instr == null) {
			return null;
		}

		List<Object> defOpRep = instr.getDefaultOperandRepresentationList(opIndex);
		if (subOpIndex >= 0 && subOpIndex < defOpRep.size()) {
			Object obj = defOpRep.get(subOpIndex);
			if (obj instanceof Register) {
				return (Register) obj;
			}
		}
		return instr.getRegister(opIndex);
	}
Get the register at the location

@param opIndex index into operands for instruction
@param subOpIndex index into operands for an operand location

@return register if there is one at the location
Ghidra/Features/Base/ghidra_scripts/MultiInstructionMemReference.java