//
// sub_BBEAE from 0xbbeae to 0xbbefc (78 bytes)
//
// 0 xrefs:
//
// 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
//
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);
}