//
// sub_BE7C0 from 0xbe7c0 to 0xbe860 (160 bytes)
//
// 2 xrefs:
// > ??> @ 0x10ee30
// > ??> @ 0x10eec8
//
// 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 12:14:42 +0000
//
__int64 __fastcall sub_BE7C0(__int64 a1, char a2, char a3)
{
__int64 v4; // x8
int v5; // w8
__int16 v7; // w8
__int64 v8; // [xsp+0h] [xbp-20h] BYREF
int v9; // [xsp+8h] [xbp-18h]
char v10; // [xsp+Ch] [xbp-14h]
if ( (a2 & 1) == 0 )
{
v5 = -1;
LABEL_5:
*(_DWORD *)(a1 + 724) = v5;
return 0;
}
if ( (a3 & 1) == 0 )
{
if ( (unsigned int)(*(_DWORD *)(a1 + 724) + 1) > 1 )
return 0;
v7 = atomic_load((unsigned int *)(a1 + 100));
if ( (v7 & 0x100) != 0 )
{
*(_DWORD *)(a1 + 724) = 0;
return 0;
}
v5 = *(_DWORD *)(*(_QWORD *)(a1 + 168) + 69864LL) + 1;
goto LABEL_5;
}
v4 = *(_QWORD *)(a1 + 168);
v10 = 0;
v8 = v4;
v9 = 3;
sub_520A0((__int64)&v8);
*(_DWORD *)(a1 + 724) = 0;
sub_51F94((__int64)&v8);
return 0;
}