private void allocateBits(DataTypeComponent dtc, int leftBit, int rightBit,
				boolean truncatedLeft, boolean truncatedRight) {
			if (truncatedLeft && truncatedRight && leftBit == rightBit) {
				throw new AssertException();
			}

			// adjust bit indexes for missing bitAttributes
			int adjust = 8 * leftChopBytes;
			leftBit -= adjust;
			rightBit -= adjust;

			// compute start and end bit index within allocationBytes which
			// may have been reduced from allocationByteSize based upon visibility.
			int startIndex = Math.max(0, leftBit);
			int endIndex = Math.min((8 * allocationBytes) - 1, rightBit);

			for (int i = startIndex; i <= endIndex; i++) {
				EndBitType leftEndType = EndBitType.NOT_END;
				EndBitType rightEndType = EndBitType.NOT_END;
				if (dtc != null) {
					if (i == leftBit) {
						leftEndType = truncatedLeft ? EndBitType.TRUNCATED_END : EndBitType.END;
					}
					if (i == rightBit) {
						rightEndType = truncatedRight ? EndBitType.TRUNCATED_END : EndBitType.END;
					}
				}
				bitAttributes[i] =
					new BitAttributes(dtc, leftEndType, rightEndType, bitAttributes[i]);
				hasConflict |= bitAttributes[i].hasConflict();
			}
		}
Allocate {@link #bitAttributes} for the specified component within
the byte range covered by {@link #allocationBytes}.
@param dtc composite component
@param leftBit left bit index within the full {@link #allocationByteSize}
               where 0 is the left-most bit index.
@param rightBit right bit index within the full {@link #allocationByteSize}
                where 0 is the left-most bit index.
@param truncatedLeft true if leftBit has been truncated by the full
                     allocation range
@param truncatedRight true if rightBit has been truncated by the full
                     allocation range
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java