//
// cocos2d::ZipUtils::decompressString from 0x5efef0 to 0x5effea (250 bytes)
//
// 6 xrefs:
// > GManager::loadFromCompressedString @ 0x2f0300
// > PlayLayer::init @ 0x31cdd8
// > LevelEditorLayer::init @ 0x376a36
// > GameLevelManager::onGetLevelSaveDataCompleted @ 0x3c9516
// > GJAccountManager::onSyncAccountCompleted @ 0x464a7e
// > GJAccountManager::onSyncAccountCompleted @ 0x464af6
//
// 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
//
cocos2d::ZipUtils *__fastcall cocos2d::ZipUtils::decompressString(
cocos2d::ZipUtils *a1,
_DWORD *a2,
cocos2d *a3,
cocos2d *a4)
{
cocos2d *v5; // r0
const unsigned __int8 *v6; // lr
unsigned __int8 **v7; // r3
unsigned __int8 *v8; // r4
unsigned __int8 *v9; // r2
cocos2d *v10; // r3
cocos2d::ZipUtils *v12; // [sp+0h] [bp-10h] BYREF
void *v13; // [sp+4h] [bp-Ch] BYREF
cocos2d *v14[2]; // [sp+8h] [bp-8h] BYREF
v12 = a1;
v13 = a2;
v14[0] = a3;
v14[1] = a4;
v5 = (cocos2d *)*a2;
v6 = *(const unsigned __int8 **)(*a2 - 12);
if ( (int)v6 <= 0 )
{
LABEL_16:
sub_775C20(a1);
return a1;
}
v12 = nullptr;
if ( a3 )
{
cocos2d::ZipUtils::encryptDecrypt(v14, a2, (char)a4);
v8 = (unsigned __int8 *)base64Decode(
v14[0],
*((const unsigned __int8 **)v14[0] - 3),
(void **)&v12,
(unsigned int *)((char *)&dword_0 + 1));
sub_774008(v14);
}
else
{
v8 = (unsigned __int8 *)base64Decode(v5, v6, (void **)&v12, (unsigned int *)((char *)&dword_0 + 1));
}
if ( (int)v8 <= 0 )
{
if ( v12 )
{
operator delete[](v12);
v12 = nullptr;
}
goto LABEL_16;
}
v13 = nullptr;
v9 = cocos2d::ZipUtils::ccInflateMemory(v12, v8, &v13, v7, (unsigned int)v12);
if ( (int)v9 <= 0 )
{
if ( v12 )
{
operator delete[](v12);
v12 = nullptr;
}
if ( v13 )
{
operator delete[](v13);
v13 = nullptr;
}
goto LABEL_16;
}
v14[0] = (cocos2d *)&unk_ACDDA8;
sub_774534(v14, v13, v9);
if ( v12 )
{
operator delete[](v12);
v12 = nullptr;
}
if ( v13 )
{
operator delete[](v13);
v13 = nullptr;
}
v10 = v14[0];
v14[0] = (cocos2d *)&unk_ACDDA8;
*(_DWORD *)a1 = v10;
sub_774008(v14);
return a1;
}