//
// EditorSFXManager::encodeDataTo from 0xcc71d0 to 0xcc7500 (816 bytes)
//
// 2 xrefs:
// > GameManager::encodeDataTo @ 0x72a3ac
// > ??> @ 0x5da18
//
// 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::encodeDataTo(EditorSFXManager *this, DS_Dictionary *a2)
{
cocos2d::CCArray *v4; // x0
int v5; // w25
unsigned int v6; // w20
__int64 v7; // x22
cocos2d::CCString *v8; // x0
const char *CString; // x0
size_t v10; // x0
const char *v11; // x1
cocos2d::CCArray *v12; // x0
int v13; // w25
unsigned int v14; // w20
__int64 v15; // x22
cocos2d::CCString *v16; // x0
const char *v17; // x0
size_t v18; // x0
const char *v19; // x1
char *v21; // [xsp+58h] [xbp+58h]
char *v22; // [xsp+58h] [xbp+58h]
__int64 v23; // [xsp+60h] [xbp+60h] BYREF
__int64 v24; // [xsp+68h] [xbp+68h]
void *v25; // [xsp+70h] [xbp+70h]
if ( !a2 )
return _stack_chk_guard;
DS_Dictionary::setIntegerForKey(a2, "editorSFXVersion", 1);
EditorSFXManager::ensureLoaded(this);
EditorSFXManager::serializeAll(this, &v23);
DS_Dictionary::setStringForKey(a2, "editorSFX", &v23);
if ( (v23 & 1) != 0 )
operator delete(v25);
v4 = *((cocos2d::CCArray **)this + 18);
if ( v4 )
{
v5 = cocos2d::CCArray::count(v4);
v6 = 0;
DS_Dictionary::setIntegerForKey(a2, "editorSFXFavoriteCount", v5);
if ( v5 > 0 )
{
do
{
while ( 1 )
{
v7 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 18), v6);
if ( v7 )
{
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"editorSFXFavorite_%d",
(const char *)v6);
CString = (const char *)cocos2d::CCString::getCString(v8);
v23 = 0;
v24 = 0;
v25 = nullptr;
v21 = (char *)CString;
v10 = strlen(CString);
std::string::__init(&v23, v21, v10);
v11 = (char *)&v23 + 1;
if ( (v23 & 1) != 0 )
v11 = (const char *)v25;
DS_Dictionary::setSubDictForKey(a2, v11, 0, 1);
(*(void (__fastcall **)(__int64, DS_Dictionary *))(*(_QWORD *)v7 + 48LL))(v7, a2);
DS_Dictionary::stepOutOfSubDict(a2);
if ( (v23 & 1) != 0 )
break;
}
if ( v5 == ++v6 )
goto LABEL_13;
}
++v6;
operator delete(v25);
}
while ( v5 != v6 );
}
LABEL_13:
v12 = *((cocos2d::CCArray **)this + 19);
if ( v12 )
goto LABEL_14;
LABEL_25:
DS_Dictionary::setIntegerForKey(a2, "editorSFXMyCount", 0);
DS_Dictionary::setIntegerForKey(a2, "editorSFXNextLocalID", *((_DWORD *)this + 40));
DS_Dictionary::setFloatForKey(a2, "editorSFXGlobalVolume", *((float *)this + 48));
return _stack_chk_guard;
}
DS_Dictionary::setIntegerForKey(a2, "editorSFXFavoriteCount", 0);
v12 = *((cocos2d::CCArray **)this + 19);
if ( !v12 )
goto LABEL_25;
LABEL_14:
v13 = cocos2d::CCArray::count(v12);
v14 = 0;
DS_Dictionary::setIntegerForKey(a2, "editorSFXMyCount", v13);
DS_Dictionary::setIntegerForKey(a2, "editorSFXNextLocalID", *((_DWORD *)this + 40));
if ( v13 > 0 )
{
do
{
while ( 1 )
{
v15 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 19), v14);
if ( v15 )
{
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"editorSFXMy_%d",
(const char *)v14);
v17 = (const char *)cocos2d::CCString::getCString(v16);
v23 = 0;
v24 = 0;
v25 = nullptr;
v22 = (char *)v17;
v18 = strlen(v17);
std::string::__init(&v23, v22, v18);
v19 = (char *)&v23 + 1;
if ( (v23 & 1) != 0 )
v19 = (const char *)v25;
DS_Dictionary::setSubDictForKey(a2, v19, 0, 1);
(*(void (__fastcall **)(__int64, DS_Dictionary *))(*(_QWORD *)v15 + 48LL))(v15, a2);
DS_Dictionary::stepOutOfSubDict(a2);
if ( (v23 & 1) != 0 )
break;
}
if ( v13 == ++v14 )
goto LABEL_22;
}
++v14;
operator delete(v25);
}
while ( v13 != v14 );
}
LABEL_22:
DS_Dictionary::setFloatForKey(a2, "editorSFXGlobalVolume", *((float *)this + 48));
return _stack_chk_guard;
}