//
// LocalLevelManager::dataLoaded from 0x10025f250 to 0x10025fa98 (2120 bytes)
//
// 1 xrefs:
// > ??> @ 0x100910e90
//
// 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 11:01:38 +0000
//
__int64 __fastcall LocalLevelManager::dataLoaded(__int64 a1, __int64 a2)
{
__int64 ArrayForKey; // x22
int updated; // w21
int v5; // w20
__int64 LevelsInNameGroups; // x21
__int64 v7; // x23
__int64 v8; // x0
__int64 i; // x23
__int64 v10; // x0
__int64 v11; // x25
std::string::size_type size; // x8
__int64 v13; // x26
__int64 v14; // x27
int v15; // w24
int v16; // w8
__int64 v17; // x28
int v18; // w24
__int64 v19; // x0
__int64 v20; // x27
__int64 v21; // x26
__int64 v22; // x27
__int64 v23; // x0
bool v24; // w28
__int64 v25; // x22
__int64 j; // x23
__int64 v27; // x0
char *CString; // x0
__int64 v29; // x24
__int64 v30; // x22
int v31; // w24
__int64 v32; // x0
int v33; // w25
__int64 v34; // x21
__int64 v35; // x23
__int64 v36; // x0
__int64 v37; // x26
__int64 v38; // x0
__int64 v39; // x27
__int64 v40; // x23
int v41; // w20
__int64 v42; // x0
__int64 v43; // x25
std::string::size_type v44; // x8
__int64 v45; // x26
int v46; // w24
__int64 k; // x27
int v48; // w8
__int64 v49; // x28
int v50; // w24
__int64 v51; // x0
__int64 v52; // x27
__int64 v53; // x26
__int64 v54; // x27
__int64 v55; // x0
__int64 v56; // x22
__int64 v57; // x23
__int64 v58; // x0
char *v59; // x0
__int64 v60; // x24
__int64 result; // x0
void *__p[2]; // [xsp+10h] [xbp-D0h] BYREF
__int64 v64; // [xsp+20h] [xbp-C0h]
void *v65[2]; // [xsp+30h] [xbp-B0h] BYREF
__int64 v66; // [xsp+40h] [xbp-A0h]
std::string __dst; // [xsp+50h] [xbp-90h] BYREF
std::string v68; // [xsp+70h] [xbp-70h] BYREF
ArrayForKey = DS_Dictionary::getArrayForKey(a2, "LLM_01", 0);
if ( !*(_QWORD *)(a1 + 360) )
{
LocalLevelManager::setLocalLevels(a1, ArrayForKey);
goto LABEL_71;
}
updated = LocalLevelManager::updateLevelOrder(a1);
v5 = updated + sub_1002E757C(ArrayForKey) + 1;
LevelsInNameGroups = LocalLevelManager::getLevelsInNameGroups(a1);
v7 = 0;
*(_OWORD *)&v68.__r_.__value_.__r.__words[1] = 0u;
v68.__r_.__value_.__r.__words[0] = (std::string::size_type)&v68.__r_.__value_.__l.__size_;
while ( (unsigned int)v7 < (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 360)) )
{
v8 = sub_1002E75A0(*(_QWORD *)(a1 + 360), v7);
if ( (*(char *)(v8 + 1463) & 0x8000000000000000LL) != 0 )
{
if ( !*(_QWORD *)(v8 + 1448) )
goto LABEL_9;
LABEL_8:
sub_1000D8F30((__int64 **)&v68, v8 + 1440, v8 + 1440);
goto LABEL_9;
}
if ( *(_BYTE *)(v8 + 1463) )
goto LABEL_8;
LABEL_9:
v7 = (unsigned int)(v7 + 1);
}
for ( i = 0; (unsigned int)i < (unsigned int)sub_1002E757C(ArrayForKey); i = (unsigned int)(i + 1) )
{
v10 = sub_1002E75A0(ArrayForKey, i);
v11 = v10;
*(_BYTE *)(v10 + 786) = 0;
if ( *(char *)(v10 + 367) < 0 )
sub_1000097D0(&__dst, *(void **)(v10 + 344), *(_QWORD *)(v10 + 352));
else
__dst = *(std::string *)(v10 + 344);
size = HIBYTE(__dst.__r_.__value_.__r.__words[2]);
if ( (__dst.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = __dst.__r_.__value_.__l.__size_;
if ( !size )
std::string::assign(&__dst, "Unknown");
v13 = cocos2d::CCDictionary::objectForKey(LevelsInNameGroups, &__dst);
if ( v13 )
{
v14 = 0;
v15 = 0;
while ( (unsigned int)v14 < (unsigned int)sub_1002E757C(v13) )
{
v16 = *(_DWORD *)(sub_1002E75A0(v13, v14) + 612);
if ( v16 > v15 )
v15 = v16;
v14 = (unsigned int)(v14 + 1);
}
v17 = 0;
v18 = v15 + 1;
do
{
if ( (unsigned int)v17 >= (unsigned int)sub_1002E757C(v13) )
{
v22 = 0;
while ( (unsigned int)v22 < (unsigned int)sub_1002E757C(v13) )
{
v23 = sub_1002E75A0(v13, v22);
if ( *(char *)(v23 + 415) < 0 )
{
sub_1000097D0(v65, *(void **)(v23 + 392), *(_QWORD *)(v23 + 400));
}
else
{
*(_OWORD *)v65 = *(_OWORD *)(v23 + 392);
v66 = *(_QWORD *)(v23 + 408);
}
if ( *(char *)(v11 + 415) < 0 )
{
sub_1000097D0(__p, *(void **)(v11 + 392), *(_QWORD *)(v11 + 400));
}
else
{
*(_OWORD *)__p = *(_OWORD *)(v11 + 392);
v64 = *(_QWORD *)(v11 + 408);
}
v24 = sub_1000045BC(v65, __p);
if ( SHIBYTE(v64) < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v66) < 0 )
operator delete(v65[0]);
v22 = (unsigned int)(v22 + 1);
if ( v24 )
goto LABEL_61;
}
if ( sub_1000D9098((__int64)&v68, (const void **)(v11 + 1440)) )
{
if ( *(char *)(v11 + 1463) < 0 )
{
**(_BYTE **)(v11 + 1440) = 0;
*(_QWORD *)(v11 + 1448) = 0;
}
else
{
*(_BYTE *)(v11 + 1440) = 0;
*(_BYTE *)(v11 + 1463) = 0;
}
}
sub_1002E74E0(v13, v11);
goto LABEL_59;
}
v19 = sub_1002E75A0(v13, v17);
v20 = v19;
v17 = (unsigned int)(v17 + 1);
}
while ( *(_DWORD *)(v19 + 612) != *(_DWORD *)(v11 + 612) );
if ( (*(_BYTE *)(v19 + 786) & 1) == 0 )
{
GJGameLevel::handleStatsConflict(v11, v19);
sub_1002E765C(v13, v20, 1);
sub_1002E74E0(v13, v11);
goto LABEL_61;
}
if ( sub_1000D9098((__int64)&v68, (const void **)(v11 + 1440)) )
{
if ( *(char *)(v11 + 1463) < 0 )
{
**(_BYTE **)(v11 + 1440) = 0;
*(_QWORD *)(v11 + 1448) = 0;
}
else
{
*(_BYTE *)(v11 + 1440) = 0;
*(_BYTE *)(v11 + 1463) = 0;
}
}
sub_1002E74E0(v13, v11);
*(_DWORD *)(v20 + 612) = v18;
LABEL_59:
*(_DWORD *)(v11 + 632) = v5;
}
else
{
v21 = sub_1002E736C(0);
if ( sub_1000D9098((__int64)&v68, (const void **)(v11 + 1440)) )
{
if ( *(char *)(v11 + 1463) < 0 )
{
**(_BYTE **)(v11 + 1440) = 0;
*(_QWORD *)(v11 + 1448) = 0;
}
else
{
*(_BYTE *)(v11 + 1440) = 0;
*(_BYTE *)(v11 + 1463) = 0;
}
}
sub_1002E74E0(v21, v11);
*(_DWORD *)(v11 + 632) = v5;
cocos2d::CCDictionary::setObject(LevelsInNameGroups, v21, &__dst);
}
--v5;
LABEL_61:
if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
}
sub_1002E7674(*(_QWORD *)(a1 + 360));
v25 = cocos2d::CCDictionary::allKeys(LevelsInNameGroups);
for ( j = 0; (unsigned int)j < (unsigned int)sub_1002E757C(v25); j = (unsigned int)(j + 1) )
{
v27 = cocos2d::CCArray::stringAtIndex(v25, j);
CString = (char *)cocos2d::CCString::getCString(v27);
sub_100009900(&__dst, CString);
v29 = cocos2d::CCDictionary::objectForKey(LevelsInNameGroups, &__dst);
if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
sub_1002E7570(*(_QWORD *)(a1 + 360), v29);
}
LocalLevelManager::reorderLevels(a1);
sub_1000D8D9C((__int64)&v68, (char *)v68.__r_.__value_.__l.__size_);
LABEL_71:
v30 = DS_Dictionary::getArrayForKey(a2, "LLM_03", 0);
if ( *(_QWORD *)(a1 + 368) )
{
v31 = LocalLevelManager::updateListOrder(a1);
v32 = sub_1002E757C(v30);
v33 = v32;
v34 = cocos2d::CCDictionary::create(v32);
if ( (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 368)) )
{
v35 = 0;
do
{
v36 = sub_1002E75A0(*(_QWORD *)(a1 + 368), v35);
v37 = v36;
if ( *(char *)(v36 + 455) < 0 )
sub_1000097D0(&v68, *(void **)(v36 + 432), *(_QWORD *)(v36 + 440));
else
v68 = *(std::string *)(v36 + 432);
v38 = cocos2d::CCDictionary::objectForKey(v34, &v68);
v39 = v38;
if ( SHIBYTE(v68.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(v68.__r_.__value_.__l.__data_);
if ( !v39 )
{
LABEL_81:
v39 = sub_1002E736C(v38);
if ( *(char *)(v37 + 455) < 0 )
sub_1000097D0(&v68, *(void **)(v37 + 432), *(_QWORD *)(v37 + 440));
else
v68 = *(std::string *)(v37 + 432);
cocos2d::CCDictionary::setObject(v34, v39, &v68);
if ( SHIBYTE(v68.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v68.__r_.__value_.__l.__data_);
}
}
else if ( !v38 )
{
goto LABEL_81;
}
sub_1002E74E0(v39, v37);
v35 = (unsigned int)(v35 + 1);
}
while ( (unsigned int)v35 < (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 368)) );
}
if ( (unsigned int)sub_1002E757C(v30) )
{
v40 = 0;
v41 = v31 + v33 + 1;
do
{
v42 = sub_1002E75A0(v30, v40);
v43 = v42;
*(_BYTE *)(v42 + 399) = 0;
if ( *(char *)(v42 + 455) < 0 )
sub_1000097D0(&v68, *(void **)(v42 + 432), *(_QWORD *)(v42 + 440));
else
v68 = *(std::string *)(v42 + 432);
v44 = HIBYTE(v68.__r_.__value_.__r.__words[2]);
if ( (v68.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v44 = v68.__r_.__value_.__l.__size_;
if ( !v44 )
std::string::assign(&v68, "Unknown");
v45 = cocos2d::CCDictionary::objectForKey(v34, &v68);
if ( v45 )
{
v46 = 0;
for ( k = 0; (unsigned int)k < (unsigned int)sub_1002E757C(v45); k = (unsigned int)(k + 1) )
{
v48 = *(_DWORD *)(sub_1002E75A0(v45, k) + 372);
if ( v48 > v46 )
v46 = v48;
}
v49 = 0;
v50 = v46 + 1;
do
{
if ( (unsigned int)v49 >= (unsigned int)sub_1002E757C(v45) )
{
v54 = 0;
while ( (unsigned int)v54 < (unsigned int)sub_1002E757C(v45) )
{
v55 = sub_1002E75A0(v45, v54);
v54 = (unsigned int)(v54 + 1);
if ( GJLevelList::hasMatchingLevels(v43, v55) )
goto LABEL_117;
}
sub_1002E74E0(v45, v43);
LABEL_114:
*(_DWORD *)(v43 + 376) = v41;
goto LABEL_115;
}
v51 = sub_1002E75A0(v45, v49);
v52 = v51;
v49 = (unsigned int)(v49 + 1);
}
while ( *(_DWORD *)(v51 + 372) != *(_DWORD *)(v43 + 372) );
if ( (*(_BYTE *)(v51 + 399) & 1) != 0 )
{
if ( GJLevelList::hasMatchingLevels(v43, v51) )
goto LABEL_117;
sub_1002E74E0(v45, v43);
*(_DWORD *)(v52 + 372) = v50;
goto LABEL_114;
}
sub_1000D6360(v43, v51);
sub_1002E765C(v45, v52, 1);
sub_1002E74E0(v45, v43);
}
else
{
v53 = sub_1002E736C(0);
sub_1002E74E0(v53, v43);
*(_DWORD *)(v43 + 376) = v41;
cocos2d::CCDictionary::setObject(v34, v53, &v68);
LABEL_115:
--v41;
}
LABEL_117:
if ( SHIBYTE(v68.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v68.__r_.__value_.__l.__data_);
v40 = (unsigned int)(v40 + 1);
}
while ( (unsigned int)v40 < (unsigned int)sub_1002E757C(v30) );
}
sub_1002E7674(*(_QWORD *)(a1 + 368));
v56 = cocos2d::CCDictionary::allKeys(v34);
if ( (unsigned int)sub_1002E757C(v56) )
{
v57 = 0;
do
{
v58 = cocos2d::CCArray::stringAtIndex(v56, v57);
v59 = (char *)cocos2d::CCString::getCString(v58);
sub_100009900(&v68, v59);
v60 = cocos2d::CCDictionary::objectForKey(v34, &v68);
if ( SHIBYTE(v68.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v68.__r_.__value_.__l.__data_);
sub_1002E7570(*(_QWORD *)(a1 + 368), v60);
v57 = (unsigned int)(v57 + 1);
}
while ( (unsigned int)v57 < (unsigned int)sub_1002E757C(v56) );
}
LocalLevelManager::reorderLists(a1);
}
else
{
LocalLevelManager::setLocalLists(a1, v30);
}
result = DS_Dictionary::getIntegerForKey(a2, "LLM_02");
if ( (int)result <= 18 )
return LocalLevelManager::updateLevelRevision(a1);
return result;
}