//
// GameLevelManager::onDeleteCommentCompleted from 0x1402407f0 to 0x140240b2f (831 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x140219c77
// > ??> @ 0x14091c19c
//
// 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:36 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall GameLevelManager::onDeleteCommentCompleted(__int64 a1, const void **a2, void **a3)
{
_BYTE *v6; // rbx
size_t v7; // rdi
size_t v8; // r8
void *v9; // rcx
size_t v10; // r8
cocos2d::CCArray *v11; // r15
void *v12; // rcx
__int64 v13; // rcx
cocos2d::CCString *v14; // rax
const char *CString; // rax
__int64 v16; // rax
unsigned int v17; // r15d
cocos2d::CCArray *v18; // rbx
void *v19; // rcx
cocos2d::CCString *v20; // rax
const char *v21; // rax
unsigned int v22; // ebx
const void *v23; // rcx
unsigned __int64 v24; // rdi
size_t v25; // r8
__int64 v26; // rcx
void *Block[2]; // [rsp+40h] [rbp-30h] BYREF
__m128i si128; // [rsp+50h] [rbp-20h]
v6 = a3;
if ( (unsigned __int64)a3[3] > 0xF )
v6 = *a3;
*(_OWORD *)Block = 0;
si128 = 0;
v7 = -1;
v8 = -1;
do
++v8;
while ( v6[v8] );
sub_14003D230(Block, v6, v8);
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 1200), Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v9 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v9);
}
*(_OWORD *)Block = 0;
si128 = 0;
v10 = -1;
do
++v10;
while ( v6[v10] );
sub_14003D230(Block, v6, v10);
v11 = sub_1400D2840((__int64 *)Block, "_");
if ( si128.m128i_i64[1] > 0xFuLL )
{
v12 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v12);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
if ( cocos2d::CCArray::count(v11) >= 4
&& (v14 = cocos2d::CCArray::objectAtIndex(v11, 3u), CString = cocos2d::CCString::getCString(v14), atoi(CString) == 1) )
{
v16 = GJAccountManager::sharedState(v13);
v17 = *(_DWORD *)(v16 + 360) - *(_DWORD *)(v16 + 364);
}
else
{
v17 = GameLevelManager::levelIDFromCommentKey(v13, v6);
}
*(_OWORD *)Block = 0;
si128 = 0;
do
++v7;
while ( v6[v7] );
sub_14003D230(Block, v6, v7);
v18 = sub_1400D2840((__int64 *)Block, "_");
if ( si128.m128i_i64[1] > 0xFuLL )
{
v19 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v19 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v19 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v19);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
if ( cocos2d::CCArray::count(v18) < 3 )
{
v22 = 0;
}
else
{
v20 = cocos2d::CCArray::objectAtIndex(v18, 2u);
v21 = cocos2d::CCString::getCString(v20);
v22 = atoi(v21);
}
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 2;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "-1");
v23 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v23 = *a2;
v24 = (unsigned __int64)a2[2];
v25 = v24;
if ( v24 > 2 )
v25 = 2;
if ( !memcmp(v23, Block, v25) && v24 == 2 )
{
v26 = *(_QWORD *)(a1 + 1376);
if ( v26 )
(*(void (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)v26 + 16LL))(v26, v17, v22);
}
sub_14003D310((__int64)a2);
sub_14003D310((__int64)a3);
}