//
// AnimatedGameObject::init from 0x4ec00c to 0x4ec156 (330 bytes)
//
// 1 xrefs:
// > AnimatedGameObject::create @ 0x4ec1e0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:51:08 +0000
//
int __fastcall AnimatedGameObject::init(AnimatedGameObject *this, int a2)
{
void *v2; // r3
char *v5; // r0
int v6; // r7
cocos2d::CCSprite *v8; // r0
cocos2d::CCTexture2D *v9; // r0
const cocos2d::CCSize *v10; // r0
int v11; // r8
void (__fastcall *v12)(int, _BYTE *); // r9
float v13[2]; // [sp+4h] [bp-18h] BYREF
_BYTE v14[8]; // [sp+Ch] [bp-10h] BYREF
v2 = &_stack_chk_guard;
*((_DWORD *)this + 271) = 2;
*((_DWORD *)this + 223) = a2;
if ( a2 == 1327 )
{
v5 = "GJBeast02";
}
else if ( a2 >= 1328 )
{
if ( a2 == 1584 )
{
LOBYTE(v2) = 1;
*((_BYTE *)this + 1304) = 1;
v5 = "GJBeast04";
}
else
{
LOBYTE(v2) = -36;
if ( a2 == 2012 )
{
LOBYTE(v2) = 1;
*((_BYTE *)this + 1304) = 1;
v5 = "GJBeast05";
}
else
{
if ( a2 != 1328 )
return 0;
v5 = "GJBeast03";
}
}
}
else
{
if ( a2 != 918 )
{
LOBYTE(v2) = -105;
if ( a2 == 919 )
{
v5 = "BlackSludge";
goto LABEL_16;
}
return 0;
}
LOBYTE(v2) = 1;
*((_BYTE *)this + 1304) = 1;
v5 = "GJBeast01";
}
LABEL_16:
v8 = CCAnimatedSprite::createWithType((CCAnimatedSprite *)v5, nullptr, nullptr, (bool)v2);
*((_DWORD *)this + 319) = v8;
SpriteAnimationManager::stopAnimations(*((SpriteAnimationManager **)v8 + 133));
*(_DWORD *)(*((_DWORD *)this + 319) + 564) = (char *)this + 1268;
v9 = (cocos2d::CCTexture2D *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 319) + 536))(*((_DWORD *)this + 319));
v6 = GameObject::initWithTexture(this, v9);
if ( v6 )
{
AnimatedGameObject::setupAnimatedSize(this, a2);
(*(void (__fastcall **)(AnimatedGameObject *, _DWORD))(*(_DWORD *)this + 228))(this, *((_DWORD *)this + 319));
v10 = (const cocos2d::CCSize *)(*(int (__fastcall **)(AnimatedGameObject *))(*(_DWORD *)this + 164))(this);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v13, v10);
v11 = *((_DWORD *)this + 319);
v12 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v11 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v14, v13[0] * 0.5, v13[1] * 0.5);
v12(v11, v14);
*((_BYTE *)this + 755) = 1;
*((_BYTE *)this + 261) = 0;
AnimatedGameObject::setupChildSprites(this);
}
return v6;
}