//
// GameLevelManager::purgeFriendRequestSearchCache from 0x4afefc to 0x4b006c (368 bytes)
//
// 2 xrefs:
// > GameLevelManager::friendRequestWasRemoved @ 0x4b0160
// > GameLevelManager::invalidateRequests @ 0x4b0244
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:50:02 +0000
//
int __fastcall GameLevelManager::purgeFriendRequestSearchCache(cocos2d::CCDictionary **this, const char *a2, int a3)
{
cocos2d::CCString *v5; // r0
const char *CString; // r5
size_t v7; // r0
int v8; // r0
_DWORD *v9; // r3
cocos2d::CCString **v10; // r5
cocos2d::CCString *v11; // r0
cocos2d::CCString *v12; // t1
const char *v14; // r0
const char *v15; // r4
char *v16; // r1
size_t v17; // r2
size_t v18; // r0
cocos2d::CCDictionary *v19; // r8
int *v20; // r0
_BOOL4 StoredOnlineLevels; // r6
unsigned int i; // r8
void (__fastcall ***v23)(_DWORD, _BOOL4, const char *); // r0
size_t v24; // r0
cocos2d::CCDictionary *v25; // r6
cocos2d::CCString **v26; // [sp+0h] [bp-34h]
int v27; // [sp+8h] [bp-2Ch] BYREF
size_t v28; // [sp+Ch] [bp-28h]
char *v29; // [sp+10h] [bp-24h]
int v30[3]; // [sp+14h] [bp-20h] BYREF
int v31[3]; // [sp+20h] [bp-14h] BYREF
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"fReqS_%i_", a2);
v27 = 0;
v28 = 0;
v29 = nullptr;
CString = (const char *)cocos2d::CCString::getCString(v5);
v7 = strlen(CString);
std::string::__init(&v27, CString, v7);
v8 = cocos2d::CCDictionary::allKeys(*(this + 181));
if ( v8 )
{
v9 = *(_DWORD **)(v8 + 52);
if ( *v9 )
{
v10 = (cocos2d::CCString **)v9[3];
v26 = &v10[*v9] + 0x3FFFFFFF;
LABEL_4:
while ( v10 <= v26 )
{
v12 = *v10++;
v11 = v12;
if ( !v12 )
break;
v14 = (const char *)cocos2d::CCString::getCString(v11);
v15 = v14;
if ( (v27 & 1) != 0 )
{
v16 = v29;
v17 = v28;
}
else
{
v17 = (int)(unsigned __int8)v27 >> 1;
v16 = (char *)&v27 + 1;
}
if ( !strncmp(v14, v16, v17) )
{
if ( a3 > 0 )
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels((GameLevelManager *)this, v15);
if ( StoredOnlineLevels )
{
for ( i = 0; i < cocos2d::CCArray::count((cocos2d::CCArray *)StoredOnlineLevels); ++i )
{
if ( *(_DWORD *)(cocos2d::CCArray::objectAtIndex((cocos2d::CCArray *)StoredOnlineLevels, i) + 296) == a3 )
{
cocos2d::CCArray::removeObjectAtIndex((cocos2d::CCArray *)StoredOnlineLevels, i, 1);
v23 = (void (__fastcall ***)(_DWORD, _BOOL4, const char *))*(this + 224);
if ( v23 )
(**v23)(v23, StoredOnlineLevels, v15);
if ( !cocos2d::CCArray::count((cocos2d::CCArray *)StoredOnlineLevels) )
{
memset(v31, 0, sizeof(v31));
v24 = strlen(v15);
v25 = *(this + 181);
std::string::__init(v31, v15, v24);
cocos2d::CCDictionary::removeObjectForKey(v25);
v20 = v31;
goto LABEL_21;
}
goto LABEL_4;
}
}
}
}
else
{
memset(v30, 0, sizeof(v30));
v18 = strlen(v15);
v19 = *(this + 181);
std::string::__init(v30, v15, v18);
cocos2d::CCDictionary::removeObjectForKey(v19);
v20 = v30;
LABEL_21:
std::string::~string((int)v20);
}
}
}
}
}
return std::string::~string((int)&v27);
}