//
// GJMapPack::create from 0x81a5a8 to 0x81ad18 (1904 bytes)
//
// 2 xrefs:
// > GameLevelManager::createAndGetMapPacks @ 0x81ae1c
// > ??> @ 0x42b08
//
// 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:54:58 +0000
//
__int64 __fastcall GJMapPack::create(GJMapPack *this, cocos2d::CCDictionary *a2)
{
cocos2d::CCString *v3; // x0
int v4; // w25
cocos2d::CCString *v5; // x0
size_t v6; // x0
cocos2d::CCString *v7; // x0
const char *v8; // x0
size_t v9; // x0
cocos2d::CCString *v10; // x0
int v11; // w26
cocos2d::CCString *v12; // x0
int v13; // w27
cocos2d::CCString *v14; // x0
int v15; // w22
cocos2d::CCString *v16; // x0
size_t v17; // x0
cocos2d::CCString *v18; // x0
size_t v19; // x0
GJMapPack *v20; // x0
__int64 v21; // x20
char v22; // w0
__int64 *v23; // x0
char v24; // w0
__int64 *v25; // x0
char *CString; // [xsp+68h] [xbp+68h]
char *v28; // [xsp+68h] [xbp+68h]
char *v29; // [xsp+68h] [xbp+68h]
char *v30; // [xsp+68h] [xbp+68h]
__int64 v31; // [xsp+70h] [xbp+70h] BYREF
size_t v32; // [xsp+78h] [xbp+78h]
void *v33; // [xsp+80h] [xbp+80h]
__int64 v34; // [xsp+88h] [xbp+88h] BYREF
size_t v35; // [xsp+90h] [xbp+90h]
void *v36; // [xsp+98h] [xbp+98h]
__int64 v37[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v38; // [xsp+B0h] [xbp+B0h]
__int64 v39[2]; // [xsp+B8h] [xbp+B8h] BYREF
void *v40; // [xsp+C8h] [xbp+C8h]
__int64 v41[2]; // [xsp+D0h] [xbp+D0h] BYREF
void *v42; // [xsp+E0h] [xbp+E0h]
__int64 v43[2]; // [xsp+E8h] [xbp+E8h] BYREF
void *v44; // [xsp+F8h] [xbp+F8h]
__int64 v45; // [xsp+100h] [xbp+100h] BYREF
size_t v46; // [xsp+108h] [xbp+108h]
void *v47; // [xsp+110h] [xbp+110h]
__int64 v48[2]; // [xsp+118h] [xbp+118h] BYREF
void *v49; // [xsp+128h] [xbp+128h]
__int64 v50; // [xsp+130h] [xbp+130h] BYREF
size_t v51; // [xsp+138h] [xbp+138h]
void *v52; // [xsp+140h] [xbp+140h]
GJMapPack *v53[2]; // [xsp+148h] [xbp+148h] BYREF
void *v54; // [xsp+158h] [xbp+158h]
__int64 v55; // [xsp+160h] [xbp+160h] BYREF
size_t v56; // [xsp+168h] [xbp+168h]
void *v57; // [xsp+170h] [xbp+170h]
__int64 v58; // [xsp+178h] [xbp+178h] BYREF
size_t v59; // [xsp+180h] [xbp+180h]
void *v60; // [xsp+188h] [xbp+188h]
char v61[8]; // [xsp+190h] [xbp+190h] BYREF
size_t v62; // [xsp+198h] [xbp+198h]
void *v63; // [xsp+1A0h] [xbp+1A0h]
char v64[8]; // [xsp+1A8h] [xbp+1A8h] BYREF
size_t v65; // [xsp+1B0h] [xbp+1B0h]
void *v66; // [xsp+1B8h] [xbp+1B8h]
__int64 v67; // [xsp+1C0h] [xbp+1C0h] BYREF
size_t v68; // [xsp+1C8h] [xbp+1C8h]
void *v69; // [xsp+1D0h] [xbp+1D0h]
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, "1", 1u);
v3 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(this, &v67);
v4 = cocos2d::CCString::intValue(v3);
if ( (v67 & 1) != 0 )
operator delete(v69);
v67 = 0;
v68 = 0;
v69 = nullptr;
std::string::__init(&v67, &byte_120A098, 1u);
v5 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(this, &v67);
CString = (char *)cocos2d::CCString::getCString(v5);
v31 = 0;
v32 = 0;
v33 = nullptr;
v6 = strlen(CString);
std::string::__init(&v31, CString, v6);
if ( (v67 & 1) != 0 )
operator delete(v69);
v37[0] = 0;
v37[1] = 0;
v38 = nullptr;
std::string::__init(v37, "3", 1u);
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(this, v37);
v8 = (const char *)cocos2d::CCString::getCString(v7);
v34 = 0;
v35 = 0;
v36 = nullptr;
v28 = (char *)v8;
v9 = strlen(v8);
std::string::__init(&v34, v28, v9);
if ( (v37[0] & 1) != 0 )
operator delete(v38);
v39[0] = 0;
v39[1] = 0;
v40 = nullptr;
std::string::__init(v39, &byte_11BCA00, 1u);
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(this, v39);
v11 = cocos2d::CCString::intValue(v10);
if ( (v39[0] & 1) != 0 )
operator delete(v40);
v41[0] = 0;
v41[1] = 0;
v42 = nullptr;
std::string::__init(v41, "5", 1u);
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(this, v41);
v13 = cocos2d::CCString::intValue(v12);
if ( (v41[0] & 1) != 0 )
operator delete(v42);
v43[0] = 0;
v43[1] = 0;
v44 = nullptr;
std::string::__init(v43, "6", 1u);
v14 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(this, v43);
v15 = cocos2d::CCString::intValue(v14);
if ( (v43[0] & 1) != 0 )
operator delete(v44);
v48[0] = 0;
v48[1] = 0;
v49 = nullptr;
std::string::__init(v48, "7", 1u);
v16 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(this, v48);
v29 = (char *)cocos2d::CCString::getCString(v16);
v45 = 0;
v46 = 0;
v47 = nullptr;
v17 = strlen(v29);
std::string::__init(&v45, v29, v17);
if ( (v48[0] & 1) != 0 )
operator delete(v49);
v53[0] = nullptr;
v53[1] = nullptr;
v54 = nullptr;
std::string::__init((__int64 *)v53, "8", 1u);
v18 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(this, v53);
v30 = (char *)cocos2d::CCString::getCString(v18);
v50 = 0;
v51 = 0;
v52 = nullptr;
v19 = strlen(v30);
std::string::__init(&v50, v30, v19);
v20 = (GJMapPack *)LOBYTE(v53[0]);
if ( ((__int64)v53[0] & 1) != 0 )
operator delete(v54);
v21 = GJMapPack::create(v20);
v22 = v31;
v55 = 0;
v56 = 0;
*(_DWORD *)(v21 + 328) = v4;
v57 = nullptr;
if ( (v22 & 1) != 0 )
{
std::string::__init(&v55, v33, v32);
}
else
{
v57 = v33;
v55 = v31;
v56 = v32;
}
v23 = (__int64 *)(v21 + 344);
if ( (__int64 *)(v21 + 344) != &v55 )
{
if ( (v55 & 1) != 0 )
std::string::assign(v23, v57, v56);
else
std::string::assign(v23, (char *)&v55 + 1, (unsigned __int8)v55 >> 1);
}
if ( (v55 & 1) != 0 )
operator delete(v57);
v24 = v34;
*(_DWORD *)(v21 + 336) = v11;
*(_DWORD *)(v21 + 340) = v13;
*(_DWORD *)(v21 + 332) = v15;
v58 = 0;
v59 = 0;
v60 = nullptr;
if ( (v24 & 1) != 0 )
{
std::string::__init(&v58, v36, v35);
}
else
{
v60 = v36;
v58 = v34;
v59 = v35;
}
v25 = (__int64 *)(v21 + 368);
if ( (__int64 *)(v21 + 368) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v25, v60, v59);
else
std::string::assign(v25, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
{
operator delete(v60);
*(_QWORD *)v61 = 0;
v62 = 0;
v63 = nullptr;
if ( (v34 & 1) == 0 )
goto LABEL_31;
}
else
{
*(_QWORD *)v61 = 0;
v62 = 0;
v63 = nullptr;
if ( (v34 & 1) == 0 )
{
LABEL_31:
v63 = v36;
*(_QWORD *)v61 = v34;
v62 = v35;
goto LABEL_32;
}
}
std::string::__init((__int64 *)v61, v36, v35);
LABEL_32:
GJMapPack::parsePackLevels(v21, v61);
if ( (v61[0] & 1) != 0 )
operator delete(v63);
*(_QWORD *)v64 = 0;
v65 = 0;
v66 = nullptr;
if ( (v45 & 1) != 0 )
{
std::string::__init((__int64 *)v64, v47, v46);
}
else
{
v66 = v47;
*(_QWORD *)v64 = v45;
v65 = v46;
}
v67 = 0;
v68 = 0;
v69 = nullptr;
if ( (v50 & 1) != 0 )
{
std::string::__init(&v67, v52, v51);
}
else
{
v67 = v50;
v68 = v51;
v69 = v52;
}
GJMapPack::parsePackColors((_BYTE *)v21, v64, (__int64)&v67);
if ( (v67 & 1) != 0 )
operator delete(v69);
if ( (v64[0] & 1) != 0 )
{
operator delete(v66);
if ( (v50 & 1) == 0 )
{
LABEL_42:
if ( (v45 & 1) == 0 )
goto LABEL_43;
LABEL_51:
operator delete(v47);
if ( (v34 & 1) == 0 )
goto LABEL_44;
goto LABEL_52;
}
}
else if ( (v50 & 1) == 0 )
{
goto LABEL_42;
}
operator delete(v52);
if ( (v45 & 1) != 0 )
goto LABEL_51;
LABEL_43:
if ( (v34 & 1) == 0 )
goto LABEL_44;
LABEL_52:
operator delete(v36);
LABEL_44:
if ( (v31 & 1) != 0 )
operator delete(v33);
return v21;
}