//
// GJBaseGameLayer::loadUpToPosition from 0x9ebbf8 to 0x9ebfa0 (936 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::loadStartPosObject @ 0x9ec054
// > ??> @ 0xe8fa8
//
// 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:59:03 +0000
//
__int64 __fastcall GJBaseGameLayer::loadUpToPosition(GJBaseGameLayer *this, float a2, unsigned int a3, unsigned int a4)
{
float (__fastcall *v6)(GJBaseGameLayer *, __int64 *, _QWORD, __int64, _QWORD, _QWORD); // x21
float v7; // s12
float v8; // s13
int v9; // w22
const cocos2d::CCPoint *v10; // x0
float v11; // s11
int v12; // w27
float v13; // s8
double v14; // d1
__int64 v15; // x1
double v16; // d2
double v17; // d1
float v18; // s9
float v19; // s10
float v20; // s9
float v21; // s9
unsigned __int8 v22; // w1
double v23; // d12
__int64 v26; // [xsp+A8h] [xbp+A8h]
_BYTE v27[8]; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v28; // [xsp+C0h] [xbp+C0h] BYREF
v26 = a4;
(*(void (__fastcall **)(GJBaseGameLayer *))(*(_QWORD *)this + 1424LL))(this);
GJBaseGameLayer::resetSongTriggerValues(this);
v6 = *(float (__fastcall **)(GJBaseGameLayer *, __int64 *, _QWORD, __int64, _QWORD, _QWORD))(*(_QWORD *)this + 1408LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, a2, 0.0);
v7 = v6(this, &v28, a3, v26, 0, 0);
if ( v7 > 3600.0 )
{
v8 = 216000.0;
v7 = 3600.0;
}
else
{
v8 = v7 / 0.016667;
}
v9 = (int)(float)(ceilf(v8) + 1.0);
v10 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 407) + 192LL))(*((_QWORD *)this + 407));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, v10);
(*(void (__fastcall **)(_QWORD, void *))(**((_QWORD **)this + 407) + 184LL))(*((_QWORD *)this + 407), &unk_155D2C8);
if ( v9 > 0 )
{
v11 = 0.0;
v12 = 0;
do
{
if ( v7 < (float)(v11 + 0.016667) )
{
v13 = v7 - v11;
v14 = (float)(v7 - v11);
v11 = (float)(v7 - v11) + v11;
}
else
{
v11 = v11 + 0.016667;
v14 = 0.0166666675;
v13 = 0.016667;
}
v15 = *(_QWORD *)this;
v16 = *((double *)this + 116) + v14;
v17 = *((double *)this + 115) + v14;
*((double *)this + 116) = v16;
*((double *)this + 115) = v17;
(*(void (__fastcall **)(__int64 *__return_ptr, GJBaseGameLayer *, float))(v15 + 1416))(&v28, this, v11);
v18 = *(float *)&v28;
v19 = v18
- *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 407) + 192LL))(*((_QWORD *)this + 407));
v20 = *((float *)&v28 + 1);
v21 = v20
- *(float *)((*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 407) + 192LL))(*((_QWORD *)this + 407))
+ 4);
(*(void (__fastcall **)(_QWORD, __int64 *))(**((_QWORD **)this + 407) + 184LL))(*((_QWORD *)this + 407), &v28);
GJEffectManager::updateEffects(*((GJEffectManager **)this + 269), v13);
GJEffectManager::preCollisionCheck(*((GJEffectManager **)this + 269));
std::__tree>::clear((_QWORD *)this + 510);
GJEffectManager::updateSpawnTriggers(*((GJEffectManager **)this + 269), v13);
std::__tree>::clear((_QWORD *)this + 510);
*(float *)(*((_QWORD *)this + 269) + 1624LL) = v19;
*(float *)(*((_QWORD *)this + 269) + 1628LL) = v21;
*(float *)(*((_QWORD *)this + 269) + 1632LL) = v19;
*(float *)(*((_QWORD *)this + 269) + 1636LL) = v21;
GJEffectManager::updateTimers(*((GJEffectManager **)this + 269), v13, 1.0);
GJEffectManager::prepareMoveActions(*((GJEffectManager **)this + 269), v13, 0);
v22 = v9 - 1 == v12++;
GJBaseGameLayer::processMoveActionsStep(this, v13, v22);
GJEffectManager::postMoveActions(*((GJEffectManager **)this + 269));
GJBaseGameLayer::updateCollisionBlocks((cocos2d::CCArray **)this);
GJBaseGameLayer::checkSpawnObjects(this);
*((_DWORD *)this + 207) = *((_DWORD *)this + 208);
GJBaseGameLayer::checkSpawnObjects(this);
GJEffectManager::postCollisionCheck(*((GJEffectManager **)this + 269));
GJGameState::updateTweenActions((__int64)this + 424, v13);
GJEffectManager::processColors(*((GJEffectManager **)this + 269));
}
while ( v12 != v9 );
}
*(_QWORD *)(*((_QWORD *)this + 407) + 2440LL) = 0;
*(_QWORD *)(*((_QWORD *)this + 407) + 2448LL) = 0;
PlayerObject::setYVelocity(*((_QWORD *)this + 407), 0.0);
GJBaseGameLayer::toggleLockPlayer((PlayerObject **)this, 0, 1);
GJBaseGameLayer::toggleLockPlayer((PlayerObject **)this, 0, 0);
*(_DWORD *)(*((_QWORD *)this + 269) + 1624LL) = 0;
*(_DWORD *)(*((_QWORD *)this + 269) + 1628LL) = 0;
*(_DWORD *)(*((_QWORD *)this + 269) + 1632LL) = 0;
*(_DWORD *)(*((_QWORD *)this + 269) + 1636LL) = 0;
(*(void (__fastcall **)(_QWORD, _BYTE *))(**((_QWORD **)this + 407) + 184LL))(*((_QWORD *)this + 407), v27);
v23 = (v7 + v7) / 0.00416666667 + 0.5;
*((_DWORD *)this + 236) = (int)v23;
*((_DWORD *)this + 238) = (int)v23;
return _stack_chk_guard;
}