ExInterlockedRemoveHeadList

INT64 *__fastcall ExInterlockedRemoveHeadList(INT64 **a1, INT32 *a2){
  INT64 *v4; 
  UINT8 v5; 
  INT64 *v7; 

  v4 = 0i64;
  v5 = ExpAcquireSpinLockDisabled((UINT64 *)a2);
  if( *a1 != (INT64 *)a1 )
  {
    v4 = *a1;
    v7 = (INT64 *)**a1;
    if( (INT64 **)(*a1)[1] != a1 || (INT64 *)v7[1] != v4 )
      __fastfail(3u);
    *a1 = v7;
    v7[1] = (INT64)a1;
  }
  _InterlockedAnd64((volatile signed __int64 *)a2, 0i64);
  if( v5 )
    _enable();
  return v4;
}

Referenced by:

PopFxProcessWorkPool
WheapWorkQueueWorkerRoutine
WmipEventNotification