//
// sub_777588 from 0x777588 to 0x7775ca (66 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
//
int __fastcall sub_777588(int *a1, unsigned int a2, size_t a3, const wchar_t **a4)
{
int v4; // r0
unsigned int v5; // r4
const wchar_t *v6; // r3
size_t v7; // r4
const wchar_t *v8; // r0
size_t v9; // r5
size_t v10; // r2
int result; // r0
v4 = *a1;
v5 = *(_DWORD *)(v4 - 12);
if ( a2 > v5 )
sub_7732C4(
"%s: __pos (which is %zu) > this->size() (which is %zu)",
"basic_string::compare",
a2,
*(_DWORD *)(v4 - 12));
v6 = *a4;
v7 = v5 - a2;
v8 = (const wchar_t *)(v4 + 4 * a2);
v9 = *(v6 - 3);
if ( v7 >= a3 )
v7 = a3;
v10 = v7;
if ( v7 >= v9 )
v10 = *(v6 - 3);
result = wmemcmp(v8, v6, v10);
if ( !result )
return v7 - v9;
return result;
}