//
// sub_FF7378 from 0xff7378 to 0xff742c (180 bytes)
//
// 2 xrefs:
// > ??> @ 0x13ffa10
// > ??> @ 0x13ffa60
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:15:49 +0000
//
__int64 __fastcall sub_FF7378(__int64 a1, void *a2, int a3)
{
__int64 v5; // x20
unsigned __int64 v7; // x2
__int64 v8; // x1
v5 = *(_QWORD *)(*(_QWORD *)(a1 + 48) + 8LL);
BIO_clear_flags(a1, 15);
v7 = *(_QWORD *)v5;
if ( (a3 & 0x80000000) == 0 )
{
if ( v7 < a3 )
a3 = *(_QWORD *)v5;
if ( a3 > 0 && a2 )
{
memcpy(a2, *(const void **)(v5 + 8), a3);
v8 = *(_QWORD *)(v5 + 8);
*(_QWORD *)v5 -= a3;
*(_QWORD *)(v5 + 8) = v8 + a3;
return (unsigned int)a3;
}
}
if ( v7 )
return (unsigned int)a3;
a3 = *(_DWORD *)(a1 + 40);
if ( !a3 )
return (unsigned int)a3;
BIO_set_flags(a1, 9);
return (unsigned int)a3;
}