//
// ProfilePage::followUserFinished from 0x140557cd0 to 0x14055850d (2109 bytes)
//
// 2 xrefs:
// > ??> @ 0x1407d8798
// > ??> @ 0x14092bf34
//
// 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=8
void __fastcall ProfilePage::followUserFinished(__int64 a1, int a2, unsigned __int8 a3)
{
int v3; // r15d
__int64 v6; // rcx
__int64 v7; // rdx
__int64 v8; // rcx
int v9; // esi
__int64 v10; // r8
__int64 v11; // rdi
__int64 v12; // rbx
cocos2d::CCString *v13; // rax
int v14; // ebx
void *v15; // r8
__int64 v16; // rdx
__int64 v17; // rcx
__int64 v18; // r8
__int64 v19; // rax
__int64 v20; // rdi
float v21; // xmm6_4
int v22; // esi
__int64 v23; // rdx
__int64 v24; // rcx
__int64 v25; // r8
__int64 v26; // rbx
cocos2d::CCString *v27; // rax
__int64 v28; // rcx
int v29; // ebx
__int64 v30; // r8
unsigned __int64 v31; // rdx
void *v32; // r8
__int64 v33; // rax
__int64 v34; // rdi
int v35; // esi
__int64 v36; // rdx
__int64 v37; // rcx
__int64 v38; // r8
__int64 v39; // rbx
cocos2d::CCString *v40; // rax
__int64 v41; // rcx
int v42; // ebx
__int64 v43; // r8
unsigned __int64 v44; // rdx
void *v45; // r8
__int64 v46; // rax
__int64 v47; // rdi
int v48; // esi
__int64 v49; // rdx
__int64 v50; // rcx
__int64 v51; // r8
__int64 v52; // rbx
cocos2d::CCString *v53; // rax
__int64 v54; // rcx
int v55; // ebx
__int64 v56; // r8
unsigned __int64 v57; // rdx
void *v58; // r8
__int64 v59; // rax
__int64 v60; // rax
__int64 v61; // r8
int v62; // edx
bool v63; // sf
int v64; // edx
int v65; // eax
const char *v66; // rdx
size_t v67; // r8
__int64 v68; // rbx
__int64 v69; // rdx
__int64 v70; // r8
cocos2d::CCNode *v71; // rax
void *v72; // [rsp+30h] [rbp-69h]
void *v73; // [rsp+30h] [rbp-69h]
void *v74; // [rsp+30h] [rbp-69h]
void *v75; // [rsp+30h] [rbp-69h]
void *v76; // [rsp+30h] [rbp-69h]
__int128 v77; // [rsp+38h] [rbp-61h] BYREF
__int64 v78; // [rsp+48h] [rbp-51h]
__int64 v79; // [rsp+50h] [rbp-49h]
void *v80[2]; // [rsp+60h] [rbp-39h] BYREF
__int64 v81; // [rsp+70h] [rbp-29h]
unsigned __int64 v82; // [rsp+78h] [rbp-21h]
void *Block[2]; // [rsp+80h] [rbp-19h] BYREF
__int64 v84; // [rsp+90h] [rbp-9h]
unsigned __int64 v85; // [rsp+98h] [rbp-1h]
v3 = a3;
if ( a3 )
{
v6 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v72 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v72);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v6 = *(_QWORD *)&qword_14090BFB0;
}
v9 = cocos2d::CCDictionary::count(*(cocos2d::CCDictionary **)(v6 + 872));
v11 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v73 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v73);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v11 = qword_14090BFD0;
}
v12 = AchievementManager::sharedState(v8, v7, v10);
*(_OWORD *)Block = 0;
v85 = 0;
Block[0] = sub_14003D460(0x20u);
v84 = 26;
v85 = 31;
strcpy((char *)Block[0], "geometry.ach.followCreator");
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v12 + 352), Block);
v14 = cocos2d::CCString::intValue(v13);
if ( v85 > 0xF )
{
v15 = Block[0];
if ( v85 + 1 >= 0x1000 )
{
v15 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v15);
}
v84 = 0;
v85 = 15;
LOBYTE(Block[0]) = 0;
if ( v14 < 100 )
{
*(_OWORD *)v80 = 0;
v80[0] = sub_14003D460(0x20u);
v81 = 26;
v82 = 31;
strcpy((char *)v80[0], "geometry.ach.followCreator");
GameManager::completedAchievement(v11, (__int64)v80);
v19 = AchievementManager::sharedState(v17, v16, v18);
AchievementManager::reportAchievementWithID(v19, (__int64)"geometry.ach.followCreator", 100);
}
v20 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v74 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v74);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v20 = qword_14090BFD0;
}
v21 = (float)v9;
v22 = (int)floorf((float)((float)v9 / 10.0) * 100.0);
v26 = AchievementManager::sharedState(v24, v23, v25);
*(_OWORD *)v80 = 0;
v81 = 0;
v82 = 0;
v80[0] = sub_14003D460(0x20u);
v81 = 28;
v82 = 31;
strcpy((char *)v80[0], "geometry.ach.followCreator02");
v27 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v26 + 352), v80);
v29 = cocos2d::CCString::intValue(v27);
v31 = v82;
if ( v82 > 0xF )
{
v32 = v80[0];
if ( v82 + 1 >= 0x1000 )
{
v32 = *((void **)v80[0] - 1);
if ( (unsigned __int64)((char *)v80[0] - (char *)v32 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v32);
}
v81 = 0;
v82 = 15;
LOBYTE(v80[0]) = 0;
if ( v29 < 100 )
{
if ( v22 >= 100 )
{
v77 = 0;
*(_QWORD *)&v77 = sub_14003D460(0x20u);
v78 = 28;
v79 = 31;
strcpy((char *)v77, "geometry.ach.followCreator02");
GameManager::completedAchievement(v20, (__int64)&v77);
}
v33 = AchievementManager::sharedState(v28, v31, v30);
AchievementManager::reportAchievementWithID(v33, (__int64)"geometry.ach.followCreator02", v22);
}
v34 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v75 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v75);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v34 = qword_14090BFD0;
}
v35 = (int)floorf((float)(v21 / 25.0) * 100.0);
v39 = AchievementManager::sharedState(v37, v36, v38);
*(_OWORD *)Block = 0;
v84 = 0;
v85 = 0;
Block[0] = sub_14003D460(0x20u);
v84 = 28;
v85 = 31;
strcpy((char *)Block[0], "geometry.ach.followCreator03");
v40 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v39 + 352), Block);
v42 = cocos2d::CCString::intValue(v40);
v44 = v85;
if ( v85 > 0xF )
{
v45 = Block[0];
if ( v85 + 1 >= 0x1000 )
{
v45 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v45 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v45);
}
v84 = 0;
v85 = 15;
LOBYTE(Block[0]) = 0;
if ( v42 < 100 )
{
if ( v35 >= 100 )
{
v77 = 0;
v78 = 0;
v79 = 0;
*(_QWORD *)&v77 = sub_14003D460(0x20u);
v78 = 28;
v79 = 31;
strcpy((char *)v77, "geometry.ach.followCreator03");
GameManager::completedAchievement(v34, (__int64)&v77);
}
v46 = AchievementManager::sharedState(v41, v44, v43);
AchievementManager::reportAchievementWithID(v46, (__int64)"geometry.ach.followCreator03", v35);
}
v47 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v76 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v76);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v47 = qword_14090BFD0;
}
v48 = (int)floorf((float)(v21 / 50.0) * 100.0);
v52 = AchievementManager::sharedState(v50, v49, v51);
*(_OWORD *)v80 = 0;
v81 = 0;
v82 = 0;
v80[0] = sub_14003D460(0x20u);
v81 = 28;
v82 = 31;
strcpy((char *)v80[0], "geometry.ach.followCreator04");
v53 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v52 + 352), v80);
v55 = cocos2d::CCString::intValue(v53);
v57 = v82;
if ( v82 > 0xF )
{
v58 = v80[0];
if ( v82 + 1 >= 0x1000 )
{
v58 = *((void **)v80[0] - 1);
if ( (unsigned __int64)((char *)v80[0] - (char *)v58 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v58);
}
if ( v55 < 100 )
{
if ( v48 >= 100 )
{
v77 = 0;
v78 = 0;
v79 = 0;
*(_QWORD *)&v77 = sub_14003D460(0x20u);
v78 = 28;
v79 = 31;
strcpy((char *)v77, "geometry.ach.followCreator04");
GameManager::completedAchievement(v47, (__int64)&v77);
}
v59 = AchievementManager::sharedState(v54, v57, v56);
AchievementManager::reportAchievementWithID(v59, (__int64)"geometry.ach.followCreator04", v48);
}
}
if ( a2 == *(_DWORD *)(a1 + 16) )
{
v60 = *(_QWORD *)(a1 + 8);
if ( v60 )
{
*(_BYTE *)(v60 + 792) = v3;
v61 = *(_QWORD *)(a1 + 8);
v62 = 2 * v3 - 1;
v63 = *(_DWORD *)(v61 + 784) + v62 < 0;
v64 = *(_DWORD *)(v61 + 784) + v62;
v65 = 0;
if ( !v63 )
v65 = v64;
*(_DWORD *)(v61 + 784) = v65;
ProfilePage::loadPageFromUserInfo(a1 - 720, *(cocos2d::CCObject **)(a1 + 8));
v77 = 0;
v78 = 0;
v79 = 15;
LOBYTE(v77) = 0;
v66 = "Unfollowed";
if ( (_BYTE)v3 )
v66 = "Following";
*(_OWORD *)v80 = 0;
v81 = 0;
v82 = 0;
v67 = -1;
do
++v67;
while ( v66[v67] );
sub_14003D230(v80, v66, v67);
v68 = *(_QWORD *)(a1 - 720);
v71 = TextAlertPopup::create((__int64)v80, v69, v70, 150, (__int64)&v77);
(*(void (__fastcall **)(__int64, cocos2d::CCNode *, __int64))(v68 + 456))(a1 - 720, v71, 100);
}
}
}