//
// GameManager::removeCustomObject from 0x717188 to 0x7172a8 (288 bytes)
//
// 2 xrefs:
// > EditorUI::onDeleteCustomItem @ 0xbdfe8c
// > ??> @ 0xb7fe8
//
// 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:52:16 +0000
//
__int64 __fastcall GameManager::removeCustomObject(GameManager *this, const char *a2)
{
cocos2d::CCString *v3; // x0
const char *CString; // x24
size_t v5; // x0
size_t v6; // x19
__int64 v7; // x23
unsigned __int64 v8; // x0
char *v9; // x3
__int64 v11; // [xsp+40h] [xbp+40h] BYREF
size_t v12; // [xsp+48h] [xbp+48h]
void *v13; // [xsp+50h] [xbp+50h]
v3 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a2);
v11 = 0;
CString = (const char *)cocos2d::CCString::getCString(v3);
v12 = 0;
v13 = nullptr;
v5 = strlen(CString);
v6 = v5;
v7 = *((_QWORD *)this + 57);
if ( v5 > 0xFFFFFFFFFFFFFFEFLL )
sub_62BE7C();
if ( v5 > 0x16 )
{
v8 = (v5 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v11 = v8 | 1;
v9 = (char *)operator new(v8);
v13 = v9;
v12 = v6;
LABEL_4:
v9 = (char *)memcpy(v9, CString, v6);
goto LABEL_5;
}
LOBYTE(v11) = 2 * v5;
v9 = (char *)&v11 + 1;
if ( v5 )
goto LABEL_4;
LABEL_5:
v9[v6] = 0;
cocos2d::CCDictionary::removeObjectForKey(v7, &v11);
if ( (v11 & 1) != 0 )
operator delete(v13);
return _stack_chk_guard;
}