//
// GJBaseGameLayer::speedForShaderTarget from 0x9a23fc to 0x9a2588 (396 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::updateShaderLayer @ 0x9a2d78
// > GJBaseGameLayer::updateShaderLayer @ 0x9a2d94
// > ??> @ 0xe60e0
//
// 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:08 +0000
//
cocos2d::CCPoint *__usercall GJBaseGameLayer::speedForShaderTarget@(
GJBaseGameLayer *this@,
int a2@,
cocos2d::CCPoint *a3@)
{
__int64 MainObject; // x0
GameObject *v6; // x21
__int64 v7; // x0
long double v8; // q0
__int64 v10; // x23
GameObject *v11; // x0
__int64 LastPosition; // x0
long double v13; // q0
__int64 v15; // [xsp+58h] [xbp+58h] BYREF
__int64 v16; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCPoint::CCPoint(a3);
if ( a2 == -1 )
goto LABEL_11;
if ( a2 == -2 )
{
if ( *((_BYTE *)this + 1010) )
{
v10 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 408) + 192LL))(*((_QWORD *)this + 408));
v11 = *((GameObject **)this + 408);
LABEL_10:
LastPosition = GameObject::getLastPosition(v11);
cocos2d::CCPoint::operator-(&v16, v10, LastPosition, v13);
cocos2d::CCPoint::operator=(a3, &v16);
return a3;
}
LABEL_11:
v10 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 407) + 192LL))(*((_QWORD *)this + 407));
v11 = *((GameObject **)this + 407);
goto LABEL_10;
}
if ( a2 <= 0 )
{
cocos2d::CCPoint::operator-(&v16, (char *)this + 1148);
cocos2d::CCPoint::operator=(a3, &v16);
}
else
{
MainObject = GJBaseGameLayer::tryGetMainObject((cocos2d::CCDictionary **)this, a2);
v6 = (GameObject *)MainObject;
if ( MainObject )
{
(*(void (__fastcall **)(__int64 *__return_ptr))(*(_QWORD *)MainObject + 1360LL))(&v15);
v7 = GameObject::getLastPosition(v6);
cocos2d::CCPoint::operator-(&v16, &v15, v7, v8);
}
else
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v16, (const cocos2d::CCPoint *)&unk_155D2C8);
}
cocos2d::CCPoint::operator=(a3, &v16);
}
return a3;
}