//
// GameToolbox::getRelativeOffset from 0x3cd468 to 0x3cd5f8 (400 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::getRelativeOffset @ 0x45febc
// > EditorUI::getRelativeOffset @ 0x70d508
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:46:38 +0000
//
cocos2d::CCPoint *__fastcall GameToolbox::getRelativeOffset(cocos2d::CCPoint *a1, int a2, cocos2d::CCPoint *a3)
{
int v6; // r7
int v7; // r8
float v8; // r0
float v9; // s14
float v10; // s15
float v11; // s13
bool v12; // fzf
int v13; // r2
if ( cocos2d::CCPoint::equals(a3, (const cocos2d::CCPoint *)&unk_D2A6B4) )
goto LABEL_33;
v6 = (*(int (__fastcall **)(int))(*(_DWORD *)a2 + 716))(a2);
v7 = (*(int (__fastcall **)(int))(*(_DWORD *)a2 + 712))(a2);
v8 = COERCE_FLOAT((*(int (__fastcall **)(int))(*(_DWORD *)a2 + 184))(a2));
v9 = 90.0;
v10 = v8;
v11 = fabsf(v8);
if ( v11 == 90.0 || v11 == 270.0 )
{
v13 = *((_DWORD *)a3 + 1);
*((_DWORD *)a3 + 1) = *(_DWORD *)a3;
*(_DWORD *)a3 = v13;
}
if ( v8 < 0.0 )
v10 = v8 + 360.0;
if ( v7 )
{
if ( v6 )
{
if ( v10 == 0.0 || v10 == 90.0 )
{
*(float *)a3 = -*(float *)a3;
if ( v10 == 0.0 )
goto LABEL_29;
}
v9 = 270.0;
}
else
{
if ( v10 == 0.0 || v10 == 270.0 )
{
*(float *)a3 = -*(float *)a3;
if ( v10 == 270.0 )
goto LABEL_29;
}
v9 = 180.0;
}
goto LABEL_27;
}
if ( v6 )
{
if ( v10 != 90.0 && v10 != 180.0 )
{
v12 = v10 == 0.0;
LABEL_32:
if ( !v12 )
goto LABEL_33;
goto LABEL_29;
}
*(float *)a3 = -*(float *)a3;
if ( v10 == 0.0 )
{
LABEL_29:
*((float *)a3 + 1) = -*((float *)a3 + 1);
goto LABEL_33;
}
LABEL_27:
v12 = v10 == v9;
goto LABEL_32;
}
if ( (v10 == 90.0 || v10 == 180.0) && (*((float *)a3 + 1) = -*((float *)a3 + 1), v10 == 180.0) || v10 == 270.0 )
*(float *)a3 = -*(float *)a3;
LABEL_33:
cocos2d::CCPoint::CCPoint(a1, a3);
return a1;
}