//
// sub_8B558 from 0x8b558 to 0x8b5b8 (96 bytes)
//
// 6 xrefs:
// > sub_8B5B8 @ 0x8b5c0
// > sub_FB568 @ 0xfb7d0
// > sub_FB568 @ 0xfb82c
// > sub_FB568 @ 0xfb8e4
// > sub_FB568 @ 0xfb950
// > sub_FDB58 @ 0xfdb98
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:14:12 +0000
//
__int64 __fastcall sub_8B558(int a1, int a2)
{
__int64 result; // x0
__int64 v4; // x12
int v5; // w13
int v6; // w8
int v7; // w8
__int64 v8; // x12
int v9; // w8
result = 0;
if ( qword_124E70 )
{
if ( dword_124E68 >= 1 )
{
v4 = qword_124E70 + a1;
v5 = a1 + a2;
v6 = -a1;
result = (v4 - 1) & v6;
v7 = (v5 - 1) & v6;
v8 = result + v7;
v9 = dword_124E68 - (result - qword_124E70 + v7);
qword_124E70 = v8;
dword_124E68 = v9;
}
}
return result;
}