//
// LocalLevelManager::updateLevelRevision from 0x1001c8c6c to 0x1001c8ec0 (596 bytes)
//
// 1 xrefs:
// > LocalLevelManager::dataLoaded @ 0x1001c9a3c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall LocalLevelManager::updateLevelRevision(LocalLevelManager *a1)
{
int v2; // w25
__int64 v3; // x20
__int64 v4; // x0
std::string *v5; // x23
_BOOL4 v6; // w24
cocos2d::CCString *v7; // x0
char *CString; // x0
cocos2d::CCDictionary *v9; // x20
__int64 v10; // x21
__int64 v11; // x23
int i; // w27
void **v13; // x8
cocos2d::CCString *v14; // x0
char *v15; // x24
__int64 v16; // x25
cocos2d::CCNode *v17; // x25
std::string __str; // [xsp+10h] [xbp-A0h] BYREF
void *__p[2]; // [xsp+28h] [xbp-88h] BYREF
char v20; // [xsp+3Fh] [xbp-71h]
void *__dst[2]; // [xsp+40h] [xbp-70h] BYREF
__int64 v22; // [xsp+50h] [xbp-60h]
if ( (unsigned int)sub_10024A36C(a1->m_localLevels) )
{
v2 = 0;
v3 = 0;
do
{
v4 = sub_10024A388(a1->m_localLevels, v3);
v5 = (std::string *)(v4 + 344);
if ( *(char *)(v4 + 367) < 0 )
{
sub_1000097D0(__dst, *(void **)(v4 + 344), *(_QWORD *)(v4 + 352));
}
else
{
*(_OWORD *)__dst = *(_OWORD *)&v5->__r_.__value_.__l.__data_;
v22 = *(_QWORD *)(v4 + 360);
}
sub_100009900(__p, "");
v6 = sub_1000045BC(__dst, __p);
if ( v20 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v22) < 0 )
{
operator delete(__dst[0]);
if ( v6 )
{
LABEL_12:
v7 = (cocos2d::CCString *)sub_100268F4C("Unnamed %i", v2);
CString = (char *)cocos2d::CCString::getCString(v7);
sub_100009900(&__str, CString);
std::string::operator=(v5, &__str);
++v2;
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}
}
else if ( v6 )
{
goto LABEL_12;
}
v3 = (unsigned int)(v3 + 1);
}
while ( (unsigned int)v3 < (unsigned int)sub_10024A36C(a1->m_localLevels) );
}
v9 = cocos2d::CCDictionary::create();
if ( (unsigned int)sub_10024A36C(a1->m_localLevels) )
{
v10 = 0;
do
{
v11 = sub_10024A388(a1->m_localLevels, v10);
for ( i = 0; ; ++i )
{
if ( *(char *)(v11 + 367) < 0 )
{
sub_1000097D0(__dst, *(void **)(v11 + 344), *(_QWORD *)(v11 + 352));
}
else
{
*(_OWORD *)__dst = *(_OWORD *)(v11 + 344);
v22 = *(_QWORD *)(v11 + 360);
}
if ( v22 >= 0 )
v13 = __dst;
else
v13 = (void **)__dst[0];
v14 = (cocos2d::CCString *)sub_100268F4C("rev_%i_%s", i, (const char *)v13);
v15 = (char *)cocos2d::CCString::getCString(v14);
if ( SHIBYTE(v22) < 0 )
operator delete(__dst[0]);
sub_100009900(__dst, v15);
v16 = cocos2d::CCDictionary::objectForKey_1(v9, __dst);
if ( SHIBYTE(v22) < 0 )
operator delete(__dst[0]);
if ( !v16 )
break;
}
v17 = cocos2d::CCNode::create();
sub_100009900(__dst, v15);
cocos2d::CCDictionary::setObject_1(v9, v17, __dst);
if ( SHIBYTE(v22) < 0 )
operator delete(__dst[0]);
*(_DWORD *)(v11 + 604) = i;
v10 = (unsigned int)(v10 + 1);
}
while ( (unsigned int)v10 < (unsigned int)sub_10024A36C(a1->m_localLevels) );
}
}