//
// sub_D1AE00 from 0xd1ae00 to 0xd1ae98 (152 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_D1AE00(__int64 *a1, const wchar_t **a2, unsigned __int64 a3)
{
const wchar_t *v3; // x22
__int64 v4; // x1
__int64 v5; // x19
size_t v6; // x23
unsigned __int64 v8; // x19
__int64 v10; // x20
wchar_t v11; // w1
v3 = *a2;
v4 = *a1;
v5 = *(_QWORD *)(*a1 - 24);
v6 = *((_QWORD *)v3 - 3);
if ( !v5 )
return -1;
v8 = v5 - 1;
if ( a3 <= v8 )
v8 = a3;
v10 = 4 * v8;
while ( 1 )
{
v11 = *(_DWORD *)(v4 + v10);
v10 -= 4;
if ( !wmemchr(v3, v11, v6) )
break;
if ( --v8 == -1 )
return -1;
v4 = *a1;
}
return v8;
}