//
// cocos2d::ZipUtils::decompressString2 from 0x7fb130 to 0x7fb276 (326 bytes)
//
// 5 xrefs:
// > sub_4B5ADC @ 0x4b5b36
// > MusicDownloadManager::parseSFXLibrary @ 0x571d04
// > MusicDownloadManager::parseNewsFeed @ 0x573d54
// > MusicDownloadManager::parseMusicLibrary @ 0x5787f8
// > DS_Dictionary::loadRootSubDictFromCompressedFile @ 0x80ce56
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:14 +0000
//
cocos2d::ZipUtils *__fastcall cocos2d::ZipUtils::decompressString2(
cocos2d::ZipUtils *this,
unsigned __int8 *a2,
int a3,
const unsigned __int8 *a4,
char a5)
{
const unsigned __int8 *v5; // r9
unsigned __int8 **v8; // r3
unsigned __int8 *v9; // r10
int v10; // r1
cocos2d *v11; // r0
unsigned __int8 *v12; // r2
int v13; // r0
int v14; // r1
cocos2d *v15; // r2
int v16; // r0
int v17; // r1
cocos2d *v18; // r2
unsigned int v20; // [sp+0h] [bp-28h]
cocos2d::ZipUtils *v21; // [sp+4h] [bp-24h] BYREF
void *v22; // [sp+8h] [bp-20h] BYREF
_DWORD v23[3]; // [sp+Ch] [bp-1Ch] BYREF
int v24; // [sp+18h] [bp-10h] BYREF
int v25; // [sp+1Ch] [bp-Ch]
cocos2d *v26; // [sp+20h] [bp-8h]
v5 = a4;
if ( a2 && (int)a4 > 0 )
{
v21 = nullptr;
if ( a3 )
{
memset(v23, 0, sizeof(v23));
std::string::append(v23, a2, (size_t)a4);
cocos2d::ZipUtils::encryptDecrypt((int)&v24, (unsigned __int8 *)v23, a5);
if ( (v24 & 1) != 0 )
v10 = v25;
else
v10 = (int)(unsigned __int8)v24 >> 1;
v5 = (const unsigned __int8 *)v10;
if ( (v24 & 1) != 0 )
v11 = v26;
else
v11 = (cocos2d *)((char *)&v24 + 1);
v9 = (unsigned __int8 *)base64Decode(
v11,
(const unsigned __int8 *)v10,
(void **)&v21,
(unsigned int *)((char *)&dword_0 + 1));
std::string::~string((int)&v24);
std::string::~string((int)v23);
}
else
{
v9 = (unsigned __int8 *)base64Decode((cocos2d *)a2, a4, (void **)&v21, (unsigned int *)((char *)&dword_0 + 1));
}
if ( (int)v9 <= 0 )
{
if ( v21 )
{
operator delete[](v21);
v21 = nullptr;
}
}
else
{
v22 = nullptr;
v12 = cocos2d::ZipUtils::ccInflateMemory(v21, v9, &v22, v8, v20);
if ( (int)v12 > 0 )
{
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::append(&v24, v22, (size_t)v12);
if ( v21 )
{
operator delete[](v21);
v21 = nullptr;
}
if ( v22 )
{
operator delete[](v22);
v22 = nullptr;
}
v13 = v24;
v14 = v25;
v15 = v26;
v24 = 0;
v25 = 0;
v26 = nullptr;
*(_DWORD *)this = v13;
*((_DWORD *)this + 1) = v14;
*((_DWORD *)this + 2) = v15;
goto LABEL_27;
}
if ( v21 )
{
operator delete[](v21);
v21 = nullptr;
}
if ( v22 )
{
operator delete[](v22);
v22 = nullptr;
}
}
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::append(&v24, a2, (size_t)v5);
v16 = v24;
v17 = v25;
v18 = v26;
v24 = 0;
v25 = 0;
v26 = nullptr;
*(_DWORD *)this = v16;
*((_DWORD *)this + 1) = v17;
*((_DWORD *)this + 2) = v18;
LABEL_27:
std::string::~string((int)&v24);
return this;
}
*(_DWORD *)this = 0;
*((_DWORD *)this + 1) = 0;
*((_DWORD *)this + 2) = 0;
std::string::__init((int *)this, &unk_B6B226, 0);
return this;
}