//
// sub_D1707C from 0xd1707c to 0xd17118 (156 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_D1707C(__int64 *a1, unsigned __int64 a2, size_t a3, const void **a4)
{
__int64 v4; // x0
unsigned __int64 v5; // x4
_QWORD *v6; // x3
size_t v7; // x4
const void *v8; // x0
size_t v9; // x19
size_t v10; // x20
size_t v11; // x2
__int64 result; // x0
__int64 v13; // x19
v4 = *a1;
v5 = *(_QWORD *)(v4 - 24);
if ( a2 > v5 )
sub_D13C5C("%s: __pos (which is %zu) > this->size() (which is %zu)", "basic_string::compare", a2, v5);
v6 = *a4;
v7 = v5 - a2;
v8 = (const void *)(v4 + a2);
if ( v7 > a3 )
v9 = a3;
else
v9 = v7;
v10 = *(v6 - 3);
if ( v9 > v10 )
v11 = *(v6 - 3);
else
v11 = v9;
result = memcmp(v8, v6, v11);
if ( !(_DWORD)result )
{
result = 0x7FFFFFFF;
v13 = v9 - v10;
if ( v13 <= 0x7FFFFFFF )
{
if ( v13 >= (__int64)0xFFFFFFFF80000000LL )
return (unsigned int)v13;
else
return 0x80000000LL;
}
}
return result;
}