//
// GameManager::unloadIcons from 0x729324 to 0x729460 (316 bytes)
//
// 5 xrefs:
// > PlayerObject::~PlayerObject @ 0x75d7dc
// > SimplePlayer::~SimplePlayer @ 0x8b94fc
// > GJItemIcon::~GJItemIcon @ 0x8b9580
// > GJRobotSprite::~GJRobotSprite @ 0xa3c378
// > ??> @ 0x6dbd0
//
// 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
//
__int64 __fastcall GameManager::unloadIcons(GameManager *this, int a2)
{
char *v2; // x4
__int64 **v4; // x23
char *v5; // x0
char *v6; // x3
__int64 v7; // x0
int v8; // w1
int v10[3]; // [xsp+5Ch] [xbp+5Ch] BYREF
int i; // [xsp+6Ch] [xbp+6Ch] BYREF
int *p_i; // [xsp+70h] [xbp+70h] BYREF
v2 = (char *)this + 1192;
v4 = (__int64 **)((char *)this + 1184);
v10[0] = a2;
v5 = *((char **)this + 149);
if ( v5 )
{
v6 = v2;
do
{
while ( *((_DWORD *)v5 + 8) >= a2 )
{
v6 = v5;
v5 = *(char **)v5;
if ( !v5 )
goto LABEL_5;
}
v5 = *((char **)v5 + 1);
}
while ( v5 );
LABEL_5:
if ( v2 != v6 && *((_DWORD *)v6 + 8) <= a2 )
{
for ( i = 0; i <= 8; ++i )
{
p_i = v10;
v7 = std::__tree>,std::__map_value_compare>,std::less,true>,std::allocator>>>::__emplace_unique_key_args,std::tuple<>>(
v4,
v10,
(__int64)&unk_1122210,
&p_i);
p_i = &i;
v8 = *(_DWORD *)(std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
(__int64 **)(v7 + 40),
&i,
(__int64)&unk_1122210,
&p_i)
+ 32);
if ( v8 > 0 )
GameManager::unloadIcon((__int64 **)this, v8, i, v10[0]);
}
std::__tree>,std::__map_value_compare>,std::less,true>,std::allocator>>>::__erase_unique(
v4,
v10);
}
}
return _stack_chk_guard;
}