//
// FriendRequestPopup::onAccept from 0x8cb6a4 to 0x8cb7dc (312 bytes)
//
// 3 xrefs:
// > ??> @ 0x70ad0
// > FriendRequestPopup::loadFromGJFriendRequest @ 0x8cce84
// > ??> @ 0x122bb68
//
// 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::onAccept(FriendRequestPopup *a1, cocos2d::CCObject *a2)
{
GameLevelManager *v3; // x0
UploadActionPopup *m_popup; // x0
void *v5; // x3
unsigned int *v6; // x2
int v7; // w0
__int64 v8; // [xsp+40h] [xbp+40h] BYREF
v3 = GameLevelManager::sharedState();
if ( GameLevelManager::acceptFriendRequest(v3, a1->m_request->m_accountID, a1->m_request->m_requestID) )
{
sub_D153B8((int)&v8, "Accepting Friend Request...");
m_popup = (UploadActionPopup *)UploadActionPopup::create((__int64)&a1->UploadPopupDelegate);
a1->m_popup = m_popup;
v5 = (void *)(v8 - 24);
if ( (__int64 *)(v8 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v8 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v8 - 8);
*(_DWORD *)(v8 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v5);
m_popup = a1->m_popup;
}
m_popup->show(m_popup);
}
}