//
// sub_D1A9D4 from 0xd1a9d4 to 0xd1aa70 (156 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_D1A9D4(__int64 *a1, const wchar_t **a2, unsigned __int64 a3)
{
const wchar_t *v3; // x22
__int64 v4; // x1
size_t v5; // x23
__int64 v6; // x19
unsigned __int64 v8; // x19
__int64 v10; // x20
wchar_t v11; // w1
v3 = *a2;
v4 = *a1;
v5 = *((_QWORD *)v3 - 3);
v6 = *(_QWORD *)(*a1 - 24);
if ( !v5 || !v6 )
return -1;
v8 = v6 - 1;
if ( a3 <= v8 )
v8 = a3;
v10 = 4 * v8;
while ( 1 )
{
v11 = *(_DWORD *)(v4 + v10);
v10 -= 4;
if ( wmemchr(v3, v11, v5) )
break;
if ( --v8 == -1 )
return -1;
v4 = *a1;
}
return v8;
}