//
// sub_849578 from 0x849578 to 0x8495e2 (106 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:02:26 +0000
//
int __fastcall sub_849578(int a1, char *a2, unsigned int a3, int *a4)
{
int v4; // r5
bool v5; // zf
int v6; // r4
int v7; // r2
bool v8; // zf
int v11; // r0
int v12; // r0
if ( a3 <= 3
|| (unsigned int)(unsigned __int8)*a2 - 48 > 9
|| (unsigned int)(unsigned __int8)a2[1] - 48 > 9
|| (unsigned int)(unsigned __int8)a2[2] - 48 > 9 )
{
return 0;
}
v4 = (unsigned __int8)a2[3];
v5 = v4 == 32;
if ( v4 != 32 )
v5 = a3 == 5;
v6 = v5;
if ( v5 )
{
v11 = strtol(a2, nullptr, 10);
v12 = sub_84B870(v11);
if ( v12 == 1 )
*a4 = 0;
else
*a4 = v12;
}
else if ( v4 == 45 )
{
v7 = *(_DWORD *)(a1 + 1144);
v8 = v7 == 2;
if ( v7 != 2 )
v8 = v7 == 7;
if ( v8 )
{
v7 = 1;
v6 = 1;
}
else
{
v6 = 0;
}
if ( v8 )
*a4 = v7;
}
return v6;
}