private int findOpIndex(PcodeOp op, Varnode loc) {
		if (loc instanceof VarnodeOperation) {
			return -1;
		}
		Instruction instr = listing.getInstructionAt(op.getSeqnum().getTarget());
		int numOperands = instr.getNumOperands();
		for (int i = 0; i < numOperands; i++) {
			PcodeOp[] operandPcode = instr.getPcode(i);
			if (operandPcode == null || operandPcode.length == 0) {
				continue;
			}
			if (matchOpPcodeObjectAssignment(operandPcode, loc)) {
				return i;
			}
		}
		int opMatchCnt = 0;
		int lastOpMatch = -1;
		for (int i = 0; i < numOperands; i++) {
			// Check representation
			if (matchOpObject(instr, i, loc)) {
				++opMatchCnt;
				lastOpMatch = i;
			}
		}
		if (opMatchCnt == 1) {
			return lastOpMatch;
		}
		return Reference.MNEMONIC;
	}
Returns the set of registers which were modified
Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java