WheapCountBadPageExtents

__int64 __fastcall WheapCountBadPageExtents(__int64 *a1, unsigned int a2){
  unsigned int v2; 
  __int64 v3; 
  __int64 *v4; 
  __int64 v5; 
  bool v6; 
  unsigned int v7; 
  v2 = 0;
  if( a2 )
  {
    v3 = *a1;
    v2 = 1;
    if( a2 > 1 )
    {
      v4 = a1 + 1;
      v5 = a2 - 1;
      do
      {
        v6 = *v4 <= (unsigned __int64)(v3 + 1);
        v7 = v2 + 1;
        v3 = *v4++;
        if( v6 )
          v7 = v2;
        v2 = v7;
        --v5;
      }
      while( v5 );
    }
  }
  return v2;
}

Referenced by:

WheaPersistBadPageToBcd