//
// sub_775ECC from 0x775ecc to 0x775f7e (178 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
//
_DWORD *__fastcall sub_775ECC(_DWORD *result, _BYTE *a2, _BYTE *a3)
{
_DWORD *v3; // r7
size_t v5; // r4
unsigned int v6; // r5
bool v7; // cc
unsigned int v8; // r5
int *v9; // r0
void *v10; // r3
int *v11; // r8
int *v12; // r0
v3 = result;
if ( a2 == a3 )
{
*result = &unk_ACDDA8;
return result;
}
v5 = a3 - a2;
if ( (unsigned int)(a3 - a2) > 0x3FFFFFFC )
sub_7731C4("basic_string::_S_create");
v6 = v5 + 29;
v7 = a3 != a2;
if ( v5 )
v7 = v6 > 0x1000;
if ( v7 )
{
v8 = v5 + 4096 - (v6 & 0xFFF);
if ( v8 >= 0x3FFFFFFC )
v8 = 1073741820;
v9 = (int *)operator new(v8 + 13);
v10 = v9 + 3;
v11 = v9;
v9[1] = v8;
v9[2] = 0;
}
else
{
v12 = (int *)operator new(v5 + 13);
v11 = v12;
v12[1] = v5;
v10 = v12 + 3;
v12[2] = 0;
if ( v5 == 1 )
{
*((_BYTE *)v12 + 12) = *a2;
goto LABEL_11;
}
}
v10 = memcpy(v10, a2, v5);
LABEL_11:
result = v3;
if ( v11 != &dword_ACDD9C )
{
*v11 = v5;
*((_BYTE *)v11 + v5 + 12) = 0;
}
*v3 = v10;
return result;
}