private Equate getUniqueEquate(EquateTable et, String name, long value) {
		for (int count = -1; count <= Integer.MAX_VALUE; count++) {
			String newName = name + ((count >= 0) ? SYMBOL_CONFLICT_SUFFIX : "") +
				((count > 0) ? Integer.toString(count) : "");
			Equate eq = et.getEquate(newName);
			if (eq == null) {
				try {
					Equate equate = et.createEquate(newName, value);
					if (!newName.equals(name)) {
						saveDuplicateEquate(equate, name);
					}
					return equate;
				}
				catch (DuplicateNameException e) {
					Equate equate = et.getEquate(newName);
					if (equate != null && equate.getValue() == value) {
						return equate;
					}
					continue;
				}
				catch (InvalidInputException e) {
					throw new RuntimeException(
						"Can't merge equate with name [" + name + "] and value [" + value + "].",
						e);
				}
			}
			else if (eq.getValue() == value) {
				return eq;
			}
		}
		throw new RuntimeException(
			"Can't merge equate with name [" + name + "] and value [" + value + "].");
	}
<CODE>mergeEquate</CODE> replaces the current equates in program1 with those in program2.
@param originAddress the address where the equates should be merged.
This address should be derived from the origin program.
@param opIndex the operand index where the equates should be merged.
@param value the scalar value where the equate is used.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java