//
// MapPackCell::loadFromMapPack from 0x100127ffc to 0x100128aac (2736 bytes)
//
// 2 xrefs:
// > CustomListView::loadCell @ 0x1001260ec
// > CustomListView::reloadAll @ 0x10013273c
//
// 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 10:59:19 +0000
//
void __fastcall MapPackCell::loadFromMapPack(__int64 a1, __int64 a2)
{
__int64 v4; // x0
const char *CString; // x0
__int64 v6; // x20
__int64 v7; // x8
__int64 v8; // x8
void **v9; // x0
__int64 v10; // x20
__int64 v11; // x8
__int16 v12; // w9
__n128 v13; // q0
float *v14; // x0
void *v15; // x20
__int64 v16; // x21
float v17; // s10
float *v18; // x0
__int64 v19; // x0
__int64 v20; // x0
int v21; // w20
int v22; // w22
__int64 v23; // x0
__n128 v24; // q0
__int64 v25; // x21
__int64 v26; // x0
__int64 v27; // x21
float *v28; // x22
__int64 v29; // x8
__int16 v30; // w9
float v31; // s8
__int64 v32; // x0
float v33; // s8
int v34; // w0
float v35; // s1
float v36; // s2
int v37; // w22
int v38; // w0
__int64 v39; // x0
__int64 v40; // x0
__int64 v41; // x22
__int64 v42; // x0
float v43; // s8
__int64 v44; // x8
int v45; // w9
int v46; // w8
unsigned int v47; // w26
__int64 v48; // x22
float v49; // s0
float v50; // s1
__int64 v51; // x0
__int64 v52; // x0
__int64 v53; // x23
float32x2_t *v54; // x24
double v55; // d0
__n128 v56; // q0
__int64 v57; // x22
float v58; // s0
float v59; // s1
__int64 v60; // x0
__int64 v61; // x0
__int64 v62; // x23
float32x2_t *v63; // x24
double v64; // d0
__n128 v65; // q0
__int64 v66; // x20
float32x2_t *v67; // x19
double v68; // d0
float32x2_t v69; // [xsp+14h] [xbp-8Ch] BYREF
__int16 v70; // [xsp+1Ch] [xbp-84h] BYREF
char v71; // [xsp+1Eh] [xbp-82h]
void *__p[2]; // [xsp+20h] [xbp-80h] BYREF
__int64 v73; // [xsp+30h] [xbp-70h]
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 536) + 584LL))(*(_QWORD *)(a1 + 536), 1);
sub_1002E7674(*(_QWORD *)(a1 + 584));
sub_1002E7674(*(_QWORD *)(a1 + 576));
*(_QWORD *)(a1 + 552) = a2;
LODWORD(a2) = *(_DWORD *)(a2 + 332);
v4 = sub_1003065B0("difficulty_%02d_btn_001.png", a2);
CString = (const char *)cocos2d::CCString::getCString(v4);
if ( !(_DWORD)a2 )
CString = "difficulty_auto_btn_001.png";
v6 = cocos2d::CCSprite::createWithSpriteFrameName(CString);
sub_1000262BC((float *)__p, 31.0, *(float *)(a1 + 524) * 0.5);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v6 + 184LL))(v6, __p);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v6 + 160LL))(v6, 1.1);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v6, 2);
v7 = *(_QWORD *)(a1 + 552);
if ( *(char *)(v7 + 367) < 0 )
{
sub_1000097D0(__p, *(void **)(v7 + 344), *(_QWORD *)(v7 + 352));
}
else
{
v8 = v7 + 344;
*(_OWORD *)__p = *(_OWORD *)v8;
v73 = *(_QWORD *)(v8 + 16);
}
if ( v73 >= 0 )
v9 = __p;
else
v9 = (void **)__p[0];
v10 = cocos2d::CCLabelBMFont::create_1(v9, "bigFont.fnt");
if ( SHIBYTE(v73) < 0 )
operator delete(__p[0]);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 536) + 456LL))(*(_QWORD *)(a1 + 536), v10);
v11 = *(_QWORD *)(a1 + 552);
v12 = *(_WORD *)(v11 + 395);
BYTE2(__p[0]) = *(_BYTE *)(v11 + 397);
LOWORD(__p[0]) = v12;
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v10 + 1072LL))(v10, __p);
sub_1000262BC(
(float *)__p,
(float)((float)(*(float *)(a1 + 520) * 0.5) + -14.0) + -2.0,
(float)(*(float *)(a1 + 524) * 0.5) + 30.0);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v10 + 184LL))(v10, __p);
v13.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 328LL))(v10);
if ( v13.n128_f32[0] > 205.0 )
{
v14 = (float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 328LL))(v10, v13.n128_f32[0]);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 160LL))(v10, 205.0 / *v14);
}
if ( (*(float (__fastcall **)(__int64, __n128))(*(_QWORD *)v10 + 168LL))(v10, v13) <= 0.9 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v10 + 168LL))(v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v10 + 160LL))(v10);
v15 = ButtonSprite::create_1(
(__int64)"View",
50,
0,
0,
(__int64)"bigFont.fnt",
(__int64)"GJ_button_01.png",
0.6,
50.0);
*(_QWORD *)(a1 + 560) = CCMenuItemSpriteExtra::create(v15, 0, a1, sub_100136B78, 0);
CCMenuItemSpriteExtra::setSizeMult(1.5);
v16 = sub_100270434(*(_QWORD *)(a1 + 560));
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 536) + 456LL))(*(_QWORD *)(a1 + 536), v16);
v17 = *(float *)(a1 + 520);
v18 = (float *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v15 + 328LL))(v15);
sub_1000262BC((float *)__p, (float)(v17 - (float)(*v18 * 0.5)) + -9.0, *(float *)(a1 + 524) * 0.5);
v19 = (*(__int64 (__fastcall **)(__int64, void **))(*(_QWORD *)v16 + 184LL))(v16, __p);
v20 = GameStatsManager::sharedState(v19);
v21 = sub_1003CF304(v20, *(unsigned int *)(*(_QWORD *)(a1 + 552) + 328LL));
if ( (v21 & 1) == 0 )
{
v22 = sub_1000D4D50(*(_QWORD *)(a1 + 552));
if ( v22 >= (int)sub_1000D4D40(*(_QWORD *)(a1 + 552)) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 560) + 344LL))(*(_QWORD *)(a1 + 560), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 560) + 1056LL))(*(_QWORD *)(a1 + 560), 0);
v23 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_rewardBtn_001.png");
*(_QWORD *)(a1 + 568) = CCMenuItemSpriteExtra::create(v23, 0, a1, MapPackCell::onClaimReward, 0);
v24 = CCMenuItemSpriteExtra::setSizeMult(1.5);
(*(void (__fastcall **)(__int64, _QWORD, __n128))(*(_QWORD *)v16 + 456LL))(v16, *(_QWORD *)(a1 + 568), v24);
v25 = *(_QWORD *)(a1 + 568);
v26 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 560) + 192LL))(*(_QWORD *)(a1 + 560));
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v25 + 184LL))(v25, v26);
}
}
v71 = 0;
v70 = 0;
v27 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v27 + 960LL))(v27, &v70);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v27 + 912LL))(v27, 125);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v27 + 144LL))(v27, 0.8);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v27 + 128LL))(v27, 0.6);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 536) + 464LL))(*(_QWORD *)(a1 + 536), v27, 3);
sub_1000262BC((float *)__p, (float)(*(float *)(a1 + 520) * 0.5) + -14.0, (float)(*(float *)(a1 + 524) * 0.5) + -2.0);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v27 + 184LL))(v27, __p);
v28 = (float *)cocos2d::CCSprite::create("GJ_progressBar_001.png");
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v28 + 128LL))(v28, 0.985);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v28 + 144LL))(v28, 0.83);
v29 = *(_QWORD *)(a1 + 552);
v30 = *(_WORD *)(v29 + 392);
BYTE2(__p[0]) = *(_BYTE *)(v29 + 394);
LOWORD(__p[0]) = v30;
(*(void (__fastcall **)(float *, void **))(*(_QWORD *)v28 + 960LL))(v28, __p);
v31 = v28[108] - (float)(v28[108] * 0.985);
(*(void (__fastcall **)(__int64, float *, __int64))(*(_QWORD *)v27 + 464LL))(v27, v28, 1);
sub_1000262BC((float *)__p, 0.0, 0.5);
(*(void (__fastcall **)(float *, void **))(*(_QWORD *)v28 + 296LL))(v28, __p);
v32 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v27 + 328LL))(v27);
sub_1000262BC((float *)__p, v31 * 0.5, *(float *)(v32 + 4) * 0.5);
(*(void (__fastcall **)(float *, void **))(*(_QWORD *)v28 + 184LL))(v28, __p);
v33 = (float)(int)sub_1000D4D50(*(_QWORD *)(a1 + 552));
v34 = sub_1000D4D40(*(_QWORD *)(a1 + 552));
v35 = v28[108];
if ( v35 <= (float)(v35 * (float)(v33 / (float)v34)) )
v36 = v28[108];
else
v36 = v35 * (float)(v33 / (float)v34);
sub_1000262CC((float *)__p, 0.0, 0.0, v36, v28[109]);
(*(void (__fastcall **)(float *, void **))(*(_QWORD *)v28 + 1136LL))(v28, __p);
v37 = sub_1000D4D50(*(_QWORD *)(a1 + 552));
v38 = sub_1000D4D40(*(_QWORD *)(a1 + 552));
v39 = sub_1003065B0("%i/%i", v37, v38);
v40 = cocos2d::CCString::getCString(v39);
v41 = cocos2d::CCLabelBMFont::create_1(v40, "bigFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 536) + 464LL))(*(_QWORD *)(a1 + 536), v41, 4);
v42 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v27 + 192LL))(v27);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v41 + 184LL))(v41, v42);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v41 + 160LL))(v41, 0.5);
v43 = (float)(*(float *)(a1 + 524) * 0.5) + -30.0;
v44 = *(_QWORD *)(a1 + 552);
v45 = *(_DWORD *)(v44 + 336);
v46 = *(_DWORD *)(v44 + 340);
if ( v46 <= 0 )
v47 = v45 > 0;
else
v47 = (v45 > 0) + 1;
if ( v45 >= 1 )
{
v48 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_starsIcon_001.png");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 536) + 464LL))(*(_QWORD *)(a1 + 536), v48, 2);
if ( v47 > 1 )
{
v49 = (float)(*(float *)(a1 + 520) * 0.5) + -4.0;
v50 = -40.0;
}
else
{
v49 = *(float *)(a1 + 520) * 0.5;
v50 = -4.0;
}
sub_1000262BC((float *)__p, v49 + v50, v43);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v48 + 184LL))(v48, __p);
v51 = sub_1003065B0("%i", *(_DWORD *)(*(_QWORD *)(a1 + 552) + 336LL));
v52 = cocos2d::CCString::getCString(v51);
v53 = cocos2d::CCLabelBMFont::create_1(v52, "bigFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 536) + 464LL))(*(_QWORD *)(a1 + 536), v53, 1);
sub_1000262BC((float *)__p, 1.0, 0.5);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v53 + 296LL))(v53, __p);
v54 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v48 + 192LL))(v48);
sub_1000262BC((float *)&v69, -17.0, 0.0);
*(float32x2_t *)&v55 = sub_100026318(v54, &v69, (float32x2_t *)__p);
(*(void (__fastcall **)(__int64, void **, double))(*(_QWORD *)v53 + 184LL))(v53, __p, v55);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v53 + 160LL))(v53, 0.7);
sub_1002E74E0(*(_QWORD *)(a1 + 584), v48);
v56 = sub_1002E74E0(*(_QWORD *)(a1 + 576), v53);
if ( (v21 & 1) != 0 )
{
LOWORD(__p[0]) = -1;
BYTE2(__p[0]) = 50;
(*(void (__fastcall **)(__int64, void **, __n128))(*(_QWORD *)v53 + 1072LL))(v53, __p, v56);
if ( *(int *)(*(_QWORD *)(a1 + 552) + 340LL) <= 0 )
goto LABEL_40;
}
else if ( *(int *)(*(_QWORD *)(a1 + 552) + 340LL) < 1 )
{
return;
}
LABEL_35:
v57 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_coinsIcon_001.png");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 536) + 464LL))(*(_QWORD *)(a1 + 536), v57, 2);
if ( v47 > 1 )
{
v58 = (float)(*(float *)(a1 + 520) * 0.5) + -4.0;
v59 = 40.0;
}
else
{
v58 = *(float *)(a1 + 520) * 0.5;
v59 = -4.0;
}
sub_1000262BC((float *)__p, v58 + v59, v43);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v57 + 184LL))(v57, __p);
v60 = sub_1003065B0("%i", *(_DWORD *)(*(_QWORD *)(a1 + 552) + 340LL));
v61 = cocos2d::CCString::getCString(v60);
v62 = cocos2d::CCLabelBMFont::create_1(v61, "bigFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 536) + 464LL))(*(_QWORD *)(a1 + 536), v62, 1);
sub_1000262BC((float *)__p, 1.0, 0.5);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v62 + 296LL))(v62, __p);
v63 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v57 + 192LL))(v57);
sub_1000262BC((float *)&v69, -19.0, 0.0);
*(float32x2_t *)&v64 = sub_100026318(v63, &v69, (float32x2_t *)__p);
(*(void (__fastcall **)(__int64, void **, double))(*(_QWORD *)v62 + 184LL))(v62, __p, v64);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v62 + 160LL))(v62, 0.7);
sub_1002E74E0(*(_QWORD *)(a1 + 584), v57);
v65 = sub_1002E74E0(*(_QWORD *)(a1 + 576), v62);
if ( v21 )
{
LOWORD(__p[0]) = -1;
BYTE2(__p[0]) = 50;
(*(void (__fastcall **)(__int64, void **, __n128))(*(_QWORD *)v62 + 1072LL))(v62, __p, v65);
goto LABEL_40;
}
return;
}
if ( v46 > 0 )
goto LABEL_35;
if ( v21 )
{
LABEL_40:
v66 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_completesIcon_001.png");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 536) + 464LL))(*(_QWORD *)(a1 + 536), v66, 5);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v66 + 160LL))(v66, 1.0);
v67 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v27 + 192LL))(v27);
sub_1000262BC((float *)&v69, 86.0, 1.0);
*(float32x2_t *)&v68 = sub_100026318(v67, &v69, (float32x2_t *)__p);
(*(void (__fastcall **)(__int64, void **, double))(*(_QWORD *)v66 + 184LL))(v66, __p, v68);
}
}