PopDirectedDripsDiagRundownDevices

VOID __stdcall PopDirectedDripsDiagRundownDevices(){
  char *v0; 
  __int64 v1; 
  unsigned int v2; 
  unsigned int v3; 
  int *v4; 
  int v5; 
  int v6; 
  _UNICODE_STRING *v7; 
  _UNICODE_STRING *v8; 
  char v9; 
  _UNICODE_STRING *v10; 
  _UNICODE_STRING *v11; 
  const _UNICODE_STRING *v12; 
  __int64 v13; 
  _UNICODE_STRING *v14; 
  REGHANDLE v15; 
  int Length; 
  int v17; 
  int v18; 
  int v19; 
  unsigned int v20; 
  _QWORD *v21; 
  int v22; 
  _DWORD *v23; 
  __int64 v24; 
  __int64 v25; 
  unsigned __int64 v26; 
  __int64 v27; 
  unsigned __int64 v28; 
  __int64 v29; 
  __int64 v30; 
  __int64 v31; 
  __int64 v32; 
  char v33[4]; 
  unsigned int v34; 
  int v35; 
  int v36; 
  int v37; 
  int v38; 
  __int64 v39; 
  _UNICODE_STRING *v40; 
  _UNICODE_STRING *v41; 
  int v42; 
  int v43; 
  int v44; 
  int v45; 
  _UNICODE_STRING *v46; 
  UINT64 v47; 
  UINT64 v48; 
  _EVENT_DATA_DESCRIPTOR v49; 
  int *v50; 
  __int64 v51; 
  int *v52; 
  __int64 v53; 
  wchar_t *Buffer; 
  int v55[2]; 
  int *v56; 
  __int64 v57; 
  __int64 v58; 
  int v59[2]; 
  int *v60; 
  __int64 v61; 
  wchar_t *v62; 
  int v63[2]; 
  int *v64; 
  __int64 v65; 
  wchar_t *v66; 
  int v67[2]; 
  int *v68; 
  __int64 v69; 
  int *v70; 
  __int64 v71; 
  int *v72; 
  __int64 v73; 
  int *v74; 
  __int64 v75; 
  int *v76; 
  __int64 v77; 
  wchar_t *v78; 
  int v79[2]; 
  UINT64 *v80; 
  __int64 v81; 
  _UNICODE_STRING **v82; 
  __int64 v83; 
  int *v84; 
  __int64 v85; 
  wchar_t *v86; 
  int v87[2]; 
  __int64 *v88; 
  __int64 v89; 
  _QWORD v90[28]; 

  v34 = 0;
  v38 = 0;
  LODWORD(v39) = 0;
  v36 = 0;
  v37 = 0;
  v33[0] = PopWnfCsEnterScenarioId;
  v47 = PopWnfCsEnterScenarioId;
  while( 1 )
  {
    v0 = (char *)qword_140C1E990;
    if( qword_140C1E990 == &qword_140C1E990 )
      break;
    if( *((PVOID **)qword_140C1E990 + 1) != &qword_140C1E990
      || (v1 = *(_QWORD *)qword_140C1E990, *(PVOID *)(*(_QWORD *)qword_140C1E990 + 8i64) != qword_140C1E990) )
    {
      __fastfail(3u);
    }
    qword_140C1E990 = *(PVOID *)qword_140C1E990;
    v2 = 0;
    *(_QWORD *)(v1 + 8) = &qword_140C1E990;
    v3 = 0;
    v34 = 0;
    if( *((_DWORD *)v0 + 39) )
    {
      PopDirectedDripsDiagCreateBlockerEntryULong((__int64)v90, (__int64)L"DFX Transition Count");
      v2 = v34 + 1;
      v34 = v2;
      v3 = v2;
    }
    if( *((_DWORD *)v0 + 40) )
    {
      PopDirectedDripsDiagCreateBlockerEntryULong((__int64)&v90[7 * v3], (__int64)L"PS4 Transition Count");
      v2 = v34 + 1;
      v34 = v2;
      v3 = v2;
    }
    v4 = (int *)(v0 + 152);
    v5 = *((_DWORD *)v0 + 38);
    v6 = v5;
    if( (_WORD)v5 )
    {
      PopDirectedDripsDiagCreateBlockerEntryBoolean((INT64)&v90[7 * v3], (INT64)L"Problem Device");
      v2 = v34 + 1;
      v34 = v2;
      v3 = v2;
      v5 = *v4;
      v6 = *v4;
    }
    if( (v6 & 0x10000) != 0 )
    {
      PopDirectedDripsDiagCreateBlockerEntryBoolean((INT64)&v90[7 * v3], (INT64)L"Initiated PS4 Transition");
      v2 = ++v34;
      v5 = *v4;
      v6 = *v4;
    }
    if( (v6 & 0x40000) != 0 )
    {
      v7 = &PopDirectedDripsDiagEmptyString;
      v8 = &PopDirectedDripsDiagEmptyString;
      if( *((_QWORD *)v0 + 7) )
        v8 = (_UNICODE_STRING *)(v0 + 48);
      v9 = 0;
      if( *((_QWORD *)v0 + 9) )
      {
        v46 = (_UNICODE_STRING *)(v0 + 64);
        v7 = &PopDirectedDripsDiagEmptyString;
      }
      else
      {
        v46 = &PopDirectedDripsDiagEmptyString;
      }
      v10 = &PopDirectedDripsDiagEmptyString;
      if( *((_QWORD *)v0 + 11) )
        v10 = (_UNICODE_STRING *)(v0 + 80);
      v11 = &PopDirectedDripsDiagEmptyString;
      if( *((_QWORD *)v0 + 13) )
        v11 = (_UNICODE_STRING *)(v0 + 96);
      if( *((_QWORD *)v0 + 15) )
      {
        v40 = (_UNICODE_STRING *)(v0 + 112);
        v7 = &PopDirectedDripsDiagEmptyString;
      }
      else
      {
        v40 = &PopDirectedDripsDiagEmptyString;
      }
      if( *((_QWORD *)v0 + 17) )
        v7 = (_UNICODE_STRING *)(v0 + 128);
      v41 = v7;
      if( (unsigned int)dword_140D2C920 > 5 && tlgKeywordOn((__int64)&dword_140D2C920, 0x400000000000i64) )
      {
        LOBYTE(v35) = v33[0];
        v51 = 1i64;
        v50 = &v35;
        v52 = v55;
        Buffer = v8->Buffer;
        v55[0] = v8->Length;
        v53 = 2i64;
        v55[1] = 0;
        v12 = PopDirectedDripsDiagSanitizeHardwareId((unsigned __int16 *)v0 + 32);
        v57 = 2i64;
        v56 = v59;
        v59[1] = 0;
        v13 = (__int64)v12->Buffer;
        v59[0] = v12->Length;
        v60 = v63;
        v62 = v10->Buffer;
        v63[0] = v10->Length;
        v64 = v67;
        v66 = v11->Buffer;
        v67[0] = v11->Length;
        v42 = *((_DWORD *)v0 + 37);
        v68 = &v42;
        v43 = *((_DWORD *)v0 + 39);
        v70 = &v43;
        v44 = *((_DWORD *)v0 + 40);
        v72 = &v44;
        v74 = &v45;
        v76 = v79;
        v58 = v13;
        v61 = 2i64;
        v63[1] = 0;
        v65 = 2i64;
        v78 = v40->Buffer;
        v79[0] = v40->Length;
        v48 = v47;
        v80 = &v48;
        LODWORD(v40) = *((_DWORD *)v0 + 6);
        v82 = &v40;
        v84 = v87;
        v67[1] = 0;
        v69 = 4i64;
        v71 = 4i64;
        v73 = 4i64;
        v45 = v5;
        v75 = 4i64;
        v77 = 2i64;
        v79[1] = 0;
        v81 = 8i64;
        v83 = 4i64;
        v85 = 2i64;
        v14 = v41;
        v87[1] = 0;
        v41 = (_UNICODE_STRING *)0x1000000;
        v89 = 8i64;
        v86 = v14->Buffer;
        v87[0] = v14->Length;
        v88 = (__int64 *)&v41;
        tlgWriteTransfer_EtwWriteTransfer(
          (__int64)&dword_140D2C920,
          (unsigned __int8 *)byte_140028E21,
          0i64,
          0i64,
          0x16u,
          &v49);
        v2 = v34;
        v9 = 0;
      }
      if( PopDiagHandleRegistered != v9 )
      {
        v15 = PopDiagHandle;
        if( EtwEventEnabled(PopDiagHandle, &POP_ETW_EVENT_DIRECTED_DRIPS_DEVICE_STATS) )
        {
          PopDirectedDripsDiagEventData.Ptr = (unsigned __int64)v33;
          *(_QWORD *)&PopDirectedDripsDiagEventData.Size = 1i64;
          qword_140C1E830 = (__int64)(v0 + 16);
          qword_140C1E838 = 8i64;
          v36 = v8->Length >> 1;
          qword_140C1E840 = (__int64)&v36;
          qword_140C1E848 = 4i64;
          Length = v8->Length;
          qword_140C1E850 = (__int64)v8->Buffer;
          dword_140C1E858 = Length;
          dword_140C1E85C = 0;
          v37 = v46->Length >> 1;
          qword_140C1E860 = (__int64)&v37;
          qword_140C1E868 = 4i64;
          v17 = v46->Length;
          qword_140C1E870 = (__int64)v46->Buffer;
          dword_140C1E878 = v17;
          dword_140C1E87C = 0;
          v38 = v10->Length >> 1;
          qword_140C1E880 = (__int64)&v38;
          qword_140C1E888 = 4i64;
          v18 = v10->Length;
          qword_140C1E890 = (__int64)v10->Buffer;
          dword_140C1E898 = v18;
          dword_140C1E89C = 0;
          LODWORD(v39) = v11->Length >> 1;
          qword_140C1E8A0 = (__int64)&v39;
          qword_140C1E8A8 = 4i64;
          v19 = v11->Length;
          qword_140C1E8B0 = (__int64)v11->Buffer;
          qword_140C1E8C0 = (__int64)(v0 + 148);
          qword_140C1E8D0 = (__int64)(v0 + 156);
          qword_140C1E8F0 = (__int64)(v0 + 152);
          dword_140C1E8B8 = v19;
          qword_140C1E8E0 = (__int64)(v0 + 160);
          dword_140C1E8BC = 0;
          qword_140C1E8C8 = 4i64;
          qword_140C1E8D8 = 4i64;
          qword_140C1E8E8 = 4i64;
          qword_140C1E8F8 = 4i64;
          EtwWrite(v15, &POP_ETW_EVENT_DIRECTED_DRIPS_DEVICE_STATS, 0, 0xEu, &PopDirectedDripsDiagEventData);
          v2 = v34;
        }
      }
    }
    if( PopDiagSleepStudyHandleRegistered && v2 )
    {
      v20 = 0;
      v21 = v90;
      do
      {
        v22 = 5 * v20++;
        v23 = v21 + 2;
        v24 = 2i64 * (unsigned int)(v22 + 2);
        v25 = 2i64 * (unsigned int)(v22 + 3);
        *(&PopDirectedDripsDiagEventData.Ptr + v24) = (unsigned __int64)(v0 + 32);
        *((_QWORD *)&PopDirectedDripsDiagEventData.Size + v24) = 16i64;
        v26 = v21[1];
        *(&PopDirectedDripsDiagEventData.Ptr + v25) = (unsigned __int64)v21;
        *((_QWORD *)&PopDirectedDripsDiagEventData.Size + v25) = 4i64;
        v27 = 2i64 * (unsigned int)(v22 + 4);
        *(&PopDirectedDripsDiagEventData.Ptr + v27) = v26;
        LODWORD(v26) = *(_DWORD *)v21;
        *(&PopDirectedDripsDiagEventData.Reserved + 2 * v27) = 0;
        *(&PopDirectedDripsDiagEventData.Size + 2 * v27) = 2 * v26;
        v28 = (unsigned __int64)v21 + 20;
        v21 += 7;
        v29 = 2i64 * (unsigned int)(v22 + 5);
        *(&PopDirectedDripsDiagEventData.Ptr + v29) = (unsigned __int64)v23;
        *((_QWORD *)&PopDirectedDripsDiagEventData.Size + v29) = 4i64;
        v30 = 2i64 * (unsigned int)(v22 + 6);
        *(&PopDirectedDripsDiagEventData.Ptr + v30) = v28;
        *((_QWORD *)&PopDirectedDripsDiagEventData.Size + v30) = (unsigned int)(2 * *v23);
      }
      while( v20 < v2 );
      *(_QWORD *)&PopDirectedDripsDiagEventData.Size = 1i64;
      PopDirectedDripsDiagEventData.Ptr = (unsigned __int64)v33;
      v31 = 2i64 * (unsigned int)(v22 + 7);
      qword_140C1E838 = 4i64;
      qword_140C1E830 = (__int64)&v34;
      *(&PopDirectedDripsDiagEventData.Ptr + v31) = (unsigned __int64)&v47;
      *((_QWORD *)&PopDirectedDripsDiagEventData.Size + v31) = 8i64;
      EtwWrite(
        PopDiagSleepStudyHandle,
        &SLEEPSTUDY_EVT_SCENARIO_BLOCKER_DATA,
        0,
        v2 + 4 * v2 + 3,
        &PopDirectedDripsDiagEventData);
    }
    v32 = *((_QWORD *)v0 + 2);
    if( v32 )
    {
      *(_QWORD *)(v32 + 776) = 0i64;
      *((_QWORD *)v0 + 2) = 0i64;
    }
    PopDirectedDripsDiagFreeDeviceDiagnostic(v0);
  }
}

Referenced by:

PopDirectedDripsDiagNotifySessionStop