//
// FollowRewardPage::updateRate from 0x1004210b0 to 0x100421351 (673 bytes)
//
// 2 xrefs:
// > sub_1004213E0 @ 0x1004213ec
// > ??> @ 0x1009349e8
//
// 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 FollowRewardPage::updateRate(FollowRewardPage *a1)
{
double v1; // xmm0_8
unsigned int v2; // r14d
GameStatsManager *v3; // rax
bool isSpecialChestUnlocked; // r15
void **v5; // rax
const char *v6; // r13
GameStatsManager *v7; // rax
GameManager *v8; // rax
_BYTE *v9; // r15
cocos2d::CCLayer *m_mainLayer; // r13
int v11; // eax
GameStatsManager *v12; // rax
GameStatsManager *v13; // rax
GameStatsManager *v14; // rax
GameStatsManager *v15; // rax
char v16; // [rsp+0h] [rbp-C0h] BYREF
char v17[15]; // [rsp+1h] [rbp-BFh] BYREF
char v18; // [rsp+10h] [rbp-B0h] BYREF
char v19; // [rsp+18h] [rbp-A8h] BYREF
char v20[15]; // [rsp+19h] [rbp-A7h] BYREF
char v21; // [rsp+28h] [rbp-98h] BYREF
char v22; // [rsp+30h] [rbp-90h] BYREF
char v23[15]; // [rsp+31h] [rbp-8Fh] BYREF
char v24; // [rsp+40h] [rbp-80h] BYREF
char v25; // [rsp+48h] [rbp-78h] BYREF
char v26[15]; // [rsp+49h] [rbp-77h] BYREF
char v27; // [rsp+58h] [rbp-68h] BYREF
char v28; // [rsp+60h] [rbp-60h] BYREF
char v29[15]; // [rsp+61h] [rbp-5Fh] BYREF
char v30; // [rsp+70h] [rbp-50h] BYREF
char v31; // [rsp+78h] [rbp-48h] BYREF
char v32[15]; // [rsp+79h] [rbp-47h] BYREF
char v33; // [rsp+88h] [rbp-38h] BYREF
char *v34; // [rsp+90h] [rbp-30h]
if ( (unsigned int)sub_100720070(a1->m_chests) )
{
v2 = 0;
v34 = &v18;
do
{
switch ( v2 )
{
case 0u:
v3 = GameStatsManager::sharedState();
v16 = 8;
strcpy(v17, "0007");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked((__int64)v3, (__int64)&v16, v1);
v5 = (void **)&v18;
v6 = "22";
if ( (v16 & 1) != 0 )
goto LABEL_8;
goto LABEL_9;
case 1u:
v14 = GameStatsManager::sharedState();
v19 = 8;
strcpy(v20, "0008");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked((__int64)v14, (__int64)&v19, v1);
v5 = (void **)&v21;
v6 = "24";
if ( (v19 & 1) == 0 )
goto LABEL_9;
goto LABEL_8;
case 2u:
v12 = GameStatsManager::sharedState();
v22 = 8;
strcpy(v23, "0009");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked((__int64)v12, (__int64)&v22, v1);
v5 = (void **)&v24;
v6 = "23";
if ( (v22 & 1) == 0 )
goto LABEL_9;
goto LABEL_8;
case 3u:
v13 = GameStatsManager::sharedState();
v25 = 8;
strcpy(v26, "0010");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked((__int64)v13, (__int64)&v25, v1);
v5 = (void **)&v27;
v6 = "26";
if ( (v25 & 1) == 0 )
goto LABEL_9;
goto LABEL_8;
case 4u:
v7 = GameStatsManager::sharedState();
v28 = 8;
strcpy(v29, "0011");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked((__int64)v7, (__int64)&v28, v1);
v5 = (void **)&v30;
v6 = "27";
if ( (v28 & 1) != 0 )
goto LABEL_8;
goto LABEL_9;
case 5u:
v15 = GameStatsManager::sharedState();
v31 = 8;
strcpy(v32, "0024");
isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked((__int64)v15, (__int64)&v31, v1);
v5 = (void **)&v33;
v6 = "32";
if ( (v31 & 1) == 0 )
goto LABEL_9;
LABEL_8:
operator delete(*v5);
LABEL_9:
v8 = GameManager::sharedState();
if ( GameManager::getUGV(v8, v6) && !isSpecialChestUnlocked )
{
v9 = (_BYTE *)sub_1007200C0(a1->m_chests, v2);
v9[604] = 0;
(*(void (__fastcall **)(_BYTE *, void *))(*(_QWORD *)v9 + 944LL))(v9, &unk_10081B8D8);
m_mainLayer = a1->m_mainLayer;
v11 = (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)v9 + 64LL))(v9);
((void (__fastcall *)(cocos2d::CCLayer *, _QWORD))m_mainLayer->removeChildByTag)(
m_mainLayer,
(unsigned int)(v11 + 10));
}
break;
default:
break;
}
++v2;
}
while ( v2 < (unsigned int)sub_100720070(a1->m_chests) );
}
}