//
// GameManager::loadIcon from 0x729460 to 0x7297a0 (832 bytes)
//
// 15 xrefs:
// > GameManager::finishedLoadingIconAsync @ 0x729828
// > PlayerObject::updatePlayerFrame @ 0x756628
// > PlayerObject::updatePlayerRollFrame @ 0x756840
// > PlayerObject::updatePlayerSwingFrame @ 0x756a50
// > PlayerObject::updatePlayerDartFrame @ 0x756c68
// > PlayerObject::updatePlayerShipFrame @ 0x756e80
// > PlayerObject::updatePlayerJetpackFrame @ 0x757098
// > PlayerObject::updatePlayerBirdFrame @ 0x7572b0
// > PlayerObject::init @ 0x767078
// > PlayerObject::init @ 0x76708c
// > SimplePlayer::updatePlayerFrame @ 0x8bc6c0
// > SimplePlayer::init @ 0x8bd608
// > GJRobotSprite::updateFrame @ 0xa3c974
// > GJRobotSprite::init @ 0xa3cf24
// > ??> @ 0xc16c0
//
// 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:32 +0000
//
cocos2d::CCSpriteFrameCache *__fastcall GameManager::loadIcon(__int64 **this, signed int a2, int a3, int a4)
{
cocos2d::CCTextureCache *v6; // x0
cocos2d::CCTextureCache *v7; // x0
char *v8; // x1
__int64 v9; // x0
int v10; // w26
__int64 v11; // x0
__int64 v12; // x0
cocos2d::CCSpriteFrameCache *v13; // x21
cocos2d::CCTextureCache *v15; // x0
cocos2d::CCTextureCache *v16; // x0
char *v17; // x1
cocos2d::CCSpriteFrameCache *v18; // x0
const char *v19; // x1
cocos2d::CCSpriteFrameCache *v20; // [xsp+60h] [xbp+60h]
int v21; // [xsp+68h] [xbp+68h] BYREF
int v22; // [xsp+6Ch] [xbp+6Ch] BYREF
int v23; // [xsp+9Ch] [xbp+9Ch] BYREF
int *v24; // [xsp+A0h] [xbp+A0h] BYREF
int *v25; // [xsp+A8h] [xbp+A8h] BYREF
int *v26; // [xsp+B0h] [xbp+B0h] BYREF
int *v27; // [xsp+B8h] [xbp+B8h] BYREF
int *v28; // [xsp+C0h] [xbp+C0h] BYREF
int *v29; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v30; // [xsp+D0h] [xbp+D0h] BYREF
size_t v31; // [xsp+D8h] [xbp+D8h]
void *v32; // [xsp+E0h] [xbp+E0h]
__int64 v33; // [xsp+E8h] [xbp+E8h] BYREF
size_t v34; // [xsp+F0h] [xbp+F0h]
char *v35; // [xsp+F8h] [xbp+F8h]
__int64 v36; // [xsp+100h] [xbp+100h] BYREF
size_t v37; // [xsp+108h] [xbp+108h]
void *v38; // [xsp+110h] [xbp+110h]
v21 = a4;
v22 = a3;
GameManager::sheetNameForIcon(a2, a3, &v30);
if ( (v30 & 1) != 0 )
{
if ( !v31 )
{
v13 = nullptr;
LABEL_28:
operator delete(v32);
return v13;
}
}
else if ( !((int)(unsigned __int8)v30 >> 1) )
{
return nullptr;
}
v23 = GameManager::keyForIcon((GameManager *)this, a2, v22);
v33 = 0;
v34 = 0;
v35 = nullptr;
if ( (v30 & 1) != 0 )
{
std::string::__init(&v33, v32, v31);
}
else
{
v35 = (char *)v32;
v33 = v30;
v34 = v31;
}
std::string::append((__int64)&v33, ".png", 4u);
v24 = &v23;
v6 = (cocos2d::CCTextureCache *)*(unsigned int *)(std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
this + 145,
&v23,
(__int64)&unk_1122210,
&v24)
+ 32);
if ( (int)v6 <= 0 )
{
v36 = 0;
v37 = 0;
v38 = nullptr;
if ( (v30 & 1) != 0 )
{
std::string::__init(&v36, v32, v31);
}
else
{
v36 = v30;
v37 = v31;
v38 = v32;
}
v15 = (cocos2d::CCTextureCache *)std::string::append((__int64)&v36, ".plist", 6u);
v16 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v15);
v17 = (char *)&v33 + 1;
if ( (v33 & 1) != 0 )
v17 = v35;
v20 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCTextureCache::addImage(v16, v17, 0);
v18 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v20);
v19 = (char *)&v36 + 1;
if ( (v36 & 1) != 0 )
v19 = (const char *)v38;
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v18, v19);
if ( (v36 & 1) != 0 )
operator delete(v38);
}
else
{
v7 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v6);
v8 = (char *)&v33 + 1;
if ( (v33 & 1) != 0 )
v8 = v35;
v20 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCTextureCache::textureForKey(v7, v8);
}
v25 = &v21;
v9 = std::__tree>,std::__map_value_compare>,std::less,true>,std::allocator>>>::__emplace_unique_key_args,std::tuple<>>(
this + 148,
&v21,
(__int64)&unk_1122210,
&v25);
v26 = &v22;
v10 = *(_DWORD *)(std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
(__int64 **)(v9 + 40),
&v22,
(__int64)&unk_1122210,
&v26)
+ 32);
if ( v10 != a2 )
{
v27 = &v23;
v11 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
this + 145,
&v23,
(__int64)&unk_1122210,
&v27);
++*(_DWORD *)(v11 + 32);
if ( v10 > 0 )
GameManager::unloadIcon(this, v10, v22, v21);
v28 = &v21;
v12 = std::__tree>,std::__map_value_compare>,std::less,true>,std::allocator>>>::__emplace_unique_key_args,std::tuple<>>(
this + 148,
&v21,
(__int64)&unk_1122210,
&v28);
v29 = &v22;
*(_DWORD *)(std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
(__int64 **)(v12 + 40),
&v22,
(__int64)&unk_1122210,
&v29)
+ 32) = a2;
}
if ( (v33 & 1) != 0 )
operator delete(v35);
v13 = v20;
if ( (v30 & 1) != 0 )
goto LABEL_28;
return v13;
}