//
// sub_100501DA0 from 0x100501da0 to 0x100501df8 (88 bytes)
//
// 1 xrefs:
// > sub_1004FE784 @ 0x1004fe7b0
//
// 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
//
unsigned __int64 __fastcall sub_100501DA0(int a1, int a2)
{
bool v2; // cc
unsigned __int64 result; // x0
int v5; // w12
signed int v6; // w8
if ( qword_1008818E0 )
v2 = dword_1008818E8 < 1;
else
v2 = 1;
if ( v2 )
return 0;
result = (qword_1008818E0 + 3) & 0xFFFFFFFFFFFFFFFCLL;
v5 = result - qword_1008818E0;
v6 = (a2 * a1 + 3) & 0xFFFFFFFC;
qword_1008818E0 = result + v6;
dword_1008818E8 = dword_1008818E8 - v6 - v5;
return result;
}