MmFreeContiguousMemory

VOID __stdcall MmFreeContiguousMemory(PVOID BaseAddress){
  int SystemRegionType; 
  int v3; 
  UINT64 v4[2]; 
  __int128 v5; 
  UINT64 v6; 
  SIZE_T NumberOfBytes; 
  NumberOfBytes = 0i64;
  *(_OWORD *)v4 = 0i64;
  v5 = 0i64;
  SystemRegionType = MiGetSystemRegionType((UINT64)BaseAddress);
  if( SystemRegionType != 5 )
  {
    if( SystemRegionType )
    {
      MiFillPteHierarchy((UINT64)BaseAddress, v4);
      v3 = 4;
      do
        v6 = MI_READ_PTE_LOCK_FREE(v4[--v3]);
      while( (v6 & 0x80u) == 0i64 && v3 );
      if( ((unsigned __int16)BaseAddress & 0xFFF) == 0 )
      {
        ExRemovePoolTag(BaseAddress);
        KeBugCheckEx(0xC2u, 0x60ui64, (ULONG_PTR)BaseAddress, NumberOfBytes, 0i64);
      }
      KeBugCheckEx(0xC2u, 0x61ui64, (ULONG_PTR)BaseAddress, 0i64, 0i64);
    }
    KeBugCheckEx(0xC2u, 0x62ui64, (ULONG_PTR)BaseAddress, 0i64, 0i64);
  }
  ExFreePoolWithTag(BaseAddress, 0);
}

Referenced by:

ExtEnvAllocatePhysicalMemory
ExtEnvFreePhysicalMemory
HalFreeCommonBuffer
HalFreeCommonBufferV3
HalpAllocateDomainCommonBufferInternal
HalpDmaAllocateLocalContiguousPool
HalpDmaAllocateMapRegisters
HalpDmaFreeChildAdapter
HalpDmaGrowContiguousMapBuffers
HvlSetupPhysicalFaultNotificationQueue
HvlpFreeOverlayPages
IommupHvInitializeLibrary
IopInitializeInMemoryDumpData
ViReleaseDmaAdapter