//
// GameStatsManager::hasCompletedStarLevel from 0x1402e1ad0 to 0x1402e1bf9 (297 bytes)
//
// 6 xrefs:
// > LevelCell::loadCustomLevelCell @ 0x14014b062
// > GameStatsManager::completedStarLevel @ 0x1402e1fff
// > LevelInfoLayer::updateLabelValues @ 0x140425994
// > LevelPage::updateDynamicPage @ 0x140444470
// > PlayLayer::levelComplete @ 0x140506c5f
// > ??> @ 0x14091de64
//
// 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:29:49 +0000
//
// Hidden C++ exception states: #wind=1
_BOOL8 __fastcall GameStatsManager::hasCompletedStarLevel(__int64 a1, __int64 a2)
{
cocos2d::CCString *v3; // rax
bool v4; // zf
__int64 v5; // rdx
const char *v6; // rcx
const char *CString; // rax
size_t v8; // r8
bool v9; // bl
void *v10; // rcx
void *Block[2]; // [rsp+30h] [rbp-38h] BYREF
__int128 v13; // [rsp+40h] [rbp-28h]
if ( *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996) <= 0 )
{
v4 = *(_BYTE *)(a2 + 721) == 0;
v5 = (unsigned int)(*(_DWORD *)(a2 + 328) - *(_DWORD *)(a2 + 332));
v6 = "gstar_%i";
if ( v4 )
v6 = "star_%i";
v3 = cocos2d::CCString::createWithFormat(v6, v5);
}
else
{
v3 = cocos2d::CCString::createWithFormat("%s%i", "dstar_", *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996));
}
CString = cocos2d::CCString::getCString(v3);
*(_OWORD *)Block = 0;
v13 = 0;
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_14003D230(Block, CString, v8);
v9 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 712), Block) != 0;
if ( *((_QWORD *)&v13 + 1) > 0xFu )
{
v10 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v13 + 1) + 1LL) >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
return v9;
}