@SuppressWarnings("unchecked")
	private DataType findDataType(Map<String, Object> type, CategoryPath cp) {
		String kind = (String) type.get("kind");
		String name = (String) type.get("name");
		if (kind == null) {
			return null;
		}
		if (kind.equals("pointer") || (kind.equals("array"))) {
			DataType byName = findExistingDataType(cp, kind, name);
			if (byName != null) {
				if (byName instanceof FunctionDefinition) {
					return new PointerDataType(byName, dataManager);
				}
				return byName;
			}
			Map<String, Object> subtype = (Map<String, Object>) type.get("subtype");
			if (subtype != null) {
				DataType base = findDataType(subtype, cp);
				if (base == null) {
					return null;
					// throw new RuntimeException("Subtype not found: " + subtype);
				}
				if (kind.equals("pointer")) {
					return new PointerDataType(base, dataManager);
				} else {
					int count = (int) (double) type.get("count");
					return new ArrayDataType(base, count, base.getLength(), dataManager);
				}
			}
		}
		if (name == null) {
			return null;
		}
		if (kind.equals("typedef")) {
			Map<String, Object> subtype = (Map<String, Object>) type.get("type");
			String typeName = (String) type.get("typeName");
			if (typeName != null) {
				cp = new CategoryPath((String) type.get("typeLocation"));
				name = typeName;
			} else if (subtype != null) {
				DataType base = findDataType(subtype);
				if (base == null) {
					return null;
				}
				return base;
			}
		}
		if (kind.equals("bitfield")) {
			Map<String, Object> subtype = (Map<String, Object>) type.get("type");
			String typeName = (String) type.get("typeName");
			if (typeName != null) {
				cp = new CategoryPath((String) type.get("typeLocation"));
				name = typeName;
			} else if (subtype != null) {
				DataType base = findDataType(subtype);
				if (base == null) {
					return null;
				}
				return base;
			}
		}
		return findExistingDataType(cp, kind, name);
	}
Reads the datatypes encoded in SARIF from the specified SARIF parser and
recreates them in a datatype manager.

@param result  the SARIF parser
@param monitor the task monitor
@throws SAXParseException  if an SARIF parse error occurs
@throws CancelledException if the user cancels the read operation
Ghidra/Features/Sarif/src/main/java/sarif/managers/DataTypesSarifMgr.java