//
// EditorSFXManager::overwriteMyConfigFromLive from 0x14018bd70 to 0x14018bf05 (405 bytes)
//
// 2 xrefs:
// > EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x140198282
// > ??> @ 0x140918f8c
//
// This function is hookable on this platform (idp: pc, 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:27:41 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall EditorSFXManager::overwriteMyConfigFromLive(_QWORD *a1, int a2, void **a3)
{
int v5; // esi
struct cocos2d::CCObject *MyConfig; // r15
void **v8; // rax
char v9; // bl
int v10; // ebp
_QWORD *v11; // r14
_QWORD *i; // rbx
cocos2d::CCArray **v13; // rdi
__int64 v14; // rax
__int64 v15; // rbx
void *v16; // rdx
_BYTE v17[16]; // [rsp+38h] [rbp-70h] BYREF
__int64 v18; // [rsp+48h] [rbp-60h]
void *v19[4]; // [rsp+58h] [rbp-50h] BYREF
v5 = 0;
MyConfig = EditorSFXManager::getMyConfig((__int64)a1, a2);
if ( MyConfig )
{
v8 = EditorSFXManager::serializeAll(a1, v19);
cocos2d::ZipUtils::compressString(v17, v8, 0, 0xFFFFFFFFLL, 0);
sub_14003D310((__int64)v19);
if ( v18 )
{
v10 = 0;
v11 = (_QWORD *)a1[1];
for ( i = (_QWORD *)*v11; i != v11; i = (_QWORD *)*i )
{
v13 = (cocos2d::CCArray **)i[3];
if ( v13 && *v13 && cocos2d::CCArray::count(*v13) )
{
++v5;
v10 += cocos2d::CCArray::count(*v13);
}
}
v14 = sub_14003F4F0((__int64)v19, (__int64)v17);
v15 = v14;
if ( (struct cocos2d::CCObject *)((char *)MyConfig + 512) != (struct cocos2d::CCObject *)v14 )
{
v16 = (void *)v14;
if ( *(_QWORD *)(v14 + 24) > 0xFu )
v16 = *(void **)v14;
sub_1400405A0((void **)MyConfig + 64, v16, *(_QWORD *)(v14 + 16));
}
sub_14003D310(v15);
*((_BYTE *)MyConfig + 544) = 1;
*((_DWORD *)MyConfig + 90) = v10;
*((_DWORD *)MyConfig + 89) = v5;
++*((_DWORD *)MyConfig + 83);
*((_DWORD *)MyConfig + 93) = time64(nullptr);
v9 = 1;
}
else
{
if ( a3 )
sub_1400405A0(a3, "No active sound actions to save.", 0x20u);
v9 = 0;
}
sub_14003D310((__int64)v17);
return v9;
}
else
{
if ( a3 )
sub_1400405A0(a3, "List not found.", 0xFu);
return 0;
}
}