KiIsThreadRankNonZero

VOID __stdcall KiIsThreadRankNonZero(_ETHREAD *Thread, _KPRCB *Prcb){
  unsigned __int8 CurrentIrql; 
  _KPRCB *CurrentPrcb; 
  __int64 v5; 
  __int64 v6; 
  if( *((char *)Thread + 195) < 16 && *((_QWORD *)Thread + 13) )
  {
    if( Prcb )
    {
      CurrentIrql = 2;
      CurrentPrcb = Prcb;
    }
    else
    {
      CurrentIrql = KeGetCurrentIrql();
      __writecr8(2ui64);
      CurrentPrcb = KeGetCurrentPrcb();
    }
    v5 = *((_QWORD *)Thread + 13);
    if( v5 )
    {
      v6 = *((unsigned int *)CurrentPrcb + 54) + v5;
      if( v6 )
      {
        if( Prcb )
        {
          KiGetThreadEffectiveRankNonZero(Thread, (_KSCB *)v6, 0i64, 0, 0i64);
        }
        else
        {
          do
          {
            if( ((*(unsigned __int8 *)(v6 + 112) >> 3) & 1) != 0 )
              break;
            v6 = *(_QWORD *)(v6 + 408);
          }
          while( v6 );
        }
      }
    }
    if( CurrentIrql < 2u )
      __writecr8(CurrentIrql);
  }
}

Referenced by:

KeDelayExecutionThread
KeQueryEffectiveBasePriorityThread
KeQueryEffectivePriorityThread
KeSetActualBasePriorityThread
KeTransitionProcessorParkState
KeUpdateThreadSchedulingProperties
KeYieldExecution
KiApplyForegroundBoostThread
KiCheckForEffectivePriorityChange
KiConfigureSchedulingInformation
KiDeferGroupSchedulingPreemption
KiDeferredReadySingleThread
KiDirectSwitchThread
KiGroupSchedulingGenerationEnd
KiGroupSchedulingQuantumEnd
KiQuantumEnd
KiRemoveBoostThread
KiSchedulerApc
KiSearchForNewThread
KiSearchForNewThreadOnProcessor
KiSelectNextThread
KiSetPriorityThread
KiSwapThread
KiTransitionSchedulingGroupGeneration
KiUpdateGlobalCpuSetConfiguration
KiUpdateThreadPriority