//
// sub_1004D9AD0 from 0x1004d9ad0 to 0x1004d9b00 (48 bytes)
//
// 2 xrefs:
// > sub_1004EBF30 @ 0x1004ebfec
// > sub_1004ECD60 @ 0x1004ece28
//
// 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
//
__int64 __fastcall sub_1004D9AD0(__int64 a1, int a2)
{
int v2; // w9
int v4; // w10
v2 = *(_DWORD *)(a1 + 8);
if ( v2 < 0 )
return 0xFFFFFFFFLL;
v4 = *(_DWORD *)(a1 + 12) + a2;
if ( v4 > v2 )
return 0xFFFFFFFFLL;
*(_DWORD *)(a1 + 12) = v4;
return 0;
}