ExFreePoolSanityChecks

VOID __stdcall ExFreePoolSanityChecks(VOID *P){
  unsigned __int8 CurrentIrql; 
  POOL_TYPE v3; 
  char *v4; 
  char v5; 
  int v6; 
  ULONG_PTR v7; 
  UINT64 v8; 

  if( !(unsigned int)KevSkipVerification() )
  {
    if( (unsigned __int64)P <= 0x7FFFFFFEFFFFi64 )
      VerifierBugCheckIfAppropriate(0xC4ui64, 0x10u, (ULONG_PTR)P, 0, 0, v8);
    if( !ExpSpecialAllocations || !ExIsSpecialPoolAddress(P) )
    {
      CurrentIrql = KeGetCurrentIrql();
      if( ((unsigned __int16)P & 0xFFF) == 0 )
      {
        v3 = MmDeterminePoolType(P);
        if( (v3 & 1) != 0 )
        {
          if( CurrentIrql > 1u )
            VerifierBugCheckIfAppropriate(0xC4ui64, 0x11u, CurrentIrql, v3, (ULONG_PTR)P, v8);
        }
        else if( CurrentIrql > 2u )
        {
          VerifierBugCheckIfAppropriate(0xC4ui64, 0x12u, CurrentIrql, v3, (ULONG_PTR)P, v8);
        }
        return;
      }
      if( ((unsigned __int8)P & 0xF) != 0 )
        VerifierBugCheckIfAppropriate(0xC4ui64, 0x16u, 0x15A9u, (ULONG_PTR)P, 0, v8);
      v4 = (char *)P - 16;
      v5 = *((char *)P - 13);
      if( (v5 & 3) == 0 )
      {
        VerifierBugCheckIfAppropriate(0xC4ui64, 0x13u, 0x15B3u, (_DWORD)P - 16, *(_DWORD *)v4, v8);
        v5 = v4[3];
      }
      v6 = v5 & 3;
      if( (v6 & 1) != 0 )
      {
        if( CurrentIrql <= 1u )
          goto LABEL_22;
        v7 = 17;
      }
      else
      {
        if( CurrentIrql <= 2u )
          goto LABEL_22;
        v7 = 18;
      }
      VerifierBugCheckIfAppropriate(0xC4ui64, v7, CurrentIrql, v6, (ULONG_PTR)P, v8);
LABEL_22:
      if( (v4[3] & 2) == 0 )
        VerifierBugCheckIfAppropriate(0xC4ui64, 0x14u, 0x15D0u, (_DWORD)P - 16, 0, v8);
    }
  }
}

Referenced by:

VerifierExFreePool
VerifierExFreePoolWithTag