//
// GameManager::unloadIcons from 0x32955c to 0x3295e6 (138 bytes)
//
// 4 xrefs:
// > PlayerObject::~PlayerObject @ 0x347e18
// > SimplePlayer::~SimplePlayer @ 0x402208
// > GJItemIcon::~GJItemIcon @ 0x402268
// > GJRobotSprite::~GJRobotSprite @ 0x4b7c8c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GameManager::unloadIcons(GameManager *a1, int a2)
{
std::_rb_tree_base *p_m_header; // r6
std::_rb_tree_base *v4; // r2
std::_rb_tree_base *i; // r3
std::_rb_tree_base *m_left; // r0
std::map> *p_m_iconRequests; // r0
_DWORD *v8; // r0
int v9; // r2
int v10; // r1
int v11; // [sp+4h] [bp-Ch] BYREF
int j; // [sp+8h] [bp-8h] BYREF
p_m_header = &a1->m_iconRequests.m_header;
v11 = a2;
v4 = &a1->m_iconRequests.m_header;
for ( i = a1->m_iconRequests.m_header.m_parent; i; i = m_left )
{
if ( *(_DWORD *)&i[1].m_isblack >= a2 )
{
m_left = i->m_left;
}
else
{
m_left = i->m_right;
i = v4;
}
v4 = i;
}
if ( v4 != p_m_header && a2 >= *(_DWORD *)&v4[1].m_isblack )
{
for ( j = 0; ; ++j )
{
p_m_iconRequests = &a1->m_iconRequests;
if ( j > 8 )
break;
v8 = (_DWORD *)std::map>::operator[](p_m_iconRequests, &v11);
v10 = *(_DWORD *)std::map::operator[](v8, &j, v9);
if ( v10 > 0 )
GameManager::unloadIcon(a1, v10, j, v11);
}
std::_Rb_tree>,std::_Select1st>>,std::less,std::allocator>>>::erase(
p_m_iconRequests,
&v11);
}
}