//
// FollowRewardPage::updateRate from 0x962f10 to 0x963434 (1316 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'FollowRewardPage::updateRate @ 0x963438
// > ??> @ 0x4e498
// > ??> @ 0x11bd170
//
// 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 FollowRewardPage::updateRate(FollowRewardPage *a1)
{
unsigned int v2; // w19
GameStatsManager *v3; // x22
unsigned int isSpecialChestUnlocked; // w22
char *v5; // x0
GameManager *v6; // x0
unsigned int UGV; // w0
unsigned int v8; // w1
__int64 v9; // x0
__int64 v10; // x2
__int64 v11; // x22
cocos2d::CCLayer *m_mainLayer; // x27
__int64 v13; // x0
__int64 (__fastcall *v14)(__int64); // x1
void (__fastcall *removeChildByTag)(cocos2d::CCNode *__hidden, int); // x22
int v16; // w0
GameStatsManager *v17; // x22
char *v18; // x0
GameManager *v19; // x0
GameStatsManager *v20; // x22
char *v21; // x0
GameManager *v22; // x0
GameStatsManager *v23; // x22
char *v24; // x0
GameManager *v25; // x0
GameStatsManager *v26; // x22
char *v27; // x0
GameManager *v28; // x0
GameStatsManager *v29; // x22
char *v30; // x0
GameManager *v31; // x0
unsigned int *v32; // x2
int v33; // w1
unsigned int *v34; // x2
int v35; // w1
unsigned int *v36; // x2
int v37; // w1
unsigned int *v38; // x2
int v39; // w1
unsigned int *v40; // x2
int v41; // w1
unsigned int *v42; // x2
int v43; // w1
char *v44; // [xsp+70h] [xbp+70h] BYREF
v2 = 0;
while ( v2 < (unsigned int)cocos2d::CCArray::count(a1->m_chests) )
{
if ( v2 )
{
switch ( v2 )
{
case 1u:
v20 = GameStatsManager::sharedState();
sub_D153B8((int)&v44, "0008");
isSpecialChestUnlocked = (unsigned __int8)GameStatsManager::isSpecialChestUnlocked((__int64)v20, &v44);
v21 = v44 - 24;
if ( v44 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = (unsigned int *)(v44 - 8);
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *((_DWORD *)v44 - 2);
*((_DWORD *)v44 - 2) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v21);
}
v22 = GameManager::sharedState();
UGV = GameManager::getUGV(v22, "24");
break;
case 2u:
v23 = GameStatsManager::sharedState();
sub_D153B8((int)&v44, "0009");
isSpecialChestUnlocked = (unsigned __int8)GameStatsManager::isSpecialChestUnlocked((__int64)v23, &v44);
v24 = v44 - 24;
if ( v44 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)(v44 - 8);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *((_DWORD *)v44 - 2);
*((_DWORD *)v44 - 2) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v24);
}
v25 = GameManager::sharedState();
UGV = GameManager::getUGV(v25, "23");
break;
case 3u:
v26 = GameStatsManager::sharedState();
sub_D153B8((int)&v44, "0010");
isSpecialChestUnlocked = (unsigned __int8)GameStatsManager::isSpecialChestUnlocked((__int64)v26, &v44);
v27 = v44 - 24;
if ( v44 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v38 = (unsigned int *)(v44 - 8);
do
v39 = __ldaxr(v38);
while ( __stlxr(v39 - 1, v38) );
}
else
{
v39 = *((_DWORD *)v44 - 2);
*((_DWORD *)v44 - 2) = v39 - 1;
}
if ( v39 <= 0 )
operator delete(v27);
}
v28 = GameManager::sharedState();
UGV = GameManager::getUGV(v28, "26");
break;
case 4u:
v29 = GameStatsManager::sharedState();
sub_D153B8((int)&v44, "0011");
isSpecialChestUnlocked = (unsigned __int8)GameStatsManager::isSpecialChestUnlocked((__int64)v29, &v44);
v30 = v44 - 24;
if ( v44 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v40 = (unsigned int *)(v44 - 8);
do
v41 = __ldaxr(v40);
while ( __stlxr(v41 - 1, v40) );
}
else
{
v41 = *((_DWORD *)v44 - 2);
*((_DWORD *)v44 - 2) = v41 - 1;
}
if ( v41 <= 0 )
operator delete(v30);
}
v31 = GameManager::sharedState();
UGV = GameManager::getUGV(v31, "27");
break;
case 5u:
v3 = GameStatsManager::sharedState();
sub_D153B8((int)&v44, "0024");
isSpecialChestUnlocked = (unsigned __int8)GameStatsManager::isSpecialChestUnlocked((__int64)v3, &v44);
v5 = v44 - 24;
if ( v44 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v42 = (unsigned int *)(v44 - 8);
do
v43 = __ldaxr(v42);
while ( __stlxr(v43 - 1, v42) );
}
else
{
v43 = *((_DWORD *)v44 - 2);
*((_DWORD *)v44 - 2) = v43 - 1;
}
if ( v43 <= 0 )
operator delete(v5);
}
v6 = GameManager::sharedState();
UGV = GameManager::getUGV(v6, "32");
break;
default:
goto LABEL_8;
}
}
else
{
v17 = GameStatsManager::sharedState();
sub_D153B8((int)&v44, "0007");
isSpecialChestUnlocked = (unsigned __int8)GameStatsManager::isSpecialChestUnlocked((__int64)v17, &v44);
v18 = v44 - 24;
if ( v44 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(v44 - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *((_DWORD *)v44 - 2);
*((_DWORD *)v44 - 2) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v18);
}
v19 = GameManager::sharedState();
UGV = GameManager::getUGV(v19, "22");
}
if ( UGV > isSpecialChestUnlocked )
{
v8 = v2++;
v9 = cocos2d::CCArray::objectAtIndex(a1->m_chests, v8);
v10 = *(_QWORD *)v9;
v11 = v9;
*(_BYTE *)(v9 + 604) = 0;
(*(void (__fastcall **)(__int64, _UNKNOWN **))(v10 + 944))(v9, &off_EFA9B8);
m_mainLayer = a1->m_mainLayer;
v13 = v11;
v14 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 64LL);
removeChildByTag = m_mainLayer->removeChildByTag;
v16 = v14(v13);
removeChildByTag(m_mainLayer, v16 + 10);
continue;
}
LABEL_8:
++v2;
}
}