CmpDoFindSubKeyByNumber

INT64 __fastcall CmpDoFindSubKeyByNumber(INT64 a1, INT16 *a2, UINT64 a3){
  INT16 v4; 
  unsigned int v5; 
  __int64 v8; 
  _WORD *v9; 
  unsigned int v10; 
  unsigned int v11; 
  int v12; 
  int v13; 

  v12 = -1;
  v13 = 0;
  v4 = *a2;
  v5 = a3;
  if( *a2 != 26994 )
  {
LABEL_2:
    if( ((v4 - 26220) & 0xFDFF) == 0 )
      return *(unsigned int *)&a2[4 * v5 + 2];
    return *(unsigned int *)&a2[2 * v5 + 2];
  }
  v8 = 0i64;
  if( !a2[1] )
    return *(unsigned int *)&a2[2 * v5 + 2];
  while( 1 )
  {
    v9 = (_WORD *)(*(__int64(__fastcall **)(INT64, _QWORD, int *))(a1 + 8))(a1, *(unsigned int *)&a2[2 * v8 + 2], &v12);
    if( !v9 )
      return 0xFFFFFFFFi64;
    v10 = (unsigned __int16)v9[1];
    if( v5 < v10 )
      break;
    v5 -= v10;
    (*(void(__fastcall **)(INT64, int *))(a1 + 16))(a1, &v12);
    v8 = (unsigned int)(v8 + 1);
    if( (unsigned int)v8 >= (unsigned __int16)a2[1] )
    {
      v4 = *a2;
      goto LABEL_2;
    }
  }
  if( ((*v9 - 26220) & 0xFDFF) != 0 )
    v11 = *(_DWORD *)&v9[2 * v5 + 2];
  else
    v11 = *(_DWORD *)&v9[4 * v5 + 2];
  (*(void(__fastcall **)(INT64, int *))(a1 + 16))(a1, &v12);
  return v11;
}

Referenced by:

CmpCheckRegistry2
CmpFindSubKeyByNumber
CmpFindSubKeyByNumberEx
CmpKeyEnumStackEntryAdvance
CmpKeyEnumStackEntryBegin
CmpKeyEnumStackEntryNotifyPromotion