CmpKeyEnumStackAdvance

INT64 __fastcall CmpKeyEnumStackAdvance(INT16 *a1){
  INT64 result; 
  __int16 v3; 
  INT16 v4; 
  INT64 *EntryAtLayerHeight; 
  __int16 v6; 
  INT64 *v7; 
  INT64 v8; 
  INT64 v9; 
LABEL_1:
  while( 1 )
  {
    result = CmpKeyEnumStackAdvanceInternal((INT64)a1);
    if( (int)result < 0 )
      return result;
    v3 = *a1;
    if( *a1 >= 0 )
    {
      while( 1 )
      {
        CmpKeyNodeStackGetEntryAtLayerHeight((INT64)(a1 + 4), v3);
        EntryAtLayerHeight = (INT64 *)CmpKeyEnumStackGetEntryAtLayerHeight((INT64)a1, v4);
        v8 = v7[2];
        if( v8 )
          break;
        v9 = EntryAtLayerHeight[1];
        if( !v9 || !(unsigned int)CmpGetEffectiveKeyNodeSemantics(*EntryAtLayerHeight, v9) )
        {
          v3 = v6 - 1;
          if( v3 >= 0 )
            continue;
        }
        goto LABEL_1;
      }
      if( (unsigned int)CmpGetEffectiveKeyNodeSemantics(*v7, v8) != 1 )
        return 0i64;
    }
  }
}

Referenced by:

CmpEnumerateLayeredKey
CmpGetSubKeyCountForKeyNodeStack
CmpPartialPromoteSubkeys
CmpSubtreeEnumeratorAdvance