//
// sub_D167F0 from 0xd167f0 to 0xd16898 (168 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
//
size_t __fastcall sub_D167F0(__int64 *a1, char *a2, size_t a3)
{
size_t v5; // x0
__int64 v6; // x21
size_t v7; // x20
size_t result; // x0
size_t v9; // x1
size_t v10; // x1
size_t v11; // x19
v5 = strlen(a2);
v6 = *a1;
v7 = v5;
result = -1;
v9 = *(_QWORD *)(v6 - 24);
if ( v7 <= v9 )
{
v10 = v9 - v7;
if ( v10 > a3 )
v11 = a3;
else
v11 = v10;
while ( 1 )
{
if ( !memcmp((const void *)(v6 + v11), a2, v7) )
return v11;
if ( !v11 )
break;
--v11;
}
return -1;
}
return result;
}