//
// GJBaseGameLayer::toggleFlipped from 0x100281f24 to 0x100282088 (356 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::collisionCheckObjects @ 0x100283f18
// > GJBaseGameLayer::collisionCheckObjects @ 0x100284390
//
// 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 11:01:55 +0000
//
__int64 __fastcall GJBaseGameLayer::toggleFlipped(__int64 result, int a2, char a3)
{
__int64 v5; // x19
float v6; // s0
__int64 v7; // x0
float v8; // s0
float v9; // s8
int v11; // w8
if ( *(unsigned __int8 *)(result + 1000) == a2 )
return result;
v5 = result;
*(_BYTE *)(result + 1000) = a2;
result = PlayerObject::deactivateStreak(*(_QWORD *)(result + 3256), 1);
if ( (a3 & 1) != 0 )
{
v6 = 0.0;
if ( a2 )
v6 = 1.0;
*(_BYTE *)(v5 + 1008) = 0;
*(float *)(v5 + 1004) = v6;
return result;
}
v7 = *(_QWORD *)(v5 + 3256);
if ( (a2 & 1) == 0 )
{
PlayerObject::spawnPortalCircle(v7, 16776960, 50.0);
*(_BYTE *)(v5 + 1008) = 0;
v8 = *(float *)(v5 + 1004);
v9 = 0.0;
if ( v8 != 0.0 && v8 != 1.0 )
goto LABEL_20;
v11 = 1065353048;
LABEL_19:
*(_DWORD *)(v5 + 1004) = v11;
goto LABEL_25;
}
PlayerObject::spawnPortalCircle(v7, 38655, 50.0);
*(_BYTE *)(v5 + 1008) = 0;
v8 = *(float *)(v5 + 1004);
v9 = 1.0;
if ( v8 == 0.0 || v8 == 1.0 )
{
v11 = 925353388;
goto LABEL_19;
}
LABEL_20:
if ( (*(_BYTE *)(v5 + 1000) & 1) != 0 )
{
if ( v8 >= 0.5 )
goto LABEL_25;
goto LABEL_24;
}
if ( v8 > 0.5 )
LABEL_24:
*(_BYTE *)(v5 + 1008) = 1;
LABEL_25:
PlayerObject::levelWillFlip(*(_QWORD *)(v5 + 3256));
if ( *(_BYTE *)(v5 + 1010) == 1 )
PlayerObject::levelWillFlip(*(_QWORD *)(v5 + 3264));
result = sub_10027409C(v5 + 424, 7, 1, -1, -1, *(float *)(v5 + 1004), v9, 0.4, 1.2);
*(_BYTE *)(v5 + 1009) = 1;
return result;
}