//
// GJRotationControl::onApplyAngle from 0xbceeec to 0xbcf0ac (448 bytes)
//
// 4 xrefs:
// > GJRotationControl::applyFocusedInput @ 0xbcf0d8
// > ??> @ 0x802f0
// > GJRotationControl::init @ 0xbd40c4
// > ??> @ 0x1543528
//
// 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 13:03:36 +0000
//
__int64 __fastcall GJRotationControl::onApplyAngle(GJRotationControl *this, cocos2d::CCObject *a2)
{
CCTextInputNode *v3; // x0
const char *v4; // x0
float v5; // s8
float v6; // s9
float v7; // s8
__int64 v8; // x0
const char *v10; // x1
__int64 v11[2]; // [xsp+40h] [xbp+40h] BYREF
void *v12; // [xsp+50h] [xbp+50h]
v3 = *((CCTextInputNode **)this + 58);
if ( !v3 )
return _stack_chk_guard;
CCTextInputNode::getString(v3, v11);
if ( (v11[0] & 1) != 0 )
{
if ( v11[1] )
{
v4 = (const char *)v12;
goto LABEL_4;
}
}
else
{
v4 = (char *)v11 + 1;
if ( (int)LOBYTE(v11[0]) >> 1 )
{
LABEL_4:
v5 = atof(v4);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 58) + 1160LL))(*((_QWORD *)this + 58), 0);
v6 = fmodf(v5, 360.0);
if ( v6 <= 180.0 )
{
if ( v6 <= -180.0 )
v6 = v6 + 360.0;
}
else
{
v6 = v6 - 360.0;
}
v7 = v6 - *((float *)this + 109);
if ( v7 <= 180.0 )
{
if ( v7 <= -180.0 )
v7 = v7 + 360.0;
}
else
{
v7 = v7 - 360.0;
}
if ( v7 != 0.0 )
{
v8 = *((_QWORD *)this + 64);
if ( v8 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 8LL))(v8);
(***((void (__fastcall ****)(_QWORD, _QWORD, float))this + 64))(
*((_QWORD *)this + 64),
*((unsigned __int8 *)this + 456),
v7);
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)this + 64) + 16LL))(*((_QWORD *)this + 64));
}
}
GJRotationControl::setAngle(this, v6);
goto LABEL_12;
}
}
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 58) + 1160LL))(*((_QWORD *)this + 58), 0);
GJRotationControl::updateAngleInput(this, *((float *)this + 109), v10);
LABEL_12:
if ( (v11[0] & 1) != 0 )
operator delete(v12);
return _stack_chk_guard;
}