//
// sub_BBEAE from 0xbbeae to 0xbbefc (78 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_BBEAE(_DWORD *a1, void *a2, size_t a3, size_t *a4)
{
size_t v5; // r5
unsigned int v6; // r4
int v7; // r0
unsigned int v9; // r9
v5 = a3;
v6 = a1[5];
v7 = a1[105];
v9 = v7 + a3;
if ( v7 + a3 > v6 )
v5 = v6 - v7;
qmemcpy(a2, (const void *)(a1[106] + v7), v5);
*a4 = v5;
a1[105] += v5;
return 16 * (v9 > v6);
}