//
// sub_BD18E from 0xbd18e to 0xbd1b8 (42 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 11:41:46 +0000
//
int __fastcall sub_BD18E(int a1, int a2, int a3, _DWORD *a4)
{
int v4; // r4
unsigned int v5; // r1
unsigned int v6; // r5
int result; // r0
v4 = *(_DWORD *)(a1 + 420);
v5 = *(_DWORD *)(a1 + 16);
v6 = v4 + a3;
if ( v4 + a3 > v5 )
a3 = v5 - v4;
*a4 = a3;
*(_DWORD *)(a1 + 420) += a3;
result = 0;
if ( v6 > v5 )
return 31;
return result;
}