//
// GameManager::logLoadedIconInfo from 0x5f1b68 to 0x5f1c8c (292 bytes)
//
// 1 xrefs:
// > ??> @ 0x7ea08
//
// 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::logLoadedIconInfo(GameManager *a1)
{
std::_rb_tree_base *p_m_header; // x21
std::map *p_m_iconLoadCounts; // x22
int v4; // w19
int v5; // w24
std::_rb_tree_base *m_parent; // x0
std::_rb_tree_base *v7; // x2
std::_rb_tree_base *v8; // x1
int *v9; // x20
__int64 insert_hint_unique_pos; // x0
__int64 v11; // x1
_BOOL8 v12; // x0
__int64 v13; // [xsp+48h] [xbp+48h]
p_m_header = &a1->m_iconLoadCounts.m_header;
p_m_iconLoadCounts = &a1->m_iconLoadCounts;
v4 = 0;
v5 = GameManager::keyForIcon(a1, 8, 8);
if ( v5 > 0 )
{
while ( 1 )
{
m_parent = a1->m_iconLoadCounts.m_header.m_parent;
if ( !m_parent )
break;
v7 = p_m_header;
do
{
while ( *(_DWORD *)&m_parent[1].m_isblack >= v4 )
{
v7 = m_parent;
m_parent = m_parent->m_left;
if ( !m_parent )
goto LABEL_6;
}
m_parent = m_parent->m_right;
}
while ( m_parent );
LABEL_6:
v8 = v7;
if ( v7 == p_m_header )
break;
if ( *(_DWORD *)&v7[1].m_isblack > v4 )
goto LABEL_8;
LABEL_13:
if ( ++v4 == v5 )
return;
}
v8 = p_m_header;
LABEL_8:
v13 = (__int64)v8;
v9 = (int *)operator new(0x28u);
v9[8] = v4;
v9[9] = 0;
insert_hint_unique_pos = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_get_insert_hint_unique_pos(
p_m_iconLoadCounts,
v13,
v9 + 8);
if ( v11 )
{
v12 = insert_hint_unique_pos || p_m_header == (std::_rb_tree_base *)v11 || v9[8] < *(_DWORD *)(v11 + 32);
sub_CFAD74(v12, v9, v11, p_m_header);
++p_m_iconLoadCounts->m_nodecount;
}
else
{
operator delete(v9);
}
goto LABEL_13;
}
}