//
// cocos2d::ZipUtils::ccDeflateMemory from 0x7fa9b0 to 0x7faa6c (188 bytes)
//
// 1 xrefs:
// > cocos2d::ZipUtils::compressString @ 0x7fb3c8
//
// 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
//
int __fastcall cocos2d::ZipUtils::ccDeflateMemory(
cocos2d::ZipUtils *this,
unsigned __int8 *a2,
void **a3,
unsigned __int8 **a4,
int a5)
{
char *v9; // r0
int v10; // r5
int result; // r0
int v12; // r0
int v13; // r4
char *v14; // r0
_DWORD v15[3]; // [sp+14h] [bp-40h] BYREF
char *v16; // [sp+20h] [bp-34h]
int v17; // [sp+24h] [bp-30h]
int v18; // [sp+34h] [bp-20h]
int v19; // [sp+38h] [bp-1Ch]
int v20; // [sp+3Ch] [bp-18h]
v9 = (char *)operator new[](0x100000u);
v15[0] = this;
v15[1] = a2;
v18 = 0;
v10 = 0x100000;
v19 = 0;
v20 = 0;
v17 = 0x100000;
*a3 = v9;
v16 = v9;
result = deflateInit2_(v15, a4);
if ( !result )
{
while ( 1 )
{
v12 = deflate(v15, 4);
v13 = v12;
if ( v12 == 1 )
break;
if ( v12 >= -4 )
{
if ( v12 <= -3 )
goto LABEL_11;
if ( v12 == 2 )
{
v13 = -3;
goto LABEL_11;
}
}
v14 = (char *)realloc(*a3, 2 * v10);
*a3 = v14;
if ( !v14 )
{
deflateEnd(v15);
return -4;
}
v17 = v10;
v16 = &v14[v10];
v10 *= 2;
}
v13 = v10 - v17;
LABEL_11:
deflateEnd(v15);
return v13;
}
return result;
}