//
// sub_9E7DB8 from 0x9e7db8 to 0x9e7e50 (152 bytes)
//
// 2 xrefs:
// > ??> @ 0xc77a8c
// > ??> @ 0xc77ab4
//
// 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 12:07:24 +0000
//
signed int __fastcall sub_9E7DB8(int a1, void *a2, signed int a3)
{
int v4; // r5
unsigned int v7; // r3
bool v8; // cc
int v10; // r3
v4 = *(_DWORD *)(*(_DWORD *)(a1 + 32) + 4);
BIO_clear_flags(a1, 15);
v7 = *(_DWORD *)v4;
if ( a3 < 0 )
goto LABEL_14;
if ( a3 >= v7 )
a3 = *(_DWORD *)v4;
v8 = (int)a2 <= 0;
if ( a2 )
v8 = a3 <= 0;
if ( v8 )
{
LABEL_14:
if ( !v7 && (a3 = *(_DWORD *)(a1 + 28)) != 0 )
{
BIO_set_flags(a1, 9);
return a3;
}
else
{
return a3;
}
}
else
{
memcpy(a2, *(const void **)(v4 + 4), a3);
v10 = *(_DWORD *)(v4 + 4) + a3;
*(_DWORD *)v4 -= a3;
*(_DWORD *)(v4 + 4) = v10;
return a3;
}
}