//
// engine_unlocked_init from 0x101b400 to 0x101b454 (84 bytes)
//
// 6 xrefs:
// > ENGINE_init @ 0x101b5ac
// > engine_table_register @ 0x10dc2e0
// > engine_table_select @ 0x10dc514
// > engine_table_select @ 0x10dc558
// > engine_table_select @ 0x10dc5b4
// > ??> @ 0xbb630
//
// 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:16:07 +0000
//
__int64 __fastcall engine_unlocked_init(__int64 a1)
{
int v1; // w1
__int64 (*v3)(void); // x2
__int64 result; // x0
int v5; // w2
v1 = *(_DWORD *)(a1 + 160);
if ( v1 || (v3 = *(__int64 (**)(void))(a1 + 96)) == nullptr )
{
result = 1;
}
else
{
result = v3();
if ( !(_DWORD)result )
return result;
v1 = *(_DWORD *)(a1 + 160);
}
v5 = *(_DWORD *)(a1 + 156);
*(_DWORD *)(a1 + 160) = v1 + 1;
*(_DWORD *)(a1 + 156) = v5 + 1;
return result;
}