//
// deflatePrime from 0x949028 to 0x9490ae (134 bytes)
//
// 0 xrefs:
//
// 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:13 +0000
//
int __fastcall deflatePrime(int a1, int a2, int a3)
{
int v3; // r6
int *v6; // r10
int v7; // lr
int v8; // r4
int v9; // r3
if ( !a1 )
return -2;
v3 = *(_DWORD *)(a1 + 28);
if ( !v3 )
return -2;
if ( *(_DWORD *)(v3 + 5796) < (unsigned int)(*(_DWORD *)(v3 + 16) + 2) )
return -5;
v6 = (int *)(v3 + 5820);
do
{
v7 = *v6;
v8 = 16 - *v6;
if ( v8 >= a2 )
v8 = a2;
v9 = ((1 << v8) - 1) & a3;
a3 >>= v8;
*(_WORD *)(v3 + 5816) |= (_WORD)v9 << v7;
*v6 = v7 + v8;
sub_94F708(v3);
a2 -= v8;
}
while ( a2 );
return 0;
}