RtlpHeapListCompare

__int64 __fastcall RtlpHeapListCompare(__int64 a1, __int64 a2, int a3, char a4){
  int v7; 
  if( a4 )
  {
    v7 = *(_DWORD *)(a2 - 16 + 8);
    if( *(_DWORD *)(a1 + 124) )
    {
      v7 = *(_DWORD *)(a2 - 16 + 8) ^ *(_DWORD *)(a1 + 136);
      if( HIBYTE(v7) != ((unsigned __int8)v7 ^ (unsigned __int8)(BYTE1(v7) ^ BYTE2(v7))) )
        RtlpLogHeapFailure(3i64, a1, a2 - 16, 0i64, 0i64, 0i64);
    }
    return(unsigned int)(a3 - (unsigned __int16)v7);
  }
  else
  {
    return(unsigned int)(a3 - *(_DWORD *)(a2 + 40));
  }
}

Referenced by:

RtlpHeapAddListEntry
RtlpHeapFindListLookupEntry
RtlpHeapRemoveListEntry