//
// cocos2d::extension::AssetsManager::uncompress from 0xd09d94 to 0xd0a040 (684 bytes)
//
// 2 xrefs:
// > cocos2d::extension::assetsManagerDownloadAndUncompress @ 0xd0a2bc
// > ??> @ 0xfe530
//
// 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:06:59 +0000
//
__int64 __fastcall cocos2d::extension::AssetsManager::uncompress(cocos2d::extension::AssetsManager *this)
{
char *v1; // x27
cocos2d *v3; // x0
__int64 v4; // x0
cocos2d *v5; // x19
void *v6; // x1
unsigned __int64 v7; // x26
void *v8; // x1
const char *v9; // x1
void *v10; // x1
void *v11; // x1
unsigned int v12; // w19
const char *v14; // x0
void *v15; // x1
unsigned int v16; // w3
FILE *v17; // x21
int v18; // w0
unsigned __int64 v19; // [xsp+70h] [xbp+70h] BYREF
unsigned __int64 v20[2]; // [xsp+80h] [xbp+80h] BYREF
cocos2d *v21; // [xsp+90h] [xbp+90h]
unsigned __int64 v22[2]; // [xsp+98h] [xbp+98h] BYREF
char *v23; // [xsp+A8h] [xbp+A8h]
__int64 v24; // [xsp+B0h] [xbp+B0h] BYREF
char v25[512]; // [xsp+138h] [xbp+138h] BYREF
__int64 v26; // [xsp+338h] [xbp+338h] BYREF
v1 = (char *)this + 8;
std::operator+("cocos2dx-update-temp-package.zip", (__int64)this + 8, v20);
v3 = (cocos2d *)((char *)v20 + 1);
if ( (v20[0] & 1) != 0 )
v3 = v21;
v4 = cocos2d::unzOpen(v3, (const char *)LOBYTE(v20[0]));
v5 = (cocos2d *)v4;
if ( !v4 )
goto LABEL_18;
if ( (unsigned int)cocos2d::unzGetGlobalInfo(v4, &v19) )
{
LABEL_22:
cocos2d::unzClose(v5, v6);
LABEL_18:
v12 = 0;
goto LABEL_19;
}
v7 = 0;
while ( v19 > v7 )
{
if ( (unsigned int)cocos2d::unzGetCurrentFileInfo(v5, &v24, v25, 512, 0, 0, 0, 0) )
goto LABEL_22;
std::operator+(v25, (__int64)v1, v22);
if ( v25[strlen(v25) - 1] != 47 )
{
if ( !(unsigned int)cocos2d::unzOpenCurrentFile(v5, v8) )
{
v14 = (char *)v22 + 1;
if ( (v22[0] & 1) != 0 )
v14 = v23;
v17 = fopen(v14, "wb");
if ( v17 )
{
while ( 1 )
{
v18 = cocos2d::unzReadCurrentFile(v5, &v26, &elf_hash_bucket[1922], v16);
v15 = (void *)v18;
if ( v18 < 0 )
break;
if ( !v18 )
{
fclose(v17);
goto LABEL_11;
}
fwrite(&v26, v18, 1u, v17);
}
}
cocos2d::unzCloseCurrentFile(v5, v15);
}
LABEL_16:
cocos2d::unzClose(v5, v10);
if ( (v22[0] & 1) != 0 )
operator delete(v23);
goto LABEL_18;
}
v9 = (char *)v22 + 1;
if ( (v22[0] & 1) != 0 )
v9 = v23;
if ( !cocos2d::extension::AssetsManager::createDirectory(this, v9) )
goto LABEL_16;
LABEL_11:
cocos2d::unzCloseCurrentFile(v5, v10);
if ( ++v7 < v19 )
{
if ( (unsigned int)cocos2d::unzGoToNextFile(v5, v11) )
goto LABEL_16;
if ( (v22[0] & 1) != 0 )
LABEL_33:
operator delete(v23);
}
else if ( (v22[0] & 1) != 0 )
{
goto LABEL_33;
}
}
v12 = 1;
LABEL_19:
if ( (v20[0] & 1) != 0 )
operator delete(v21);
return v12;
}