//
// GJRobotSprite::updateFrame from 0x1002dc8f0 to 0x1002dcd0c (1052 bytes)
//
// 2 xrefs:
// > GJRobotSprite::init @ 0x1002dc850
// > SimplePlayer::updatePlayerFrame @ 0x1003a03c8
//
// 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:02:45 +0000
//
__int64 __fastcall GJRobotSprite::updateFrame(__int64 a1, int a2)
{
int v3; // w8
bool v4; // cc
__int64 v5; // x20
__int64 v6; // x0
__int64 Icon; // x0
__int64 v8; // x21
__int64 result; // x0
__int64 v10; // x22
__int64 v11; // x27
__int64 v12; // x0
const char *v13; // x8
__int64 v14; // x0
const std::string::value_type *CString; // x0
std::string *v16; // x8
__int64 v17; // x0
char *v18; // x0
std::string *v19; // x8
__int64 v20; // x0
char *v21; // x0
std::string *v22; // x8
__int64 v23; // x0
char *v24; // x0
_QWORD *v25; // x0
__int64 v26; // x0
void **v27; // x1
__int64 v28; // x0
__int64 v29; // x0
__int64 v30; // x28
__int64 v31; // x0
void **v32; // x1
__int64 v33; // x0
float v34; // s9
__int64 v35; // x0
__int64 v36; // x0
__int64 v37; // x28
__int64 v38; // x0
void **v39; // x1
__int64 v40; // x0
std::string *v41; // x8
__int64 v42; // x0
char *v43; // x0
_QWORD *v44; // x0
__int64 v45; // x0
void **v46; // x1
__int64 v47; // x1
__int64 v48; // x0
__int64 v49; // x28
float v50; // s9
__int64 v51; // x0
float v52; // [xsp+18h] [xbp-E8h] BYREF
void *__p[2]; // [xsp+20h] [xbp-E0h] BYREF
char v54; // [xsp+37h] [xbp-C9h]
void *v55[2]; // [xsp+38h] [xbp-C8h] BYREF
char v56; // [xsp+4Fh] [xbp-B1h]
void *v57[2]; // [xsp+50h] [xbp-B0h] BYREF
char v58; // [xsp+67h] [xbp-99h]
void *v59[2]; // [xsp+68h] [xbp-98h] BYREF
char v60; // [xsp+7Fh] [xbp-81h]
std::string v61; // [xsp+80h] [xbp-80h] BYREF
if ( *(_DWORD *)(a1 + 760) == 5 )
v3 = 68;
else
v3 = 69;
if ( v3 < a2 )
{
v4 = 0;
}
else
{
v3 = a2;
v4 = a2 <= 1;
}
if ( v4 )
v5 = 1;
else
v5 = (unsigned int)v3;
v6 = GameManager::sharedState(a1);
Icon = GameManager::loadIcon(v6, v5, *(unsigned int *)(a1 + 760), *(unsigned int *)(a1 + 764));
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1064LL))(a1, Icon);
v8 = *(_QWORD *)(*(_QWORD *)(a1 + 672) + 632LL);
result = sub_1002E757C(v8);
if ( (_DWORD)result )
{
v10 = 0;
do
{
v11 = sub_1002E75A0(v8, v10);
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 64LL))(v11);
memset(&v61, 0, sizeof(v61));
v13 = "spider_%02d_%02d";
if ( *(_DWORD *)(a1 + 760) == 5 )
v13 = "robot_%02d_%02d";
v14 = sub_1003065B0(v13, v5, v12);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v14);
std::string::assign(&v61, CString);
if ( (v61.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v16 = &v61;
else
v16 = (std::string *)v61.__r_.__value_.__r.__words[0];
v17 = sub_1003065B0("%s_001.png", (const char *)v16);
v18 = (char *)cocos2d::CCString::getCString(v17);
sub_100009900(v59, v18);
if ( (v61.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v19 = &v61;
else
v19 = (std::string *)v61.__r_.__value_.__r.__words[0];
v20 = sub_1003065B0("%s_2_001.png", (const char *)v19);
v21 = (char *)cocos2d::CCString::getCString(v20);
sub_100009900(v57, v21);
if ( (v61.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v22 = &v61;
else
v22 = (std::string *)v61.__r_.__value_.__r.__words[0];
v23 = sub_1003065B0("%s_glow_001.png", (const char *)v22);
v24 = (char *)cocos2d::CCString::getCString(v23);
v25 = sub_100009900(v55, v24);
v26 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v25);
if ( v60 >= 0 )
v27 = v59;
else
v27 = (void **)v59[0];
v28 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v26, v27);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 1160LL))(v11, v28);
v29 = sub_1002E75A0(*(_QWORD *)(a1 + 736), v10);
v30 = v29;
if ( v29 )
{
v31 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v29);
if ( v58 >= 0 )
v32 = v57;
else
v32 = (void **)v57[0];
v33 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v31, v32);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v30 + 1160LL))(v30, v33);
v34 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 328LL))(v11);
v35 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 328LL))(v11);
sub_1000262BC((float *)__p, v34 * 0.5, *(float *)(v35 + 4) * 0.5);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v30 + 184LL))(v30, __p);
}
v36 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 744) + 488LL))(*(_QWORD *)(a1 + 744));
v37 = sub_1002E75A0(v36, v10);
v38 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v37);
if ( v56 >= 0 )
v39 = v55;
else
v39 = (void **)v55[0];
v40 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v38, v39);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v37 + 1160LL))(v37, v40);
if ( v11 == *(_QWORD *)(a1 + 768) )
{
if ( (v61.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v41 = &v61;
else
v41 = (std::string *)v61.__r_.__value_.__r.__words[0];
v42 = sub_1003065B0("%s_extra_001.png", (const char *)v41);
v43 = (char *)cocos2d::CCString::getCString(v42);
v44 = sub_100009900(__p, v43);
v45 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v44);
if ( v54 >= 0 )
v46 = __p;
else
v46 = (void **)__p[0];
v47 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v45, v46);
if ( v47 )
{
v48 = *(_QWORD *)(a1 + 752);
if ( v48 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v48 + 1160LL))(v48);
}
else
{
*(_QWORD *)(a1 + 752) = cocos2d::CCSprite::createWithSpriteFrame(v47);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 768) + 464LL))(*(_QWORD *)(a1 + 768));
}
v49 = *(_QWORD *)(a1 + 752);
v50 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 328LL))(v11);
v51 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 328LL))(v11);
sub_1000262BC(&v52, v50 * 0.5, *(float *)(v51 + 4) * 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v49 + 184LL))(v49, &v52);
LOBYTE(v47) = 1;
}
*(_BYTE *)(a1 + 728) = v47;
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 752) + 344LL))(*(_QWORD *)(a1 + 752));
if ( v54 < 0 )
operator delete(__p[0]);
}
if ( v56 < 0 )
operator delete(v55[0]);
if ( v58 < 0 )
operator delete(v57[0]);
if ( v60 < 0 )
operator delete(v59[0]);
if ( SHIBYTE(v61.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v61.__r_.__value_.__l.__data_);
v10 = (unsigned int)(v10 + 1);
result = sub_1002E757C(v8);
}
while ( (unsigned int)v10 < (unsigned int)result );
}
return result;
}