EtwpUpdateLastBranchTracingConfiguration

INT64 __fastcall EtwpUpdateLastBranchTracingConfiguration(INT64 a1, INT64 a2){
  int LbrData; 
  unsigned int v4; 
  if( EtwpLastBranchSupportedOptions )
  {
    v4 = *(_DWORD *)(a2 + 16);
    if( (~EtwpLastBranchSupportedOptions & v4) != 0 || (v4 & 3) == 3 )
    {
      return(unsigned int)-1073741811;
    }
    else
    {
      if( (*(_DWORD *)(a1 + 832) & 0x8000) != 0 )
        return 3221226243i64;
      if( *(_QWORD *)(a1 + 1008) || (LbrData = EtwpAllocateLbrData(a1), LbrData >= 0) )
      {
        if( **(_DWORD **)(a1 + 1008) )
        {
          return(unsigned int)-1073741053;
        }
        else
        {
          LbrData = ((__int64(__fastcall *)(_QWORD))off_140C009B0[0])(v4);
          if( LbrData >= 0 )
          {
            EtwpReferenceLastBranchLookasideList();
            *(_DWORD *)(*(_QWORD *)(a1 + 1008) + 4i64) = v4;
            _InterlockedOr((volatile signed __int32 *)(a1 + 832), 0x8000u);
          }
        }
      }
    }
  }
  else
  {
    return(unsigned int)-1073741637;
  }
  return(unsigned int)LbrData;
}

Referenced by:

EtwSetPerformanceTraceInformation