//
// cocos2d::CCTimer::update from 0x100441b00 to 0x100441caa (426 bytes)
//
// 1 xrefs:
// > ??> @ 0x100939788
//
// 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
//
void __fastcall cocos2d::CCTimer::update(cocos2d::CCTimer *a1, float a2)
{
float v4; // xmm0_4
char v5; // al
float v6; // xmm0_4
cocos2d::CCTimer_vtbl *v7; // rdi
void (__fastcall *v8)(_QWORD); // rax
_QWORD *v9; // rdi
cocos2d::CCScriptEngineManager *v10; // rax
cocos2d::CCTimer_vtbl *v11; // rdi
void (__fastcall *v12)(_QWORD); // rax
_QWORD *v13; // rdi
cocos2d::CCScriptEngineManager *v14; // rax
cocos2d::CCDirector *v15; // rax
cocos2d::CCScheduler *v16; // rax
unsigned int v17; // xmm0_4
cocos2d::CCTimer_vtbl *v18; // rdi
void (__fastcall *v19)(_QWORD); // rax
_QWORD *v20; // rdi
cocos2d::CCScriptEngineManager *v21; // rax
v4 = *(float *)&a1[1].m_uID;
if ( v4 == -1.0 )
{
a1[1].m_uID = 0;
a1[1].m_nTag = 0;
}
else
{
v5 = BYTE1(a1[1].m_nLuaID);
if ( LOBYTE(a1[1].m_nLuaID) == 1 && (v5 & 1) == 0 )
{
*(float *)&v17 = v4 + a2;
a1[1].m_uID = v17;
if ( *(float *)&v17 >= *(float *)&a1[1].m_eObjType )
{
v18 = a1[1].__vftable;
if ( v18 )
{
v19 = *(void (__fastcall **)(_QWORD))&a1[1].m_uIndexInArray;
if ( v19 )
{
v20 = (cocos2d::CCObject *(__cdecl **)(cocos2d::CCCopying *__hidden, cocos2d::CCZone *))((char *)&v18->copyWithZone + *(_QWORD *)&a1[1].m_unknown2);
if ( ((unsigned __int8)v19 & 1) != 0 )
v19 = *(void (__fastcall **)(_QWORD))((char *)v19 + *v20 - 1);
v19(v20);
}
}
if ( a1[1].m_uOrderOfArrival )
{
v21 = cocos2d::CCScriptEngineManager::sharedManager();
(*(void (__fastcall **)(_QWORD, _QWORD, _QWORD, float))(**(_QWORD **)v21 + 104LL))(
*(_QWORD *)v21,
(unsigned int)a1[1].m_uOrderOfArrival,
0,
*(float *)&a1[1].m_uID);
}
a1[1].m_uID = 0;
}
}
else
{
v6 = v4 + a2;
*(float *)&a1[1].m_uID = v6;
if ( (v5 & 1) != 0 )
{
if ( v6 >= *(float *)&a1[1].m_uAutoReleaseCount )
{
v7 = a1[1].__vftable;
if ( v7 )
{
v8 = *(void (__fastcall **)(_QWORD))&a1[1].m_uIndexInArray;
if ( v8 )
{
v9 = (cocos2d::CCObject *(__cdecl **)(cocos2d::CCCopying *__hidden, cocos2d::CCZone *))((char *)&v7->copyWithZone + *(_QWORD *)&a1[1].m_unknown2);
if ( ((unsigned __int8)v8 & 1) != 0 )
v8 = *(void (__fastcall **)(_QWORD))((char *)v8 + *v9 - 1);
v8(v9);
}
}
if ( a1[1].m_uOrderOfArrival )
{
v10 = cocos2d::CCScriptEngineManager::sharedManager();
(*(void (__fastcall **)(_QWORD, _QWORD, _QWORD, float))(**(_QWORD **)v10 + 104LL))(
*(_QWORD *)v10,
(unsigned int)a1[1].m_uOrderOfArrival,
0,
*(float *)&a1[1].m_uID);
}
*(float *)&a1[1].m_uID = *(float *)&a1[1].m_uID - *(float *)&a1[1].m_uAutoReleaseCount;
++a1[1].m_nTag;
BYTE1(a1[1].m_nLuaID) = 0;
}
}
else if ( v6 >= *(float *)&a1[1].m_eObjType )
{
v11 = a1[1].__vftable;
if ( v11 )
{
v12 = *(void (__fastcall **)(_QWORD))&a1[1].m_uIndexInArray;
if ( v12 )
{
v13 = (cocos2d::CCObject *(__cdecl **)(cocos2d::CCCopying *__hidden, cocos2d::CCZone *))((char *)&v11->copyWithZone + *(_QWORD *)&a1[1].m_unknown2);
if ( ((unsigned __int8)v12 & 1) != 0 )
v12 = *(void (__fastcall **)(_QWORD))((char *)v12 + *v13 - 1);
v12(v13);
}
}
if ( a1[1].m_uOrderOfArrival )
{
v14 = cocos2d::CCScriptEngineManager::sharedManager();
(*(void (__fastcall **)(_QWORD, _QWORD, _QWORD, float))(**(_QWORD **)v14 + 104LL))(
*(_QWORD *)v14,
(unsigned int)a1[1].m_uOrderOfArrival,
0,
*(float *)&a1[1].m_uID);
}
a1[1].m_uID = 0;
++a1[1].m_nTag;
}
if ( !LOBYTE(a1[1].m_nLuaID) && a1[1].m_nTag > a1[1].m_uReference )
{
v15 = cocos2d::CCDirector::sharedDirector();
v16 = (cocos2d::CCScheduler *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v15->getScheduler)(v15);
cocos2d::CCScheduler::unscheduleSelector(
v16,
*(cocos2d::SEL_SCHEDULE *)&a1[1].m_uIndexInArray,
(cocos2d::CCObject *)a1[1].__vftable);
}
}
}
}