//
// FriendRequestPopup::onBlock from 0x8c5a00 to 0x8c5c8c (652 bytes)
//
// 3 xrefs:
// > ??> @ 0xba1b0
// > FriendRequestPopup::loadFromGJFriendRequest @ 0x8ccfb4
// > ??> @ 0x122e720
//
// 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 FriendRequestPopup::onBlock(FriendRequestPopup *a1, cocos2d::CCObject *a2)
{
GameLevelManager *v3; // x0
cocos2d::CCString *v4; // x0
char *CString; // x0
FLAlertLayer *v6; // x20
void *v7; // x0
char *v8; // x0
char *v9; // x0
unsigned int *v10; // x1
int v11; // w2
unsigned int *v12; // x1
int v13; // w2
unsigned int *v14; // x1
int v15; // w2
char *v16; // [xsp+40h] [xbp+40h] BYREF
char *v17; // [xsp+48h] [xbp+48h] BYREF
__int64 v18; // [xsp+50h] [xbp+50h] BYREF
v3 = GameLevelManager::sharedState();
GameLevelManager::tryGetUsername((GameLevelManager **)&v16, v3, a1->m_request->m_accountID);
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Are you sure you want to block %s?\n"
"They will no longer be able to:\n"
"-View your profile.\n"
"-Send you a friend request.\n"
"-Send you messages, and all older messages from them will be "
"deleted.",
v16);
CString = (char *)cocos2d::CCString::getCString(v4);
sub_D153B8((int)&v17, CString);
sub_D153B8((int)&v18, v17);
v6 = FLAlertLayer::create((int)a1 + 648, (__int64)"Confirm Block", (__int64)&v18);
v7 = (void *)(v18 - 24);
if ( (__int64 *)(v18 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v18 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *(_DWORD *)(v18 - 8);
*(_DWORD *)(v18 - 8) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v7);
}
ButtonSprite::updateBGImage(v6->m_button2, "GJ_button_06.png");
v6->setTag(v6, 1);
v6->show(v6);
v8 = v17 - 24;
if ( v17 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v17 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *((_DWORD *)v17 - 2);
*((_DWORD *)v17 - 2) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v8);
}
v9 = v16 - 24;
if ( v16 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v16 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *((_DWORD *)v16 - 2);
*((_DWORD *)v16 - 2) = v15 - 1;
}
if ( v15 <= 0 )
operator delete(v9);
}
}