//
// sub_D16DC8 from 0xd16dc8 to 0xd16e44 (124 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_D16DC8(__int64 *a1, const void **a2, unsigned __int64 a3)
{
__int64 v3; // x21
__int64 result; // x0
_QWORD *v5; // x20
__int64 v6; // x1
size_t v7; // x22
unsigned __int64 v8; // x19
v3 = *a1;
result = -1;
v5 = *a2;
v6 = *(_QWORD *)(v3 - 24);
v7 = *(v5 - 3);
if ( v6 )
{
if ( a3 > v6 - 1 )
v8 = v6 - 1;
else
v8 = a3;
do
{
if ( !memchr(v5, *(unsigned __int8 *)(v3 + v8), v7) )
break;
--v8;
}
while ( v8 != -1 );
return v8;
}
return result;
}