//
// GameManager::loadIconAsync from 0x729940 to 0x729b28 (488 bytes)
//
// 2 xrefs:
// > SimplePlayer::asyncLoadIcon @ 0x8bcf4c
// > ??> @ 0x79630
//
// 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:33 +0000
//
__int64 __fastcall GameManager::loadIconAsync(__int64 **this, signed int a2, int a3, int a4, cocos2d::CCObject *a5)
{
__int64 v10; // x0
char v11; // w1
cocos2d::CCTextureCache *v12; // x0
int v13; // w0
char *v14; // x1
int v15; // [xsp+54h] [xbp+54h] BYREF
int *v16; // [xsp+58h] [xbp+58h] BYREF
int *v17; // [xsp+60h] [xbp+60h] BYREF
__int64 v18; // [xsp+68h] [xbp+68h] BYREF
size_t v19; // [xsp+70h] [xbp+70h]
void *v20; // [xsp+78h] [xbp+78h]
__int64 v21; // [xsp+80h] [xbp+80h] BYREF
size_t v22; // [xsp+88h] [xbp+88h]
void *v23; // [xsp+90h] [xbp+90h]
GameManager::sheetNameForIcon(a2, a3, &v18);
if ( (v18 & 1) != 0 )
{
if ( !v19 )
{
operator delete(v20);
return _stack_chk_guard;
}
}
else if ( !((int)(unsigned __int8)v18 >> 1) )
{
return _stack_chk_guard;
}
v15 = GameManager::keyForIcon((GameManager *)this, a2, a3);
GameManager::addIconDelegate(this, a5, v15);
v16 = &v15;
if ( !*(_BYTE *)(std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
this + 151,
&v15,
(__int64)&unk_1122210,
&v16)
+ 32) )
{
v17 = &v15;
v10 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
this + 151,
&v15,
(__int64)&unk_1122210,
&v17);
v11 = v18;
v21 = 0;
*(_BYTE *)(v10 + 32) = 1;
v22 = 0;
v23 = nullptr;
if ( (v11 & 1) != 0 )
{
std::string::__init(&v21, v20, v19);
}
else
{
v23 = v20;
v21 = v18;
v22 = v19;
}
v12 = (cocos2d::CCTextureCache *)std::string::append((__int64)&v21, ".png", 4u);
v13 = cocos2d::CCTextureCache::sharedTextureCache(v12);
v14 = (char *)&v21 + 1;
if ( (v21 & 1) != 0 )
v14 = (char *)v23;
cocos2d::CCTextureCache::addImageAsync(v13, v14);
if ( (v21 & 1) != 0 )
operator delete(v23);
}
if ( (v18 & 1) != 0 )
operator delete(v20);
return _stack_chk_guard;
}