RtlCSparseBitmapFindBitSetCapped
UINT64 __stdcall RtlCSparseBitmapFindBitSetCapped(INT64 a1, UINT64 a2, INT64 a3){
unsigned __int64 v6;
__int64 v7;
__int64 v8;
__int64 v9;
const signed __int64 *v10;
__int64 v11;
UINT64 v12;
UINT64 v15;
__int64 v16;
INT64 v17[2];
*(_OWORD *)v17 = 0i64;
while( a3 )
{
v6 = a2 & 0x7FFF;
v7 = a3;
v8 = v6 + a3;
if( a3 < 0 )
{
v7 = ~v6;
if( v8 >= 0 )
v7 = a3;
}
else if( v8 > 0x8000 )
{
v7 = 0x8000 - v6;
}
if( _bittest64((const signed __int64 *)(a1 + 56), a2 >> 30) )
{
if( _bittest64(*(const signed __int64 **)a1, a2 >> 15) )
{
v9 = 1i64;
if( v7 > 1 )
v9 = v7;
v10 = (const signed __int64 *)(*(_QWORD *)(a1 + 8) + (((__int64)a2 / 0x8000) << 12));
v17[0] = v6 + v9;
v17[1] = (INT64)v10;
if( _bittest64(v10, v6) )
{
v11 = 0i64;
}
else
{
v12 = a2 & 0x7FFF;
v11 = v7 <= 0 ? -(__int64)RtlLengthCurrentClearRunBackwardEx((INT64)v17, v12, -v7) : RtlLengthCurrentClearRunForwardEx(
v17,
v12);
}
if( (__int64)abs64(v11) < (__int64)abs64(v7) )
return v6 + v11 + (((__int64)a2 / 0x8000) << 15);
}
}
else
{
v15 = a2 & 0x3FFFFFFF;
v7 = a3;
v16 = v15 + a3;
if( a3 >= 0 )
{
if( v16 > 0x40000000 )
v7 = 0x40000000 - v15;
}
else
{
v7 = ~(unsigned __int64)(unsigned int)v15;
if( v16 >= 0 )
v7 = a3;
}
}
a2 += v7;
a3 -= v7;
}
return -1i64;
}Referenced by:
RtlSparseArrayElementAllocated
RtlSparseArrayElementFindCapped