//
// GJLevelList::create from 0x1005318d0 to 0x100531ec5 (1525 bytes)
//
// 1 xrefs:
// > GameLevelManager::createAndGetLevelLists @ 0x100531832
//
// 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
//
GJLevelList *__fastcall GJLevelList::create(cocos2d::CCDictionary *a1)
{
double v1; // xmm0_8
GJLevelList *v2; // rbx
cocos2d::CCString *v3; // rax
cocos2d::CCString *v4; // rax
const char *CString; // r15
size_t v6; // rax
std::string::size_type v7; // r12
char *data; // r13
size_t v9; // rbx
cocos2d::CCString *v10; // rax
const char *v11; // r15
size_t v12; // rax
std::string::size_type v13; // r12
char *v14; // r13
size_t v15; // rbx
GJLevelList *v16; // rbx
cocos2d::CCString *v17; // rax
cocos2d::CCString *v18; // rax
cocos2d::CCString *v19; // rax
const char *v20; // r15
size_t v21; // rax
std::string::size_type v22; // r12
char *v23; // r13
size_t v24; // rbx
GJLevelList *v25; // r13
cocos2d::CCString *v26; // rax
cocos2d::CCString *v27; // rax
cocos2d::CCString *v28; // rax
cocos2d::CCString *v29; // rax
cocos2d::CCString *v30; // rax
cocos2d::CCString *v31; // rax
cocos2d::CCString *v32; // rax
cocos2d::CCString *v33; // rax
cocos2d::CCString *v34; // rax
const char *v35; // r14
size_t v36; // rax
size_t v37; // r15
char *v38; // r12
size_t v39; // rbx
std::string __dst; // [rsp+8h] [rbp-A8h] BYREF
std::string __str; // [rsp+20h] [rbp-90h] BYREF
std::string v43; // [rsp+38h] [rbp-78h] BYREF
_QWORD v44[2]; // [rsp+50h] [rbp-60h] BYREF
void *v45; // [rsp+60h] [rbp-50h]
GJLevelList *v46; // [rsp+68h] [rbp-48h]
_WORD v47[8]; // [rsp+70h] [rbp-40h] BYREF
void *__p; // [rsp+80h] [rbp-30h]
v2 = GJLevelList::create_1();
v47[0] = 12546;
LOBYTE(v47[1]) = 0;
v3 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v46 = v2;
v2->m_listID = cocos2d::CCString::intValue(v3);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
v47[0] = 12802;
LOBYTE(v47[1]) = 0;
v4 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
CString = cocos2d::CCString::getCString(v4);
v6 = strlen(CString);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v7 = v6;
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
data = (char *)operator new(v9);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst.__r_.__value_.__r.__words[0] = v9 | 1;
__dst.__r_.__value_.__l.__size_ = v7;
goto LABEL_10;
}
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v6);
data = __dst.__r_.__value_.__s.__data_;
if ( v6 )
LABEL_10:
memmove(data, CString, v7);
data[v7] = 0;
std::string::operator=((std::string *)&v46->m_listName, &__dst);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
v47[0] = 13058;
LOBYTE(v47[1]) = 0;
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v11 = cocos2d::CCString::getCString(v10);
v12 = strlen(v11);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v13 = v12;
if ( v12 >= 0x17 )
{
v15 = 26;
if ( (v12 | 7) != 0x17 )
v15 = (v12 | 7) + 1;
v14 = (char *)operator new(v15);
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)v14;
__str.__r_.__value_.__r.__words[0] = v15 | 1;
__str.__r_.__value_.__l.__size_ = v13;
goto LABEL_22;
}
__str.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v12);
v14 = __str.__r_.__value_.__s.__data_;
if ( v12 )
LABEL_22:
memmove(v14, v11, v13);
v14[v13] = 0;
v16 = v46;
std::string::operator=((std::string *)&v46->m_listDesc, &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
v47[0] = 13570;
LOBYTE(v47[1]) = 0;
v17 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v16->m_listVersion = cocos2d::CCString::intValue(v17);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "49");
v18 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v16->m_accountID = cocos2d::CCString::intValue(v18);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "50");
v19 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v20 = cocos2d::CCString::getCString(v19);
v21 = strlen(v20);
if ( v21 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v22 = v21;
if ( v21 >= 0x17 )
{
v24 = 26;
if ( (v21 | 7) != 0x17 )
v24 = (v21 | 7) + 1;
v23 = (char *)operator new(v24);
v43.__r_.__value_.__r.__words[2] = (std::string::size_type)v23;
v43.__r_.__value_.__r.__words[0] = v24 | 1;
v43.__r_.__value_.__l.__size_ = v22;
goto LABEL_38;
}
v43.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v21);
v23 = v43.__r_.__value_.__s.__data_;
if ( v21 )
LABEL_38:
memmove(v23, v20, v22);
v23[v22] = 0;
v25 = v46;
std::string::operator=((std::string *)&v46->m_creatorName, &v43);
if ( (*(_BYTE *)&v43.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v43.__r_.__value_.__l.__data_);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "10");
v26 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v25->m_downloads = cocos2d::CCString::intValue(v26);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "14");
v27 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v25->m_likes = cocos2d::CCString::intValue(v27);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
v47[0] = 14082;
LOBYTE(v47[1]) = 0;
v28 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v25->m_difficulty = cocos2d::CCString::intValue(v28);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "28");
v29 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v25->m_uploadDate = cocos2d::CCString::intValue(v29);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "29");
v30 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v25->m_updateDate = cocos2d::CCString::intValue(v30);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "55");
v31 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v25->m_diamonds = cocos2d::CCString::intValue(v31);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "56");
v32 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v25->m_levelsToClaim = cocos2d::CCString::intValue(v32);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "19");
v33 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v25->m_featured = cocos2d::CCString::boolValue(v33);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
LOBYTE(v47[0]) = 4;
strcpy((char *)v47 + 1, "51");
v34 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)v47);
v35 = cocos2d::CCString::getCString(v34);
v36 = strlen(v35);
if ( v36 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v37 = v36;
if ( v36 >= 0x17 )
{
v39 = 26;
if ( (v36 | 7) != 0x17 )
v39 = (v36 | 7) + 1;
v38 = (char *)operator new(v39);
v45 = v38;
v44[0] = v39 | 1;
v44[1] = v37;
goto LABEL_66;
}
LOBYTE(v44[0]) = 2 * v36;
v38 = (char *)v44 + 1;
if ( v36 )
LABEL_66:
memmove(v38, v35, v37);
v38[v37] = 0;
GJLevelList::parseListLevels(v25, v44);
if ( (v44[0] & 1) != 0 )
operator delete(v45);
if ( (v47[0] & 1) != 0 )
operator delete(__p);
return v25;
}