//
// CreatorLayer::onSavedLevels from 0x140137000 to 0x14013754f (1359 bytes)
//
// 2 xrefs:
// > CreatorLayer::init @ 0x1401359cd
// > ??> @ 0x140917120
//
// 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:27:05 +0000
//
// Hidden C++ exception states: #wind=9
bool CreatorLayer::onSavedLevels()
{
__int64 v0; // rbx
unsigned int v1; // edi
__int64 v2; // rsi
__int64 v3; // rbx
cocos2d::CCString *v4; // rax
int v5; // edi
void *v6; // r8
int v7; // ebx
__int64 v8; // rdi
cocos2d::CCString *v9; // rax
int v10; // edi
void *v11; // r8
__int64 v12; // rdi
cocos2d::CCString *v13; // rax
int v14; // edi
void *v15; // r8
__int64 v16; // rdi
cocos2d::CCString *v17; // rax
int v18; // edi
void *v19; // r8
struct cocos2d::CCScene *v20; // rbx
__int64 v21; // rcx
__int64 v22; // rax
struct cocos2d::CCScene *v23; // rbx
__int64 v24; // rcx
cocos2d::CCDirector *v25; // rax
void *v27; // [rsp+30h] [rbp-19h]
void *v28; // [rsp+30h] [rbp-19h]
void *v29; // [rsp+30h] [rbp-19h]
void *v30; // [rsp+30h] [rbp-19h]
void *v31; // [rsp+30h] [rbp-19h]
void *Src[2]; // [rsp+38h] [rbp-11h] BYREF
__int64 v33; // [rsp+48h] [rbp-1h]
unsigned __int64 v34; // [rsp+50h] [rbp+7h]
void *Block[2]; // [rsp+58h] [rbp+Fh] BYREF
__int64 v36; // [rsp+68h] [rbp+1Fh]
unsigned __int64 v37; // [rsp+70h] [rbp+27h]
void *v38[2]; // [rsp+78h] [rbp+2Fh] BYREF
__int64 v39; // [rsp+88h] [rbp+3Fh]
unsigned __int64 v40; // [rsp+90h] [rbp+47h]
v0 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v27 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v27);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v0 = qword_14090BFD0;
}
v1 = *(_DWORD *)(v0 + 1300);
if ( v1 != 103
|| (unsigned __int8)GameManager::getGameVariable(v0, "0218")
|| (unsigned __int8)GameManager::getGameVariable(v0, "0219")
|| (unsigned __int8)GameManager::getGameVariable(v0, "0077") )
{
v1 = 99;
}
v2 = GJSearchObject::create_2(v1);
v3 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v28 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v28);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v3 = qword_14090BFD0;
}
*(_OWORD *)Block = 0;
v36 = 3;
v37 = 15;
LODWORD(Block[0]) = 6256231;
sub_140044D80(Block, "0092", 4u);
v4 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v3 + 432), Block);
v5 = cocos2d::CCString::intValue(v4);
if ( v37 > 0xF )
{
v6 = Block[0];
if ( v37 + 1 >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
v7 = 0;
v36 = 0;
v37 = 15;
LOBYTE(Block[0]) = 0;
if ( v5 > 999 )
goto LABEL_24;
v8 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v29 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v29);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v8 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v33 = 3;
v34 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0092", 4u);
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v8 + 432), Src);
v10 = cocos2d::CCString::intValue(v9);
if ( v34 > 0xF )
{
v11 = Src[0];
if ( v34 + 1 >= 0x1000 )
{
v11 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v11 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v11);
}
v33 = 0;
v34 = 15;
LOBYTE(Src[0]) = 0;
if ( v10 >= 0 )
{
LABEL_24:
v12 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v30 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v30);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v12 = qword_14090BFD0;
}
*(_OWORD *)v38 = 0;
v39 = 3;
v40 = 15;
LODWORD(v38[0]) = 6256231;
sub_140044D80(v38, "0092", 4u);
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v12 + 432), v38);
v14 = cocos2d::CCString::intValue(v13);
if ( v40 > 0xF )
{
v15 = v38[0];
if ( v40 + 1 >= 0x1000 )
{
v15 = *((void **)v38[0] - 1);
if ( (unsigned __int64)((char *)v38[0] - (char *)v15 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v15);
}
v39 = 0;
v40 = 15;
LOBYTE(v38[0]) = 0;
if ( v14 <= 999 )
{
v16 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v31 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v31);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v16 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v33 = 3;
v34 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0092", 4u);
v17 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v16 + 432), Src);
v18 = cocos2d::CCString::intValue(v17);
if ( v34 > 0xF )
{
v19 = Src[0];
if ( v34 + 1 >= 0x1000 )
{
v19 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v19 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v19);
}
v7 = v18;
}
else
{
v7 = 999;
}
}
*(_DWORD *)(v2 + 452) = v7;
v20 = (struct cocos2d::CCScene *)cocos2d::CCScene::create();
*(_QWORD *)(cocos2d::CCApplication::sharedApplication(v21) + 232) = v20;
v22 = LevelBrowserLayer::create(v2);
(*(void (__fastcall **)(struct cocos2d::CCScene *, __int64))(*(_QWORD *)v20 + 464LL))(v20, v22);
v23 = cocos2d::CCTransitionFade::create(0.5, v20);
v25 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v24);
return cocos2d::CCDirector::pushScene(v25, v23);
}