//
// GameLevelManager::onRemoveFriendCompleted from 0x4c278c to 0x4c28b8 (300 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4dabea
//
// 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:25 +0000
//
int __fastcall GameLevelManager::onRemoveFriendCompleted(GameLevelManager *a1, unsigned __int8 *a2, int a3)
{
const char *v3; // r5
cocos2d::CCDictionary *v5; // r8
bool v7; // nf
size_t v8; // r0
int SplitIntFromKey; // r0
int v10; // r8
_BOOL4 v11; // r5
int result; // r0
int v13; // r0
int v14; // r2
int v15; // r3
int v16; // r1
int v17; // r0
int v18; // r2
int v19; // r3
cocos2d::CCArray *StoredUserList; // r5
unsigned int i; // r6
int v22; // r0
int v23; // [sp+0h] [bp-14h] BYREF
int v24; // [sp+4h] [bp-10h]
int v25; // [sp+8h] [bp-Ch]
v5 = *((cocos2d::CCDictionary **)a1 + 187);
v7 = (*(_BYTE *)a3 & 1) != 0;
if ( (*(_BYTE *)a3 & 1) == 0 )
v3 = (const char *)(a3 + 1);
v23 = 0;
if ( v7 )
v3 = *(const char **)(a3 + 8);
v24 = 0;
v25 = 0;
v8 = strlen(v3);
std::string::__init(&v23, v3, v8);
cocos2d::CCDictionary::removeObjectForKey(v5);
std::string::~string((int)&v23);
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(a1, v3, 1u);
v23 = 0;
v24 = 0;
v25 = 0;
v10 = SplitIntFromKey;
std::string::__init(&v23, "-1", 2u);
v11 = sub_4A9CC4(a2, (unsigned __int8 *)&v23);
std::string::~string((int)&v23);
result = *((_DWORD *)a1 + 222);
if ( v11 )
{
if ( result )
return (*(int (__fastcall **)(int, int, int))(*(_DWORD *)result + 4))(result, v10, 39);
}
else
{
if ( result )
(**(void (__fastcall ***)(int, int, int))result)(result, v10, 39);
v13 = GameLevelManager::userInfoForAccountID((cocos2d::CCDictionary **)a1, v10);
v16 = v13;
if ( v13 )
{
v15 = 0;
*(_DWORD *)(v13 + 520) = 0;
v17 = *((_DWORD *)a1 + 221);
if ( v17 )
(*(void (__fastcall **)(int, int))(*(_DWORD *)v17 + 8))(v17, v16);
}
StoredUserList = (cocos2d::CCArray *)GameLevelManager::getStoredUserList((int)a1, 0, v14, v15);
if ( StoredUserList )
{
for ( i = 0; i < cocos2d::CCArray::count(StoredUserList); ++i )
{
if ( *(_DWORD *)(cocos2d::CCArray::objectAtIndex(StoredUserList, i) + 296) == v10 )
{
cocos2d::CCArray::removeObjectAtIndex(StoredUserList, i, 1);
v22 = *((_DWORD *)a1 + 223);
if ( v22 )
(*(void (__fastcall **)(int, cocos2d::CCArray *, _DWORD))(*(_DWORD *)v22 + 8))(v22, StoredUserList, 0);
return GameLevelManager::resetStoredUserList((int)a1, 4, v18, v19);
}
}
}
return GameLevelManager::resetStoredUserList((int)a1, 4, v18, v19);
}
return result;
}