//
// GameLevelManager::readFriendRequests from 0x829a38 to 0x829d70 (824 bytes)
//
// 3 xrefs:
// > GameLevelManager::readFriendRequest @ 0x829e20
// > FRequestProfilePage::onMarkRead @ 0xa4f480
// > ??> @ 0xbcd10
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:55:05 +0000
//
__int64 __fastcall GameLevelManager::readFriendRequests(cocos2d::CCObject *a1, unsigned __int8 *a2)
{
int v4; // w0
const char *v6; // x0
unsigned int v7; // w0
cocos2d::CCString *v8; // x0
const char *CString; // x0
char *v10; // x23
size_t v11; // x0
__int64 v12; // x24
__int64 v13; // x24
cocos2d::CCNode *v14; // x0
__int64 v15; // x25
cocos2d::CCObject *v16; // x24
size_t v17; // x0
const char *v18; // x25
cocos2d::CCString *v19; // x0
__int64 v20; // x0
cocos2d::CCString *v21; // x0
size_t v22; // x0
const char *v23; // x1
size_t v24; // x0
size_t v25; // x0
char *v26; // [xsp+58h] [xbp+58h]
char *v27; // [xsp+58h] [xbp+58h]
__int64 v28[2]; // [xsp+68h] [xbp+68h] BYREF
void *v29; // [xsp+78h] [xbp+78h]
__int64 v30[2]; // [xsp+80h] [xbp+80h] BYREF
void *v31; // [xsp+90h] [xbp+90h]
__int64 v32[2]; // [xsp+98h] [xbp+98h] BYREF
void *v33; // [xsp+A8h] [xbp+A8h]
cocos2d::CCNode *v34; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v35; // [xsp+B8h] [xbp+B8h]
void *v36; // [xsp+C0h] [xbp+C0h]
v4 = *a2;
if ( (v4 & 1) != 0 )
{
if ( !*((_QWORD *)a2 + 1) )
return _stack_chk_guard;
v6 = *((const char **)a2 + 2);
}
else
{
if ( !(v4 >> 1) )
return _stack_chk_guard;
v6 = (const char *)(a2 + 1);
}
v7 = atoi(v6);
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"readFriendReq_%i",
(const char *)v7);
CString = (const char *)cocos2d::CCString::getCString(v8);
v34 = nullptr;
v10 = (char *)CString;
v35 = 0;
v36 = nullptr;
v11 = strlen(CString);
v12 = *((_QWORD *)a1 + 136);
std::string::__init((__int64 *)&v34, v10, v11);
v13 = cocos2d::CCDictionary::objectForKey(v12, &v34);
v14 = (cocos2d::CCNode *)(unsigned __int8)v34;
if ( ((unsigned __int8)v34 & 1) != 0 )
{
operator delete(v36);
if ( v13 )
return _stack_chk_guard;
}
else if ( v13 )
{
return _stack_chk_guard;
}
v15 = *((_QWORD *)a1 + 136);
v16 = (cocos2d::CCObject *)cocos2d::CCNode::create(v14);
v34 = nullptr;
v35 = 0;
v36 = nullptr;
v17 = strlen(v10);
std::string::__init((__int64 *)&v34, v10, v17);
cocos2d::CCDictionary::setObject(v15, v16);
if ( ((unsigned __int8)v34 & 1) != 0 )
operator delete(v36);
GameLevelManager::getBasePostString(v28);
v18 = (const char *)(a2 + 1);
if ( (*a2 & 1) != 0 )
v18 = *((const char **)a2 + 2);
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v20 = cocos2d::CCString::getCString(v19);
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&requestID=%s&secret=%s",
v18,
v20);
v26 = (char *)cocos2d::CCString::getCString(v21);
v22 = strlen(v26);
std::string::append((__int64)v28, v26, v22);
v30[0] = 0;
v30[1] = 0;
v31 = nullptr;
std::string::__init(v30, "https://www.boomlings.com/database/readGJFriendRequest20.php", 0x3Cu);
v23 = (char *)v28 + 1;
if ( (v28[0] & 1) != 0 )
v23 = (const char *)v29;
v27 = (char *)v23;
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
v24 = strlen(v23);
std::string::__init(v32, v27, v24);
v34 = nullptr;
v35 = 0;
v36 = nullptr;
v25 = strlen(v10);
std::string::__init((__int64 *)&v34, v10, v25);
GameLevelManager::ProcessHttpRequest(a1, v30, (__int64)v32, (char *)&v34, 38);
if ( ((unsigned __int8)v34 & 1) != 0 )
operator delete(v36);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
if ( (v30[0] & 1) != 0 )
operator delete(v31);
if ( (v28[0] & 1) != 0 )
operator delete(v29);
return _stack_chk_guard;
}