//
// GameLevelManager::onSendThreadMessageCompleted from 0x81111c to 0x811418 (764 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x85c084
// > ??> @ 0x1043f8
//
// 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:54:50 +0000
//
__int64 __fastcall GameLevelManager::onSendThreadMessageCompleted(__int64 a1, __int64 a2, char *a3)
{
__int64 v5; // x24
char *v6; // x20
size_t v7; // x0
__int64 v8; // x24
_BOOL4 v9; // w20
const char *v10; // x1
size_t v11; // x0
cocos2d::CCArray *v12; // x19
__int64 v13; // x23
cocos2d::CCString *v14; // x0
unsigned int v15; // w24
cocos2d::CCString *v16; // x0
const char *CString; // x0
__int64 v18; // x0
__int64 v20; // x0
cocos2d::CCString *v21; // x0
cocos2d::CCNotificationCenter *v22; // x0
bool v23; // cc
int v24; // w0
cocos2d::CCString *v25; // x0
cocos2d::CCString *v26; // x0
char *v27; // [xsp+48h] [xbp+48h]
__int64 v28; // [xsp+50h] [xbp+50h] BYREF
__int64 v29; // [xsp+58h] [xbp+58h]
void *v30; // [xsp+60h] [xbp+60h]
v5 = *(_QWORD *)(a1 + 1088);
v6 = a3 + 1;
if ( (*a3 & 1) != 0 )
v6 = *((char **)a3 + 2);
v28 = 0;
v29 = 0;
v30 = nullptr;
v7 = strlen(v6);
std::string::__init(&v28, v6, v7);
cocos2d::CCDictionary::removeObjectForKey(v5, &v28);
if ( (v28 & 1) != 0 )
operator delete(v30);
v8 = std::string::find(a2, 0x3Au, 0);
v28 = 0;
v29 = 0;
v30 = nullptr;
std::string::__init(&v28, &word_117CE08, 2u);
v9 = sub_7FEA60(a2, (__int64)&v28) || v8 == -1;
if ( v9 )
{
if ( (v28 & 1) != 0 )
{
operator delete(v30);
v20 = *(_QWORD *)(a1 + 1264);
if ( !v20 )
return _stack_chk_guard;
}
else
{
v20 = *(_QWORD *)(a1 + 1264);
if ( !v20 )
return _stack_chk_guard;
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)v20 + 56LL))(v20);
return _stack_chk_guard;
}
if ( (v28 & 1) != 0 )
{
operator delete(v30);
v10 = (const char *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) == 0 )
goto LABEL_8;
goto LABEL_23;
}
v10 = (const char *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
LABEL_23:
v10 = *(const char **)(a2 + 16);
LABEL_8:
v27 = (char *)v10;
v28 = 0;
v29 = 0;
v30 = nullptr;
v11 = strlen(v10);
std::string::__init(&v28, v27, v11);
v12 = sub_80CFCC((unsigned __int8 *)&v28, ":");
if ( (v28 & 1) != 0 )
operator delete(v30);
v13 = 0;
v14 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v12, 0);
v15 = cocos2d::CCString::intValue(v14);
if ( (unsigned int)cocos2d::CCArray::count(v12) > 1 )
{
v16 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v12, 1u);
CString = (const char *)cocos2d::CCString::getCString(v16);
v13 = atoll(CString);
}
if ( !*(_BYTE *)(a1 + 448) && *(_BYTE *)(a1 + 449) )
{
v23 = (unsigned int)cocos2d::CCArray::count(v12) > 2;
v24 = 0;
if ( v23 )
{
v26 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v12, 2u);
v24 = cocos2d::CCString::intValue(v26);
}
*(_DWORD *)(a1 + 440) = v24;
if ( (unsigned int)cocos2d::CCArray::count(v12) > 3 )
{
v25 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v12, 3u);
*(_DWORD *)(a1 + 444) = cocos2d::CCString::intValue(v25);
}
else
{
*(_DWORD *)(a1 + 444) = 0;
}
}
else
{
if ( (unsigned int)cocos2d::CCArray::count(v12) > 2 )
{
v21 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v12, 2u);
LOBYTE(v9) = (unsigned int)cocos2d::CCString::intValue(v21) != 0;
}
*(_BYTE *)(a1 + 450) = v9;
*(_DWORD *)(a1 + 440) = 0;
*(_DWORD *)(a1 + 444) = 0;
}
v18 = *(_QWORD *)(a1 + 1264);
if ( v18 )
{
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v18 + 48LL))(v18, v15, v13);
}
else
{
v22 = (cocos2d::CCNotificationCenter *)cocos2d::CCNotificationCenter::sharedNotificationCenter(nullptr);
cocos2d::CCNotificationCenter::postNotification(v22, "ThreadsChangedNotification", nullptr);
}
return _stack_chk_guard;
}