//
// inflateReset2 from 0x94bf34 to 0x94bf9a (102 bytes)
//
// 3 xrefs:
// > sub_86C25C @ 0x86c29a
// > sub_86C418 @ 0x86c480
// > inflateInit2_ @ 0x94bfde
//
// 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:05:17 +0000
//
int __fastcall inflateReset2(int a1, int a2)
{
_DWORD *v3; // r5
int v4; // r4
int v5; // r8
bool v6; // cc
_BOOL4 v7; // r7
if ( !a1 )
return -2;
v3 = *(_DWORD **)(a1 + 28);
if ( !v3 )
return -2;
v4 = a2;
if ( a2 >= 0 )
{
v5 = (a2 >> 4) + 1;
if ( a2 <= 47 )
v4 = a2 & 0xF;
}
else
{
v4 = -a2;
v5 = 0;
}
v6 = v4 != 0;
if ( v4 )
v6 = (unsigned int)(v4 - 8) > 7;
v7 = v6;
if ( v6 )
return -2;
if ( v3[13] )
{
if ( v4 != v3[9] )
{
(*(void (__fastcall **)(_DWORD))(a1 + 36))(*(_DWORD *)(a1 + 40));
v3[13] = v7;
}
}
v3[2] = v5;
v3[9] = v4;
return inflateReset((_DWORD *)a1);
}