//
// sub_4A4B4 from 0x4a4b4 to 0x4a4f6 (66 bytes)
//
// 3 xrefs:
// > sub_4A9A4 @ 0x4abac
// > sub_5A3F8 @ 0x5a4da
// > sub_5A574 @ 0x5a5f4
//
// 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 sub_4A4B4(int a1, int a2)
{
unsigned int v2; // r3
unsigned int v3; // r3
int v4; // r4
unsigned int v5; // r2
int v7; // [sp+4h] [bp-Ch] BYREF
v7 = 0;
v2 = *(_DWORD *)(a1 + 44);
if ( !a2 )
v2 = *(_DWORD *)(a1 + 328);
v3 = (unsigned __int16)(v2 >> 1);
v4 = 2 * v3 + 2;
if ( v3 > 0xFFFD )
v4 = 2;
v5 = (*(_DWORD *)(a1 + 44) & 0xFFFE0000 | v4) + 1;
*(_DWORD *)(a1 + 44) = v5;
if ( a2 )
*(_DWORD *)(a1 + 328) = v5;
sub_444C0(&v7);
return 0;
}