//
// cocos2d::CCAnimate::initWithAnimation from 0x1002204c4 to 0x1002205d4 (272 bytes)
//
// 2 xrefs:
// > cocos2d::CCAnimate::create @ 0x100220494
// > cocos2d::CCAnimate::copyWithZone @ 0x10022076c
//
// 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:01:08 +0000
//
__int64 __fastcall cocos2d::CCAnimate::initWithAnimation(__int64 a1, __int64 a2)
{
float v4; // s8
float v5; // s0
__int64 v6; // x21
unsigned int v7; // w0
__int64 v8; // x8
unsigned int *v9; // x9
__int64 v10; // x8
float v11; // s0
__int64 *v12; // x20
unsigned __int64 v13; // x21
float v14; // s9
float v15; // s10
__int64 v16; // x8
float v18; // [xsp+Ch] [xbp-44h] BYREF
v4 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a2 + 80LL))(a2);
v5 = v4 * (float)*(unsigned int *)(a2 + 84);
if ( v5 == 0.0 )
v5 = 0.00000011921;
*(float *)(a1 + 80) = v5;
*(_DWORD *)(a1 + 84) = 0;
*(_BYTE *)(a1 + 88) = 1;
*(_DWORD *)(a1 + 112) = 0;
sub_1002205D4(a1, a2);
*(_QWORD *)(a1 + 120) = 0;
*(_DWORD *)(a1 + 128) = 0;
v6 = *(_QWORD *)(a1 + 104);
v7 = sub_1002E757C(*(_QWORD *)(a2 + 72));
sub_100015DB8(v6, v7);
v8 = *(_QWORD *)(a2 + 72);
if ( v8 )
{
v9 = *(unsigned int **)(v8 + 56);
v10 = *v9;
if ( (_DWORD)v10 )
{
v11 = *(float *)(a2 + 56);
v12 = *((__int64 **)v9 + 2);
v13 = (unsigned __int64)&v12[v10 - 1];
v14 = 0.0;
v15 = v4 / v11;
do
{
v16 = *v12;
if ( !*v12 )
break;
v18 = (float)(v15 * v14) / v4;
v14 = v14 + *(float *)(v16 + 64);
sub_10022061C(*(_QWORD *)(a1 + 104), &v18);
++v12;
}
while ( (unsigned __int64)v12 <= v13 );
}
}
return 1;
}