//
// GameStatsManager::firstSetup from 0x1401f1ab0 to 0x1401f2197 (1767 bytes)
//
// 2 xrefs:
// > GameManager::firstLoad @ 0x140188bf6
// > ??> @ 0x1406cc6cc
//
// 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 GameStatsManager::firstSetup(GameStatsManager *a1)
{
cocos2d::CCDictionary *v2; // rax
cocos2d::CCDictionary *m_playerStats; // rcx
cocos2d::CCDictionary *v4; // rdi
cocos2d::CCDictionary *v5; // rax
cocos2d::CCDictionary *m_completedLevels; // rcx
cocos2d::CCDictionary *v7; // rdi
cocos2d::CCDictionary *v8; // rax
cocos2d::CCDictionary *m_verifiedUserCoins; // rcx
cocos2d::CCDictionary *v10; // rdi
cocos2d::CCDictionary *v11; // rax
cocos2d::CCDictionary *m_pendingUserCoins; // rcx
cocos2d::CCDictionary *v13; // rdi
cocos2d::CCDictionary *v14; // rax
cocos2d::CCDictionary *m_completedMappacks; // rcx
cocos2d::CCDictionary *v16; // rdi
cocos2d::CCDictionary *v17; // rax
cocos2d::CCDictionary *m_purchasedItems; // rcx
cocos2d::CCDictionary *v19; // rdi
cocos2d::CCDictionary *v20; // rax
cocos2d::CCDictionary *m_onlineCurrencyScores; // rcx
cocos2d::CCDictionary *v22; // rdi
cocos2d::CCDictionary *v23; // rax
cocos2d::CCDictionary *m_gauntletCurrencyScores; // rcx
cocos2d::CCDictionary *v25; // rdi
cocos2d::CCDictionary *v26; // rax
cocos2d::CCDictionary *m_unusedCurrencyAwardDict; // rcx
cocos2d::CCDictionary *v28; // rdi
cocos2d::CCDictionary *v29; // rax
cocos2d::CCDictionary *m_onlineStars; // rcx
cocos2d::CCDictionary *v31; // rdi
cocos2d::CCDictionary *v32; // rax
cocos2d::CCDictionary *m_mainCurrencyScores; // rcx
cocos2d::CCDictionary *v34; // rdi
cocos2d::CCDictionary *v35; // rax
cocos2d::CCDictionary *m_timelyCurrencyScores; // rcx
cocos2d::CCDictionary *v37; // rdi
cocos2d::CCDictionary *v38; // rax
cocos2d::CCDictionary *m_timelyStars; // rcx
cocos2d::CCDictionary *v40; // rdi
cocos2d::CCDictionary *v41; // rax
cocos2d::CCDictionary *m_gauntletDiamondScores; // rcx
cocos2d::CCDictionary *v43; // rdi
cocos2d::CCDictionary *v44; // rax
cocos2d::CCDictionary *m_timelyDiamondScores; // rcx
cocos2d::CCDictionary *v46; // rdi
cocos2d::CCDictionary *v47; // rax
cocos2d::CCDictionary *m_dailyChests; // rcx
cocos2d::CCDictionary *v49; // rdi
cocos2d::CCDictionary *v50; // rax
cocos2d::CCDictionary *m_rewardItems; // rcx
cocos2d::CCDictionary *v52; // rdi
cocos2d::CCDictionary *v53; // rax
cocos2d::CCDictionary *m_worldAdvertChests; // rcx
cocos2d::CCDictionary *v55; // rdi
cocos2d::CCDictionary *v56; // rax
cocos2d::CCDictionary *m_activeChallenges; // rcx
cocos2d::CCDictionary *v58; // rdi
cocos2d::CCDictionary *v59; // rax
cocos2d::CCDictionary *m_upcomingChallenges; // rcx
cocos2d::CCDictionary *v61; // rdi
cocos2d::CCDictionary *v62; // rax
cocos2d::CCDictionary *m_challengeDiamonds; // rcx
cocos2d::CCDictionary *v64; // rdi
cocos2d::CCDictionary *v65; // rax
cocos2d::CCDictionary *m_completedLists; // rcx
cocos2d::CCDictionary *v67; // rdi
cocos2d::CCDictionary *v68; // rax
cocos2d::CCDictionary *m_treasureRoomChests; // rcx
cocos2d::CCDictionary *v70; // rdi
cocos2d::CCDictionary *v71; // rax
cocos2d::CCDictionary *m_miscChests; // rcx
cocos2d::CCDictionary *v73; // rdi
cocos2d::CCDictionary *v74; // rax
cocos2d::CCDictionary *m_enabledItems; // rcx
cocos2d::CCDictionary *v76; // rdi
cocos2d::CCDictionary *v77; // rax
cocos2d::CCDictionary *m_wraithChests; // rcx
cocos2d::CCDictionary *v79; // rdi
cocos2d::CCDictionary *v80; // rax
cocos2d::CCDictionary *m_weeklyChest; // rcx
cocos2d::CCDictionary *v82; // rdi
cocos2d::CCDictionary *v83; // rax
cocos2d::CCDictionary *m_eventChest; // rcx
cocos2d::CCDictionary *v85; // rdi
cocos2d::CCDictionary *v86; // rax
cocos2d::CCDictionary *v87; // rdi
cocos2d::CCDictionary *m_unlockedGauntlets; // rcx
int v89; // eax
v2 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(a1);
v4 = v2;
if ( a1->m_playerStats != v2 )
{
if ( v2 )
cocos2d::CCObject::retain(v2);
m_playerStats = a1->m_playerStats;
if ( m_playerStats )
cocos2d::CCObject::release(m_playerStats);
a1->m_playerStats = v4;
}
v5 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_playerStats);
v7 = v5;
if ( a1->m_completedLevels != v5 )
{
if ( v5 )
cocos2d::CCObject::retain(v5);
m_completedLevels = a1->m_completedLevels;
if ( m_completedLevels )
cocos2d::CCObject::release(m_completedLevels);
a1->m_completedLevels = v7;
}
v8 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_completedLevels);
v10 = v8;
if ( a1->m_verifiedUserCoins != v8 )
{
if ( v8 )
cocos2d::CCObject::retain(v8);
m_verifiedUserCoins = a1->m_verifiedUserCoins;
if ( m_verifiedUserCoins )
cocos2d::CCObject::release(m_verifiedUserCoins);
a1->m_verifiedUserCoins = v10;
}
v11 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_verifiedUserCoins);
v13 = v11;
if ( a1->m_pendingUserCoins != v11 )
{
if ( v11 )
cocos2d::CCObject::retain(v11);
m_pendingUserCoins = a1->m_pendingUserCoins;
if ( m_pendingUserCoins )
cocos2d::CCObject::release(m_pendingUserCoins);
a1->m_pendingUserCoins = v13;
}
v14 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_pendingUserCoins);
v16 = v14;
if ( a1->m_completedMappacks != v14 )
{
if ( v14 )
cocos2d::CCObject::retain(v14);
m_completedMappacks = a1->m_completedMappacks;
if ( m_completedMappacks )
cocos2d::CCObject::release(m_completedMappacks);
a1->m_completedMappacks = v16;
}
v17 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_completedMappacks);
v19 = v17;
if ( a1->m_purchasedItems != v17 )
{
if ( v17 )
cocos2d::CCObject::retain(v17);
m_purchasedItems = a1->m_purchasedItems;
if ( m_purchasedItems )
cocos2d::CCObject::release(m_purchasedItems);
a1->m_purchasedItems = v19;
}
v20 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_purchasedItems);
v22 = v20;
if ( a1->m_onlineCurrencyScores != v20 )
{
if ( v20 )
cocos2d::CCObject::retain(v20);
m_onlineCurrencyScores = a1->m_onlineCurrencyScores;
if ( m_onlineCurrencyScores )
cocos2d::CCObject::release(m_onlineCurrencyScores);
a1->m_onlineCurrencyScores = v22;
}
v23 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_onlineCurrencyScores);
v25 = v23;
if ( a1->m_gauntletCurrencyScores != v23 )
{
if ( v23 )
cocos2d::CCObject::retain(v23);
m_gauntletCurrencyScores = a1->m_gauntletCurrencyScores;
if ( m_gauntletCurrencyScores )
cocos2d::CCObject::release(m_gauntletCurrencyScores);
a1->m_gauntletCurrencyScores = v25;
}
v26 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_gauntletCurrencyScores);
v28 = v26;
if ( a1->m_unusedCurrencyAwardDict != v26 )
{
if ( v26 )
cocos2d::CCObject::retain(v26);
m_unusedCurrencyAwardDict = a1->m_unusedCurrencyAwardDict;
if ( m_unusedCurrencyAwardDict )
cocos2d::CCObject::release(m_unusedCurrencyAwardDict);
a1->m_unusedCurrencyAwardDict = v28;
}
v29 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_unusedCurrencyAwardDict);
v31 = v29;
if ( a1->m_onlineStars != v29 )
{
if ( v29 )
cocos2d::CCObject::retain(v29);
m_onlineStars = a1->m_onlineStars;
if ( m_onlineStars )
cocos2d::CCObject::release(m_onlineStars);
a1->m_onlineStars = v31;
}
v32 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_onlineStars);
v34 = v32;
if ( a1->m_mainCurrencyScores != v32 )
{
if ( v32 )
cocos2d::CCObject::retain(v32);
m_mainCurrencyScores = a1->m_mainCurrencyScores;
if ( m_mainCurrencyScores )
cocos2d::CCObject::release(m_mainCurrencyScores);
a1->m_mainCurrencyScores = v34;
}
v35 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_mainCurrencyScores);
v37 = v35;
if ( a1->m_timelyCurrencyScores != v35 )
{
if ( v35 )
cocos2d::CCObject::retain(v35);
m_timelyCurrencyScores = a1->m_timelyCurrencyScores;
if ( m_timelyCurrencyScores )
cocos2d::CCObject::release(m_timelyCurrencyScores);
a1->m_timelyCurrencyScores = v37;
}
v38 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_timelyCurrencyScores);
v40 = v38;
if ( a1->m_timelyStars != v38 )
{
if ( v38 )
cocos2d::CCObject::retain(v38);
m_timelyStars = a1->m_timelyStars;
if ( m_timelyStars )
cocos2d::CCObject::release(m_timelyStars);
a1->m_timelyStars = v40;
}
v41 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_timelyStars);
v43 = v41;
if ( a1->m_gauntletDiamondScores != v41 )
{
if ( v41 )
cocos2d::CCObject::retain(v41);
m_gauntletDiamondScores = a1->m_gauntletDiamondScores;
if ( m_gauntletDiamondScores )
cocos2d::CCObject::release(m_gauntletDiamondScores);
a1->m_gauntletDiamondScores = v43;
}
v44 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_gauntletDiamondScores);
v46 = v44;
if ( a1->m_timelyDiamondScores != v44 )
{
if ( v44 )
cocos2d::CCObject::retain(v44);
m_timelyDiamondScores = a1->m_timelyDiamondScores;
if ( m_timelyDiamondScores )
cocos2d::CCObject::release(m_timelyDiamondScores);
a1->m_timelyDiamondScores = v46;
}
v47 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_timelyDiamondScores);
v49 = v47;
if ( a1->m_dailyChests != v47 )
{
if ( v47 )
cocos2d::CCObject::retain(v47);
m_dailyChests = a1->m_dailyChests;
if ( m_dailyChests )
cocos2d::CCObject::release(m_dailyChests);
a1->m_dailyChests = v49;
}
v50 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_dailyChests);
v52 = v50;
if ( a1->m_rewardItems != v50 )
{
if ( v50 )
cocos2d::CCObject::retain(v50);
m_rewardItems = a1->m_rewardItems;
if ( m_rewardItems )
cocos2d::CCObject::release(m_rewardItems);
a1->m_rewardItems = v52;
}
v53 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_rewardItems);
v55 = v53;
if ( a1->m_worldAdvertChests != v53 )
{
if ( v53 )
cocos2d::CCObject::retain(v53);
m_worldAdvertChests = a1->m_worldAdvertChests;
if ( m_worldAdvertChests )
cocos2d::CCObject::release(m_worldAdvertChests);
a1->m_worldAdvertChests = v55;
}
v56 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_worldAdvertChests);
v58 = v56;
if ( a1->m_activeChallenges != v56 )
{
if ( v56 )
cocos2d::CCObject::retain(v56);
m_activeChallenges = a1->m_activeChallenges;
if ( m_activeChallenges )
cocos2d::CCObject::release(m_activeChallenges);
a1->m_activeChallenges = v58;
}
v59 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_activeChallenges);
v61 = v59;
if ( a1->m_upcomingChallenges != v59 )
{
if ( v59 )
cocos2d::CCObject::retain(v59);
m_upcomingChallenges = a1->m_upcomingChallenges;
if ( m_upcomingChallenges )
cocos2d::CCObject::release(m_upcomingChallenges);
a1->m_upcomingChallenges = v61;
}
v62 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_upcomingChallenges);
v64 = v62;
if ( a1->m_challengeDiamonds != v62 )
{
if ( v62 )
cocos2d::CCObject::retain(v62);
m_challengeDiamonds = a1->m_challengeDiamonds;
if ( m_challengeDiamonds )
cocos2d::CCObject::release(m_challengeDiamonds);
a1->m_challengeDiamonds = v64;
}
v65 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_challengeDiamonds);
v67 = v65;
if ( a1->m_completedLists != v65 )
{
if ( v65 )
cocos2d::CCObject::retain(v65);
m_completedLists = a1->m_completedLists;
if ( m_completedLists )
cocos2d::CCObject::release(m_completedLists);
a1->m_completedLists = v67;
}
v68 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_completedLists);
v70 = v68;
if ( a1->m_treasureRoomChests != v68 )
{
if ( v68 )
cocos2d::CCObject::retain(v68);
m_treasureRoomChests = a1->m_treasureRoomChests;
if ( m_treasureRoomChests )
cocos2d::CCObject::release(m_treasureRoomChests);
a1->m_treasureRoomChests = v70;
}
v71 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_treasureRoomChests);
v73 = v71;
if ( a1->m_miscChests != v71 )
{
if ( v71 )
cocos2d::CCObject::retain(v71);
m_miscChests = a1->m_miscChests;
if ( m_miscChests )
cocos2d::CCObject::release(m_miscChests);
a1->m_miscChests = v73;
}
v74 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_miscChests);
v76 = v74;
if ( a1->m_enabledItems != v74 )
{
if ( v74 )
cocos2d::CCObject::retain(v74);
m_enabledItems = a1->m_enabledItems;
if ( m_enabledItems )
cocos2d::CCObject::release(m_enabledItems);
a1->m_enabledItems = v76;
}
v77 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_enabledItems);
v79 = v77;
if ( a1->m_wraithChests != v77 )
{
if ( v77 )
cocos2d::CCObject::retain(v77);
m_wraithChests = a1->m_wraithChests;
if ( m_wraithChests )
cocos2d::CCObject::release(m_wraithChests);
a1->m_wraithChests = v79;
}
v80 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_wraithChests);
v82 = v80;
if ( a1->m_weeklyChest != v80 )
{
if ( v80 )
cocos2d::CCObject::retain(v80);
m_weeklyChest = a1->m_weeklyChest;
if ( m_weeklyChest )
cocos2d::CCObject::release(m_weeklyChest);
a1->m_weeklyChest = v82;
}
v83 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_weeklyChest);
v85 = v83;
if ( a1->m_eventChest != v83 )
{
if ( v83 )
cocos2d::CCObject::retain(v83);
m_eventChest = a1->m_eventChest;
if ( m_eventChest )
cocos2d::CCObject::release(m_eventChest);
a1->m_eventChest = v85;
}
v86 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(m_eventChest);
v87 = v86;
if ( a1->m_unlockedGauntlets != v86 )
{
if ( v86 )
cocos2d::CCObject::retain(v86);
m_unlockedGauntlets = a1->m_unlockedGauntlets;
if ( m_unlockedGauntlets )
cocos2d::CCObject::release(m_unlockedGauntlets);
a1->m_unlockedGauntlets = v87;
}
a1->m_bonusKey.value = 0;
v89 = (int)(float)((float)((float)rand() / 32767.0) * 1000.0);
a1->m_bonusKey.seed = v89;
a1->m_bonusKey.random = v89;
sub_14005E0D0(&a1->m_playerStatsRandMap._Traitsobj._Mypair._Myval2._Myval2);
sub_14005E0D0(&a1->m_playerStatsSeedMap._Traitsobj._Mypair._Myval2._Myval2);
a1->m_pathBugFixed = 0;
a1->m_activePath = 0;
}