CmpFindSubKeyByHashWithStatus

INT64 __fastcall CmpFindSubKeyByHashWithStatus(INT64 a1, INT64 a2, const _UNICODE_STRING *a3, _DWORD *a4){
  int v8; 
  int v9; 
  unsigned __int16 v10; 
  int v12; 
  v8 = CmpHashUnicodeComponent(a3);
  *a4 = -1;
  v9 = v8;
  v10 = 0;
  if( !*(_WORD *)(a2 + 2) )
    return 3221225524i64;
  while( 1 )
  {
    if( v9 != *(_DWORD *)(a2 + 8i64 * v10 + 8) )
      goto LABEL_3;
    v12 = CmpDoCompareKeyName(a1, a3, 0i64, *(unsigned int *)(a2 + 8i64 * v10 + 4));
    if( v12 == 2 )
      return 3221225626i64;
    if( !v12 )
    {
      *a4 = *(_DWORD *)(a2 + 8i64 * v10 + 4);
      return 0i64;
    }
LABEL_3:
    if( ++v10 >= *(_WORD *)(a2 + 2) )
      return 3221225524i64;
  }
}

Referenced by:

CmpFindSubKeyByNameWithStatus