qsort
VOID __fastcall qsort(UINT64 a1, UINT64 a2, UINT64 a3, INT64 a4, INT64 *a5, UINT64 a6, UINT64 a7){
UINT64 v11;
__int64 v12;
UINT64 v13;
UINT64 v14;
UINT64 i;
UINT64 v16;
_BYTE *v17;
UINT64 v18;
char v19;
UINT64 v20;
UINT64 v21;
_BYTE *v22;
UINT64 v23;
char v24;
UINT64 v25;
_BYTE *v26;
UINT64 v27;
char v28;
UINT64 v29;
_BYTE *v30;
UINT64 v31;
char v32;
unsigned __int64 v33;
_BYTE *v34;
unsigned __int64 v35;
_BYTE *v36;
unsigned __int64 v37;
char v38;
unsigned __int64 v39;
__int64 v40;
__int64 v41[62];
__int64 v42[62];
memset(v41, 0i64, sizeof(v41));
memset(v42, 0i64, sizeof(v42));
if( (a1 || !a2) && a3 && a4 )
{
if( a2 >= 2 )
{
v11 = a1 + a3 * (a2 - 1);
v12 = 0i64;
v40 = 0i64;
while( 1 )
{
while( 1 )
{
v13 = (v11 - a1) / a3 + 1;
if( v13 <= 8 )
{
if( v11 > a1 )
{
do
{
v14 = a1;
for( i = a3 + a1; i <= v11; i += a3 )
{
if( ((int(__fastcall *)(UINT64, UINT64))a4)(i, v14) > 0 )
v14 = i;
}
v16 = a3;
v17 = (_BYTE *)v11;
if( v14 != v11 )
{
v18 = v14 - v11;
do
{
v19 = v17[v18];
v17[v18] = *v17;
*v17++ = v19;
--v16;
}
while( v16 );
}
v11 -= a3;
}
while( v11 > a1 );
v12 = v40;
}
goto LABEL_18;
}
v20 = a3 * (v13 >> 1);
v21 = v20 + a1;
if( ((int(__fastcall *)(UINT64, UINT64))a4)(a1, v20 + a1) > 0 )
{
v23 = a3;
v22 = (_BYTE *)(v20 + a1);
if( a1 != v21 )
{
do
{
v24 = v22[-v20];
v22[-v20] = *v22;
*v22++ = v24;
--v23;
}
while( v23 );
}
}
if( ((int(__fastcall *)(UINT64, UINT64, _BYTE *, UINT64))a4)(a1, v11, v22, v23) > 0 )
{
v25 = a3;
v26 = (_BYTE *)v11;
if( a1 != v11 )
{
v27 = a1 - v11;
do
{
v28 = v26[v27];
v26[v27] = *v26;
*v26++ = v28;
--v25;
}
while( v25 );
}
}
if( ((int(__fastcall *)(UINT64, UINT64, UINT64))a4)(v20 + a1, v11, v25) > 0 )
{
v29 = a3;
v30 = (_BYTE *)v11;
if( v21 != v11 )
{
v31 = v21 - v11;
do
{
v32 = v30[v31];
v30[v31] = *v30;
*v30++ = v32;
--v29;
}
while( v29 );
}
}
v33 = a1;
v34 = (_BYTE *)v11;
while( 1 )
{
if( v21 > v33 )
{
while( 1 )
{
v33 += a3;
if( v33 >= v21 )
break;
if( ((int(__fastcall *)(unsigned __int64, UINT64, UINT64))a4)(v33, v21, v29) > 0 )
goto LABEL_38;
}
}
do
v33 += a3;
while( v33 <= v11 && ((int(__fastcall *)(unsigned __int64, UINT64, UINT64))a4)(v33, v21, v29) <= 0 );
do
{
LABEL_38:
v35 = (unsigned __int64)v34;
v34 -= a3;
}
while( (unsigned __int64)v34 > v21 && ((int(__fastcall *)(_BYTE *, UINT64))a4)(v34, v21) > 0 );
if( (unsigned __int64)v34 < v33 )
break;
v29 = a3;
v36 = v34;
if( v34 != (_BYTE *)v33 )
{
v37 = v33 - (_QWORD)v34;
do
{
v38 = v36[v37];
v36[v37] = *v36;
*v36++ = v38;
--v29;
}
while( v29 );
}
v39 = v33;
if( (_BYTE *)v21 != v34 )
v39 = v21;
v21 = v39;
}
if( v21 < v35 )
{
while( 1 )
{
v35 -= a3;
if( v35 <= v21 )
break;
if( ((unsigned int(__fastcall *)(unsigned __int64, UINT64))a4)(v35, v21) )
goto LABEL_53;
}
}
do
v35 -= a3;
while( v35 > a1 && !((unsigned int(__fastcall *)(unsigned __int64, UINT64))a4)(v35, v21) );
LABEL_53:
v12 = v40;
if( (__int64)(v35 - a1) >= (__int64)(v11 - v33) )
break;
if( v33 < v11 )
{
v41[v40] = v33;
v42[v40] = v11;
v12 = ++v40;
}
if( a1 >= v35 )
{
LABEL_18:
v40 = --v12;
if( v12 < 0 )
return;
a1 = v41[v12];
v11 = v42[v12];
}
else
{
v11 = v35;
}
}
if( a1 < v35 )
{
v41[v40] = a1;
v42[v40] = v35;
v12 = ++v40;
}
if( v33 >= v11 )
goto LABEL_18;
a1 = v33;
}
}
}
else
{
xHalTimerWatchdogStop(0i64, 0i64);
}
}Referenced by:
AdtpBuildObjectTypeStrings
AsiPopulateHashes
CmpSortedValueEnumStackEntryStart
EtwpAllocateTraceBuffer
EtwpGetTraceGroupInfo
EtwpUpdateDisallowedGuids
ExpLoadAndSortLicensingCacheDescriptors
HalpChannelInitializeStaticConfiguration
HalpNumaAddRangeProximity
HalpNumaInitializeStaticConfiguration
HalpNumaParseHmat
HvlStartBootLogicalProcessors
KiComputeNumaCosts
KiIntSteerCalculateDistribution
MiAssignTopLevelRanges
MiClearPteAccessed
MiCreateFreePfns
MiDeleteVa
MiFillNoReservationCluster
MiInitializeNumaGraph
MiMoveDirtyBitsToPfns
MiProcessCrcList
MiTerminateWsleCluster
MiZeroPage
MmFreeBootRegistry
MmUnmapViewInSystemCache
PnpAllocateResources
PpmCheckComputeHeteroResponse
PspBuildCreateProcessContext
RtlpDynamicLookasideRebalance
RtlpFcUpdateFeatureConfiguration
RtlpFcUpdateUsageTriggers
SLUpdateLicenseDataInternal
ST_STORE::StDmRegionEvict
SymCryptParallelHashProcess
VslInitializeSecureKernelCfg