//
// PlayerObject::updatePlayerJetpackFrame from 0x75703c to 0x757254 (536 bytes)
//
// 2 xrefs:
// > PlayerObject::toggleFlyMode @ 0x759b5c
// > ??> @ 0x6b860
//
// 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::updatePlayerJetpackFrame(PlayerObject *this, int a2)
{
unsigned int v3; // w19
__int64 **v4; // x0
cocos2d::CCString *v5; // x0
const char *CString; // x28
cocos2d::CCString *v7; // x0
const char *v8; // x27
cocos2d::CCString *v9; // x0
__int64 v10; // x0
cocos2d::CCSpriteFrameCache **v11; // x24
const char *v12; // x26
void (__fastcall *v13)(cocos2d::CCSpriteFrameCache **, __int64); // x25
cocos2d::CCSpriteFrameCache *v14; // x0
__int64 v15; // x0
cocos2d::CCSpriteFrameCache **v16; // x24
void (__fastcall *v17)(cocos2d::CCSpriteFrameCache **, __int64); // x25
cocos2d::CCSpriteFrameCache *v18; // x0
__int64 v19; // x0
cocos2d::CCSpriteFrameCache **v20; // x24
void (__fastcall *v21)(cocos2d::CCSpriteFrameCache **, __int64); // x25
cocos2d::CCSpriteFrameCache *v22; // x0
__int64 v23; // x0
const cocos2d::CCSize *v24; // x0
__int64 v25; // x24
void (__fastcall *v26)(__int64, _BYTE *); // x21
cocos2d::CCString *v27; // x0
const char *v28; // x0
size_t v29; // x0
char *v31; // [xsp+68h] [xbp+68h]
float v32[2]; // [xsp+70h] [xbp+70h] BYREF
_BYTE v33[8]; // [xsp+78h] [xbp+78h] BYREF
__int64 v34[2]; // [xsp+80h] [xbp+80h] BYREF
void *v35; // [xsp+90h] [xbp+90h]
if ( a2 <= 0 )
{
v3 = 1;
}
else if ( a2 > 8 )
{
v3 = 8;
}
else
{
v3 = a2;
}
v4 = (__int64 **)GameManager::sharedState(_stack_chk_guard);
GameManager::loadIcon(v4, v3, 8, *((_DWORD *)this + 743));
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"jetpack_%02d_001.png",
(const char *)v3);
CString = (const char *)cocos2d::CCString::getCString(v5);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"jetpack_%02d_2_001.png",
(const char *)v3);
v8 = (const char *)cocos2d::CCString::getCString(v7);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"jetpack_%02d_glow_001.png",
(const char *)v3);
v10 = cocos2d::CCString::getCString(v9);
v11 = *((cocos2d::CCSpriteFrameCache ***)this + 229);
v12 = (const char *)v10;
v13 = *((void (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v11 + 145);
v14 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v11);
v15 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v14, CString);
v13(v11, v15);
v16 = *((cocos2d::CCSpriteFrameCache ***)this + 230);
v17 = *((void (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v16 + 145);
v18 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v16);
v19 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v18, v8);
v17(v16, v19);
v20 = *((cocos2d::CCSpriteFrameCache ***)this + 233);
v21 = *((void (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v20 + 145);
v22 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v20);
v23 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v22, v12);
v21(v20, v23);
v24 = (const cocos2d::CCSize *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 229) + 328LL))(*((_QWORD *)this + 229));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v32, v24);
v25 = *((_QWORD *)this + 230);
v26 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v25 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, v32[0] * 0.5, v32[1] * 0.5);
v26(v25, v33);
v27 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"jetpack_%02d_extra_001.png",
(const char *)v3);
v28 = (const char *)cocos2d::CCString::getCString(v27);
v34[0] = 0;
v31 = (char *)v28;
v34[1] = 0;
v35 = nullptr;
v29 = strlen(v28);
std::string::__init(v34, v31, v29);
PlayerObject::updateShipSpriteExtra((__int64)this, (__int64)v34);
if ( (v34[0] & 1) != 0 )
operator delete(v35);
return _stack_chk_guard;
}