HalpTimerDelayedQueryCounter
UINT64 __fastcall HalpTimerDelayedQueryCounter(VOID *InternalData){
void *v1;
void *v2;
void *v3;
__int64(__fastcall *v4)(VOID *);
UINT64 v6;
INT64 v7;
__int64 v8;
__int64 v9;
__int64 v10;
unsigned __int64 v11;
signed __int64 v12;
int v13;
unsigned __int64 v14;
__int64 v15;
__int64 v16;
unsigned __int64 v17;
signed __int64 v18;
__int64 v19;
__int64 v20;
__int64 v21;
int v23[18];
UINT64 FromFrequency;
v4 = (__int64(__fastcall *)(VOID *))HalpTimerDelayedQueryHardwareCount;
++HalpTimerHeavilyPenalizedQpcCalls;
*(_QWORD *)(HalpPerformanceCounter + 112) = HalpTimerDelayedQueryHardwareCount;
HalpTimerDelayedQueryHardwareCount = 0i64;
v6 = *((_QWORD *)HalpTimerSavedPerformanceCounter + 2);
if( v6 )
{
do
{
v7 = HalpPerformanceCounter;
FromFrequency = *(_QWORD *)(HalpPerformanceCounter + 192);
if( *(_DWORD *)(HalpPerformanceCounter + 220) == 64 )
{
HalpTimerGetInternalData((_KDPC *)HalpPerformanceCounter, v1, v2, v3);
v21 = (*(__int64(__fastcall **)(__int64))(v7 + 112))(v20);
v8 = *(_QWORD *)(v7 + 208);
v18 = v21;
}
else
{
do
{
v8 = *(_QWORD *)(v7 + 208);
do
{
v9 = *(_QWORD *)(v7 + 200);
HalpTimerGetInternalData((_KDPC *)v7, v1, v2, v3);
v11 = (*(__int64(__fastcall **)(__int64))(v7 + 112))(v10);
_InterlockedOr(v23, 0);
v12 = *(_QWORD *)(v7 + 200);
}
while( v9 != v12 );
}
while( v8 != *(_QWORD *)(v7 + 208) );
v13 = *(_DWORD *)(v7 + 220);
v14 = v9 ^ v11;
if( _bittest64((const __int64 *)&v14, (unsigned __int8)(v13 - 1)) )
{
if( v13 == 64 )
v15 = -1i64;
else
v15 = (1i64 << v13) - 1;
v16 = 1i64;
if( v13 != 64 )
v16 = 1i64 << v13;
v17 = v9 & v15;
v18 = v11 | v9 ^ v17;
if( v11 < v17 )
v18 += v16;
_InterlockedCompareExchange64((volatile signed __int64 *)(v7 + 200), v18, v12);
}
else
{
if( v13 == 64 )
v19 = -1i64;
else
v19 = (1i64 << v13) - 1;
v18 = v11 | v9 & ~v19;
}
}
}
while( HalpTimerScaleCounter(v8 + v18, FromFrequency, *((_QWORD *)HalpTimerSavedPerformanceCounter + 24)) < v6 );
}
return v4(InternalData);
}Referenced by:
No references.