//
// sub_D16C68 from 0xd16c68 to 0xd16cec (132 bytes)
//
// 1 xrefs:
// > formatTags @ 0x7de908
//
// 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_D16C68(__int64 *a1, void *a2, unsigned __int64 a3, size_t a4)
{
__int64 v4; // x20
unsigned __int64 v5; // x19
unsigned __int64 v7; // x21
v4 = *a1;
v5 = a3;
v7 = *(_QWORD *)(*a1 - 24);
if ( a3 >= v7 )
return -1;
while ( memchr(a2, *(unsigned __int8 *)(v4 + v5), a4) )
{
if ( ++v5 >= v7 )
return -1;
}
return v5;
}