//
// PlayerObject::updatePlayerJetpackFrame from 0x1004037b0 to 0x1004039d5 (549 bytes)
//
// 1 xrefs:
// > PlayerObject::toggleFlyMode @ 0x100403358
//
// This function is hookable on this platform (idp: pc, 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:30:03 +0000
//
void __fastcall PlayerObject::updatePlayerJetpackFrame(__int64 a1, int a2, double a3)
{
int v3; // r14d
__int64 v4; // rax
__int64 v5; // rax
const char *CString; // r13
__int64 v7; // rax
const char *v8; // r12
__int64 v9; // rax
__int64 v10; // r15
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // r15
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // r15
__int64 v17; // rax
__int64 v18; // rax
_QWORD *v19; // rax
__int64 v20; // r15
__int64 v21; // rax
const char *v22; // r15
size_t v23; // rax
size_t v24; // r14
char *v25; // r12
size_t v26; // r13
char v27; // [rsp+0h] [rbp-60h]
char v28; // [rsp+0h] [rbp-60h]
char v29; // [rsp+0h] [rbp-60h]
char v30; // [rsp+0h] [rbp-60h]
float v31; // [rsp+8h] [rbp-58h] BYREF
const char *v32; // [rsp+10h] [rbp-50h]
__int64 v33; // [rsp+18h] [rbp-48h] BYREF
_QWORD __dst[2]; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
v3 = a2;
if ( a2 >= 8 )
v3 = 8;
if ( v3 < 2 )
v3 = 1;
v4 = GameManager::sharedState();
GameManager::loadIcon(v4, (unsigned int)v3, 8u, *(_DWORD *)(a1 + 2972), a3);
v5 = sub_10088E820("jetpack_%02d_001.png", v27);
CString = (const char *)cocos2d::CCString::getCString(v5);
v7 = sub_10088E820("jetpack_%02d_2_001.png", v28);
v8 = (const char *)cocos2d::CCString::getCString(v7);
v9 = sub_10088E820("jetpack_%02d_glow_001.png", v29);
v32 = (const char *)cocos2d::CCString::getCString(v9);
v10 = *(_QWORD *)(a1 + 1832);
v11 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v12 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v11, CString);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v10 + 1160LL))(v10, v12);
v13 = *(_QWORD *)(a1 + 1840);
v14 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v15 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v14, v8);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v13 + 1160LL))(v13, v15);
v16 = *(_QWORD *)(a1 + 1864);
v17 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v18 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v17, v32);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v16 + 1160LL))(v16, v18);
v19 = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1832) + 328LL))(*(_QWORD *)(a1 + 1832));
sub_100278630(&v33, v19);
v20 = *(_QWORD *)(a1 + 1840);
sub_100278250(&v31, *(float *)&v33 * 0.5, 0.5 * *((float *)&v33 + 1));
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v20 + 184LL))(v20, &v31);
v21 = sub_10088E820("jetpack_%02d_extra_001.png", v30);
v22 = (const char *)cocos2d::CCString::getCString(v21);
v23 = strlen(v22);
if ( v23 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v24 = v23;
if ( v23 >= 0x17 )
{
v26 = 26;
if ( (v23 | 7) != 0x17 )
v26 = (v23 | 7) + 1;
v25 = (char *)operator new(v26);
__p = v25;
__dst[0] = v26 + 1;
__dst[1] = v24;
goto LABEL_12;
}
LOBYTE(__dst[0]) = 2 * v23;
v25 = (char *)__dst + 1;
if ( v23 )
LABEL_12:
memmove(v25, v22, v24);
v25[v24] = 0;
PlayerObject::updateShipSpriteExtra(a1, (__int64)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
}