IoGetLowerDeviceObjectWithTag

VOID *__fastcall IoGetLowerDeviceObjectWithTag(INT64 a1, UINT64 a2){
  ULONG v3; 
  UINT8 v4; 
  __int64 v5; 
  KIRQL v6; 
  void *v7; 
  int v8; 
  v3 = a2;
  v4 = KeAcquireQueuedSpinLock(0xAui64);
  v5 = *(_QWORD *)(a1 + 312);
  v6 = v4;
  v7 = 0i64;
  v8 = *(_DWORD *)(v5 + 32);
  if( (v8 & 0xF) == 0 || (v8 & 0xE) == 0 && *(_QWORD *)(v5 + 48) )
  {
    if( *(_QWORD *)(v5 + 48) )
    {
      v7 = *(void **)(v5 + 48);
      ObfReferenceObjectWithTag(v7, v3);
    }
  }
  KeReleaseQueuedSpinLock(0xAui64, v6);
  return v7;
}

Referenced by:

IoBuildPoDeviceNotifyList
IoGetLowerDeviceObject
IopCheckDeviceFlags
IopSynchronousCall
PiControlGetDeviceStack