//
// GameManager::calculateBaseKeyForIcons from 0x324f2c to 0x324fe6 (186 bytes)
//
// 1 xrefs:
// > GameManager::init @ 0x325032
//
// 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::calculateBaseKeyForIcons(GameManager *a1)
{
int *m_start; // r3
unsigned int v3; // r1
int *v4; // r1
int v5; // r3
int v6; // r4
int v7; // r2
std::map *p_m_iconLoadCounts; // r5
GameManager *i; // [sp+0h] [bp-8h] BYREF
i = a1;
m_start = a1->m_keyStartForIcon.m_start;
v3 = a1->m_keyStartForIcon.m_finish - m_start;
if ( v3 > 8 )
{
if ( v3 != 9 )
a1->m_keyStartForIcon.m_finish = m_start + 9;
}
else
{
std::vector::_M_default_append((int)&a1->m_keyStartForIcon, 9 - v3);
}
v4 = a1->m_keyStartForIcon.m_start;
v5 = 0;
v6 = 0;
do
{
v7 = v5 - 1;
v4[v5] = v6;
switch ( v5 )
{
case 1:
v6 += 169;
break;
case 2:
v6 += 118;
break;
case 3:
v6 += 149;
break;
case 4:
v6 += 96;
break;
case 5:
v6 += 68;
break;
case 6:
v6 += 69;
break;
case 7:
v6 += 43;
break;
case 8:
v6 += 8;
break;
default:
v6 += 485;
break;
}
++v5;
}
while ( v5 != 9 );
p_m_iconLoadCounts = &a1->m_iconLoadCounts;
for ( i = nullptr; (int)i < v6; i = (GameManager *)((char *)i + 1) )
*(_DWORD *)std::map::operator[](p_m_iconLoadCounts, &i, v7) = 0;
}