private DemangledObject demangleInternal(MangledContext mangledContext)
			throws DemangledException {

		DemanglerOptions demanglerOptions = mangledContext.getOptions();
		String mangled = mangledContext.getMangled();
		GnuDemanglerOptions options = getGnuOptions(demanglerOptions);
		if (skip(mangled, options)) {
			return null;
		}

		String originalMangled = mangled;
		String globalPrefix = null;
		if (mangled.startsWith(GLOBAL_PREFIX)) {
			int index = mangled.indexOf("_Z");
			if (index > 0) {
				globalPrefix = mangled.substring(0, index);
				mangled = mangled.substring(index);
			}
		}
		else if (mangled.startsWith("__Z")) {
			mangled = mangled.substring(1);
		}

		boolean isDwarf = false;
		if (mangled.startsWith(DWARF_REF)) {
			int len = DWARF_REF.length();
			mangled = mangled.substring(len);
			isDwarf = true;
		}

		try {

			GnuDemanglerNativeProcess process = getNativeProcess(options);
			String demangled = process.demangle(mangled);
			if (demangled == null) {
				throw new DemangledException(false);
			}
			demangled = demangled.trim();
			if (demangled.length() == 0 || mangled.equals(demangled)) {
				throw new DemangledException(true);
			}

			DemangledObject demangledObject =
				parse(originalMangled, process, demangled, options);
			if (demangledObject == null) {
				return demangledObject;
			}

			if (globalPrefix != null) {
				DemangledFunction dfunc = new DemangledFunction(originalMangled, demangled,
					globalPrefix + demangledObject.getName());
				dfunc.setNamespace(demangledObject.getNamespace());
				demangledObject = dfunc;
			}

			if (isDwarf) {
				DemangledAddressTable dat =
					new DemangledAddressTable(originalMangled, demangled, (String) null, false);
				dat.setSpecialPrefix("DWARF Debug ");
				dat.setName(demangledObject.getName());
				dat.setNamespace(demangledObject.getNamespace());
				return dat;
			}

			return demangledObject;
		}
		catch (IOException e) {
			if (e.getMessage().endsWith("14001")) {
				ResourceFile installationDir = Application.getInstallationDirectory();
				throw new DemangledException("Missing runtime libraries. " + "Please install " +
					installationDir + File.separatorChar + "support" + File.separatorChar +
					"install_windows_runtime_libraries.exe.");
			}
			throw new DemangledException(e);
		}
	}
A class for demangling debug symbols created using GNU GCC.
Ghidra/Features/GnuDemangler/src/main/java/ghidra/app/util/demangler/gnu/GnuDemangler.java