private CPPResult doWork(Function function, DecompInterface decompiler,
				TaskMonitor monitor) {
			Address entryPoint = function.getEntryPoint();
			CodeUnit codeUnitAt = function.getProgram().getListing().getCodeUnitAt(entryPoint);
			if (codeUnitAt == null || !(codeUnitAt instanceof Instruction)) {
				return new CPPResult(entryPoint, function.getPrototypeString(false, false) + ';',
					null, List.of());
			}

			monitor.setMessage("Decompiling " + function.getName());

			DecompileResults dr =
				decompiler.decompileFunction(function, options.getDefaultTimeout(), monitor);
			String errorMessage = dr.getErrorMessage();
			if (!"".equals(errorMessage)) {
				Msg.warn(CppExporter.this, "Error decompiling: " + errorMessage);
				if (options.isWARNCommentIncluded()) {
					monitor.incrementProgress(1);
					return new CPPResult(entryPoint, null,
						"/*" + EOL + "Unable to decompile '" + function.getName() + "'" + EOL +
							"Cause: " + errorMessage + EOL + "*/" + EOL,
						List.of());
				}
				return null;
			}

			DecompiledFunction decompiledFunction = dr.getDecompiledFunction();
			List<String> globals =
				CollectionUtils.asStream(dr.getHighFunction().getGlobalSymbolMap().getSymbols())
						.map(hsym -> {
							String dt = hsym.getDataType().getDisplayName();
							String name = hsym.getName();
							String space = dt.endsWith("*") ? "" : " ";
							return "%s%s%s;".formatted(dt, space, name);
						})
						.toList();
			return new CPPResult(entryPoint, decompiledFunction.getSignature(),
				decompiledFunction.getC(), globals);
		}
Generate suitable C-style definition statements (#define) for any fake data-type names
which may be produced by the decompiler (e.g., unkint, unkuint, etc.).
@param dataOrganization is the data organization to result the size of core types.
@return multi-line string containing C-style declarations of fake decompiler types.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/util/exporter/CppExporter.java