//
// GameLevelManager::onSendThreadMessageCompleted from 0x4c5040 to 0x4c5210 (464 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4db704
//
// 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:29 +0000
//
int __fastcall GameLevelManager::onSendThreadMessageCompleted(int a1, int a2, int a3)
{
const char *v3; // r8
cocos2d::CCDictionary *v5; // r9
bool v7; // nf
size_t v8; // r0
int v9; // r0
int v10; // r8
_BOOL4 v11; // r10
int result; // r0
bool v13; // nf
size_t v14; // r0
cocos2d::CCArray *v15; // r6
cocos2d::CCString *v16; // r0
int v17; // r11
cocos2d::CCString *v18; // r0
const char *CString; // r0
__int64 v20; // r8
int v21; // r4
cocos2d::CCNotificationCenter *v22; // r0
cocos2d::CCString *v23; // r0
cocos2d::CCString *v24; // r0
int v25; // r0
cocos2d::CCString *v26; // r0
int v27; // r4
cocos2d::CCNotificationCenter *v28; // r0
int v29; // [sp+0h] [bp-14h] BYREF
int v30; // [sp+4h] [bp-10h]
int v31; // [sp+8h] [bp-Ch]
v5 = *(cocos2d::CCDictionary **)(a1 + 748);
v7 = (*(_BYTE *)a3 & 1) != 0;
if ( (*(_BYTE *)a3 & 1) == 0 )
v3 = (const char *)(a3 + 1);
v29 = 0;
if ( v7 )
v3 = *(const char **)(a3 + 8);
v30 = 0;
v31 = 0;
v8 = strlen(v3);
std::string::__init(&v29, v3, v8);
cocos2d::CCDictionary::removeObjectForKey(v5);
std::string::~string((int)&v29);
v9 = std::string::find((unsigned __int8 *)a2, 58, 0);
v29 = 0;
v30 = 0;
v31 = 0;
v10 = v9;
std::string::__init(&v29, "-1", 2u);
v11 = sub_4A9CC4((unsigned __int8 *)a2, (unsigned __int8 *)&v29);
if ( !v11 )
v11 = v10 == -1;
std::string::~string((int)&v29);
if ( v11 )
{
result = *(_DWORD *)(a1 + 840);
if ( result )
return (*(int (__fastcall **)(int))(*(_DWORD *)result + 28))(result);
}
else
{
v13 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
++a2;
v29 = 0;
if ( v13 )
a2 = *(_DWORD *)(a2 + 8);
v30 = 0;
v31 = 0;
v14 = strlen((const char *)a2);
std::string::__init(&v29, (const void *)a2, v14);
v15 = sub_4C1A88(&v29, ":");
std::string::~string((int)&v29);
v16 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v15, 0);
v17 = cocos2d::CCString::intValue(v16);
if ( cocos2d::CCArray::count(v15) <= 1u )
{
v20 = 0;
}
else
{
v18 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v15, 1u);
CString = (const char *)cocos2d::CCString::getCString(v18);
v20 = atoll(CString);
}
v21 = *(unsigned __int8 *)(a1 + 332);
if ( !*(_BYTE *)(a1 + 332) && *(_BYTE *)(a1 + 333) )
{
if ( cocos2d::CCArray::count(v15) <= 2u )
{
v25 = v21;
}
else
{
v24 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v15, 2u);
v25 = cocos2d::CCString::intValue(v24);
}
*(_DWORD *)(a1 + 324) = v25;
if ( cocos2d::CCArray::count(v15) <= 3u )
{
v22 = nullptr;
}
else
{
v26 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v15, 3u);
v22 = (cocos2d::CCNotificationCenter *)cocos2d::CCString::intValue(v26);
}
*(_DWORD *)(a1 + 328) = v22;
}
else
{
v22 = (cocos2d::CCNotificationCenter *)cocos2d::CCArray::count(v15);
if ( (unsigned int)v22 > 2 )
{
v23 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v15, 2u);
v22 = (cocos2d::CCNotificationCenter *)cocos2d::CCString::intValue(v23);
LOBYTE(v11) = (_BYTE)v22;
if ( v22 )
LOBYTE(v11) = 1;
}
*(_BYTE *)(a1 + 334) = v11;
*(_DWORD *)(a1 + 324) = 0;
*(_DWORD *)(a1 + 328) = 0;
}
v27 = *(_DWORD *)(a1 + 840);
if ( v27 )
{
return (*(int (__fastcall **)(_DWORD, int, _DWORD, _DWORD, int, int, int))(*(_DWORD *)v27 + 24))(
*(_DWORD *)(a1 + 840),
v17,
v20,
HIDWORD(v20),
v29,
v30,
v31);
}
else
{
v28 = (cocos2d::CCNotificationCenter *)cocos2d::CCNotificationCenter::sharedNotificationCenter(v22);
return cocos2d::CCNotificationCenter::postNotification(v28, "ThreadsChangedNotification", nullptr);
}
}
return result;
}