ExAllocateTimerInternal2

CHAR *__stdcall ExAllocateTimerInternal2(INT64 a1, INT64 a2, INT16 *a3, UINT64 a4){
  unsigned __int64 v5; 
  VOID **PoolWithTag; 
  VOID **v9; 
  __int64 v10; 
  INT64 v12; 
  UINT8 v13[2]; 
  INT16 v14; 

  v5 = (unsigned int)a4;
  if( !ExpExTimerAttributesAreValid((unsigned int)a4) || ((v5 & 2) != 0) != (a3 != 0i64) )
    KeBugCheckEx(0xC7u, (PVOID)9, 0i64, (PVOID)v5, 0i64);
  PoolWithTag = ExAllocatePoolWithTag(0x200ui64, 0xA0ui64, 1834252357i64);
  v9 = PoolWithTag;
  if( PoolWithTag )
  {
    if( (v5 & 2) != 0 )
    {
      *(_WORD *)v13 = *a3;
      v14 = a3[1];
      LODWORD(v12) = v5;
      KeInitializeIRTimer((INT64)PoolWithTag, a1, a2, v13, v12);
    }
    else
    {
      *((_WORD *)PoolWithTag + 1) = 0;
      KiInitializeTimer2((INT64)PoolWithTag, a1, a2, (unsigned int)v5);
    }
    v9[17] = (VOID *)(KiWaitNever ^ __ROR8__((unsigned __int64)v9 ^ _byteswap_uint64(KiWaitAlways), KiWaitNever));
    v10 = KiWaitNever ^ __ROR8__((unsigned __int64)v9 ^ _byteswap_uint64(KiWaitAlways), KiWaitNever);
    *((_BYTE *)v9 + 152) = ExpTimerFreedCookie;
    v9[18] = (VOID *)v10;
  }
  return(CHAR *)v9;
}

Referenced by:

ExAllocateTimer
ExAllocateTimerInternal