//
// cocos2d::CCAnimate::update from 0xac081c to 0xac0ac4 (680 bytes)
//
// 2 xrefs:
// > ??> @ 0x720f0
// > ??> @ 0x11fee28
//
// 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 cocos2d::CCAnimate::update(cocos2d::CCAnimate *a1, float a2)
{
float v2; // s8
float *m_start; // x24
unsigned int v5; // w0
unsigned int m_pOrigFrame; // w20
unsigned int v7; // w25
__int64 *v8; // x2
__int64 v9; // x1
__int64 v10; // x0
unsigned __int64 v11; // x2
__int64 *v12; // x2
__int64 v13; // x0
__int64 v14; // x0
cocos2d::CCNode *v15; // x0
const cocos2d::CCSize *v16; // x0
cocos2d::CCNode *m_pTarget; // x19
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
cocos2d::CCArray *v19; // x27
unsigned int v20; // w19
const cocos2d::CCSize *v21; // x0
unsigned int v22; // w1
__int64 v23; // x0
unsigned int v24; // w1
float v25; // s0
cocos2d::CCSize v26; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCPoint v27; // [xsp+80h] [xbp+80h] BYREF
v2 = a2;
if ( a2 < 1.0 )
{
v24 = (unsigned int)a1[1].__vftable;
v25 = (float)HIDWORD(a1->m_pSplitTimes[3].m_finish) * a2;
if ( (unsigned int)v25 > v24 )
{
LODWORD(a1->m_pOrigFrame) = 0;
LODWORD(a1[1].__vftable) = v24 + 1;
}
v2 = fmodf(v25, 1.0);
}
m_start = a1->m_pSplitTimes[3].m_start;
v5 = cocos2d::CCArray::count((cocos2d::CCArray *)m_start);
m_pOrigFrame = (unsigned int)a1->m_pOrigFrame;
v7 = v5;
if ( v5 > m_pOrigFrame )
{
v8 = *(__int64 **)&a1->m_nNextFrame;
v9 = m_pOrigFrame;
v10 = *v8;
v11 = (v8[1] - *v8) >> 2;
if ( v11 <= m_pOrigFrame )
LABEL_22:
sub_D13C5C("vector::_M_range_check: __n (which is %zu) >= this->size() (which is %zu)", v9, v11);
if ( v2 >= *(float *)(v10 + 4LL * m_pOrigFrame) )
{
do
{
v14 = cocos2d::CCArray::objectAtIndex((cocos2d::CCArray *)m_start, m_pOrigFrame);
((void (__fastcall *)(cocos2d::CCNode *, _QWORD))a1->m_pTarget->cocos2d::CCActionInterval::cocos2d::CCFiniteTimeAction::cocos2d::CCAction::__vftable[1].setSkewY)(
a1->m_pTarget,
*(_QWORD *)(v14 + 56));
if ( BYTE4(a1[1].__vftable) && a1->m_pTarget->getParent(a1->m_pTarget) )
{
v15 = a1->m_pTarget->getParent(a1->m_pTarget);
v16 = v15->getContentSize(v15);
cocos2d::CCSize::CCSize(&v26, v16);
m_pTarget = a1->m_pTarget;
setPosition = m_pTarget->setPosition;
cocos2d::CCPoint::CCPoint(&v27, v26.width * 0.5, v26.height * 0.5);
setPosition(m_pTarget, &v27);
if ( !BYTE5(a1[1].__vftable) )
goto LABEL_7;
}
else if ( !BYTE5(a1[1].__vftable) )
{
goto LABEL_7;
}
v19 = a1->m_pTarget->getChildren(a1->m_pTarget);
if ( v19 )
{
v20 = 0;
v21 = a1->m_pTarget->getContentSize(a1->m_pTarget);
cocos2d::CCSize::CCSize(&v26, v21);
cocos2d::CCPoint::CCPoint(&v27, v26.width * 0.5, v26.height * 0.5);
while ( v20 < (unsigned int)cocos2d::CCArray::count(v19) )
{
v22 = v20++;
v23 = cocos2d::CCArray::objectAtIndex(v19, v22);
(*(void (__fastcall **)(__int64, cocos2d::CCPoint *))(*(_QWORD *)v23 + 184LL))(v23, &v27);
}
LODWORD(a1->m_pOrigFrame) = ++m_pOrigFrame;
if ( v7 <= m_pOrigFrame )
return;
goto LABEL_8;
}
LABEL_7:
LODWORD(a1->m_pOrigFrame) = ++m_pOrigFrame;
if ( v7 <= m_pOrigFrame )
return;
LABEL_8:
v12 = *(__int64 **)&a1->m_nNextFrame;
v9 = m_pOrigFrame;
v13 = *v12;
v11 = (v12[1] - *v12) >> 2;
if ( m_pOrigFrame >= v11 )
goto LABEL_22;
}
while ( v2 >= *(float *)(v13 + 4LL * m_pOrigFrame) );
}
}
}