//
// sub_D16BE4 from 0xd16be4 to 0xd16c68 (132 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_D16BE4(__int64 *a1, const void **a2, unsigned __int64 a3)
{
__int64 v3; // x21
const void *v4; // x20
unsigned __int64 v5; // x19
unsigned __int64 v6; // x22
size_t v7; // x23
v3 = *a1;
v4 = *a2;
v5 = a3;
v6 = *(_QWORD *)(*a1 - 24);
v7 = *((_QWORD *)*a2 - 3);
if ( a3 >= v6 )
return -1;
while ( memchr(v4, *(unsigned __int8 *)(v3 + v5), v7) )
{
if ( ++v5 >= v6 )
return -1;
}
return v5;
}