//
// adler32_combine from 0x947030 to 0x9470ca (154 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:12 +0000
//
int __fastcall adler32_combine(unsigned int a1, unsigned int a2, int a3)
{
int v3; // r5
unsigned int v4; // r3
int v5; // r1
int v6; // r0
unsigned int v7; // r3
unsigned int v8; // r2
if ( a3 < 0 )
return -1;
v3 = (unsigned __int16)a1 + (unsigned __int16)a2;
v4 = a3 % 65521 * (unsigned __int16)a1;
v5 = HIWORD(a1) - a3 % 65521 + HIWORD(a2);
v6 = 65520;
v7 = v4 % 0xFFF1 + v5;
v8 = v7 + 65521;
if ( v3 )
{
v6 = v3 - 1;
if ( (unsigned int)(v3 - 1) > 0xFFF0 )
v6 = v3 - 65522;
}
if ( v8 > 0x1FFE1 )
v8 = v7 - 65521;
if ( v8 > 0xFFF0 )
v8 -= 65521;
return v6 | (v8 << 16);
}