//
// ProfilePage::onFollow from 0x140557a60 to 0x140557c44 (484 bytes)
//
// 2 xrefs:
// > ProfilePage::init @ 0x140551491
// > ??> @ 0x14092bf04
//
// This function is hookable on this platform (idp: pc, 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:34:11 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall ProfilePage::onFollow(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rax
cocos2d::CCObject *v4; // rbx
char result; // al
__int64 v6; // rcx
bool isFollowingUser; // bl
__int64 v8; // rcx
__int128 v9; // [rsp+50h] [rbp-48h] BYREF
__int64 v10; // [rsp+60h] [rbp-38h]
__int64 v11; // [rsp+68h] [rbp-30h]
_BYTE v12[32]; // [rsp+70h] [rbp-28h] BYREF
void *v13; // [rsp+B0h] [rbp+18h]
void *v14; // [rsp+B0h] [rbp+18h]
v2 = GJAccountManager::sharedState();
if ( *(_DWORD *)(v2 + 360) - *(_DWORD *)(v2 + 364) > 0 )
{
v6 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v13 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v13);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v6 = *(_QWORD *)&qword_14090BFB0;
}
isFollowingUser = GameLevelManager::isFollowingUser(v6);
v8 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v14 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v14);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v8 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v8 + 536) = a1 + 720;
result = GameLevelManager::followUserOnline(
(cocos2d::CCActionManager **)v8,
*(_DWORD *)(a1 + 736),
!isFollowingUser);
if ( result )
return ProfilePage::updateFollowButton(a1, !isFollowingUser);
}
else
{
v9 = 0;
*(_QWORD *)&v9 = sub_14003D460(0x40u);
v10 = 48;
v11 = 63;
strcpy((char *)v9, "You need an account to follow this user.");
v3 = sub_14003F4F0((__int64)v12, (__int64)&v9);
v4 = FLAlertLayer::create(0, (int)"Follow", v3, (__int64)"OK", 0, 1132068864, 0, 0, 1065353216);
sub_14003D310((__int64)&v9);
return (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v4 + 1064LL))(v4);
}
return result;
}