//
// sub_BF4790 from 0xbf4790 to 0xbf47f4 (100 bytes)
//
// 2 xrefs:
// > sub_BF47F4 @ 0xbf4a2c
// > sub_BF4FA8 @ 0xbf537c
//
// 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
//
__int64 __fastcall sub_BF4790(__int64 a1)
{
_DWORD *v1; // x1
__int64 result; // x0
unsigned int v3; // w2
__int64 v4; // x0
v1 = *(_DWORD **)(a1 + 520);
if ( *(int *)(a1 + 372) <= 1 )
{
v3 = *(_DWORD *)(a1 + 368) - 1;
v4 = *(_QWORD *)(a1 + 376);
if ( v1[4] < v3 )
result = *(unsigned int *)(v4 + 12);
else
result = *(unsigned int *)(v4 + 76);
v1[7] = result;
v1[5] = 0;
v1[6] = 0;
}
else
{
v1[5] = 0;
v1[7] = 1;
v1[6] = 0;
return 1;
}
return result;
}