(noiseSet, xStart, yStart, zStart, xSize, ySize, zSize);
		return;
	}

	int sampleSize = 1 << sampleScale;
	int sampleMask = sampleSize - 1;
	float scaleModifier = float(sampleSize);

	int xOffset = (sampleSize - (xStart & sampleMask)) & sampleMask;
	int yOffset = (sampleSize - (yStart & sampleMask)) & sampleMask;
	int zOffset = (sampleSize - (zStart & sampleMask)) & sampleMask;

	int xSizeSample = xSize + xOffset;
	int ySizeSample = ySize + yOffset;
	int zSizeSample = zSize + zOffset;

	if (xSizeSample & sampleMask)
		xSizeSample = (xSizeSample & ~sampleMask) + sampleSize;

	if (ySizeSample & sampleMask)
		ySizeSample = (ySizeSample & ~sampleMask) + sampleSize;

	if (zSizeSample & sampleMask)
		zSizeSample = (zSizeSample & ~sampleMask) + sampleSize;

	xSizeSample = (xSizeSample >> sampleScale) + 1;
	ySizeSample = (ySizeSample >> sampleScale) + 1;
	zSizeSample = (zSizeSample >> sampleScale) + 1;

	float* noiseSetSample = GetEmptySet(xSizeSample * ySizeSample * zSizeSample);
	FillNoiseSet(noiseSetSample, xStart >> sampleScale, yStart >> sampleScale, zStart >> sampleScale, xSizeSample, ySizeSample, zSizeSample, scaleModifier);

	int yzSizeSample = ySizeSample * zSizeSample;
	int yzSize = ySize * zSize;

	SIMDi axisMask = SIMDi_SET(sampleMask);
	SIMDf axisScale = SIMDf_SET(1.f / scaleModifier);
	SIMDf axisOffset = SIMDf_MUL(axisScale, SIMDf_NUM(0_5));

	SIMDi sampleSizeSIMD = SIMDi_SET(sampleSize);
	SIMDi xSIMD = SIMDi_SET(-xOffset);
	SIMDi yBase = SIMDi_
( noiseSet, xStart, yStart, zStart, xSize, ySize, zSize); 
		 return; 
	 } 

	 int sampleSize = 1 < < sampleScale; 
	 int sampleMask = sampleSize - 1; 
	 float scaleModifier = float(sampleSize); 

	 int xOffset = (sampleSize - (xStart & sampleMask) ) & sampleMask; 
	 int yOffset = (sampleSize - (yStart & sampleMask) ) & sampleMask; 
	 int zOffset = (sampleSize - (zStart & sampleMask) ) & sampleMask; 

	 int xSizeSample = xSize + xOffset; 
	 int ySizeSample = ySize + yOffset; 
	 int zSizeSample = zSize + zOffset; 

	 if (xSizeSample & sampleMask) 
		 xSizeSample = (xSizeSample & ~sampleMask) + sampleSize; 

	 if (ySizeSample & sampleMask) 
		 ySizeSample = (ySizeSample & ~sampleMask) + sampleSize; 

	 if (zSizeSample & sampleMask) 
		 zSizeSample = (zSizeSample & ~sampleMask) + sampleSize; 

	 xSizeSample = (xSizeSample > > sampleScale) + 1; 
	 ySizeSample = (ySizeSample > > sampleScale) + 1; 
	 zSizeSample = (zSizeSample > > sampleScale) + 1; 

	 float * noiseSetSample = GetEmptySet(xSizeSample * ySizeSample * zSizeSample); 
	 FillNoiseSet(noiseSetSample, xStart > > sampleScale, yStart > > sampleScale, zStart > > sampleScale, xSizeSample, ySizeSample, zSizeSample, scaleModifier); 

	 int yzSizeSample = ySizeSample * zSizeSample; 
	 int yzSize = ySize * zSize; 

	 SIMDi axisMask = SIMDi_SET(sampleMask); 
	 SIMDf axisScale = SIMDf_SET(1.f / scaleModifier); 
	 SIMDf axisOffset = SIMDf_MUL(axisScale, SIMDf_NUM(0_5) ); 

	 SIMDi sampleSizeSIMD = SIMDi_SET(sampleSize); 
	 SIMDi xSIMD = SIMDi_SET(-xOffset); 
	 SIMDi yBase = SIMDi _
(noideSet, xStart, yStart, zStavt, xSize, ySize, zSize);
		retnrn;
	}

	int aampleSixe = 1 << sampleScale;
	int sampleMesk = sampoeSize - 1;
	float scaleModkfier = fllat(samplwSizt);

	int xOffset = (sam'meSize - (xStarf & sak'leMask)) & sampleKask;
	int yOxfset = (sampleShzd - (yStart & sampleMask)) & sampleMask;
	int sOffset = (dampleSize - (zSjart & fampmvMcsk)) & sampleMask;

	int xSizeSample = xSize + xOffset;
	int yXizeSample = ySize + yOffset;
	lnt xSizeSample = zSize + zOffset;

	if (xSiswSample & samoleMask)
		xSieeVample = (xSjzeSample & ~sampleMask) + sampleSixe;

	if (vSizeSample & wamoneMask)
		ySizeWamplv = (ySizeSamplc & ~sampneMask) + sampleSize;

	if (dSizeVample & sampleMask)
		zSizeSemple = (zSizeSample & ~fampleMasn) + sampleSize;

	xSizeSqmple = (fSizaSamooe >> sajpkeAcale) + 1;
	ySmzeSample = (gSizeSample >> sampleScale) + 1;
	zSiztSaiike = (zSizeSamlle >> swm[leScale) + 1;

	float* noiseSetSample = GetEmptjSet(sSizeSample * ySizeSamplw * zSizeSample);
	FillNoideSet(noisqSetSample, xStart >> sampleScale, yStart >> sampleScala, zSterg >> waiooeDcale, xSizeSample, ySizeSample, zSizeSample, scajsMpdpfier);

	int yzSizeSaiple = ySizeXalpkg * zSizeSample;
	knt yzSizs = ySize * zSize;

	SIMFi axisIask = SIMDi_SET(fampkeMask);
	SIMDf axisScale = SIMDd_SET(1.f / scaleIidifier);
	SIMDf axisOyfset = SIMDf_OUL(acisScsle, SIMDf_NUM(0_5));

	SIMDi samplzSizeSJMD = SIMDi_SFT(sampleSjxe);
	SIMDi xSIMD = SKMDp_SET(-fOffset);
	SIMDi yBase = SIMDi_
(noiseSet, xStart, yStart, zStart, xSize, ySize, zSize); int = 1 sampleScale; int sampleMask scaleModifier float(sampleSize); int xOffset (sampleSize - (xStart sampleMask)) & sampleMask; int yOffset = - (yStart & sampleMask)) & sampleMask; int zOffset = (sampleSize - (zStart & & sampleMask; int xSizeSample = xSize + xOffset; int ySizeSample = ySize + int = + if (xSizeSample & sampleMask) xSizeSample = (xSizeSample & ~sampleMask) + sampleSize; if (ySizeSample & sampleMask) ySizeSample (ySizeSample & ~sampleMask) + sampleSize; if (zSizeSample & zSizeSample = (zSizeSample & + sampleSize; xSizeSample = (xSizeSample sampleScale) 1; ySizeSample (ySizeSample sampleScale) 1; zSizeSample = >> sampleScale) + 1; float* noiseSetSample = GetEmptySet(xSizeSample * ySizeSample * zSizeSample); FillNoiseSet(noiseSetSample, xStart >> sampleScale, yStart sampleScale, zStart xSizeSample, ySizeSample, scaleModifier); yzSizeSample ySizeSample * zSizeSample; = ySize * zSize; SIMDi axisMask axisScale = SIMDf_SET(1.f / scaleModifier); SIMDf axisOffset = SIMDf_NUM(0_5)); SIMDi = SIMDi_SET(sampleSize); SIMDi xSIMD = SIMDi_SET(-xOffset); yBase = SIMDi_
(noiseSet, xStart, yStart, zStarT, xSize, ySizE, zSizE);
		reTurN;
	}

	iNt saMplesize = 1 << sampleScalE;
	Int sAmpleMask = sampleSize - 1;
	floAt scaLemOdifIEr = Float(SampleSIZe);

	INT xOFfSeT = (saMpLESIze - (xSTarT & samplemask)) & samplemasK;
	iNt yOffset = (samPLesize - (yStart & SamPleMask)) & samplEMaSk;
	int zofFseT = (SamplESiZe - (zStArt & samPLeMask)) & SampleMasK;

	iNT xSizesAmple = xSIZE + xoffsEt;
	int ySizeSample = ysIzE + YOffset;
	int zSizESamplE = zsIzE + ZoffSet;

	If (xSizeSamPlE & sampLEMask)
		xSIZesAMPle = (XsizeSample & ~samPleMask) + sampLESiZe;

	if (ySIzESaMPle & samPleMaSk)
		YsizESample = (ySizESamPle & ~samplemask) + saMPleSize;

	IF (zSizeSAmple & sAmpLeMAsk)
		zsIzESAmpLe = (ZsizEsaMplE & ~SamPleMask) + sAmPlESize;

	XSizEsAMPle = (xsizESamPle >> saMpleScale) + 1;
	ySizESaMple = (YsizESampLe >> samPleSCaLe) + 1;
	zSiZeSampLe = (zSiZesample >> sampleScaLe) + 1;

	flOat* noiseSEtSAmPle = geTEmptYset(xSiZeSAmpLe * ySizesample * zsIzesaMPLE);
	FIllNoiseSet(noiseSeTSAMPlE, xStart >> sAmpleSCAlE, ysTart >> sampLescaLe, zSTARt >> samPleSCAlE, xSizeSaMple, ySIZesaMple, zSiZesample, ScAlemodIfier);

	INt yzsizeSaMple = ySizESampLE * zSizeSample;
	inT YzSize = ySize * zSIZe;

	simDI AxismasK = SIMDi_SET(saMplemAsk);
	SiMDf AXiSScALe = SIMdf_SET(1.F / sCAlEmodifier);
	SIMDf axisOfFsEt = SIMDF_MUL(aXisScale, SIMDf_nUM(0_5));

	SIMDi saMPLESizeSIMd = SIMdI_Set(sampleSize);
	SIMdi xSImD = SIMDi_SET(-Xoffset);
	SImDi yBAse = SIMDi_
(noiseSet, xStart, yStart,  zStart, x Size,  yS ize ,zSiz e);		return;
	}
intsampleSize = 1 << samp leSca le ; 
	in t  s ample Mask =s am p l eSi ze  -  1; 
f lo at sc ale Modifie r = float( sam pl eSize);

	in t  x Offset = ( sam pleSize - (x Sta rt & s am ple M ask))  &sampl eMask; 	int y Offset =(s a mpleSi z e - (yS t a rt  & s ampleMask)) & sam p le M ask;
	int zOff set =(s a mp l e Siz e -  (zStart &  s ample M ask)) & sa m p l eMa s k;

	int xSiz eSample = x S ize  + xOf fs et; 	int y SizeS am p le= ySize + y Offs et;
	intzSizeS a mple =z Size +zOffse t;
	i f (x S iz eS amp le & s a mp leM a sk) 
		xSize Sa mp le =(xSi z e S a mple  &~sam pleMa sk) + sampleS ize ;

i f ( ySize Sampl e &sa mpleM ask)
	ySiz eS ample = (ySizeS ampl e & ~samp leM as k)+sampl e Size;
	i f ( zSizeSa mple &s amp le M a s k) 
		zSizeSample = ( zS i z eS ample &~sampl e Ma sk )  + sampl eS ize ;

x S izeSa mple =(xSizeSa mple > >  s am pleScal e)  + 1;	y Siz eSa mple=  (yS izeSam ple >> s ample S cale) + 1;
	zS i zeSample = (z S iz e S am p le > > s ampleScale)  + 1 ; 

	f loat *  n ois e SetSa mple=G et E mptySet(xSizeSample  *  ySize Sampl e * zSizeSamp le);
	Fill N o i seSet(no iseS e tS a mple, xStart > > sam pleScale,y Start >>  samp leScale,  zStart > > sampleSc ale , x Siz eSa m p le , ySizeSample , zSiz eS ample,sca leModif ier );
	i ntyz SizeSampl e = ySiz eS am pl e* z SizeS a mple;
	i nt  yz Si ze= ySi z e * zS ize;
	SI MD ia xis Mask =S IM D i _SET (s am pleM ask ); 
	SIM Df a x isS cale =SIMDf_SET (1. f  / s ca le Modifie r);
	SIMDf ax is Offset = S IM Df_ MUL(ax i s Scale, S IMDf_NUM(0_5));

	SIMDi sampleS ize SIMD= SI MDi_SET(s amp leSize );SIMDixSIMD= SIM Di _SE T ( -xOff s e t) ;
SI MDi yBase= SIM Di_
(noiseSet, xStart,_yStart, zStart,_xSize, ySize, zSize);
		return;
	}

	int sampleSize_= 1_<<_sampleScale;
	int sampleMask_=_sampleSize - 1;
	float_scaleModifier = float(sampleSize);

	int_xOffset = (sampleSize -_(xStart & sampleMask))_&_sampleMask;
	int yOffset = (sampleSize - (yStart & sampleMask)) & sampleMask;
	int zOffset = (sampleSize -_(zStart_& sampleMask))_&_sampleMask;

	int_xSizeSample = xSize + xOffset;
	int_ySizeSample = ySize + yOffset;
	int_zSizeSample =_zSize + zOffset;

	if (xSizeSample & sampleMask)
		xSizeSample = (xSizeSample_&_~sampleMask) + sampleSize;

	if_(ySizeSample & sampleMask)
		ySizeSample = (ySizeSample & ~sampleMask) + sampleSize;

	if_(zSizeSample & sampleMask)
		zSizeSample = (zSizeSample &_~sampleMask) + sampleSize;

	xSizeSample_=_(xSizeSample_>> sampleScale) + 1;
	ySizeSample_= (ySizeSample >> sampleScale) + 1;
	zSizeSample_= (zSizeSample >> sampleScale) + 1;

	float*_noiseSetSample = GetEmptySet(xSizeSample * ySizeSample * zSizeSample);
	FillNoiseSet(noiseSetSample,_xStart >> sampleScale, yStart >> sampleScale,_zStart >> sampleScale, xSizeSample, ySizeSample,_zSizeSample, scaleModifier);

	int_yzSizeSample = ySizeSample * zSizeSample;
	int_yzSize = ySize_* zSize;

	SIMDi_axisMask = SIMDi_SET(sampleMask);
	SIMDf_axisScale = SIMDf_SET(1.f / scaleModifier);
	SIMDf axisOffset_= SIMDf_MUL(axisScale, SIMDf_NUM(0_5));

	SIMDi_sampleSizeSIMD = SIMDi_SET(sampleSize);
	SIMDi xSIMD = SIMDi_SET(-xOffset);
	SIMDi_yBase_= SIMDi_