//
// GJMessagePopup::FLAlert_Clicked from 0x8cf108 to 0x8cf28c (388 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJMessagePopup::FLAlert_Clicked @ 0x8cf290
// > ??> @ 0x757c8
// > ??> @ 0x1199378
//
// 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 GJMessagePopup::FLAlert_Clicked(GJMessagePopup *a1, FLAlertLayer *a2, bool a3)
{
int v4; // w0
GameLevelManager *v5; // x0
UploadActionPopup *m_uploadPopup; // x0
UploadActionPopup *v7; // x0
void *v8; // x3
unsigned int *v9; // x2
int v10; // w0
__int64 v11; // [xsp+40h] [xbp+40h] BYREF
if ( a3 )
{
v4 = a2->getTag(a2);
if ( v4 == 1 )
{
GJMessagePopup::blockUser(a1);
}
else if ( v4 == 2 )
{
v5 = GameLevelManager::sharedState();
if ( GameLevelManager::deleteUserMessages(v5, a1->m_message, nullptr, a1->m_message->m_outgoing) )
{
GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;
m_uploadPopup = a1->m_uploadPopup;
if ( m_uploadPopup )
m_uploadPopup->m_delegate = nullptr;
sub_D153B8((int)&v11, "Deleting message...");
v7 = (UploadActionPopup *)UploadActionPopup::create((__int64)&a1->UploadPopupDelegate);
a1->m_uploadPopup = v7;
v8 = (void *)(v11 - 24);
if ( (__int64 *)(v11 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v11 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *(_DWORD *)(v11 - 8);
*(_DWORD *)(v11 - 8) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v8);
v7 = a1->m_uploadPopup;
}
v7->show(v7);
}
}
}
}