PopDirectedDripsDiagTraceBroadcastVisit

VOID __fastcall PopDirectedDripsDiagTraceBroadcastVisit(INT64 a1, INT64 a2, INT64 a3){
  int v4; 
  EVENT_DESCRIPTOR *v5; 
  int v6; 
  CHAR *DeviceDiagnostic; 
  bool v8; 
  int v9; 
  UINT64 v10; 
  unsigned int v11; 
  __int64 v12; 
  int v13; 
  int v14; 
  int v15; 
  unsigned int v16; 
  int v17; 
  INT64 v18; 
  EVENT_DATA_DESCRIPTOR UserData; 
  int *v20; 
  int v21; 
  int v22; 
  INT64 *v23; 
  int v24; 
  int v25; 
  int *v26; 
  int v27; 
  int v28; 
  __int64 v29; 
  int v30; 
  int v31; 
  int *v32; 
  int v33; 
  int v34; 
  v16 = 0;
  v14 = 0;
  v17 = 0;
  v4 = a3;
  v18 = a1;
  ExAcquirePushLockExclusiveEx((UINT64)&PopDirectedDripsDiagLock, 0i64);
  if( a2 )
    v6 = *(_DWORD *)(a2 + 32);
  else
    v6 = -1;
  v15 = v6;
  DeviceDiagnostic = *(CHAR **)(v18 + 776);
  if( !DeviceDiagnostic )
  {
    DeviceDiagnostic = PopDirectedDripsDiagCreateDeviceDiagnostic(v18);
    if( !DeviceDiagnostic )
      goto LABEL_13;
    v6 = v15;
  }
  v8 = (*((_DWORD *)DeviceDiagnostic + 38) & 0x20000) == 0;
  *((_DWORD *)DeviceDiagnostic + 37) = v6;
  v9 = v14;
  if( !v8 )
    v9 = 1;
  v14 = v9;
  if( PopDiagHandleRegistered )
  {
    v10 = PopDiagHandle;
    if( EtwEventEnabled(PopDiagHandle, (EVENT_DESCRIPTOR *)&POP_ETW_EVENT_DIRECTED_DRIPS_DEVICE_VISIT, v5) )
    {
      v11 = *(unsigned __int16 *)(v18 + 40);
      UserData.Reserved = 0;
      v22 = 0;
      v25 = 0;
      v28 = 0;
      v16 = v11 >> 1;
      UserData.Ptr = (unsigned __int64)&v15;
      v20 = &v14;
      v23 = &v18;
      v26 = (int *)&v16;
      UserData.Size = 4;
      v21 = 4;
      v27 = 4;
      v24 = 8;
      v12 = *(_QWORD *)(v18 + 48);
      v13 = *(unsigned __int16 *)(v18 + 40);
      v31 = 0;
      v34 = 0;
      v29 = v12;
      v32 = &v17;
      v30 = v13;
      v33 = 4;
      v17 = v4;
      EtwWrite(v10, (EVENT_DESCRIPTOR *)&POP_ETW_EVENT_DIRECTED_DRIPS_DEVICE_VISIT, 0i64, 6ui64, &UserData);
    }
  }
  *((_DWORD *)DeviceDiagnostic + 38) |= 0x40000u;
LABEL_13:
  if( (_InterlockedExchangeAdd64((volatile signed __int64 *)&PopDirectedDripsDiagLock, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
    ExfTryToWakePushLock((volatile INT64 *)&PopDirectedDripsDiagLock);
  KeAbPostRelease(&PopDirectedDripsDiagLock);
}

Referenced by:

PopDirectedDripsVisitDevice