PopDiagTraceBatteryTriggerFlags

INT64 __fastcall PopDiagTraceBatteryTriggerFlags(UINT64 *a1, INT64 a2){
  INT64 result; 
  int v3; 
  const CHAR *v4; 
  int v5; 
  char v6; 
  char v7; 
  char v8; 
  char v9; 
  char v10; 
  char v11; 
  char v12; 
  char v13; 
  int v14; 
  struct _EVENT_DATA_DESCRIPTOR v15; 
  char v16[16]; 
  char *v17; 
  __int64 v18; 
  char *v19; 
  __int64 v20; 
  char *v21; 
  __int64 v22; 
  char *v23; 
  __int64 v24; 
  int *v25; 
  __int64 v26; 
  result = *(unsigned int *)a1;
  v3 = dword_140C236AC;
  if( (unsigned int)result < 4 )
  {
    v4 = IndexToActionName[result];
    if( (unsigned int)result <= 1 )
    {
      v5 = *(_DWORD *)(a2 + 4);
      if( v5 != PopBatteryTriggerCachedFlags[result] )
      {
        PopBatteryTriggerCachedFlags[result] = v5;
        if( (unsigned int)dword_140C021E8 > 5 )
        {
          tlgCreate1Sz_char((__int64)v16, v4);
          v10 = v6;
          v17 = &v10;
          v12 = v7;
          v19 = &v11;
          v18 = 1i64;
          v21 = &v12;
          v11 = v8;
          v23 = &v13;
          v20 = 1i64;
          v25 = &v14;
          v22 = 1i64;
          v13 = v9;
          v24 = 1i64;
          v14 = v3;
          v26 = 4i64;
          LODWORD(result) = tlgWriteTransfer_EtwWriteTransfer(
                              (__int64)&dword_140C021E8,
                              (unsigned __int8 *)byte_140026980,
                              0i64,
                              0i64,
                              8u,
                              &v15);
        }
      }
    }
  }
  return result;
}

Referenced by:

PopBatteryApplyCompositeState
PopRecalculateCBTriggerLevels
PopResetCBTriggers