//
// engine_unlocked_init from 0x7f70b0 to 0x7f7100 (80 bytes)
//
// 6 xrefs:
// > ENGINE_init @ 0x7f724c
// > engine_table_register @ 0x8b44b0
// > engine_table_select @ 0x8b46d4
// > engine_table_select @ 0x8b4710
// > engine_table_select @ 0x8b478c
// > ??> @ 0x622fc
//
// 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
//
int __fastcall engine_unlocked_init(_DWORD *a1)
{
int v1; // r3
int (*v3)(void); // r2
int result; // r0
int v5; // r2
v1 = a1[21];
if ( v1 || (v3 = (int (*)(void))a1[12]) == nullptr )
{
result = 1;
goto LABEL_7;
}
result = v3();
if ( result )
{
v1 = a1[21];
LABEL_7:
v5 = a1[20] + 1;
a1[21] = v1 + 1;
a1[20] = v5;
}
return result;
}