//
// GameLevelManager::onSendThreadMessageCompleted from 0x140249eb0 to 0x14024a24c (924 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x14021b175
// > ??> @ 0x14091c3a0
//
// This function is hookable on this platform (idp: pc, 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 11:28:39 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall GameLevelManager::onSendThreadMessageCompleted(__int64 a1, _QWORD *a2, _QWORD *a3)
{
int v6; // ebp
_BYTE *v7; // rdx
size_t v8; // rdi
size_t v9; // r8
__int64 v10; // r8
void *v11; // rcx
_BYTE *v12; // r15
__int64 v13; // rax
__int64 v14; // r15
_BYTE *v15; // rbx
__int64 v16; // rax
__int64 v17; // rcx
const void *v18; // rcx
unsigned __int64 v19; // rbx
size_t v20; // r8
__int64 v21; // rcx
_BYTE *v22; // rdx
cocos2d::CCArray *v23; // rbx
void *v24; // rcx
cocos2d::CCString *v25; // rax
unsigned int v26; // r15d
cocos2d::CCString *v27; // rax
const char *CString; // rax
__int64 v29; // rdi
cocos2d::CCString *v30; // rax
int v31; // eax
cocos2d::CCString *v32; // rax
cocos2d::CCString *v33; // rax
bool v34; // al
__int64 v35; // rcx
cocos2d::CCNotificationCenter *v36; // rax
void *Block[2]; // [rsp+48h] [rbp-60h] BYREF
__m128i si128; // [rsp+58h] [rbp-50h]
v6 = 0;
v7 = a3;
if ( a3[3] > 0xFu )
v7 = (_BYTE *)*a3;
*(_OWORD *)Block = 0;
si128 = 0;
v8 = -1;
v9 = -1;
do
++v9;
while ( v7[v9] );
sub_14003D230(Block, v7, v9);
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 1200), Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v11 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v11 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v11);
}
v12 = a2;
if ( a2[3] > 0xFu )
v12 = (_BYTE *)*a2;
v13 = a2[2];
if ( v13 )
{
v15 = &v12[v13];
LOBYTE(v10) = 58;
v16 = sub_140677120(v12, &v12[v13], v10);
v17 = v16 - (_QWORD)v12;
v14 = -1;
if ( (_BYTE *)v16 != v15 )
v14 = v17;
}
else
{
v14 = -1;
}
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 2;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "-1");
v18 = a2;
v19 = a2[3];
if ( v19 > 0xF )
v18 = (const void *)*a2;
v20 = a2[2];
if ( v20 > 2 )
v20 = 2;
if ( !memcmp(v18, Block, v20) && a2[2] == 2 || v14 == -1 )
{
v21 = *(_QWORD *)(a1 + 1392);
if ( v21 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v21 + 56LL))(v21);
}
else
{
v22 = a2;
if ( v19 > 0xF )
v22 = (_BYTE *)*a2;
*(_OWORD *)Block = 0;
si128 = 0;
do
++v8;
while ( v22[v8] );
sub_14003D230(Block, v22, v8);
v23 = sub_1400D2840((__int64 *)Block, ":");
if ( si128.m128i_i64[1] > 0xFuLL )
{
v24 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v24 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v24 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v24);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
v25 = cocos2d::CCArray::stringAtIndex(v23, 0);
v26 = cocos2d::CCString::intValue(v25);
if ( cocos2d::CCArray::count(v23) < 2 )
{
v29 = 0;
}
else
{
v27 = cocos2d::CCArray::stringAtIndex(v23, 1u);
CString = cocos2d::CCString::getCString(v27);
v29 = atoll(CString);
}
if ( *(_BYTE *)(a1 + 520) || !*(_BYTE *)(a1 + 521) )
{
v34 = false;
if ( cocos2d::CCArray::count(v23) >= 3 )
{
v33 = cocos2d::CCArray::stringAtIndex(v23, 2u);
if ( cocos2d::CCString::intValue(v33) )
v34 = true;
}
*(_BYTE *)(a1 + 522) = v34;
*(_DWORD *)(a1 + 512) = 0;
}
else
{
if ( cocos2d::CCArray::count(v23) < 3 )
{
v31 = 0;
}
else
{
v30 = cocos2d::CCArray::stringAtIndex(v23, 2u);
v31 = cocos2d::CCString::intValue(v30);
}
*(_DWORD *)(a1 + 512) = v31;
if ( cocos2d::CCArray::count(v23) >= 4 )
{
v32 = cocos2d::CCArray::stringAtIndex(v23, 3u);
v6 = cocos2d::CCString::intValue(v32);
}
}
*(_DWORD *)(a1 + 516) = v6;
v35 = *(_QWORD *)(a1 + 1392);
if ( v35 )
{
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v35 + 48LL))(v35, v26, v29);
}
else
{
v36 = (cocos2d::CCNotificationCenter *)cocos2d::CCNotificationCenter::sharedNotificationCenter(0);
cocos2d::CCNotificationCenter::postNotification(v36, "ThreadsChangedNotification", nullptr);
}
}
sub_14003D310((__int64)a2);
sub_14003D310((__int64)a3);
}