//
// getRotateCommandAngleDelta from 0x9a6a18 to 0x9a6c40 (552 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::triggerRotateCommand @ 0x9be810
// > GJBaseGameLayer::processDynamicObjectActions @ 0x9d87e0
// > ??> @ 0xf79c0
//
// 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:58:10 +0000
//
__int64 __fastcall getRotateCommandAngleDelta(
__int64 a1,
__int64 a2,
__int64 a3,
__int64 a4,
GameObject *a5,
GameObject *a6,
GameObject *a7,
GameObject *a8)
{
long double v14; // q0
GJBaseGameLayer *v15; // x0
float v16; // s8
long double v17; // q0
float v18; // s0
__int64 v22; // [xsp+88h] [xbp+88h] BYREF
__int64 v23; // [xsp+90h] [xbp+90h] BYREF
__int64 v24; // [xsp+98h] [xbp+98h] BYREF
__int64 x; // [xsp+A0h] [xbp+A0h] BYREF
(*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)a2 + 1360LL))(&v22, a2);
(*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)a4 + 1360LL))(&v23, a4);
(*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)a3 + 1360LL))(&v24, a3);
if ( a2 == a3 )
{
v16 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 368LL))(a2);
LABEL_4:
if ( a2 != a4 )
goto LABEL_5;
LABEL_10:
v18 = 0.0;
goto LABEL_8;
}
cocos2d::CCPoint::operator-(&x, &v24, &v22, v14);
if ( sqrtf((float)(*((float *)&x + 1) * *((float *)&x + 1)) + (float)(*(float *)&x * *(float *)&x)) >= 0.01 )
{
v16 = 90.0 - (float)(atan2f(*((float *)&x + 1), *(float *)&x) * 57.296);
goto LABEL_4;
}
v16 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a3 + 368LL))(a3);
if ( a2 == a4 )
goto LABEL_10;
LABEL_5:
if ( *(_BYTE *)(a1 + 1508) )
{
applyPositionLimits((cocos2d::CCPoint *)&v23, a5, a6, a7, a8);
v15 = (GJBaseGameLayer *)cocos2d::CCPoint::operator-(&x, &v23, &v22, v17);
v18 = 0.0;
if ( sqrtf((float)(*((float *)&x + 1) * *((float *)&x + 1)) + (float)(*(float *)&x * *(float *)&x)) >= 0.01 )
v18 = 90.0 - (float)(atan2f(*((float *)&x + 1), *(float *)&x) * 57.296);
}
else
{
v15 = (GJBaseGameLayer *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a4 + 368LL))(a4);
}
LABEL_8:
GJBaseGameLayer::convertToClosestDirection(v15, (float)(v18 - v16) + *(float *)(a1 + 1560), 180.0);
return _stack_chk_guard;
}