//
// deflateBound from 0x73951c to 0x7395bc (160 bytes)
//
// 0 xrefs:
//
// 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 deflateBound(int a1, unsigned int a2)
{
unsigned int v2; // r2
_DWORD *v3; // r4
int v4; // r3
int v5; // r3
_DWORD *v7; // r7
unsigned __int8 *v8; // r5
int v9; // t1
unsigned __int8 *v10; // r5
int v11; // t1
v2 = ((a2 + 63) >> 6) + ((a2 + 7) >> 3) + a2;
if ( !a1 )
return v2 + 11;
v3 = *(_DWORD **)(a1 + 28);
if ( !v3 )
return v2 + 11;
v4 = v3[6];
if ( v4 == 1 )
{
if ( v3[27] )
v5 = 10;
else
v5 = 6;
}
else if ( v4 == 2 )
{
v7 = (_DWORD *)v3[7];
v5 = 18;
if ( v7 )
{
if ( v7[4] )
v5 = v7[5] + 20;
else
v5 = 18;
v8 = (unsigned __int8 *)v7[7];
if ( v8 )
{
do
{
v9 = *v8++;
++v5;
}
while ( v9 );
}
v10 = (unsigned __int8 *)v7[9];
if ( v10 )
{
do
{
v11 = *v10++;
++v5;
}
while ( v11 );
}
if ( v7[11] )
v5 += 2;
}
}
else if ( v4 )
{
v5 = 6;
}
else
{
v5 = 0;
}
if ( v3[12] == 15 && v3[20] == 15 )
return a2 + 7 + (a2 >> 12) + (a2 >> 14) + (a2 >> 25) + v5;
else
return v2 + 5 + v5;
}