//
// SetupSmartBlockLayer::onAllowFlipping from 0x100078a74 to 0x100078af8 (132 bytes)
//
// 2 xrefs:
// > SetupSmartBlockLayer::init @ 0x100077f4c
// > SetupSmartBlockLayer::init @ 0x10007800c
//
// 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 10:58:14 +0000
//
__int64 __fastcall SetupSmartBlockLayer::onAllowFlipping(__int64 result, __int64 a2)
{
__int64 v3; // x19
__int64 v4; // x0
__int64 ActiveSmartTemplate; // x20
bool v6; // w8
bool v7; // w8
if ( a2 )
{
v3 = result;
v4 = GameLevelManager::sharedState(result);
ActiveSmartTemplate = GameLevelManager::getActiveSmartTemplate(v4);
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
if ( (_DWORD)result == 3 )
{
v6 = (*(_BYTE *)(v3 + 674) & 1) == 0;
*(_BYTE *)(v3 + 674) = v6;
if ( ActiveSmartTemplate )
*(_BYTE *)(ActiveSmartTemplate + 136) = v6;
}
else
{
v7 = (*(_BYTE *)(v3 + 675) & 1) == 0;
*(_BYTE *)(v3 + 675) = v7;
if ( ActiveSmartTemplate )
*(_BYTE *)(ActiveSmartTemplate + 137) = v7;
}
}
return result;
}