//
// GameLevelManager::onSuggestLevelStarsCompleted from 0x140235640 to 0x1402358ea (682 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x14021a45c
// > ??> @ 0x14091bfbc
//
// 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:32 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall GameLevelManager::onSuggestLevelStarsCompleted(__int64 a1, const void **a2, _QWORD *a3)
{
_BYTE *v6; // rbx
size_t v7; // r8
__int64 v8; // rcx
void *v9; // rcx
unsigned int SplitIntFromKey; // r12d
const void *v11; // rcx
unsigned __int64 v12; // r15
size_t v13; // r8
int v14; // ebx
const void *v15; // rcx
size_t v16; // r8
int v17; // ebx
_DWORD *v18; // rbx
float v19; // xmm0_4
__int64 v20; // rcx
void (__fastcall ***v21)(_QWORD, _QWORD, __int64); // rcx
void *v22; // [rsp+30h] [rbp-40h]
void *Block[2]; // [rsp+48h] [rbp-28h] BYREF
__int64 v24; // [rsp+58h] [rbp-18h]
unsigned __int64 v25; // [rsp+60h] [rbp-10h]
v6 = a3;
if ( a3[3] > 0xFu )
v6 = (_BYTE *)*a3;
*(_OWORD *)Block = 0;
v24 = 0;
v25 = 0;
v7 = -1;
do
++v7;
while ( v6[v7] );
sub_14003D230(Block, v6, v7);
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 1200), Block);
if ( v25 > 0xF )
{
v9 = Block[0];
if ( v25 + 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);
}
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(v8, v6, 1);
*(_OWORD *)Block = 0;
v24 = 2;
v25 = 15;
strcpy((char *)Block, "-1");
v11 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v11 = *a2;
v12 = (unsigned __int64)a2[2];
v13 = v12;
if ( v12 > 2 )
v13 = 2;
v14 = memcmp(v11, Block, v13);
if ( !v14 )
{
if ( v12 >= 2 )
v14 = v12 > 2;
else
v14 = -1;
}
if ( !v14 )
goto LABEL_31;
*(_OWORD *)Block = 0;
v24 = 2;
v25 = 15;
strcpy((char *)Block, "-2");
v15 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v15 = *a2;
v16 = v12;
if ( v12 > 2 )
v16 = 2;
v17 = memcmp(v15, Block, v16);
if ( !v17 )
{
if ( v12 >= 2 )
v17 = v12 > 2;
else
v17 = -1;
}
if ( !v17 )
{
v18 = (_DWORD *)qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v22 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v22);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v18 = (_DWORD *)qword_14090BFD0;
}
v18[268] = 0;
v19 = (float)((float)rand() / 32767.0) * 1000.0;
v18[267] = (int)v19;
v18[266] = (int)v19;
LABEL_31:
v20 = *(_QWORD *)(a1 + 1488);
if ( v20 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v20 + 8LL))(v20, SplitIntFromKey, 51);
goto LABEL_35;
}
v21 = *(void (__fastcall ****)(_QWORD, _QWORD, __int64))(a1 + 1488);
if ( v21 )
(**v21)(v21, SplitIntFromKey, 51);
LABEL_35:
sub_14003D310((__int64)a2);
sub_14003D310((__int64)a3);
}