//
// GameLevelManager::deleteFriendRequests from 0x100554510 to 0x100554a43 (1331 bytes)
//
// 4 xrefs:
// > GJRequestCell::FLAlert_Clicked @ 0x100257c19
// > FriendRequestPopup::onRemove @ 0x1002a5f89
// > GameLevelManager::deleteSentFriendRequest @ 0x1005544fc
// > FRequestProfilePage::deleteSelected @ 0x1007912fa
//
// 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
//
bool __fastcall GameLevelManager::deleteFriendRequests(GameLevelManager *a1, int a2, cocos2d::CCArray *a3, bool a4)
{
__m128 v4; // xmm0
cocos2d::CCArray *v7; // r15
_BOOL4 v8; // r13d
cocos2d::CCString *v9; // rax
char *CString; // rax
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // rbx
size_t v12; // rax
std::string::size_type v13; // r14
char *data; // r13
size_t v15; // r12
__int64 v16; // rbx
__int64 v17; // r12
cocos2d::CCNode *v18; // r14
size_t v19; // rax
std::string::size_type v20; // rbx
char *v21; // r13
__int64 v23; // r14
size_t v24; // r12
cocos2d::CCString *v25; // rax
cocos2d::CCString *v26; // rax
const char *v27; // rax
cocos2d::CCString *v28; // rax
const char *v29; // rax
unsigned int i; // r12d
cocos2d::CCString *v31; // rax
const char *v32; // rax
const char *v33; // rbx
size_t v34; // rax
size_t v35; // r14
char *v36; // r15
size_t v37; // r12
size_t v38; // rax
size_t v39; // rbx
char *v40; // r14
size_t v41; // r15
char v42; // [rsp+0h] [rbp-B0h]
char v43; // [rsp+0h] [rbp-B0h]
char v44; // [rsp+0h] [rbp-B0h]
char v45; // [rsp+0h] [rbp-B0h]
cocos2d::CCNode *v46; // [rsp+8h] [rbp-A8h]
std::string v47; // [rsp+10h] [rbp-A0h] BYREF
GameLevelManager *v48; // [rsp+28h] [rbp-88h]
_QWORD v49[2]; // [rsp+30h] [rbp-80h] BYREF
void *v50; // [rsp+40h] [rbp-70h]
_QWORD v51[2]; // [rsp+48h] [rbp-68h] BYREF
void *v52; // [rsp+58h] [rbp-58h]
int v53; // [rsp+60h] [rbp-50h]
_BOOL4 v54; // [rsp+64h] [rbp-4Ch]
void *__src; // [rsp+68h] [rbp-48h]
std::string __dst[2]; // [rsp+70h] [rbp-40h] BYREF
if ( !a3 )
goto LABEL_4;
v7 = a3;
if ( (unsigned int)sub_100720070(a3) == 1 )
{
a2 = *(_DWORD *)(sub_1007200C0(v7, 0) + 376);
LABEL_4:
v7 = nullptr;
}
if ( a2 <= 0 && (!v7 || !(unsigned int)sub_100720070(v7)) )
return 0;
v8 = a4;
v9 = (cocos2d::CCString *)sub_1007AB580("delFriendReq_%i_%i", v42);
CString = (char *)cocos2d::CCString::getCString(v9);
v48 = a1;
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
__src = CString;
v12 = strlen(CString);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_64:
sub_100006BF0(*(double *)v4.i64);
v13 = v12;
v54 = v8;
v53 = a2;
if ( v12 >= 0x17 )
{
v15 = 26;
if ( (v12 | 7) != 0x17 )
v15 = (v12 | 7) + 1;
data = (char *)operator new(v15);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v15 + 1;
__dst[0].__r_.__value_.__l.__size_ = v13;
goto LABEL_13;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v12);
data = __dst[0].__r_.__value_.__s.__data_;
if ( v12 )
LABEL_13:
memmove(data, __src, v13);
data[v13] = 0;
v16 = cocos2d::CCDictionary::objectForKey_1((__int64)m_friendReqAndUserBlocks, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
if ( v16 )
return 0;
v17 = (__int64)v48->m_friendReqAndUserBlocks;
v18 = cocos2d::CCNode::create();
v19 = strlen((const char *)__src);
if ( v19 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_64;
v20 = v19;
if ( v19 >= 0x17 )
{
v46 = v18;
v23 = v17;
v24 = 26;
if ( (v19 | 7) != 0x17 )
v24 = (v19 | 7) + 1;
v21 = (char *)operator new(v24);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v21;
__dst[0].__r_.__value_.__r.__words[0] = v24 + 1;
v17 = v23;
v18 = v46;
__dst[0].__r_.__value_.__l.__size_ = v20;
goto LABEL_27;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v19);
v21 = __dst[0].__r_.__value_.__s.__data_;
if ( v19 )
LABEL_27:
memmove(v21, __src, v20);
v21[v20] = 0;
cocos2d::CCDictionary::setObject_1(v17, v18, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(__dst, v4);
v25 = (cocos2d::CCString *)sub_1007AB580("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v25);
v26 = (cocos2d::CCString *)sub_1007AB580("&targetAccountID=%i&isSender=%i&secret=%s", v43);
v27 = cocos2d::CCString::getCString(v26);
std::string::append(__dst, v27);
if ( v7 )
{
std::string::append(__dst, "&accounts=");
if ( (unsigned int)sub_100720070(v7) )
{
sub_1007200C0(v7, 0);
v28 = (cocos2d::CCString *)sub_1007AB580("%i", v44);
v29 = cocos2d::CCString::getCString(v28);
std::string::append(__dst, v29);
for ( i = 1; i < (unsigned int)sub_100720070(v7); ++i )
{
sub_1007200C0(v7, i);
std::string::append(__dst, ",");
v31 = (cocos2d::CCString *)sub_1007AB580("%i", v45);
v32 = cocos2d::CCString::getCString(v31);
std::string::append(__dst, v32);
}
}
}
v47.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v47.__r_.__value_.__r.__words[0] = 65;
v47.__r_.__value_.__l.__size_ = 63;
strcpy(v47.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/deleteGJFriendRequests20.php");
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
v33 = __dst[0].__r_.__value_.__l.__data_;
else
v33 = __dst[0].__r_.__value_.__s.__data_;
v34 = strlen(v33);
if ( v34 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(2.057594829120962e-81);
v35 = v34;
if ( v34 >= 0x17 )
{
v37 = 26;
if ( (v34 | 7) != 0x17 )
v37 = (v34 | 7) + 1;
v36 = (char *)operator new(v37);
v50 = v36;
v49[0] = v37 | 1;
v49[1] = v35;
goto LABEL_45;
}
LOBYTE(v49[0]) = 2 * v34;
v36 = (char *)v49 + 1;
if ( v34 )
LABEL_45:
memmove(v36, v33, v35);
v36[v35] = 0;
v38 = strlen((const char *)__src);
if ( v38 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(2.057594829120962e-81);
v39 = v38;
if ( v38 >= 0x17 )
{
v41 = 26;
if ( (v38 | 7) != 0x17 )
v41 = (v38 | 7) + 1;
v40 = (char *)operator new(v41);
v52 = v40;
v51[0] = v41 | 1;
v51[1] = v39;
goto LABEL_53;
}
LOBYTE(v51[0]) = 2 * v38;
v40 = (char *)v51 + 1;
if ( v38 )
LABEL_53:
memmove(v40, __src, v39);
v40[v39] = 0;
GameLevelManager::ProcessHttpRequest(v48, &v47, (__int64)v49, (__int64)v51, 30);
if ( (v51[0] & 1) != 0 )
{
operator delete(v52);
if ( (v49[0] & 1) == 0 )
{
LABEL_56:
if ( (*(_BYTE *)&v47.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_57;
LABEL_62:
operator delete(v47.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
return 1;
goto LABEL_58;
}
}
else if ( (v49[0] & 1) == 0 )
{
goto LABEL_56;
}
operator delete(v50);
if ( (*(_BYTE *)&v47.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_62;
LABEL_57:
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
LABEL_58:
operator delete(__dst[0].__r_.__value_.__l.__data_);
return 1;
}