//
// sub_1004A7AD4 from 0x1004a7ad4 to 0x1004a7f94 (1216 bytes)
//
// 1 xrefs:
// > FollowRewardPage::init @ 0x1004a7620
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:06:05 +0000
//
void __fastcall sub_1004A7AD4(__int64 a1, __int64 a2)
{
__int64 v4; // x20
__int64 v5; // x0
bool UGV; // w22
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
__int64 v11; // x0
__int64 v12; // x0
__int64 v13; // x20
std::string *v14; // x21
std::string *v15; // x4
__int64 *v16; // x19
__int64 v17; // x0
__int64 v18; // x20
_QWORD *v19; // x21
std::string v20; // [xsp+0h] [xbp-C0h] BYREF
std::string __p; // [xsp+20h] [xbp-A0h] BYREF
std::string v22; // [xsp+40h] [xbp-80h] BYREF
std::string v23; // [xsp+58h] [xbp-68h] BYREF
std::string v24; // [xsp+70h] [xbp-50h] BYREF
std::string v25; // [xsp+88h] [xbp-38h] BYREF
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
memset(&v25, 0, sizeof(v25));
sub_100009900(&v24, "");
sub_100009900(&v23, "");
sub_100009900(&v22, "");
if ( (int)v4 <= 3 )
{
switch ( (_DWORD)v4 )
{
case 1:
std::string::assign(&v25, "0007");
v9 = GameManager::sharedState();
UGV = GameManager::getUGV(v9, "22");
std::string::assign(&v24, "YouTube");
std::string::assign(&v23, "Subscribe to RobTop Games on YouTube\nto unlock this chest!");
std::string::assign(&v22, "Sub!");
break;
case 2:
std::string::assign(&v25, "0008");
v12 = GameManager::sharedState();
UGV = GameManager::getUGV(v12, "24");
std::string::assign(&v24, "Twitter");
std::string::assign(&v23, "Follow RobTop Games on Twitter\nto unlock this chest!");
std::string::assign(&v22, "Follow!");
break;
case 3:
std::string::assign(&v25, "0009");
v7 = GameManager::sharedState();
UGV = GameManager::getUGV(v7, "23");
std::string::assign(&v24, "Facebook");
std::string::assign(&v23, "Like Geometry Dash on Facebook\nto unlock this chest!");
std::string::assign(&v22, "Like!");
break;
default:
goto LABEL_37;
}
}
else if ( (int)v4 > 5 )
{
if ( (_DWORD)v4 == 6 )
{
std::string::assign(&v25, "0024");
v11 = GameManager::sharedState();
UGV = GameManager::getUGV(v11, "32");
std::string::assign(&v24, "Reddit");
std::string::assign(&v23, "Join Geometry Dash on Reddit\nto unlock this chest!");
std::string::assign(&v22, "Join!");
}
else
{
if ( (_DWORD)v4 != 7 )
goto LABEL_37;
std::string::assign(&v25, "0025");
v8 = GameManager::sharedState();
UGV = GameManager::getUGV(v8, "39");
std::string::assign(&v24, "Spotlight");
std::string::assign(
&v23,
"Subscribe to Geometry Dash Spotlight on YouTube\nto unlock this chest!");
std::string::assign(&v22, "Sub!");
}
}
else if ( (_DWORD)v4 == 4 )
{
std::string::assign(&v25, "0010");
v10 = GameManager::sharedState();
UGV = GameManager::getUGV(v10, "26");
std::string::assign(&v24, "Twitch");
std::string::assign(&v23, "Follow Geometry Dash on Twitch\nto unlock this chest!");
std::string::assign(&v22, "Follow!");
}
else
{
std::string::assign(&v25, "0011");
v5 = GameManager::sharedState();
UGV = GameManager::getUGV(v5, "27");
std::string::assign(&v24, "Discord");
std::string::assign(&v23, "Join Geometry Dash on Discord\nto unlock this chest!");
std::string::assign(&v22, "Join!");
}
if ( UGV )
{
v13 = GameStatsManager::sharedState();
if ( SHIBYTE(v25.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&v20, v25.__r_.__value_.__l.__data_, v25.__r_.__value_.__l.__size_);
else
v20 = v25;
v17 = GameStatsManager::unlockSpecialChest(v13, (__int64)&v20);
v18 = v17;
if ( SHIBYTE(v20.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(v20.__r_.__value_.__l.__data_);
if ( !v18 )
goto LABEL_37;
}
else if ( !v17 )
{
goto LABEL_37;
}
sub_1004A8030(v17, a2);
v19 = RewardUnlockLayer::create(*(unsigned int *)(v18 + 64), 0);
(*(void (__fastcall **)(__int64, _QWORD *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v19, 100);
RewardUnlockLayer::showCollectReward((__int64)v19, v18);
goto LABEL_37;
}
if ( (v24.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v14 = &v24;
else
v14 = (std::string *)v24.__r_.__value_.__r.__words[0];
if ( SHIBYTE(v23.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__p, v23.__r_.__value_.__l.__data_, v23.__r_.__value_.__l.__size_);
else
__p = v23;
if ( (v22.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v15 = &v22;
else
v15 = (std::string *)v22.__r_.__value_.__r.__words[0];
v16 = (__int64 *)FLAlertLayer::create_1(a1 + 664, (__int64)v14, (__int64)&__p, (__int64)"Cancel", (__int64)v15, 380.0);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
(*(void (__fastcall **)(__int64 *, __int64))(*v16 + 72))(v16, v4);
ButtonSprite::updateBGImage(v16[77], (__int64)"GJ_button_02.png");
(*(void (__fastcall **)(__int64 *))(*v16 + 1312))(v16);
LABEL_37:
if ( SHIBYTE(v22.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v22.__r_.__value_.__l.__data_);
if ( SHIBYTE(v23.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v23.__r_.__value_.__l.__data_);
if ( SHIBYTE(v24.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v24.__r_.__value_.__l.__data_);
if ( SHIBYTE(v25.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v25.__r_.__value_.__l.__data_);
}