PopDirectedDripsWorkerRoutine

VOID __stdcall __noreturn PopDirectedDripsWorkerRoutine(PVOID StartContext){
  EVENT_DESCRIPTOR *v2; 
  __int64 v3; 
  UINT64 v4; 
  int v5; 
  __int64 v6; 
  int v7; 
  signed __int32 v8; 
  signed __int32 v9; 
  UINT64 v10; 
  int v11; 
  char v12; 
  int v13; 
  int v14[4]; 
  int v15; 
  int v16; 
  __int64 v17; 
  struct _EVENT_DATA_DESCRIPTOR UserData; 
  __int64 *v19; 
  __int64 v20; 
  UINT64 *v21; 
  __int64 v22; 
  EVENT_DATA_DESCRIPTOR v23; 
  int *v24; 
  __int64 v25; 
  int *v26; 
  __int64 v27; 
  int *v28; 
  __int64 v29; 
LABEL_1:
  while( KeWaitForSingleObject((char *)StartContext + 24, Executive, 0, 0, 0i64) )
    ;
  v3 = _InterlockedExchange64((volatile __int64 *)StartContext + 1, 0i64);
  v17 = v3;
  v12 = 0;
  if( PopDiagHandleRegistered )
  {
    v4 = PopDiagHandle;
    if( EtwEventEnabled(PopDiagHandle, (EVENT_DESCRIPTOR *)&POP_ETW_EVENT_DIRECTED_DRIPS_WORKER, v2) )
    {
      v12 = PopWnfCsEnterScenarioId;
      *(_QWORD *)&UserData.Size = 1i64;
      UserData.Ptr = (unsigned __int64)&v12;
      v20 = 8i64;
      v19 = &v17;
      v22 = 8i64;
      v21 = &PopWnfCsEnterScenarioId;
      EtwWrite(v4, (EVENT_DESCRIPTOR *)&POP_ETW_EVENT_DIRECTED_DRIPS_WORKER, 0i64, 3ui64, &UserData);
    }
  }
  while( 1 )
  {
    while( 1 )
    {
      if( !v3 )
        goto LABEL_1;
      if( (_DWORD)v3 )
      {
        _BitScanForward((unsigned int *)&v5, v3);
        v14[1] = v5;
      }
      else
      {
        _BitScanForward((unsigned int *)&v5, HIDWORD(v3));
        v14[2] = v11;
        LOBYTE(v5) = v11 + 32;
      }
      v6 = 1i64 << v5;
      v3 &= ~(1i64 << v5);
      if( 1i64 << v5 != 2 )
        break;
      v7 = *((_DWORD *)StartContext + 32);
      _m_prefetchw((char *)StartContext + 132);
      v8 = _InterlockedOr((volatile signed __int32 *)StartContext + 33, 0);
      v9 = v8;
      if( v7 != v8 )
      {
        v16 = v8;
        v15 = v7;
        v14[0] = 0;
        v13 = 0;
        if( PopDiagHandleRegistered )
        {
          v10 = PopDiagHandle;
          if( EtwEventEnabled(
                 PopDiagHandle,
                 (EVENT_DESCRIPTOR *)&POP_ETW_EVENT_DIRECTED_DRIPS_DISENGAGE_MASK_CHANGED,
                 v2) )
          {
            v13 = v9 & (v9 ^ v7);
            v14[0] = v7 & (v9 ^ v7);
            *(_QWORD *)&v23.Size = 4i64;
            v23.Ptr = (unsigned __int64)&v15;
            v25 = 4i64;
            v24 = &v16;
            v26 = &v13;
            v28 = v14;
            v27 = 4i64;
            v29 = 4i64;
            EtwWrite(v10, (EVENT_DESCRIPTOR *)&POP_ETW_EVENT_DIRECTED_DRIPS_DISENGAGE_MASK_CHANGED, 0i64, 4ui64, &v23);
          }
        }
        *((_DWORD *)StartContext + 32) = v9;
        if( *((_BYTE *)StartContext + 144) )
        {
          if( v7 )
          {
            if( !v9 )
LABEL_26:
              PopDirectedDripsSuspendDevices((INT32 *)StartContext);
          }
          else
          {
            PopDirectedDripsResumeDevices(StartContext, 0);
          }
        }
      }
    }
    switch( v6 )
    {
      case 0x400i64:
        PopDirectedDripsHandleResiliencyNotification((INT64)StartContext);
        break;
      case 0x800i64:
        if( *((_BYTE *)StartContext + 144) )
        {
          PopDirectedDripsResumeDevices(StartContext, 1);
          goto LABEL_26;
        }
        break;
      case 0x800000000i64:
        PopDeepSleepClearDisengageReason(8i64);
        break;
    }
  }
}

Referenced by:

No references.