VrpFindNamespaceNode

_UNICODE_STRING *__fastcall VrpFindNamespaceNode(
        unsigned __int64 *a1,
        _UNICODE_STRING *a2,
        int a3,
        unsigned __int64 *a4,
        UINT64 *a5){
  unsigned __int64 v5; 
  unsigned __int64 v6; 
  UINT64 v7; 
  _UNICODE_STRING *v8; 
  _UNICODE_STRING **v13; 
  unsigned __int64 v14; 
  _UNICODE_STRING *v15; 
  NTSTATUS v16; 
  UINT64 MatchedTokens; 
  __int64 v19; 

  v5 = a1[6];
  v6 = 0i64;
  MatchedTokens = 0i64;
  v7 = 0i64;
  v8 = 0i64;
  if( v5 )
  {
    while( 1 )
    {
      v13 = 0i64;
      if( v6 < v5 )
      {
        v19 = 0i64;
        if( !is_mul_ok(a1[5], v6)
          || (v14 = a1[9], v13 = (_UNICODE_STRING **)(v14 + a1[5] * v6), (unsigned __int64)v13 < v14) )
        {
          v13 = 0i64;
        }
      }
      v15 = *v13;
      v16 = VrpComparePath(a2, *v13, &MatchedTokens);
      if( !v16 )
        break;
      if( MatchedTokens > v7 && a3 == 1 )
      {
        v7 = MatchedTokens;
        v8 = v15;
      }
      if( v16 >= 0 )
      {
        v5 = a1[6];
        if( ++v6 < v5 )
          continue;
      }
      goto LABEL_13;
    }
    v7 = MatchedTokens;
    v8 = v15;
  }
LABEL_13:
  if( a5 )
    *a5 = v7;
  if( a4 )
    *a4 = v6;
  return v8;
}

Referenced by:

VrpFindBestMatchNamespaceNode
VrpFindExactNamespaceNode
VrpTranslatePath