HalpInterruptResetThisProcessor

VOID __stdcall __noreturn HalpInterruptResetThisProcessor(){
  unsigned int Number; 
  PVOID *v1; 
  PVOID *v2; 
  int v3; 
  __int64(__fastcall *v4)(PVOID); 
  int v5; 
  INT64 v6; 
  __int64(__fastcall *v7)(_QWORD); 
  int v8; 

  Number = KeGetPcr()->Prcb.Number;
  _disable();
  HalpInterruptInitializeLocalUnit((_REGISTERED_INTERRUPT_CONTROLLER *)Controller);
  *(&CmpDummyThreadEvent + 1789) = 12;
  if( !Number )
  {
    _InterlockedDecrement((volatile signed __int32 *)&HalpInterruptProcessorsStarted);
    while( _InterlockedExchangeAdd((volatile signed __int32 *)&HalpInterruptProcessorsStarted, 0) )
      _mm_pause();
    KeStallExecutionProcessor(0x64u);
    v1 = (PVOID *)qword_140C4B850;
    while( v1 != &qword_140C4B850 )
    {
      v2 = v1;
      v1 = (PVOID *)*v1;
      v3 = *((_DWORD *)v2 + 56);
      if( (v3 & 1) != 0 )
      {
        *((_DWORD *)v2 + 56) = v3 & 0xFFFFFFFE;
        HalpInterruptInitializeController((_REGISTERED_INTERRUPT_CONTROLLER *)v2);
        v4 = (__int64(__fastcall *)(PVOID))v2[22];
        if( v4 && (v5 = v4(v2[2]), v5 < 0) )
        {
          *(&CmpDummyThreadEvent + 1789) = 35;
          *((_DWORD *)v2 + 73) = 35;
          *((_DWORD *)v2 + 74) = v5;
          v2[38] = (PVOID)"minkernel\\hals\\lib\\interrupts\\common\\intsup.c";
          *((_DWORD *)v2 + 78) = 3011;
        }
        else
        {
          *((_DWORD *)v2 + 56) &= ~1u;
        }
      }
    }
    KeStallExecutionProcessor(0x64u);
  }
  HalPerformEndOfInterruptAtController[0]();
  v6 = Controller;
  v7 = *(__int64(__fastcall **)(_QWORD))(Controller + 168);
  if( v7 )
  {
    v8 = v7(*(_QWORD *)(Controller + 16));
    if( v8 < 0 )
    {
      *(_DWORD *)(v6 + 296) = v8;
      *(&CmpDummyThreadEvent + 1789) = 34;
      *(_DWORD *)(v6 + 292) = 34;
      *(_QWORD *)(v6 + 304) = "minkernel\\hals\\lib\\interrupts\\common\\intsup.c";
      *(_DWORD *)(v6 + 312) = 3060;
    }
  }
  HalpPowerWriteResetCommand(
    Number,
    (INT64 *)((unsigned __int64)&HalpInterruptProcessorsStarted & -(__int64)(Number != 0)));
  JUMPOUT(0x1404B9C51i64);
}

Referenced by:

HalpInterruptRebootService