//
// PlayerObject::updatePlayerBirdFrame from 0x757254 to 0x7574d8 (644 bytes)
//
// 3 xrefs:
// > PlayerObject::toggleBirdMode @ 0x759cd8
// > MenuGameLayer::resetPlayer @ 0x7da5a8
// > ??> @ 0x4c678
//
// 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:52:57 +0000
//
__int64 __fastcall PlayerObject::updatePlayerBirdFrame(PlayerObject *this, int a2)
{
unsigned int v3; // w20
__int64 **v4; // x0
cocos2d::CCString *v5; // x0
cocos2d::CCString *v6; // x0
const char *v7; // x28
cocos2d::CCString *v8; // x0
const char *v9; // x27
cocos2d::CCString *v10; // x0
__int64 v11; // x0
cocos2d::CCSpriteFrameCache **v12; // x24
const char *v13; // x26
void (__fastcall *v14)(cocos2d::CCSpriteFrameCache **, __int64); // x25
cocos2d::CCSpriteFrameCache *v15; // x0
__int64 v16; // x0
cocos2d::CCSpriteFrameCache **v17; // x24
void (__fastcall *v18)(cocos2d::CCSpriteFrameCache **, __int64); // x25
cocos2d::CCSpriteFrameCache *v19; // x0
__int64 v20; // x0
cocos2d::CCSpriteFrameCache **v21; // x24
void (__fastcall *v22)(cocos2d::CCSpriteFrameCache **, __int64); // x25
cocos2d::CCSpriteFrameCache *v23; // x0
__int64 v24; // x0
cocos2d::CCSpriteFrameCache **v25; // x24
void (__fastcall *v26)(cocos2d::CCSpriteFrameCache **, __int64); // x25
cocos2d::CCSpriteFrameCache *v27; // x0
__int64 v28; // x0
const cocos2d::CCSize *v29; // x0
__int64 v30; // x24
void (__fastcall *v31)(__int64, _BYTE *); // x22
__int64 v32; // x22
void (__fastcall *v33)(__int64, __int64); // x24
__int64 v34; // x0
cocos2d::CCString *v35; // x0
const char *v36; // x0
size_t v37; // x0
char *CString; // [xsp+68h] [xbp+68h]
char *v40; // [xsp+68h] [xbp+68h]
float v41[2]; // [xsp+70h] [xbp+70h] BYREF
_BYTE v42[8]; // [xsp+78h] [xbp+78h] BYREF
__int64 v43[2]; // [xsp+80h] [xbp+80h] BYREF
void *v44; // [xsp+90h] [xbp+90h]
if ( a2 <= 0 )
{
v3 = 1;
}
else if ( a2 > 149 )
{
v3 = 149;
}
else
{
v3 = a2;
}
v4 = (__int64 **)GameManager::sharedState(_stack_chk_guard);
GameManager::loadIcon(v4, v3, 3, *((_DWORD *)this + 743));
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"bird_%02d_001.png",
(const char *)v3);
CString = (char *)cocos2d::CCString::getCString(v5);
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"bird_%02d_2_001.png",
(const char *)v3);
v7 = (const char *)cocos2d::CCString::getCString(v6);
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"bird_%02d_3_001.png",
(const char *)v3);
v9 = (const char *)cocos2d::CCString::getCString(v8);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"bird_%02d_glow_001.png",
(const char *)v3);
v11 = cocos2d::CCString::getCString(v10);
v12 = *((cocos2d::CCSpriteFrameCache ***)this + 229);
v13 = (const char *)v11;
v14 = *((void (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v12 + 145);
v15 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v12);
v16 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v15, CString);
v14(v12, v16);
v17 = *((cocos2d::CCSpriteFrameCache ***)this + 230);
v18 = *((void (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v17 + 145);
v19 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v17);
v20 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v19, v7);
v18(v17, v20);
v21 = *((cocos2d::CCSpriteFrameCache ***)this + 231);
v22 = *((void (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v21 + 145);
v23 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v21);
v24 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v23, v9);
v22(v21, v24);
v25 = *((cocos2d::CCSpriteFrameCache ***)this + 233);
v26 = *((void (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v25 + 145);
v27 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v25);
v28 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v27, v13);
v26(v25, v28);
v29 = (const cocos2d::CCSize *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 229) + 328LL))(*((_QWORD *)this + 229));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v41, v29);
v30 = *((_QWORD *)this + 230);
v31 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v30 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v42, v41[0] * 0.5, v41[1] * 0.5);
v31(v30, v42);
v32 = *((_QWORD *)this + 231);
v33 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v32 + 184LL);
v34 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 230) + 192LL))(*((_QWORD *)this + 230));
v33(v32, v34);
v35 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"bird_%02d_extra_001.png",
(const char *)v3);
v36 = (const char *)cocos2d::CCString::getCString(v35);
v43[0] = 0;
v40 = (char *)v36;
v43[1] = 0;
v44 = nullptr;
v37 = strlen(v36);
std::string::__init(v43, v40, v37);
PlayerObject::updateShipSpriteExtra((__int64)this, (__int64)v43);
if ( (v43[0] & 1) != 0 )
operator delete(v44);
return _stack_chk_guard;
}