//
// sub_D16A08 from 0xd16a08 to 0xd16a88 (128 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_D16A08(__int64 *a1, const void **a2, unsigned __int64 a3)
{
const void *v3; // x20
__int64 v4; // x22
size_t v5; // x21
__int64 v6; // x19
unsigned __int64 v8; // x19
v3 = *a2;
v4 = *a1;
v5 = *((_QWORD *)*a2 - 3);
v6 = *(_QWORD *)(*a1 - 24);
if ( !v5 || !v6 )
return -1;
v8 = v6 - 1;
if ( a3 <= v8 )
v8 = a3;
do
{
if ( memchr(v3, *(unsigned __int8 *)(v4 + v8), v5) )
break;
--v8;
}
while ( v8 != -1 );
return v8;
}