//
// sub_981220 from 0x981220 to 0x98125a (58 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:06:07 +0000
//
int __fastcall sub_981220(int result, int a2, int a3, int a4)
{
int v4; // r0
if ( result == *(_DWORD *)(a2 + 8) )
{
v4 = *(_DWORD *)(a2 + 16);
if ( v4 )
{
if ( v4 == a3 )
{
result = *(_DWORD *)(a2 + 24);
if ( result == 2 )
*(_DWORD *)(a2 + 24) = a4;
}
else
{
++*(_DWORD *)(a2 + 36);
*(_DWORD *)(a2 + 24) = 2;
*(_BYTE *)(a2 + 54) = 1;
return 1;
}
}
else
{
*(_DWORD *)(a2 + 16) = a3;
*(_DWORD *)(a2 + 24) = a4;
*(_DWORD *)(a2 + 36) = 1;
return 1;
}
}
return result;
}