//
// sub_1002CFB24 from 0x1002cfb24 to 0x1002cfe78 (852 bytes)
//
// 1 xrefs:
// > GauntletLayer::setupGauntlet @ 0x1002cf3a0
//
// 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:02:37 +0000
//
void __fastcall sub_1002CFB24(__int64 a1)
{
__int64 v2; // x20
float v3; // s8
__int64 v4; // x21
__int64 i; // x22
__int64 v6; // x0
__int64 j; // x21
__int64 v8; // x0
int v9; // w25
void **v10; // x0
__int64 v11; // x24
__int64 v12; // x23
float v13; // s9
__int64 v14; // x0
float *v15; // x0
__n128 v16; // q0
float *v17; // x0
__n128 v18; // q0
float v19; // s8
float *v20; // x0
__int64 v21; // x0
__n128 v22; // q0
__int64 v23; // x20
__int64 v24; // x0
__int64 v25; // x19
__int64 v26; // x0
__int64 SavedLevel_1; // x0
__int64 v28; // [xsp+0h] [xbp-80h] BYREF
__int64 v29; // [xsp+8h] [xbp-78h] BYREF
float v30; // [xsp+10h] [xbp-70h] BYREF
void *__p[2]; // [xsp+18h] [xbp-68h] BYREF
char v32; // [xsp+2Fh] [xbp-51h]
if ( *(_QWORD *)(a1 + 456) )
{
GauntletNode::frameForType(*(_DWORD *)(a1 + 432), __p);
v2 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 456) + 1072LL))(*(_QWORD *)(a1 + 456));
(*(void (__fastcall **)(__int64))(*(_QWORD *)v2 + 576LL))(v2);
sub_1002CFFA4(v2);
(*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)v2 + 336LL))(&v29, v2);
v3 = *(float *)&v29;
(*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)v2 + 336LL))(&v28, v2);
sub_1000262BC(&v30, v3 * 0.5, *((float *)&v28 + 1) * 0.5);
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 488LL))(v2);
for ( i = 0; (unsigned int)i < (unsigned int)sub_1002E757C(v4); i = (unsigned int)(i + 1) )
{
v6 = sub_1002E75A0(v4, i);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v6 + 184LL))(v6, &v30);
}
for ( j = 0; (unsigned int)j < (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 464)); j = (unsigned int)(j + 1) )
{
v8 = sub_1002E75A0(*(_QWORD *)(a1 + 464), j);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 344LL))(v8, 1);
}
v9 = 3;
do
{
if ( v32 >= 0 )
v10 = __p;
else
v10 = (void **)__p[0];
v11 = cocos2d::CCSprite::createWithSpriteFrameName(v10);
v12 = cocos2d::CCSprite::createWithSpriteFrameName("gauntletLock_001.png");
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v11 + 464LL))(v11, v12, 1);
v13 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 328LL))(v11);
v14 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 328LL))(v11);
sub_1000262BC((float *)&v29, v13 * 0.5, *(float *)(v14 + 4) * 0.5);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL))(v12, &v29);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v2 + 464LL))(v2, v11, 2);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v11 + 184LL))(v11, &v30);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v11 + 960LL))(v11, &unk_100763727);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 1080LL))(v11, 0x100000302LL);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v12 + 1080LL))(v12, 0x100000302LL);
v15 = cocos2d::CCFadeOut::create(0.5);
v16 = cocos2d::CCNode::runAction(v11, v15);
(*(void (__fastcall **)(__int64, __int64, __n128))(*(_QWORD *)v12 + 912LL))(v12, 200, v16);
v17 = cocos2d::CCFadeTo::create(0, 0.5);
v18 = cocos2d::CCNode::runAction(v12, v17);
--v9;
}
while ( v9 );
v19 = (*(float (__fastcall **)(__int64, __n128))(*(_QWORD *)v2 + 168LL))(v2, v18);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v2 + 160LL))(v2, 1.6);
v20 = cocos2d::CCScaleTo::create_1(0.5, v19);
v21 = cocos2d::CCEaseBounceOut::create(v20);
v22 = cocos2d::CCNode::runAction(v2, v21);
(*(void (__fastcall **)(_QWORD, __int64, __n128))(**(_QWORD **)(a1 + 456) + 1056LL))(*(_QWORD *)(a1 + 456), 1, v22);
v23 = *(_QWORD *)(a1 + 416);
v24 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 456) + 64LL))(*(_QWORD *)(a1 + 456));
v25 = sub_1002E75A0(v23, v24);
*(_BYTE *)(v25 + 650) = 1;
v26 = GameLevelManager::sharedState();
SavedLevel_1 = GameLevelManager::getSavedLevel_1(v26, v25);
if ( SavedLevel_1 )
*(_BYTE *)(SavedLevel_1 + 650) = 1;
if ( v32 < 0 )
operator delete(__p[0]);
}
}