ExpSaBinaryArrayRemove

UINT64 __fastcall ExpSaBinaryArrayRemove(INT64 a1, UINT64 a2){
  INT64 v2; 
  int v3; 
  _QWORD *v4; 
  UINT64 result; 
  v2 = a1;
  _BitScanReverse((unsigned int *)&a1, a2);
  v4 = *(_QWORD **)(v2 + 8i64 * (unsigned int)(v3 - 2));
  result = (unsigned int)a2;
  v4[((unsigned int)a2 ^ (unsigned __int64)(unsigned int)(1 << v3)) + 1] = 0i64;
  if( (*v4)-- == 1i64 )
  {
    *(_QWORD *)(v2 + 8i64 * (unsigned int)(a1 - 2)) = 0i64;
    LODWORD(result) = ExFreeHeapPool(v4);
  }
  return result;
}

Referenced by:

ExpSaPageGroupDescriptorAllocate
ExpSaPageGroupDescriptorFree