//
// sub_1004CAE9C from 0x1004cae9c to 0x1004cafc0 (292 bytes)
//
// 1 xrefs:
// > sub_1004D3A2C @ 0x1004d3aa0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:06:25 +0000
//
std::string *__fastcall sub_1004CAE9C(_QWORD *a1, __int64 a2, int a3, std::string *this)
{
std::string *v4; // x19
_OWORD *v8; // x23
const std::string::value_type *v9; // x1
void *v10; // x24
int v12; // [xsp+Ch] [xbp-54h] BYREF
void *__p[2]; // [xsp+10h] [xbp-50h] BYREF
__int64 v14; // [xsp+20h] [xbp-40h]
v4 = this;
if ( !a2 )
{
if ( !this )
return v4;
v9 = "No config to apply.";
LABEL_18:
std::string::assign(v4, v9);
return nullptr;
}
if ( *(_BYTE *)(a2 + 496) != 1 )
goto LABEL_16;
v8 = (_OWORD *)(a2 + 472);
if ( *(char *)(a2 + 495) < 0 )
{
sub_1000097D0(__p, *(void **)(a2 + 472), *(_QWORD *)(a2 + 480));
}
else
{
*(_OWORD *)__p = *v8;
v14 = *(_QWORD *)(a2 + 488);
}
if ( v14 >= 0 )
v10 = (void *)SHIBYTE(v14);
else
v10 = __p[1];
if ( (SHIBYTE(v14) & 0x8000000000000000LL) != 0 )
{
operator delete(__p[0]);
if ( v10 )
goto LABEL_13;
goto LABEL_16;
}
if ( !v10 )
{
LABEL_16:
if ( !v4 )
return v4;
v9 = "Config has no data.";
goto LABEL_18;
}
LABEL_13:
v12 = a3;
if ( *(char *)(a2 + 495) < 0 )
{
sub_1000097D0(__p, *(void **)(a2 + 472), *(_QWORD *)(a2 + 480));
}
else
{
*(_OWORD *)__p = *v8;
v14 = *(_QWORD *)(a2 + 488);
}
v4 = (std::string *)EditorSFXManager::importFromString(a1, (__int64)__p, &v12, v4);
if ( SHIBYTE(v14) < 0 )
operator delete(__p[0]);
return v4;
}