//
// GameToolbox::getRelativeOffset from 0x100044654 to 0x100044834 (480 bytes)
//
// 6 xrefs:
// > LevelEditorLayer::getObjectRect @ 0x10035b1e0
// > EditorUI::onCreateObject @ 0x1003eb418
// > EditorUI::getRelativeOffset @ 0x1003ec630
// > EditorUI::removeOffset @ 0x1003ec79c
// > EditorUI::applyOffset @ 0x1003ec81c
// > EditorUI::positionWithoutOffset @ 0x1003f7ec8
//
// 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
//
cocos2d::CCPoint __fastcall GameToolbox::getRelativeOffset(GameObject *a1, cocos2d::CCPoint a2)
{
float *v2; // x1
__int64 *v3; // x8
float *v4; // x19
__int64 *v6; // x20
int v7; // w21
int v8; // w22
float v9; // s0
float v10; // s1
bool v13; // zf
float v14; // w8
bool v16; // zf
float *v17; // x8
cocos2d::CCPoint result; // 0:s0.4,4:s1.4
v4 = v2;
v6 = v3;
if ( sub_100022A5C(v2, flt_10086A7B0) )
goto LABEL_53;
v7 = ((__int64 (__fastcall *)(GameObject *))a1->isFlipY)(a1);
v8 = ((__int64 (__fastcall *)(GameObject *))a1->isFlipX)(a1);
v9 = ((float (__fastcall *)(GameObject *))a1->getRotation)(a1);
v10 = fabsf(v9);
if ( v10 == 90.0 || v10 == 270.0 )
*(int32x2_t *)v4 = vrev64_s32(*(int32x2_t *)v4);
if ( v9 < 0.0 )
v9 = v9 + 360.0;
if ( ((v8 | v7) & 1) == 0 )
{
if ( v9 == 90.0 || v9 == 180.0 )
v4[1] = -v4[1];
v16 = v9 == 180.0 || v9 == 270.0;
v17 = v4;
if ( !v16 )
goto LABEL_53;
LABEL_52:
*v17 = -*v17;
goto LABEL_53;
}
if ( ((v8 ^ 1 | v7) & 1) != 0 )
{
if ( ((v8 | v7 ^ 1) & 1) != 0 )
{
if ( ((v8 ^ 1 | v7 ^ 1) & 1) != 0 )
goto LABEL_53;
if ( v9 == 0.0 || v9 == 90.0 )
*v4 = -*v4;
v13 = v9 == 0.0;
v14 = 270.0;
}
else
{
if ( v9 == 90.0 || v9 == 180.0 )
*v4 = -*v4;
v13 = v9 == 0.0;
v14 = 90.0;
}
}
else
{
if ( v9 == 0.0 || v9 == 270.0 )
*v4 = -*v4;
v13 = v9 == 270.0;
v14 = 180.0;
}
if ( v13 || v9 == v14 )
{
v17 = v4 + 1;
goto LABEL_52;
}
LABEL_53:
result.x = sub_1000229B8(v6, (__int64 *)v4);
return result;
}