//
// cocos2d::ZipUtils::decompressString from 0xd9c120 to 0xd9c374 (596 bytes)
//
// 20 xrefs:
// > GManager::loadFromCompressedString @ 0x6a8df8
// > PlayLayer::loadPersistentCheckpoint @ 0x6f6918
// > PlayLayer::loadPersistentCheckpoint @ 0x6f6ab4
// > PlayLayer::addLiveStartPosObject @ 0x7005a0
// > PlayLayer::init @ 0x712504
// > LevelEditorLayer::init @ 0x7af0f0
// > LevelInfoLayer::loadReplay @ 0x7e625c
// > GameLevelManager::onGetLevelSaveDataCompleted @ 0x811838
// > GJGameLevel::copyLevelInfo @ 0x82d4c0
// > GJGameLevel::ensureSessionLog @ 0x83be84
// > GJGameLevel::dataLoaded @ 0x83d99c
// > GameLevelManager::applyDeathBlob @ 0x858808
// > LocalLevelManager::importLevelsFromPaths @ 0x911658
// > LocalLevelManager::tryRecoverAutoSaves @ 0x9129b0
// > GJAccountManager::onSyncAccountCompleted @ 0x989f44
// > GJAccountManager::onSyncAccountCompleted @ 0x98a050
// > EditorSFXManager::summarizeBlob @ 0xcc5360
// > EditorSFXManager::importFromString @ 0xcc75b0
// > LevelStatsInfoPopup::buildInfoText @ 0xcf932c
// > ??> @ 0x89368
//
// 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:08:26 +0000
//
__int64 *__usercall cocos2d::ZipUtils::decompressString@(
char *a1@,
unsigned __int8 a2@,
char a3@,
__int64 *a4@)
{
int v4; // w3
unsigned __int8 v7; // w0
int v9; // w2
const unsigned __int8 *v10; // x1
cocos2d *v11; // x0
unsigned __int64 v12; // x1
unsigned __int8 **v13; // x3
int v14; // w0
__int64 v15; // x1
__int64 v16; // x1
unsigned __int64 v18; // x20
unsigned int v19; // w0
__int64 v20; // x3
char *v21; // x1
char *v22; // x1
char *v23; // x2
char v24; // w2
const unsigned __int8 *v25; // x1
cocos2d *v26; // x0
unsigned __int8 *v27; // [xsp+48h] [xbp+48h]
cocos2d::ZipUtils *v28; // [xsp+50h] [xbp+50h] BYREF
void *v29; // [xsp+58h] [xbp+58h] BYREF
__int64 v30; // [xsp+60h] [xbp+60h] BYREF
const unsigned __int8 *v31; // [xsp+68h] [xbp+68h]
void *v32; // [xsp+70h] [xbp+70h]
v4 = a2;
v7 = *a1;
v9 = v7 & 1;
v10 = (const unsigned __int8 *)(v7 >> 1);
if ( (v7 & 1) != 0 )
v10 = *((const unsigned __int8 **)a1 + 1);
if ( (int)v10 <= 0 )
goto LABEL_19;
v28 = nullptr;
if ( v4 )
{
v30 = 0;
v18 = v7 >> 1;
v31 = nullptr;
v32 = nullptr;
if ( (v7 & 1) != 0 )
v18 = *((_QWORD *)a1 + 1);
std::string::resize((unsigned __int8 *)&v30, v18, 0);
if ( v18 )
{
v19 = 0;
v20 = 0;
do
{
v21 = (char *)&v30 + 1;
if ( (v30 & 1) != 0 )
v21 = (char *)v32;
v22 = &v21[v20];
v23 = a1 + 1;
if ( (*a1 & 1) != 0 )
v23 = *((char **)a1 + 2);
++v19;
v24 = v23[v20];
v20 = v19;
*v22 = a3 ^ v24;
}
while ( v18 > v19 );
}
if ( (v30 & 1) != 0 )
{
v25 = v31;
v26 = (cocos2d *)v32;
}
else
{
v25 = (const unsigned __int8 *)((unsigned __int8)v30 >> 1);
v26 = (cocos2d *)((char *)&v30 + 1);
}
v12 = (unsigned int)base64Decode(v26, v25, (void **)&v28, 1u);
if ( (v30 & 1) != 0 )
{
v27 = (unsigned __int8 *)v12;
operator delete(v32);
v12 = (unsigned __int64)v27;
}
}
else
{
v11 = (cocos2d *)(a1 + 1);
if ( v9 )
v11 = *((cocos2d **)a1 + 2);
v12 = (unsigned int)base64Decode(v11, v10, (void **)&v28, 1u);
}
if ( (int)v12 <= 0 )
{
if ( v28 )
{
operator delete[](v28);
*a4 = 0;
a4[1] = 0;
a4[2] = 0;
v28 = nullptr;
if ( (*a1 & 1) == 0 )
goto LABEL_20;
goto LABEL_24;
}
LABEL_19:
*a4 = 0;
a4[1] = 0;
a4[2] = 0;
if ( (*a1 & 1) == 0 )
{
LABEL_20:
v16 = *((_QWORD *)a1 + 1);
*a4 = *(_QWORD *)a1;
a4[1] = v16;
a4[2] = *((_QWORD *)a1 + 2);
return a4;
}
LABEL_24:
std::string::__init(a4, *((void **)a1 + 2), *((_QWORD *)a1 + 1));
return a4;
}
v29 = nullptr;
v14 = cocos2d::ZipUtils::ccInflateMemory(v28, (unsigned __int8 *)v12, &v29, v13);
if ( v14 <= 0 )
{
if ( v28 )
{
operator delete[](v28);
v28 = nullptr;
}
if ( v29 )
{
operator delete[](v29);
v29 = nullptr;
}
goto LABEL_19;
}
v30 = 0;
v31 = nullptr;
v32 = nullptr;
std::string::append((__int64)&v30, v29, v14);
if ( v28 )
{
operator delete[](v28);
v28 = nullptr;
}
if ( v29 )
operator delete[](v29);
a4[2] = (__int64)v32;
v15 = (__int64)v31;
*a4 = v30;
a4[1] = v15;
return a4;
}