//
// SecretLayer3::onClick from 0x1003abddc to 0x1003ac688 (2220 bytes)
//
// 3 xrefs:
// > SecretLayer3::init @ 0x1003ab474
// > SecretLayer3::init @ 0x1003ab518
// > SecretLayer3::init @ 0x1003ab5bc
//
// 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:03:52 +0000
//
void __fastcall SecretLayer3::onClick(_BYTE *a1, __int64 a2)
{
int v4; // w22
_QWORD *v5; // x0
__int64 v6; // x20
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
__int64 isItemUnlocked; // x0
unsigned __int32 v11; // w22
const char *v12; // x20
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x0
__int64 v16; // x20
__int64 v17; // x20
__int64 v18; // x20
__int64 v19; // x0
void *v20; // x20
int8x8_t v21; // d2
_BYTE *v22; // x20
__int64 v23; // x20
__int64 v24; // x0
__int64 v25; // x0
__int64 UGV; // x0
__int64 v27; // x0
__int64 v28; // x0
__int64 v29; // x0
__int64 (__fastcall *v30)(); // x21
float v31; // s0
float *v32; // x22
char v33; // w0
__int64 v34; // x1
__int64 v35; // x2
__int64 v36; // x3
__int64 v37; // x4
__int64 v38; // x5
__int64 v39; // x6
__int64 v40; // x7
__int64 v41; // x0
void *v42; // x0
__int64 v43; // x0
__int64 v44; // x0
void *v45; // x20
float32x2_t v46; // [xsp+18h] [xbp-298h] BYREF
float v47; // [xsp+20h] [xbp-290h]
int v48; // [xsp+24h] [xbp-28Ch]
__int64 v49; // [xsp+28h] [xbp-288h] BYREF
void *v50[2]; // [xsp+30h] [xbp-280h] BYREF
char v51; // [xsp+47h] [xbp-269h]
void *__p[2]; // [xsp+48h] [xbp-268h] BYREF
char v53; // [xsp+5Fh] [xbp-251h]
void *v54[2]; // [xsp+60h] [xbp-250h] BYREF
char v55; // [xsp+77h] [xbp-239h]
void *v56[2]; // [xsp+78h] [xbp-238h] BYREF
char v57; // [xsp+8Fh] [xbp-221h]
void *v58[2]; // [xsp+90h] [xbp-220h] BYREF
char v59; // [xsp+A7h] [xbp-209h]
void *v60[2]; // [xsp+A8h] [xbp-208h] BYREF
char v61; // [xsp+BFh] [xbp-1F1h]
void *v62[2]; // [xsp+C0h] [xbp-1F0h] BYREF
char v63; // [xsp+D7h] [xbp-1D9h]
void *v64[2]; // [xsp+D8h] [xbp-1D8h] BYREF
char v65; // [xsp+EFh] [xbp-1C1h]
void *v66[2]; // [xsp+F0h] [xbp-1C0h] BYREF
char v67; // [xsp+107h] [xbp-1A9h]
void *v68[2]; // [xsp+108h] [xbp-1A8h] BYREF
char v69; // [xsp+11Fh] [xbp-191h]
void *v70[2]; // [xsp+120h] [xbp-190h] BYREF
char v71; // [xsp+137h] [xbp-179h]
void *v72[2]; // [xsp+138h] [xbp-178h] BYREF
char v73; // [xsp+14Fh] [xbp-161h]
void *v74[2]; // [xsp+150h] [xbp-160h] BYREF
char v75; // [xsp+167h] [xbp-149h]
_QWORD v76[2]; // [xsp+168h] [xbp-148h] BYREF
char v77; // [xsp+17Fh] [xbp-131h]
void *v78[2]; // [xsp+180h] [xbp-130h] BYREF
char v79; // [xsp+197h] [xbp-119h]
void *v80[2]; // [xsp+198h] [xbp-118h] BYREF
char v81; // [xsp+1AFh] [xbp-101h]
void *v82[2]; // [xsp+1B0h] [xbp-100h] BYREF
char v83; // [xsp+1C7h] [xbp-E9h]
void *v84[2]; // [xsp+1C8h] [xbp-E8h] BYREF
char v85; // [xsp+1DFh] [xbp-D1h]
void *v86[2]; // [xsp+1E0h] [xbp-D0h] BYREF
char v87; // [xsp+1F7h] [xbp-B9h]
_QWORD v88[2]; // [xsp+1F8h] [xbp-B8h] BYREF
char v89; // [xsp+20Fh] [xbp-A1h]
void *v90[2]; // [xsp+210h] [xbp-A0h] BYREF
char v91; // [xsp+227h] [xbp-89h]
void *v92[2]; // [xsp+228h] [xbp-88h] BYREF
char v93; // [xsp+23Fh] [xbp-71h]
void *v94[2]; // [xsp+240h] [xbp-70h] BYREF
char v95; // [xsp+257h] [xbp-59h]
void *v96[2]; // [xsp+258h] [xbp-58h] BYREF
char v97; // [xsp+26Fh] [xbp-41h]
if ( (a1[424] & 1) != 0 )
return;
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v5 = sub_1002E736C();
v6 = (__int64)v5;
if ( v4 == 3 )
{
v14 = GameStatsManager::sharedState(v5);
isItemUnlocked = GameStatsManager::isItemUnlocked(v14, 12, 3);
if ( (isItemUnlocked & 1) != 0 )
{
v11 = 51455;
v12 = "16";
goto LABEL_11;
}
sub_100009900(v72, "...");
sub_100009900(v70, "The third key is hidden well.\nEven I have not been able to find it.");
DialogObject::create((__int64)v72, (__int64)v70, 15, 0, 0xFFFFFF, 0.9);
sub_1002E74E0(v6);
if ( v71 < 0 )
operator delete(v70[0]);
if ( v73 < 0 )
operator delete(v72[0]);
sub_100009900(v68, "...");
sub_100009900(
v66,
"I suspect it is guarded by The Gatekeeper.\nRubRub's trusted pet....");
DialogObject::create((__int64)v68, (__int64)v66, 15, 0, 0xFFFFFF, 0.8);
sub_1002E74E0(v6);
if ( v67 < 0 )
operator delete(v66[0]);
if ( v69 < 0 )
operator delete(v68[0]);
sub_100009900(v64, "...");
sub_100009900(v62, "To claim the key you must fool him.\nI do not know how.");
DialogObject::create((__int64)v64, (__int64)v62, 15, 0, 0xFFFFFF, 0.9);
sub_1002E74E0(v6);
if ( v63 < 0 )
operator delete(v62[0]);
if ( v65 < 0 )
operator delete(v64[0]);
sub_100009900(v60, "...");
sub_100009900(v58, "You will find The Gatekeeper at the end of the world.");
DialogObject::create((__int64)v60, (__int64)v58, 15, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v6);
if ( v59 < 0 )
operator delete(v58[0]);
if ( v61 < 0 )
operator delete(v60[0]);
sub_100009900(v56, "...");
sub_100009900(v54, "Touch the ground beneath the promise, and the door will be revealed.");
DialogObject::create((__int64)v56, (__int64)v54, 15, 0, 0xFFFFFF, 0.8);
v43 = sub_1002E74E0(v6);
if ( v55 < 0 )
operator delete(v54[0]);
if ( v57 < 0 )
operator delete(v56[0]);
v44 = GameManager::sharedState(v43);
GameManager::setUGV(v44, "6", 1);
goto LABEL_65;
}
if ( v4 == 2 )
{
v13 = GameStatsManager::sharedState(v5);
isItemUnlocked = GameStatsManager::isItemUnlocked(v13, 12, 2);
if ( (isItemUnlocked & 1) != 0 )
{
v11 = 3342130;
v12 = "15";
goto LABEL_11;
}
sub_100009900(v84, "...");
sub_100009900(v82, "They tried to hide it from me,\nbut I have my spies.");
DialogObject::create((__int64)v84, (__int64)v82, 15, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v6);
if ( v83 < 0 )
operator delete(v82[0]);
if ( v85 < 0 )
operator delete(v84[0]);
sub_100009900(v80, "...");
sub_100009900(v78, "The second key is locked away in a secret chest.");
DialogObject::create((__int64)v80, (__int64)v78, 15, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v6);
if ( v79 < 0 )
operator delete(v78[0]);
if ( v81 < 0 )
operator delete(v80[0]);
sub_100009900(v76, "...");
sub_100009900(v74, "Unlock 50 secret chests to claim the key.");
DialogObject::create((__int64)v76, (__int64)v74, 15, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v6);
if ( v75 < 0 )
operator delete(v74[0]);
if ( v77 < 0 )
{
v42 = (void *)v76[0];
LABEL_64:
operator delete(v42);
}
LABEL_65:
v45 = DialogLayer::createWithObjects(v6, 4);
(*(void (__fastcall **)(_BYTE *, void *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v45, 100);
DialogLayer::updateChatPlacement((__int64)v45, 0);
sub_1000909DC((__int64)v45, 1);
return;
}
if ( v4 != 1 )
goto LABEL_65;
v7 = GameManager::sharedState(v5);
v8 = GameManager::setUGV(v7, "19", 1);
v9 = GameStatsManager::sharedState(v8);
isItemUnlocked = GameStatsManager::isItemUnlocked(v9, 12, 1);
if ( (isItemUnlocked & 1) == 0 )
{
sub_100009900(v96, "...");
sub_100009900(v94, "The first key is hidden in a secret gauntlet...");
DialogObject::create((__int64)v96, (__int64)v94, 15, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v6);
if ( v95 < 0 )
operator delete(v94[0]);
if ( v97 < 0 )
operator delete(v96[0]);
sub_100009900(v92, "...");
sub_100009900(v90, "Only a chosen few can find it, but I will grant you this gift...");
DialogObject::create((__int64)v92, (__int64)v90, 15, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v6);
if ( v91 < 0 )
operator delete(v90[0]);
if ( v93 < 0 )
operator delete(v92[0]);
sub_100009900(v88, "...");
sub_100009900(v86, "Complete the Chaos Gauntlet, and the key will be yours...");
DialogObject::create((__int64)v88, (__int64)v86, 15, 0, 0xFFFFFF, 1.0);
sub_1002E74E0(v6);
if ( v87 < 0 )
operator delete(v86[0]);
if ( (v89 & 0x80000000) == 0 )
goto LABEL_65;
v42 = (void *)v88[0];
goto LABEL_64;
}
v11 = 16737280;
v12 = "14";
LABEL_11:
v15 = GameManager::sharedState(isItemUnlocked);
GameManager::setUGV(v15, v12, 1);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 1056LL))(a2, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 344LL))(a2, 0);
v16 = FMODAudioEngine::sharedEngine();
sub_100009900(__p, "chestClick.ogg");
FMODAudioEngine::playEffect_1(v16, (__int64)__p);
if ( v53 < 0 )
operator delete(__p[0]);
v17 = FMODAudioEngine::sharedEngine();
sub_100009900(v50, "chestOpen01.ogg");
FMODAudioEngine::playEffect_1(v17, (__int64)v50);
if ( v51 < 0 )
operator delete(v50[0]);
v18 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 512LL))(a2);
v19 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
cocos2d::CCNode::convertToWorldSpace(v18, v19, &v49);
v20 = cocos2d::CCParticleSystemQuad::create("coinPickupEffect.plist", 0);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v20 + 1584LL))(v20, 1);
v21.i32[0] = v11;
v21.i32[1] = v11 >> 8;
v46 = vdiv_f32(vcvt_f32_u32((uint32x2_t)vand_s8(v21, (int8x8_t)0xFF000000FFLL)), (float32x2_t)vdup_n_s32(0x437F0000u));
v47 = (float)HIWORD(v11) / 255.0;
v48 = 1065353216;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v20 + 1360LL))(v20, &v46);
(*(void (__fastcall **)(_BYTE *, void *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v20, 1);
(*(void (__fastcall **)(void *, __int64 *))(*(_QWORD *)v20 + 184LL))(v20, &v49);
v22 = CCCircleWave::create(0, 0, 25.0, 5.0, 0.3);
v22[342] = BYTE2(v11);
*((_WORD *)v22 + 170) = v11;
(*(void (__fastcall **)(_BYTE *, __int64 *))(*(_QWORD *)v22 + 184LL))(v22, &v49);
(*(void (__fastcall **)(_BYTE *, _BYTE *, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v22, 0);
v23 = CCCircleWave::create_1(0);
*(_BYTE *)(v23 + 342) = BYTE2(v11);
*(_WORD *)(v23 + 340) = v11;
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v23 + 184LL))(v23, &v49);
v24 = (*(__int64 (__fastcall **)(_BYTE *, __int64, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, v23, 0);
*(_QWORD *)(v23 + 352) = 0x400000001LL;
v25 = GameManager::sharedState(v24);
UGV = GameManager::getUGV(v25, "14");
LODWORD(v23) = UGV;
v27 = GameManager::sharedState(UGV);
v28 = GameManager::getUGV(v27, "15");
LODWORD(v23) = v28 + v23;
v29 = GameManager::sharedState(v28);
if ( (_DWORD)v23 + (unsigned int)GameManager::getUGV(v29, "16") == 3 )
{
v30 = sub_1003AD2F4;
v31 = 1.0;
}
else
{
a1[424] = 1;
v30 = sub_1003AD35C;
v31 = 0.5;
}
v32 = cocos2d::CCDelayTime::create(v31);
v33 = (unsigned __int8)cocos2d::CCCallFunc::create((__int64)a1, (__int64)v30, 0);
v41 = sub_10021D420((__int64)v32, v34, v35, v36, v37, v38, v39, v40, v33);
cocos2d::CCNode::runAction((__int64)a1, v41);
}