private Node searchValue(V value, SearchMode mode) {
			Node cur = this;
			Node eq = null;
			int c;
			while (true) {
				c = comparator.compare(value, cur.val);
				if (c == 0) {
					eq = cur;
				}
				if (c < 0 || (c == 0 && mode.inEq == Comp.LT)) {
					if (cur.lChild == null) {
						break;
					}
					cur = cur.lChild;
				}
				else if (c > 0 || (c == 0 && mode.inEq == Comp.GT)) {
					if (cur.rChild == null) {
						break;
					}
					cur = cur.rChild;
				}
				else {
					break;
				}
			}
			if (eq != null) {
				if (mode.allowEq == BoundType.CLOSED) {
					return eq;
				}
				if (mode.comp == Comp.LT) {
					return eq.prev;
				}
				return eq.next;
			}
			if (mode.comp == Comp.LT) {
				if (c < 0) {
					return cur.prev; // May be null;
				}
				return cur; // c != 0 here, so c > 0
			}
			if (mode.comp == Comp.GT) {
				if (c < 0) {
					return cur;
				}
				return cur.next;
			}
			return null; // Other search modes require exact match
		}
Find the given value in this subtree

@param value the value to find
@param mode when the value occurs multiple times, identifies which instance to find
@return the node containing the given value, or null if not found
Ghidra/Framework/Generic/src/main/java/ghidra/generic/util/datastruct/TreeValueSortedMap.java