PopStatsScenarioStateChange

CHAR __fastcall PopStatsScenarioStateChange(INT64 a1, CHAR a2){
  INT64 StatsForScenarioType; 
  volatile signed __int32 *v4; 
  signed __int32 v5; 
  StatsForScenarioType = (INT64)PopAvlFindOrMakeStatsForScenarioType(a1);
  v4 = (volatile signed __int32 *)StatsForScenarioType;
  if( StatsForScenarioType )
  {
    StatsForScenarioType = PopGetStopWatchByRequestType(StatsForScenarioType, 3i64);
    if( StatsForScenarioType )
    {
      v5 = _InterlockedExchangeAdd(v4, 0);
      if( a2 )
      {
        if( !v5 )
        {
          _InterlockedIncrement(v4);
          LOBYTE(StatsForScenarioType) = PoStartStopWatch(StatsForScenarioType);
        }
      }
      else if( v5 == 1 )
      {
        _InterlockedDecrement(v4);
        LOBYTE(StatsForScenarioType) = PoPauseStopWatch(StatsForScenarioType);
      }
    }
  }
  return StatsForScenarioType;
}

Referenced by:

PopPowerRequestNotifyMobileHotspotChanged
PopWnfAudioCallback