//
// GameToolbox::getRelativeOffset from 0x69c8f8 to 0x69caf8 (512 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::getRelativeOffset @ 0x789a50
// > EditorUI::getRelativeOffset @ 0xc0027c
// > ??> @ 0xafb28
//
// 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 12:50:40 +0000
//
cocos2d::CCPoint *__usercall GameToolbox::getRelativeOffset@(
__int64 a1@,
cocos2d::CCPoint *a2@,
cocos2d::CCPoint *a3@)
{
unsigned int v6; // w23
unsigned int v7; // w22
float v8; // s0
float v9; // s1
int v11; // w0
_BOOL4 v12; // w0
if ( (unsigned __int8)cocos2d::CCPoint::equals(a2, (const cocos2d::CCPoint *)&unk_155AA70) )
goto LABEL_10;
v6 = (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a1 + 1432LL))(a1);
v7 = (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a1 + 1424LL))(a1);
v8 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a1 + 368LL))(a1);
v9 = fabsf(v8);
if ( v9 == 90.0 || v9 == 270.0 )
{
v11 = *((_DWORD *)a2 + 1);
*((_DWORD *)a2 + 1) = *(_DWORD *)a2;
*(_DWORD *)a2 = v11;
if ( v8 >= 0.0 )
{
LABEL_5:
if ( v7 < (v6 ^ 1) )
goto LABEL_6;
LABEL_13:
if ( v6 >= v7 )
{
if ( v6 <= v7 )
{
if ( !v7 || !v6 )
goto LABEL_10;
v12 = v8 == 0.0;
if ( v8 == 90.0 || v8 == 0.0 )
*(float *)a2 = -*(float *)a2;
if ( v8 == 270.0 )
{
LABEL_18:
*((float *)a2 + 1) = -*((float *)a2 + 1);
goto LABEL_10;
}
}
else
{
v12 = v8 == 90.0;
if ( v8 == 180.0 || v8 == 90.0 )
*(float *)a2 = -*(float *)a2;
if ( v8 == 0.0 )
goto LABEL_18;
}
}
else
{
v12 = v8 == 270.0;
if ( v8 == 270.0 || v8 == 0.0 )
*(float *)a2 = -*(float *)a2;
if ( v8 == 180.0 )
goto LABEL_18;
}
if ( !v12 )
goto LABEL_10;
goto LABEL_18;
}
}
else if ( v8 >= 0.0 )
{
goto LABEL_5;
}
v8 = v8 + 360.0;
if ( v7 >= (v6 ^ 1) )
goto LABEL_13;
LABEL_6:
if ( v8 == 180.0 || v8 == 90.0 )
*((float *)a2 + 1) = -*((float *)a2 + 1);
if ( v8 == 270.0 || v8 == 180.0 )
*(float *)a2 = -*(float *)a2;
LABEL_10:
cocos2d::CCPoint::CCPoint(a3, a2);
return a3;
}