//
// sub_D16B08 from 0xd16b08 to 0xd16b9c (148 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_D16B08(__int64 *a1, char *a2, unsigned __int64 a3)
{
size_t v5; // x0
__int64 v6; // x21
size_t v7; // x20
__int64 v8; // x19
unsigned __int64 v10; // x19
v5 = strlen(a2);
v6 = *a1;
v7 = v5;
v8 = *(_QWORD *)(*a1 - 24);
if ( !v5 || !v8 )
return -1;
v10 = v8 - 1;
if ( a3 <= v10 )
v10 = a3;
do
{
if ( memchr(a2, *(unsigned __int8 *)(v6 + v10), v7) )
break;
--v10;
}
while ( v10 != -1 );
return v10;
}