//
// LocalLevelManager::updateLevelRevision from 0x9118d0 to 0x911c58 (904 bytes)
//
// 2 xrefs:
// > LocalLevelManager::dataLoaded @ 0x91525c
// > ??> @ 0x46630
//
// This function is hookable on this platform (idp: arm, 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 12:57:16 +0000
//
__int64 __fastcall LocalLevelManager::updateLevelRevision(cocos2d::CCArray **this)
{
unsigned int v2; // w21
unsigned int v3; // w23
cocos2d::CCDictionary *v4; // x0
__int64 v5; // x22
char v6; // w0
__int64 v7; // x0
__int64 v8; // x1
_BOOL4 v9; // w28
__int64 v10; // x22
unsigned int v11; // w24
unsigned int v12; // w21
__int64 v13; // x0
__int64 v14; // x20
__int64 v15; // x26
size_t v16; // x1
char *v17; // x2
cocos2d::CCString *v18; // x0
char *v19; // x28
size_t v20; // x0
__int64 v21; // x27
cocos2d::CCNode *v22; // x0
const char *v23; // x1
cocos2d::CCString *v24; // x0
const char *CString; // x0
size_t v26; // x0
char *v27; // x1
size_t v28; // x2
__int64 v29; // x0
cocos2d::CCObject *v30; // x20
size_t v31; // x0
char *v33; // [xsp+68h] [xbp+68h]
__int64 v34; // [xsp+78h] [xbp+78h] BYREF
__int64 v35; // [xsp+80h] [xbp+80h]
void *v36; // [xsp+88h] [xbp+88h]
__int64 v37; // [xsp+90h] [xbp+90h] BYREF
size_t v38; // [xsp+98h] [xbp+98h]
void *v39; // [xsp+A0h] [xbp+A0h]
v2 = 0;
v3 = 0;
v4 = (cocos2d::CCDictionary *)cocos2d::CCArray::count(*(this + 45));
if ( (_DWORD)v4 )
{
do
{
v5 = cocos2d::CCArray::objectAtIndex(*(this + 45), v2) + 344;
v6 = *(_BYTE *)v5;
v34 = 0;
v35 = 0;
v36 = nullptr;
if ( (v6 & 1) != 0 )
{
std::string::__init(&v34, *(void **)(v5 + 16), *(_QWORD *)(v5 + 8));
}
else
{
v7 = *(_QWORD *)v5;
v8 = *(_QWORD *)(v5 + 8);
v36 = *(void **)(v5 + 16);
v34 = v7;
v35 = v8;
}
v37 = 0;
v38 = 0;
v39 = nullptr;
std::string::__init(&v37, &byte_11B8890, 0);
v9 = sub_91069C((__int64)&v34, (__int64)&v37);
if ( (v37 & 1) != 0 )
operator delete(v39);
if ( (v34 & 1) != 0 )
{
operator delete(v36);
if ( !v9 )
goto LABEL_8;
}
else if ( !v9 )
{
goto LABEL_8;
}
v23 = (const char *)v3++;
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Unnamed %i", v23);
CString = (const char *)cocos2d::CCString::getCString(v24);
v37 = 0;
v38 = 0;
v39 = nullptr;
v33 = (char *)CString;
v26 = strlen(CString);
std::string::__init(&v37, v33, v26);
if ( (__int64 *)v5 != &v37 )
{
if ( (v37 & 1) != 0 )
{
v27 = (char *)v39;
v28 = v38;
}
else
{
v28 = (unsigned __int8)v37 >> 1;
v27 = (char *)&v37 + 1;
}
std::string::assign((__int64 *)v5, v27, v28);
}
if ( (v37 & 1) != 0 )
{
++v2;
operator delete(v39);
goto LABEL_9;
}
LABEL_8:
++v2;
LABEL_9:
v4 = (cocos2d::CCDictionary *)cocos2d::CCArray::count(*(this + 45));
}
while ( v2 < (unsigned int)v4 );
}
v10 = cocos2d::CCDictionary::create(v4);
v11 = 0;
if ( !(unsigned int)cocos2d::CCArray::count(*(this + 45)) )
return _stack_chk_guard;
do
{
v12 = 0;
v13 = cocos2d::CCArray::objectAtIndex(*(this + 45), v11);
v14 = v13 + 344;
v37 = 0;
v15 = v13;
v38 = 0;
v39 = nullptr;
if ( (*(_BYTE *)(v13 + 344) & 1) == 0 )
{
LABEL_12:
v16 = *(_QWORD *)(v14 + 8);
v37 = *(_QWORD *)v14;
v38 = v16;
v39 = *(void **)(v14 + 16);
goto LABEL_13;
}
while ( 1 )
{
std::string::__init(&v37, *(void **)(v14 + 16), *(_QWORD *)(v14 + 8));
LABEL_13:
v17 = (char *)&v37 + 1;
if ( (v37 & 1) != 0 )
v17 = (char *)v39;
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"rev_%i_%s",
(const char *)v12,
v17);
v19 = (char *)cocos2d::CCString::getCString(v18);
if ( (v37 & 1) != 0 )
operator delete(v39);
v37 = 0;
v38 = 0;
v39 = nullptr;
v20 = strlen(v19);
std::string::__init(&v37, v19, v20);
v21 = cocos2d::CCDictionary::objectForKey(v10, &v37);
v22 = (cocos2d::CCNode *)(unsigned __int8)v37;
if ( (v37 & 1) == 0 )
{
if ( !v21 )
break;
goto LABEL_19;
}
operator delete(v39);
if ( !v21 )
break;
LABEL_19:
v37 = 0;
++v12;
v38 = 0;
v39 = nullptr;
if ( (*(_BYTE *)v14 & 1) == 0 )
goto LABEL_12;
}
v29 = cocos2d::CCNode::create(v22);
v37 = 0;
v30 = (cocos2d::CCObject *)v29;
v38 = 0;
v39 = nullptr;
v31 = strlen(v19);
std::string::__init(&v37, v19, v31);
cocos2d::CCDictionary::setObject(v10, v30);
if ( (v37 & 1) != 0 )
operator delete(v39);
*(_DWORD *)(v15 + 612) = v12;
++v11;
}
while ( v11 < (unsigned int)cocos2d::CCArray::count(*(this + 45)) );
return _stack_chk_guard;
}