//
// sub_D1A6B4 from 0xd1a6b4 to 0xd1a73c (136 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_D1A6B4(_QWORD *a1, const wchar_t **a2, size_t a3)
{
const wchar_t *v3; // x22
size_t v4; // x19
size_t v5; // x21
size_t v7; // x19
__int64 v8; // x20
const wchar_t *v9; // x0
v3 = *a2;
v4 = *(_QWORD *)(*a1 - 24LL);
v5 = *((_QWORD *)*a2 - 3);
if ( v5 > v4 )
return -1;
v7 = v4 - v5;
if ( a3 <= v7 )
v7 = a3;
v8 = *a1 + 4 * v7;
while ( 1 )
{
v9 = (const wchar_t *)v8;
v8 -= 4;
if ( !wmemcmp(v9, v3, v5) )
break;
if ( !v7 )
return -1;
--v7;
}
return v7;
}