CmpSubtreeEnumeratorBeginForKeyNodeStack

INT64 __fastcall CmpSubtreeEnumeratorBeginForKeyNodeStack(INT64 a1, INT16 *a2){
  __int16 v2; 
  INT64 i; 
  INT64 EntryAtLayerHeight; 
  INT16 v7; 
  INT64 v8; 
  __int64 v9; 
  __int64 v10; 
  INT64 result; 

  v2 = *a2;
  for( i = a1 + 16; v2 >= 0; --v2 )
  {
    EntryAtLayerHeight = CmpKeyNodeStackGetEntryAtLayerHeight(i, v2);
    v8 = CmpKeyNodeStackGetEntryAtLayerHeight((INT64)a2, v7);
    v9 = *(unsigned int *)(v8 + 8);
    if( (_DWORD)v9 != -1 )
    {
      v10 = *(_QWORD *)v8;
      *(_QWORD *)EntryAtLayerHeight = *(_QWORD *)v8;
      *(_DWORD *)(EntryAtLayerHeight + 8) = v9;
      *(_QWORD *)(EntryAtLayerHeight + 16) = (*(__int64(__fastcall **)(__int64, __int64, INT64))(v10 + 8))(
                                               v10,
                                               v9,
                                               EntryAtLayerHeight + 24);
    }
  }
  result = *(_QWORD *)(a1 + 96);
  *(_QWORD *)(result + 8) = 0i64;
  *(_QWORD *)(result + 16) = i;
  *(_WORD *)a1 = 0;
  return result;
}

Referenced by:

CmpSubtreeEnumeratorStartForKeyNodeStack