private void expandInternalStructure(Structure structure, Structure internalStruct,
			int offset) {

		DataTypeComponent[] components = internalStruct.getComponents();

		// if there is an empty structure at the offset, clear it which will replace
		// it with an undefined data type of size 1
		if (components.length == 0) {
			structure.clearAtOffset(offset);
			return;
		}
		// if non-empty, replace the structure with its components
		for (DataTypeComponent component : components) {

			int innerOffset = component.getOffset();

			// add indiv components of internal structure to the outer structure
			structure.replaceAtOffset(offset + innerOffset, component.getDataType(),
				component.getLength(), component.getFieldName(), "");
		}
		return;
	}
Method to replace an internal structure into individual parts within the containing structure
@param structure the containing structure
@param internalStruct the internal structure
@param offset the offset of the internal structure
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java