//
// GameStatsManager::trySelectActivePath from 0x10006bbd0 to 0x10006c03a (1130 bytes)
//
// 4 xrefs:
// > GameStatsManager::incrementStat @ 0x10006717a
// > GameStatsManager::incrementActivePath @ 0x10006b910
// > GJPathsLayer::init @ 0x1002fe3dd
// > GJPathPage::init @ 0x100300591
//
// 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 __fastcall GameStatsManager::trySelectActivePath(GameStatsManager *a1)
{
GameStatsManager *v1; // rbx
int m_activePath; // r14d
const char *v3; // rsi
int Stat; // r14d
const char *v5; // r14
const char *v6; // rsi
int v7; // r15d
int v8; // eax
const char *v9; // rsi
int v10; // r15d
const char *v11; // rsi
int v12; // r15d
const char *v13; // rsi
int v14; // r15d
const char *v15; // rsi
int v16; // r15d
const char *v17; // rsi
int v18; // r15d
const char *v19; // rsi
int v20; // r15d
const char *v21; // rsi
int v22; // r15d
const char *v23; // rsi
int v24; // r15d
int v25; // r14d
char v26; // [rsp+0h] [rbp-30h] BYREF
_BYTE v27[15]; // [rsp+1h] [rbp-2Fh] BYREF
void *__p; // [rsp+10h] [rbp-20h]
v1 = a1;
m_activePath = 0;
if ( (unsigned int)(a1->m_activePath - 40) >= 0xFFFFFFF6 )
m_activePath = a1->m_activePath;
a1->m_activePath = m_activePath;
if ( m_activePath )
{
GameStatsManager::sharedState();
if ( !GameStatsManager::isItemUnlocked(a1, GJItem, m_activePath - 24) )
goto LABEL_11;
GameToolbox::intToString(&v26, (unsigned int)a1->m_activePath);
if ( (v26 & 1) != 0 )
v3 = (const char *)__p;
else
v3 = v27;
Stat = GameStatsManager::getStat(a1, v3);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
if ( Stat <= 999 )
{
if ( v1->m_activePath )
return;
}
else
{
LABEL_11:
v1->m_activePath = 0;
}
}
v5 = v27;
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 6) )
{
GameToolbox::intToString(&v26, 30);
v6 = v27;
if ( (v26 & 1) != 0 )
v6 = (const char *)__p;
a1 = v1;
v7 = GameStatsManager::getStat(v1, v6);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 30;
if ( v7 <= 999 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 7) )
{
GameToolbox::intToString(&v26, 31);
v9 = v27;
if ( (v26 & 1) != 0 )
v9 = (const char *)__p;
a1 = v1;
v10 = GameStatsManager::getStat(v1, v9);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 31;
if ( v10 < 1000 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 8) )
{
GameToolbox::intToString(&v26, 32);
v11 = v27;
if ( (v26 & 1) != 0 )
v11 = (const char *)__p;
a1 = v1;
v12 = GameStatsManager::getStat(v1, v11);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 32;
if ( v12 < 1000 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 9) )
{
GameToolbox::intToString(&v26, 33);
v13 = v27;
if ( (v26 & 1) != 0 )
v13 = (const char *)__p;
a1 = v1;
v14 = GameStatsManager::getStat(v1, v13);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 33;
if ( v14 < 1000 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 10) )
{
GameToolbox::intToString(&v26, 34);
v15 = v27;
if ( (v26 & 1) != 0 )
v15 = (const char *)__p;
a1 = v1;
v16 = GameStatsManager::getStat(v1, v15);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 34;
if ( v16 < 1000 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 11) )
{
GameToolbox::intToString(&v26, 35);
v17 = v27;
if ( (v26 & 1) != 0 )
v17 = (const char *)__p;
a1 = v1;
v18 = GameStatsManager::getStat(v1, v17);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 35;
if ( v18 < 1000 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 12) )
{
GameToolbox::intToString(&v26, 36);
v19 = v27;
if ( (v26 & 1) != 0 )
v19 = (const char *)__p;
a1 = v1;
v20 = GameStatsManager::getStat(v1, v19);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 36;
if ( v20 < 1000 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 13) )
{
GameToolbox::intToString(&v26, 37);
v21 = v27;
if ( (v26 & 1) != 0 )
v21 = (const char *)__p;
a1 = v1;
v22 = GameStatsManager::getStat(v1, v21);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 37;
if ( v22 < 1000 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 14) )
{
GameToolbox::intToString(&v26, 38);
v23 = v27;
if ( (v26 & 1) != 0 )
v23 = (const char *)__p;
a1 = v1;
v24 = GameStatsManager::getStat(v1, v23);
if ( (v26 & 1) != 0 )
{
a1 = (GameStatsManager *)__p;
operator delete(__p);
}
v8 = 38;
if ( v24 < 1000 )
goto LABEL_72;
}
GameStatsManager::sharedState();
if ( GameStatsManager::isItemUnlocked(a1, GJItem, 15) )
{
GameToolbox::intToString(&v26, 39);
if ( (v26 & 1) != 0 )
v5 = (const char *)__p;
v25 = GameStatsManager::getStat(v1, v5);
if ( (v26 & 1) != 0 )
operator delete(__p);
v8 = 39;
if ( v25 < 1000 )
LABEL_72:
v1->m_activePath = v8;
}
}