SdbpCreateSearchPathPartsFromPath

__int64 __fastcall SdbpCreateSearchPathPartsFromPath(const wchar_t *a1, _QWORD *a2){
  const wchar_t *v3; 
  unsigned int v4; 
  const wchar_t *v5; 
  int i; 
  WCHAR *v7; 
  VOID *v8; 
  INT64 v9; 
  _DWORD *v10; 
  _DWORD *v11; 
  __int64 v12; 
  const wchar_t *j; 
  wchar_t v14; 
  __int64 v16; 
  v3 = a1;
  v4 = 0;
  v5 = 0i64;
  if( a1 )
  {
    for( i = *a1 != 0; ; ++i )
    {
      v7 = wcschr((WCHAR *)a1, 0x3Bu);
      if( !v7 )
        break;
      a1 = v7 + 1;
    }
    v10 = AslAlloc(v8, 48i64 * (unsigned int)(i - 1) + 56, v9);
    v11 = v10;
    if( v10 )
    {
      *v10 = i;
      v12 = -1i64;
      do
        ++v12;
      while( v3[v12] );
      for( j = &v3[v12]; ; --j )
      {
        if( j < v3 )
        {
          *a2 = v11;
          return 1i64;
        }
        v14 = *j;
        if( *j == 92 )
        {
          if( v5 )
          {
LABEL_13:
            if( v3 != j )
              continue;
            goto LABEL_8;
          }
          v5 = j;
        }
        if( v14 != 59 )
          goto LABEL_13;
LABEL_8:
        if( v5 )
        {
          if( v14 == 59 )
            ++j;
          v16 = 6i64 * v4++;
          v11[2 * v16 + 4] = v5 - j + 1;
          v5 = 0i64;
          *(_QWORD *)&v11[2 * v16 + 2] = j;
        }
      }
    }
    AslLogCallPrintf(1ui64, "SdbpCreateSearchPathPartsFromPath", 0x589ui64, "Failed to allocate search path parts");
  }
  else
  {
    AslLogCallPrintf(1ui64, "SdbpCreateSearchPathPartsFromPath", 0x56Cui64, "Invalid argument");
  }
  return 0i64;
}

Referenced by:

SdbpInitializeSearchDBContext