//
// cocos2d::ZipUtils::ccInflateGZipFile from 0x5f01b8 to 0x5f0234 (124 bytes)
//
// 1 xrefs:
// > cocos2d::CCTexturePVR::initWithContentsOfFile @ 0x5f6a2a
//
// 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
//
int __fastcall cocos2d::ZipUtils::ccInflateGZipFile(cocos2d::ZipUtils *this, char *a2, unsigned __int8 **a3)
{
int v4; // r8
size_t v5; // r7
size_t v6; // r6
int v7; // r4
int v8; // r0
void *v9; // r0
v4 = gzopen(this, "rb", a3);
if ( !v4 )
return -1;
v5 = 0x80000;
v6 = 0x80000;
v7 = 0;
for ( *(_DWORD *)a2 = malloc(0x80000u); ; *(_DWORD *)a2 = v9 )
{
v8 = gzread(v4, (void *)(*(_DWORD *)a2 + v7), v6);
if ( v8 < 0 )
{
LABEL_4:
free(*(void **)a2);
*(_DWORD *)a2 = 0;
return -1;
}
if ( !v8 )
break;
v7 += v8;
if ( v8 < v6 )
break;
v6 *= 2;
v5 += v6;
v9 = realloc(*(void **)a2, v5);
if ( !v9 )
goto LABEL_4;
}
gzclose(v4);
return v7;
}