//
// GameLevelManager::deleteFriendRequests from 0x726534 to 0x726ae4 (1456 bytes)
//
// 5 xrefs:
// > GJRequestCell::FLAlert_Clicked @ 0x61cb30
// > GameLevelManager::deleteSentFriendRequest @ 0x726aec
// > FriendRequestPopup::onRemove @ 0x8cb814
// > FRequestProfilePage::deleteSelected @ 0x8f4c48
// > ??> @ 0x71838
//
// 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
//
// local variable allocation has failed, the output may be wrong!
bool GameLevelManager::deleteFriendRequests(GameLevelManager *a1, int a2, cocos2d::CCArray *a3, bool a4)
{
_BOOL4 v4; // w21
cocos2d::CCArray *v6; // x20
int v7; // w19
cocos2d::CCString *v8; // x0
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // x23
__int64 v10; // x23
char *v11; // x0
bool result; // w0
cocos2d::CCDictionary *v13; // x24
cocos2d::CCNode *v14; // x23
char *v15; // x0
cocos2d::CCString *v16; // x0
const char *v17; // x0
cocos2d::CCString *v18; // x0
size_t v19; // x0
unsigned int i; // w19
__int64 v21; // x21
cocos2d::CCString *v22; // x0
size_t v23; // x0
char *v24; // x0
char *v25; // x0
char *v26; // x0
char *v27; // x0
unsigned int *v28; // x1
int v29; // w2
unsigned int *v30; // x19
int v31; // w1
unsigned int *v32; // x1
int v33; // w2
unsigned int *v34; // x1
int v35; // w2
unsigned int *v36; // x1
int v37; // w2
unsigned int *v38; // x1
int v39; // w2
char *CString; // [xsp+68h] [xbp+68h]
const char *v41; // [xsp+78h] [xbp+78h]
const char *v42; // [xsp+78h] [xbp+78h]
char *v43; // [xsp+A8h] [xbp+A8h] BYREF
const char *v44; // [xsp+B0h] [xbp+B0h] BYREF
const char *v45; // [xsp+B8h] [xbp+B8h] BYREF
std::string v46; // [xsp+C0h] [xbp+C0h] BYREF
v4 = a4;
v6 = a3;
v7 = a2;
if ( !a3 )
{
if ( a2 > 0 )
{
LABEL_5:
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"delFriendReq_%i_%i",
*(const char **)&a2,
v4);
goto LABEL_6;
}
return 0;
}
if ( (unsigned int)cocos2d::CCArray::count(a3) != 1 )
{
if ( v7 <= 0 && !(unsigned int)cocos2d::CCArray::count(v6) )
return 0;
*(_QWORD *)&a2 = 0xFFFFFFFFLL;
goto LABEL_5;
}
v7 = *(_DWORD *)(cocos2d::CCArray::objectAtIndex(v6, 0) + 344);
if ( v7 <= 0 )
return 0;
v6 = nullptr;
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"delFriendReq_%i_%i",
(const char *)(unsigned int)v7,
v4);
LABEL_6:
CString = (char *)cocos2d::CCString::getCString(v8);
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
sub_D153B8((int)&v46, CString);
v10 = cocos2d::CCDictionary::objectForKey(m_friendReqAndUserBlocks, &v46);
v11 = (char *)v46.m_data.m_data - 24;
if ( (__int64 *)v46.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v28 = (unsigned int *)((char *)v46.m_data.m_data - 8);
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *((_DWORD *)v46.m_data.m_data - 2);
*((_DWORD *)v46.m_data.m_data - 2) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v11);
}
result = 0;
if ( !v10 )
{
v13 = a1->m_friendReqAndUserBlocks;
v14 = cocos2d::CCNode::create();
sub_D153B8((int)&v46, CString);
cocos2d::CCDictionary::setObject((int)v13, v14);
v15 = (char *)v46.m_data.m_data - 24;
if ( (__int64 *)v46.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = (unsigned int *)((char *)v46.m_data.m_data - 8);
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *((_DWORD *)v46.m_data.m_data - 2);
*((_DWORD *)v46.m_data.m_data - 2) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v15);
}
GameLevelManager::getBasePostString(a1, (__int64)&v43);
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v17 = cocos2d::CCString::getCString(v16);
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&targetAccountID=%i&isSender=%i&secret=%s",
(const char *)(unsigned int)v7,
v4,
v17);
v41 = cocos2d::CCString::getCString(v18);
v19 = strlen(v41);
sub_D15FD4(&v43, v41, v19);
if ( v6 )
{
sub_D15FD4(&v43, "&accounts=", 10);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(v6); ++i )
{
v21 = cocos2d::CCArray::objectAtIndex(v6, i);
if ( i )
sub_D15FD4(&v43, &byte_F804F8, 1);
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)*(unsigned int *)(v21 + 344));
v42 = cocos2d::CCString::getCString(v22);
v23 = strlen(v42);
sub_D15FD4(&v43, v42, v23);
}
}
sub_D153B8((int)&v44, "https://www.boomlings.com/database/deleteGJFriendRequests20.php");
sub_D153B8((int)&v45, v43);
sub_D153B8((int)&v46, CString);
GameLevelManager::ProcessHttpRequest(a1, &v44, &v45, (cocos2d::extension::CCHttpClient **)&v46, 30);
v24 = (char *)v46.m_data.m_data - 24;
if ( (__int64 *)v46.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)((char *)v46.m_data.m_data - 8);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *((_DWORD *)v46.m_data.m_data - 2);
*((_DWORD *)v46.m_data.m_data - 2) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v24);
}
v25 = (char *)(v45 - 24);
if ( v45 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v38 = (unsigned int *)(v45 - 8);
do
v39 = __ldaxr(v38);
while ( __stlxr(v39 - 1, v38) );
}
else
{
v39 = *((_DWORD *)v45 - 2);
*((_DWORD *)v45 - 2) = v39 - 1;
}
if ( v39 <= 0 )
operator delete(v25);
}
v26 = (char *)(v44 - 24);
if ( v44 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(v44 - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *((_DWORD *)v44 - 2);
*((_DWORD *)v44 - 2) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v26);
}
v27 = v43 - 24;
if ( v43 - 24 == (char *)&qword_124B6B0 )
return 1;
if ( &pthread_create )
{
v30 = (unsigned int *)(v43 - 8);
do
v31 = __ldaxr(v30);
while ( __stlxr(v31 - 1, v30) );
}
else
{
v31 = *((_DWORD *)v43 - 2);
*((_DWORD *)v43 - 2) = v31 - 1;
}
if ( v31 > 0 )
{
return 1;
}
else
{
operator delete(v27);
return 1;
}
}
return result;
}