//
// cocos2d::ZipUtils::decompressString2 from 0xd9be64 to 0xd9c120 (700 bytes)
//
// 6 xrefs:
// > sub_82FA7C @ 0x82fb08
// > MusicDownloadManager::parseSFXLibrary @ 0x96b92c
// > MusicDownloadManager::parseMusicLibrary @ 0x976b3c
// > MusicDownloadManager::parseNewsFeed @ 0x97b08c
// > DS_Dictionary::loadRootSubDictFromCompressedFile @ 0xdbaa8c
// > ??> @ 0xe9728
//
// 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::decompressString2@(
__int64 *__return_ptr a1@,
cocos2d::ZipUtils *this@,
unsigned __int8 *a3@,
int a4@,
char a5@)
{
int v6; // w24
unsigned __int64 v8; // x24
unsigned int v9; // w5
__int64 v10; // x0
char *v11; // x1
char *v12; // x2
unsigned __int64 v13; // x1
unsigned __int8 **v14; // x3
cocos2d::ZipUtils *v15; // x0
int v16; // w0
const unsigned __int8 *v17; // x1
unsigned __int8 *v20; // [xsp+48h] [xbp+48h]
unsigned __int8 *v21; // [xsp+48h] [xbp+48h]
cocos2d::ZipUtils *v22; // [xsp+58h] [xbp+58h] BYREF
void *v23; // [xsp+60h] [xbp+60h] BYREF
__int64 v24; // [xsp+68h] [xbp+68h] BYREF
unsigned __int64 v25; // [xsp+70h] [xbp+70h]
void *v26; // [xsp+78h] [xbp+78h]
__int64 v27; // [xsp+80h] [xbp+80h] BYREF
const unsigned __int8 *v28; // [xsp+88h] [xbp+88h]
void *v29; // [xsp+90h] [xbp+90h]
v6 = a4;
if ( !this || a4 <= 0 )
{
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
std::string::__init(a1, &byte_11B8890, 0);
return a1;
}
v22 = nullptr;
if ( (_BYTE)a3 )
{
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::append((__int64)&v24, this, a4);
v27 = 0;
v28 = nullptr;
v8 = (unsigned __int8)v24 >> 1;
v29 = nullptr;
if ( (v24 & 1) != 0 )
v8 = v25;
std::string::resize((unsigned __int8 *)&v27, v8, 0);
if ( v8 )
{
v9 = 0;
v10 = 0;
do
{
++v9;
v11 = (char *)v29;
v12 = (char *)v26;
if ( (v27 & 1) == 0 )
v11 = (char *)&v27 + 1;
if ( (v24 & 1) == 0 )
v12 = (char *)&v24 + 1;
v11[v10] = a5 ^ v12[v10];
v10 = v9;
}
while ( v8 > v9 );
}
if ( (v27 & 1) != 0 )
{
v6 = (int)v28;
v13 = (unsigned int)base64Decode((cocos2d *)v29, v28, (void **)&v22, 1u);
if ( (v27 & 1) == 0 )
{
LABEL_15:
if ( (v24 & 1) == 0 )
goto LABEL_16;
LABEL_26:
v21 = (unsigned __int8 *)v13;
operator delete(v26);
v13 = (unsigned __int64)v21;
v15 = v22;
if ( (int)v21 > 0 )
goto LABEL_17;
LABEL_27:
if ( v15 )
{
operator delete[](v15);
v22 = nullptr;
}
goto LABEL_29;
}
}
else
{
v6 = (int)(unsigned __int8)v27 >> 1;
v13 = (unsigned int)base64Decode((cocos2d *)((char *)&v27 + 1), (const unsigned __int8 *)v6, (void **)&v22, 1u);
if ( (v27 & 1) == 0 )
goto LABEL_15;
}
v20 = (unsigned __int8 *)v13;
operator delete(v29);
v13 = (unsigned __int64)v20;
if ( (v24 & 1) != 0 )
goto LABEL_26;
}
else
{
v13 = (unsigned int)base64Decode(this, (const unsigned __int8 *)(unsigned int)a4, (void **)&v22, 1u);
}
LABEL_16:
v15 = v22;
if ( (int)v13 <= 0 )
goto LABEL_27;
LABEL_17:
v23 = nullptr;
v16 = cocos2d::ZipUtils::ccInflateMemory(v15, (unsigned __int8 *)v13, &v23, v14);
if ( v16 > 0 )
{
v27 = 0;
v28 = nullptr;
v29 = nullptr;
std::string::append((__int64)&v27, v23, v16);
if ( v22 )
{
operator delete[](v22);
v22 = nullptr;
}
if ( v23 )
operator delete[](v23);
goto LABEL_22;
}
if ( v22 )
{
operator delete[](v22);
v22 = nullptr;
}
if ( v23 )
{
operator delete[](v23);
v23 = nullptr;
}
LABEL_29:
v27 = 0;
v28 = nullptr;
v29 = nullptr;
std::string::append((__int64)&v27, this, v6);
LABEL_22:
a1[2] = (__int64)v29;
v17 = v28;
*a1 = v27;
a1[1] = (__int64)v17;
return a1;
}