static boolean hasReplaceableComponentsAtOffset(Structure containingStruct, int offset,
			Structure newInternalStruct, TaskMonitor monitor) throws CancelledException {

		DataTypeComponent[] newStructComponents = newInternalStruct.getComponents();

		for (DataTypeComponent newStructComponent : newStructComponents) {

			monitor.checkCancelled();

			int structOffset = newStructComponent.getOffset();

			DataTypeComponent currentComponentAtOffset =
				containingStruct.getComponentAt(offset + structOffset);
			
			if(currentComponentAtOffset == null) {
				continue;
			}

			DataType newStructCompDt = newStructComponent.getDataType();
			DataType containingComDt = currentComponentAtOffset.getDataType();

			// if component dts are equal continue
			if (newStructCompDt.equals(containingComDt)) {
				continue;
			}

			// if containing is all undefined1s at equivalent location then continue
			if (hasEnoughUndefined1sAtOffset(containingStruct, offset + structOffset,
				newStructCompDt.getLength(), monitor)) {
				continue;
			}

			// otherwise if lengths not equal then return false
			if (newStructCompDt.getLength() != containingComDt.getLength()) {
				return false;
			}

			// component lengths are equal if it gets here
			// if containing is not undefined then return false because the components would be
			// incompatible types

			if (!Undefined.isUndefined(containingComDt)) {
				return false;
			}

		}
		return true;
	}
Method to determine if the given containing struct has components at the given offset 
that are either the same, all undefined1's or equivalently sized undefineds as the components
in the given possible newInternalStruct
@param containingStruct the given structure to check
@param offset the offset at the containing struct to check for equivalent components
@param newInternalStruct the possible new internal struct to replace at the given offset in the 
given containing struct
@param monitor task monitor
@return true if components in the containing struct are replaceable with the possible new
internal struct, false otherwise
@throws CancelledException if cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/EditStructureUtils.java