public static int getPrecedence(Variable var) {
		int precedence;
		if (var.isMemoryVariable()) {
			precedence = MEMORY_PRECEDENCE;
		}
		else if (var.isRegisterVariable()) {
			precedence = REGISTER_PRECEDENCE;
		}
		else if (var.isStackVariable()) {
			precedence = STACK_PRECEDENCE;
		}
		else if (var.isUniqueVariable()) {
			precedence = UNIQUE_PRECEDENCE;
		}
		else if (var.isCompoundVariable()) {
			precedence = COMPOUND_PRECEDENCE;
		}
		else {
			precedence = 0;
		}
		if (var instanceof Parameter) {
			precedence -= PARAMETER_PRECEDENCE;
		}
		return precedence;
	}
Get a precedence value for the specified variable.
This value can be used to assist with LocalVariable.compareTo(Variable var)
@param var function variable
@return numeric precedence
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java