//
// sub_D1AA70 from 0xd1aa70 to 0xd1aaf8 (136 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
//
unsigned __int64 __fastcall sub_D1AA70(__int64 *a1, wchar_t *s, unsigned __int64 a3, size_t n)
{
__int64 v4; // x4
__int64 v5; // x20
unsigned __int64 v6; // x19
unsigned __int64 v8; // x20
__int64 v12; // x20
wchar_t v13; // w1
v4 = *a1;
v5 = *(_QWORD *)(*a1 - 24);
if ( !n || !v5 )
return -1;
v8 = v5 - 1;
if ( a3 > v8 )
v6 = v8;
else
v6 = a3;
v12 = 4 * v6;
while ( 1 )
{
v13 = *(_DWORD *)(v4 + v12);
v12 -= 4;
if ( wmemchr(s, v13, n) )
break;
if ( !v6 )
return -1;
v4 = *a1;
--v6;
}
return v6;
}