//
// GJUserCell::FLAlert_Clicked from 0x60c994 to 0x60cc64 (720 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJUserCell::FLAlert_Clicked @ 0x60cc68
// > ??> @ 0x42e58
// > ??> @ 0x11508e0
//
// 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 GJUserCell::FLAlert_Clicked(GJUserCell *a1, FLAlertLayer *a2, bool a3)
{
GameLevelManager *v4; // x0
UploadActionPopup *v5; // x0
UploadActionPopup *v6; // x0
UploadPopupDelegate_vtbl *v7; // x2
UploadPopupDelegate_vtbl *v8; // x3
unsigned int *v9; // x2
int onClosePopup; // w0
GameLevelManager *v11; // x0
UploadActionPopup *m_uploadPopup; // x0
GameLevelManager *v13; // x0
unsigned int *v14; // x2
UploadPopupDelegate v16; // [xsp+50h] [xbp+50h] BYREF
std::string v17; // 0:x2.8
std::string v18; // 0:x2.8
std::string v19; // 0:x2.8
if ( a3 )
{
if ( a2->getTag(a2) == 1 )
{
if ( !a1->m_userScore )
return;
v11 = GameLevelManager::sharedState();
if ( !GameLevelManager::unblockUser(v11, a1->m_userScore->m_accountID) )
return;
GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;
m_uploadPopup = a1->m_uploadPopup;
if ( m_uploadPopup )
m_uploadPopup->m_delegate = nullptr;
sub_D153B8((int)&v16, "Unblocking user...");
v6 = (UploadActionPopup *)UploadActionPopup::create((UploadActionPopup *)&a1->UploadPopupDelegate, &v16, v18);
a1->m_uploadPopup = v6;
v7 = v16.__vftable;
v8 = v16.__vftable - 3;
if ( (__int64 *)&v16.__vftable[-3] != &qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)&v16.__vftable[-1];
do
onClosePopup = __ldaxr(v14);
while ( __stlxr(onClosePopup - 1, v14) );
LABEL_13:
if ( onClosePopup <= 0 )
operator delete(v8);
v6 = a1->m_uploadPopup;
goto LABEL_21;
}
LABEL_30:
onClosePopup = (int)v7[-1].onClosePopup;
LODWORD(v7[-1].onClosePopup) = onClosePopup - 1;
goto LABEL_13;
}
}
else if ( a2->getTag(a2) == 2 )
{
if ( !a1->m_userScore )
return;
v4 = GameLevelManager::sharedState();
if ( !GameLevelManager::removeFriend(v4, a1->m_userScore->m_accountID) )
return;
GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;
v5 = a1->m_uploadPopup;
if ( v5 )
v5->m_delegate = nullptr;
sub_D153B8((int)&v16, "Removing Friend...");
v6 = (UploadActionPopup *)UploadActionPopup::create((UploadActionPopup *)&a1->UploadPopupDelegate, &v16, v17);
a1->m_uploadPopup = v6;
v7 = v16.__vftable;
v8 = v16.__vftable - 3;
if ( (__int64 *)&v16.__vftable[-3] != &qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)&v16.__vftable[-1];
do
onClosePopup = __ldaxr(v9);
while ( __stlxr(onClosePopup - 1, v9) );
goto LABEL_13;
}
goto LABEL_30;
}
}
else
{
if ( a2->getTag(a2) != 3 )
return;
v13 = GameLevelManager::sharedState();
if ( !GameLevelManager::deleteSentFriendRequest(v13, a1->m_userScore->m_accountID) )
return;
GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;
sub_D153B8((int)&v16, "Removing Friend Request...");
v6 = (UploadActionPopup *)UploadActionPopup::create((UploadActionPopup *)&a1->UploadPopupDelegate, &v16, v19);
a1->m_uploadPopup = v6;
if ( (__int64 *)&v16.__vftable[-3] != &qword_124B6B0 )
{
sub_4DB620(&v16.__vftable[-3]);
v6 = a1->m_uploadPopup;
}
}
LABEL_21:
v6->show(v6);
}
}