CmGetDeclarativeFilterList

__int64 __fastcall CmGetDeclarativeFilterList(
        __int64 a1,
        char *a2,
        wchar_t *Str1,
        wchar_t *Str2,
        const wchar_t *a5,
        __int64 a6,
        int a7,
        __int64 a8){
  wchar_t *v9; 
  int v11; 
  wchar_t *pszDest; 
  int v13; 
  int v14; 
  int appended; 
  __int64 v16; 
  int v17; 
  int v18; 
  __int64 v19; 
  int v21[4]; 
  wchar_t *v22; 
  v22 = Str2;
  v9 = Str1;
  v21[0] = 0;
  v11 = 0;
  pszDest = 0i64;
  v13 = 0;
  v14 = 0;
  if( a6 )
  {
    if( (unsigned int)a7 < 2 )
      return(unsigned int)-1073741811;
    v14 = a7;
    pszDest = (wchar_t *)a6;
    *(_WORD *)a6 = 0;
  }
  if( !Str1 )
  {
    appended = CmAppendDeclarativeDefaultFilters(a1, a2, a5, (__int64)Str2, pszDest, v14, (__int64)v21);
    v13 = v21[0];
    v11 = appended;
    goto LABEL_26;
  }
  if( *Str1 )
  {
    while( 1 )
    {
      if( !wcsicmp(v9, Str2) )
      {
        v17 = CmAppendDeclarativeDefaultFilters(a1, a2, a5, v16, pszDest, v14, (__int64)v21);
        if( v17 == -1073741789 )
        {
          v11 = -1073741789;
          pszDest = 0i64;
        }
        else if( v17 < 0 )
        {
          v11 = v17;
          break;
        }
        v13 += v21[0];
        if( pszDest )
        {
          v14 -= v21[0];
          pszDest += (unsigned __int64)(unsigned int)v21[0] >> 1;
        }
      }
      v18 = CmAppendDeclarativeFilterLevel(a1, a2, v9, pszDest, v14, v21);
      if( v18 == -1073741789 )
      {
        v11 = -1073741789;
        pszDest = 0i64;
      }
      else if( (int)(v18 + 0x80000000) >= 0 && v18 != -1073741772 )
      {
        v11 = v18;
        break;
      }
      v13 += v21[0];
      if( pszDest )
      {
        v14 -= v21[0];
        pszDest += (unsigned __int64)(unsigned int)v21[0] >> 1;
      }
      v19 = -1i64;
      do
        ++v19;
      while( v9[v19] );
      v9 += v19 + 1;
      if( !*v9 )
        break;
      Str2 = v22;
    }
  }
LABEL_26:
  *(_DWORD *)a8 = v13 + 2;
  if( v11 >= 0 && v13 + 2 > (unsigned int)a7 )
    return(unsigned int)-1073741789;
  return(unsigned int)v11;
}

Referenced by:

CmGetDeviceCompoundFiltersWorker
CmGetInstallerClassCompoundFiltersWorker