//
// GJBaseGameLayer::speedForShaderTarget from 0x10028d664 to 0x10028d774 (272 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::updateShaderLayer @ 0x10028cfa0
// > GJBaseGameLayer::updateShaderLayer @ 0x10028cfc4
//
// 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 11:02:01 +0000
//
double __usercall GJBaseGameLayer::speedForShaderTarget@(__int64 a1@, __int64 a2@, _QWORD *a3@)
{
__int64 v6; // x21
__int64 v7; // x0
float32x2_t *LastPosition; // x1
float32x2_t *v9; // x0
__int64 MainObject; // x0
__int64 v12; // x20
__int64 v13; // [xsp+0h] [xbp-30h] BYREF
float32x2_t v14; // [xsp+8h] [xbp-28h] BYREF
sub_1000262EC(a3);
if ( (_DWORD)a2 == -1 )
goto LABEL_5;
if ( (_DWORD)a2 == -2 )
{
if ( (*(_BYTE *)(a1 + 1010) & 1) != 0 )
{
v6 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3264) + 192LL))(*(_QWORD *)(a1 + 3264));
v7 = *(_QWORD *)(a1 + 3264);
LABEL_6:
LastPosition = (float32x2_t *)GameObject::getLastPosition(v7);
v9 = (float32x2_t *)v6;
goto LABEL_7;
}
LABEL_5:
v6 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3256) + 192LL))(*(_QWORD *)(a1 + 3256));
v7 = *(_QWORD *)(a1 + 3256);
goto LABEL_6;
}
if ( (int)a2 <= 0 )
{
sub_100026340((float32x2_t *)(a1 + 1148), &v14);
return sub_10002630C(a3, (double *)&v14);
}
MainObject = GJBaseGameLayer::tryGetMainObject(a1, a2);
if ( !MainObject )
{
sub_1000262F4(&v14, (double *)&qword_1009F5820);
return sub_10002630C(a3, (double *)&v14);
}
v12 = MainObject;
(*(void (__fastcall **)(__int64 *__return_ptr))(*(_QWORD *)MainObject + 1360LL))(&v13);
LastPosition = (float32x2_t *)GameObject::getLastPosition(v12);
v9 = (float32x2_t *)&v13;
LABEL_7:
sub_10002632C(v9, LastPosition, &v14);
return sub_10002630C(a3, (double *)&v14);
}