//
// GJBaseGameLayer::speedForShaderTarget from 0x1001f1b8c to 0x1001f1c9c (272 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::updateShaderLayer @ 0x1001f14c8
// > GJBaseGameLayer::updateShaderLayer @ 0x1001f14ec
//
// 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 GJBaseGameLayer::speedForShaderTarget(GJBaseGameLayer *a1, int a2)
{
_QWORD *v2; // x8
_QWORD *v5; // x19
__int64 v6; // x21
PlayerObject *m_player2; // x0
float32x2_t *LastPosition; // x1
float32x2_t *v9; // x0
double v10; // d0
GameObject *MainObject; // x0
GameObject *v13; // x20
__int64 v14; // [xsp+0h] [xbp-30h] BYREF
float32x2_t v15; // [xsp+8h] [xbp-28h] BYREF
cocos2d::CCPoint result; // 0:s0.4,4:s1.4
v5 = v2;
sub_1000229B0(v2);
if ( a2 == -1 )
goto LABEL_5;
if ( a2 == -2 )
{
if ( a1->m_gameState.m_isDualMode )
{
v6 = ((__int64 (__fastcall *)(PlayerObject *))a1->m_player2->getPosition)(a1->m_player2);
m_player2 = a1->m_player2;
LABEL_6:
LastPosition = (float32x2_t *)GameObject::getLastPosition(m_player2);
v9 = (float32x2_t *)v6;
goto LABEL_7;
}
LABEL_5:
v6 = ((__int64 (__fastcall *)(PlayerObject *))a1->m_player1->getPosition)(a1->m_player1);
m_player2 = a1->m_player1;
goto LABEL_6;
}
if ( a2 <= 0 )
{
sub_100022A04((float32x2_t *)&a1->m_gameState.m_cameraStepDiff, &v15);
goto LABEL_8;
}
MainObject = GJBaseGameLayer::tryGetMainObject(a1, a2);
if ( !MainObject )
{
sub_1000229B8((__int64 *)&v15, &qword_10086C9A0);
goto LABEL_8;
}
v13 = MainObject;
((void (__fastcall *)(__int64 *__return_ptr))MainObject->getRealPosition)(&v14);
LastPosition = (float32x2_t *)GameObject::getLastPosition(v13);
v9 = (float32x2_t *)&v14;
LABEL_7:
sub_1000229F0(v9, LastPosition, &v15);
LABEL_8:
v10 = sub_1000229D0(v5, (double *)&v15);
result.x = *(float *)&v10;
return result;
}