//
// inflateReset2 from 0xf38b2c to 0xf38bd4 (168 bytes)
//
// 4 xrefs:
// > sub_E54808 @ 0xe54868
// > sub_E54B1C @ 0xe54bc0
// > inflateInit2_ @ 0xf38c48
// > ??> @ 0xc7000
//
// 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:12:59 +0000
//
__int64 __fastcall inflateReset2(__int64 a1, int a2)
{
__int64 v3; // x20
int v4; // w22
int v5; // w19
if ( !a1 )
return 4294967294LL;
v3 = *(_QWORD *)(a1 + 56);
if ( !v3 )
return 4294967294LL;
if ( a2 < 0 )
{
v5 = -a2;
v4 = 0;
}
else
{
v4 = (a2 >> 4) + 1;
v5 = a2 > 47 ? a2 : a2 & 0xF;
}
if ( (unsigned int)(v5 - 8) > 7 && v5 )
return 4294967294LL;
if ( *(_QWORD *)(v3 + 64) )
{
if ( v5 != *(_DWORD *)(v3 + 48) )
{
(*(void (__fastcall **)(_QWORD))(a1 + 72))(*(_QWORD *)(a1 + 80));
*(_QWORD *)(v3 + 64) = 0;
}
}
*(_DWORD *)(v3 + 8) = v4;
*(_DWORD *)(v3 + 48) = v5;
return inflateReset((_QWORD *)a1);
}