private VarKeyNode split(Field newKey, int newId, VarKeyNode node) throws IOException {

		// Create new interior node
		VarKeyInteriorNode newNode = new VarKeyInteriorNode(nodeMgr, keyType);

		int halfway =
			((keyCount == 0 ? buffer.length() : getKeyOffset(keyCount - 1)) + buffer.length()) / 2;

		moveKeysRight(this, newNode, keyCount - getOffsetIndex(halfway));

		// Insert new key/id
		Field rightKey = newNode.getKeyField(0);
		if (newKey.compareTo(rightKey) < 0) {
			insert(newId, newKey, node);
		}
		else {
			newNode.insert(newId, newKey, node);
		}

		if (parent != null) {
			VarKeyNode rootNode = parent.insert(newNode);
			if (newNode.parent != parent) {
				// Fix my parent
				if (parent.getKeyIndex(getKeyField(0)) < 0) {
					parent = newNode.parent;
				}
			}
			return rootNode;
		}

		// New parent node becomes root
		parent = new VarKeyInteriorNode(nodeMgr, getKeyField(0), buffer.getId(), rightKey,
			newNode.getBufferId());
		newNode.parent = parent;
		return parent;
	}
Split this interior node and insert new child entry (key and buffer ID).  
Assumes 3 or more child keys exist in this node.
@param newKey new child key 
@param newId new child node's buffer ID
@param node child node instance (corresponds to newKey and newId)
@return root node.
@throws IOException thrown if IO error occurs
Ghidra/Framework/DB/src/main/java/db/VarKeyInteriorNode.java