//
// EditorSFXManager::importFromString from 0xcc7500 to 0xcc7754 (596 bytes)
//
// 3 xrefs:
// > EditorSFXManager::applyConfigDirect @ 0xcc7864
// > EditorSFXManager::applyMyConfig @ 0xcc7a88
// > ??> @ 0xe6878
//
// 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 13:06:21 +0000
//
__int64 __fastcall EditorSFXManager::importFromString(EditorSFXManager *a1, __int64 a2, _DWORD *a3, __int64 *a4)
{
__int64 v7; // x2
unsigned int v8; // w21
int v10; // w22
size_t v11; // x1
size_t v12; // x3
char *v13; // x0
int v14; // w22
unsigned __int8 v15; // w0
__int64 v16; // [xsp+58h] [xbp+58h] BYREF
size_t v17; // [xsp+60h] [xbp+60h]
void *v18; // [xsp+68h] [xbp+68h]
__int64 v19; // [xsp+70h] [xbp+70h] BYREF
size_t v20; // [xsp+78h] [xbp+78h]
char *v21; // [xsp+80h] [xbp+80h]
v7 = *(_BYTE *)a2 >> 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v7 = *(_QWORD *)(a2 + 8);
if ( v7 )
{
cocos2d::ZipUtils::decompressString(&v16, a2, 0, 0);
v10 = v16 & 1;
v11 = (unsigned __int8)v16 >> 1;
if ( v10 )
v11 = v17;
if ( v11 )
{
v12 = std::string::find((__int64)&v16, 0x3Bu, 0);
if ( v12 == -1 )
{
v19 = 0;
v20 = 0;
v21 = nullptr;
if ( v10 )
{
std::string::__init(&v19, v18, v17);
}
else
{
v21 = (char *)v18;
v19 = v16;
v20 = v17;
}
}
else
{
std::string::basic_string(&v19, (__int64)&v16, 0, v12);
}
v13 = (char *)&v19 + 1;
v14 = v19 & 1;
if ( v14 )
v13 = v21;
if ( (unsigned int)(atoi(v13) - 1) <= 1 )
{
v15 = EditorSFXManager::deserializeAll(a1, (unsigned __int8 *)&v16, *a3 == 0);
v8 = v15;
if ( !v15 && a4 )
std::string::assign(a4, "Parse error.");
v14 = v19 & 1;
}
else if ( a4 )
{
std::string::assign(a4, "Invalid or corrupt share string.");
v8 = 0;
v14 = v19 & 1;
}
else
{
v8 = 0;
}
if ( v14 )
operator delete(v21);
v10 = v16 & 1;
}
else if ( a4 )
{
std::string::assign(a4, "Invalid or corrupt share string.");
v8 = 0;
v10 = v16 & 1;
}
else
{
v8 = 0;
}
if ( v10 )
operator delete(v18);
}
else
{
v8 = 0;
if ( a4 )
std::string::assign(a4, "Empty string.", 0xDu);
}
return v8;
}